Skip to content
Permalink
Browse files

Dont lie when not modifying bootstrap

  • Loading branch information...
dereuromark committed Nov 27, 2016
1 parent 27dc4bf commit 5a26e4c71f51685f0ea181d2090df85b6d89deca
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/Shell/Task/UnloadTask.php
@@ -66,12 +66,16 @@ 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();
$content = $bootstrap->read();
if (!preg_match("@\n\s*Plugin::loadAll@", $contents)) {
$contents = preg_replace($finder, "", $contents);
if (!preg_match("@\n\s*Plugin::loadAll@", $content)) {
$newContent = preg_replace($finder, "", $content);
$bootstrap->write($contents);
if ($newContent === $content) {
return false;
}
$bootstrap->write($newContent);
$this->out('');
$this->out(sprintf('%s modified', $this->bootstrap));

0 comments on commit 5a26e4c

Please sign in to comment.
You can’t perform that action at this time.