Commit bf4f464f authored by Taylor Otwell's avatar Taylor Otwell

added bundle:refresh command to cli.

parent a0379ea4
...@@ -32,6 +32,13 @@ class Bundle { ...@@ -32,6 +32,13 @@ class Bundle {
*/ */
public static $routed = array(); 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. * Detect all of the installed bundles from disk.
* *
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
use Laravel\IoC; use Laravel\IoC;
use Laravel\File; use Laravel\File;
use Laravel\Cache;
use Laravel\Bundle; use Laravel\Bundle;
use Laravel\CLI\Tasks\Task; use Laravel\CLI\Tasks\Task;
...@@ -55,6 +56,8 @@ class Bundler extends Task { ...@@ -55,6 +56,8 @@ class Bundler extends Task {
echo "Bundle [{$bundle['name']}] has been installed!".PHP_EOL; echo "Bundle [{$bundle['name']}] has been installed!".PHP_EOL;
} }
$this->refresh();
} }
/** /**
...@@ -102,6 +105,8 @@ class Bundler extends Task { ...@@ -102,6 +105,8 @@ class Bundler extends Task {
echo "Bundle [{$name}] has been upgraded!".PHP_EOL; echo "Bundle [{$name}] has been upgraded!".PHP_EOL;
} }
$this->refresh();
} }
/** /**
...@@ -125,6 +130,16 @@ class Bundler extends Task { ...@@ -125,6 +130,16 @@ class Bundler extends Task {
} }
} }
/**
* Clear the bundle manifest cache.
*
* @return void
*/
public function refresh()
{
Cache::forget(Bundle::manifest);
}
/** /**
* Gather all of the bundles from the bundle repository. * Gather all of the bundles from the bundle repository.
* *
......
...@@ -51,7 +51,7 @@ Autoloader::namespaces(array('Laravel' => path('sys'))); ...@@ -51,7 +51,7 @@ Autoloader::namespaces(array('Laravel' => path('sys')));
* each of them. If it's not cached, we'll detect them and then * each of them. If it's not cached, we'll detect them and then
* cache it to save time later. * cache it to save time later.
*/ */
$bundles = Cache::remember('laravel.bundle.manifest', function() $bundles = Cache::remember(Bundle::manifest, function()
{ {
return Bundle::detect(path('bundle')); return Bundle::detect(path('bundle'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment