added bundle:refresh command to cli.
This commit is contained in:
@@ -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 @@
|
|||||||
|
|
||||||
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 {
|
|||||||
|
|
||||||
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 {
|
|||||||
|
|
||||||
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 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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')));
|
|||||||
* 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'));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user