Cake\Shell\Task\UnloadTask::_modifyBootstrap PHP Méthode

_modifyBootstrap() protected méthode

Update the applications bootstrap.php file.
protected _modifyBootstrap ( string $plugin ) : boolean
$plugin string Name of plugin.
Résultat boolean If modify passed.
    protected function _modifyBootstrap($plugin)
    {
        $finder = "/\nPlugin::load\\((.|.\n|\n\\s\\s|\n\t|)+'{$plugin}'(.|.\n|)+\\);\n/";
        $bootstrap = new File($this->bootstrap, false);
        $contents = $bootstrap->read();
        if (!preg_match("@\n\\s*Plugin::loadAll@", $contents)) {
            $contents = preg_replace($finder, "", $contents);
            $bootstrap->write($contents);
            $this->out('');
            $this->out(sprintf('%s modified', $this->bootstrap));
            return true;
        }
        return false;
    }