Only set noInit on PluginManager for specific CLI commands (october:up, october:update)

This commit is contained in:
Sam Georges 2014-10-16 19:49:00 +11:00
parent 8d618d4e29
commit 886e6fc70a
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ use Lang;
use Event;
use Config;
use Backend;
use Request;
use DbDongle;
use BackendMenu;
use BackendAuth;
@ -66,7 +67,11 @@ class ServiceProvider extends ModuleServiceProvider
*/
$requestPath = \October\Rain\Router\Helper::normalizeUrl(\Request::path());
$systemPath = \October\Rain\Router\Helper::normalizeUrl(Config::get('cms.backendUri') . '/system/updates');
if (App::runningInConsole() || stripos($requestPath, $systemPath) === 0)
if (stripos($requestPath, $systemPath) === 0)
PluginManager::$noInit = true;
$updateCommands = ['october:up', 'october:update'];
if (App::runningInConsole() && count(array_intersect($updateCommands, Request::server('argv'))) > 0)
PluginManager::$noInit = true;
/*