added bundle:refresh command to cli.
This commit is contained in:
parent
a0379ea48d
commit
bf4f464f67
|
@ -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 @@ public function install($bundles)
|
||||||
|
|
||||||
echo "Bundle [{$bundle['name']}] has been installed!".PHP_EOL;
|
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;
|
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.
|
* Gather all of the bundles from the bundle repository.
|
||||||
*
|
*
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
* 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'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue