From bf4f464f675f5f38420cfa9e30f8d724ed14f40d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 8 Feb 2012 08:28:16 -0600 Subject: [PATCH] added bundle:refresh command to cli. --- laravel/bundle.php | 7 +++++++ laravel/cli/tasks/bundle/bundler.php | 15 +++++++++++++++ laravel/core.php | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/laravel/bundle.php b/laravel/bundle.php index b2cfa447..14c27b3f 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -32,6 +32,13 @@ class Bundle { */ public static $routed = array(); + /** + * The cache key for the bundle manifest. + * + * @var string + */ + const manifest = 'laravel.bundle.manifest'; + /** * Detect all of the installed bundles from disk. * diff --git a/laravel/cli/tasks/bundle/bundler.php b/laravel/cli/tasks/bundle/bundler.php index 156fa341..77263ccb 100644 --- a/laravel/cli/tasks/bundle/bundler.php +++ b/laravel/cli/tasks/bundle/bundler.php @@ -2,6 +2,7 @@ use Laravel\IoC; use Laravel\File; +use Laravel\Cache; use Laravel\Bundle; use Laravel\CLI\Tasks\Task; @@ -55,6 +56,8 @@ public function install($bundles) echo "Bundle [{$bundle['name']}] has been installed!".PHP_EOL; } + + $this->refresh(); } /** @@ -102,6 +105,8 @@ public function upgrade($bundles) echo "Bundle [{$name}] has been upgraded!".PHP_EOL; } + + $this->refresh(); } /** @@ -125,6 +130,16 @@ public function publish($bundles) } } + /** + * Clear the bundle manifest cache. + * + * @return void + */ + public function refresh() + { + Cache::forget(Bundle::manifest); + } + /** * Gather all of the bundles from the bundle repository. * diff --git a/laravel/core.php b/laravel/core.php index 756da506..62484791 100644 --- a/laravel/core.php +++ b/laravel/core.php @@ -51,7 +51,7 @@ * each of them. If it's not cached, we'll detect them and then * cache it to save time later. */ -$bundles = Cache::remember('laravel.bundle.manifest', function() +$bundles = Cache::remember(Bundle::manifest, function() { return Bundle::detect(path('bundle'));