Skip to content

Commit

Permalink
Move bootstrap and croogo_bootstrap into PluginManager
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Aug 20, 2019
1 parent b42fd08 commit 018b78c
Show file tree
Hide file tree
Showing 5 changed files with 366 additions and 295 deletions.
65 changes: 0 additions & 65 deletions Core/config/bootstrap.php

This file was deleted.

212 changes: 0 additions & 212 deletions Core/config/croogo_bootstrap.php

This file was deleted.

23 changes: 23 additions & 0 deletions Core/src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,30 @@
namespace Croogo\Core;

use Cake\Core\BasePlugin;
use Cake\Core\Configure;
use Cake\Core\PluginApplicationInterface;
use Cake\Utility\Security;

use function Croogo\Core\timerStart;
use function Croogo\Core\timerStop;

class Plugin extends BasePlugin
{

public function bootstrap(PluginApplicationInterface $app)
{
parent::bootstrap($app);

\Croogo\Core\timerStart('Croogo bootstrap');
PluginManager::setup($app);
PluginManager::croogoBootstrap($app);
\Croogo\Core\timerStop('Croogo bootstrap');

// Load Install plugin
$salted = Security::getSalt() !== '__SALT__';
if (!Configure::read('Croogo.installed') || !$salted) {
$app->addPlugin('Croogo/Install', ['routes' => true, 'bootstrap' => true]);
}
}

}
Loading

0 comments on commit 018b78c

Please sign in to comment.