diff --git a/.gitignore b/.gitignore index c86bb192..6df93349 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,5 @@ /composer.phar /runtime /app/loggerconfig.php -/app/pluginconfig.php /app/config.yml /public/assets/vendor diff --git a/app/config.example.yml b/app/config.example.yml index 6be24a37..2e7d27e3 100644 --- a/app/config.example.yml +++ b/app/config.example.yml @@ -24,4 +24,6 @@ php-censor: pull_request: false authentication_settings: state: false - user_id: 1 \ No newline at end of file + user_id: 1 + build: + remove_builds: true diff --git a/app/pluginconfig.example.php b/app/pluginconfig.example.php deleted file mode 100644 index 538d30ff..00000000 --- a/app/pluginconfig.example.php +++ /dev/null @@ -1,23 +0,0 @@ -registerResource( - // This function will be called when the resource is needed. - function() { - return [ - 'Foo' => "Stuff", - 'Bar' => "More Stuff" - ]; - }, - - // In addition to the function for building the resource the system - // also needs to be told when to load the resource. Either or both - // of the following arguments can be used (null to ignore) - - // This resource will only be given when the argument name is: - "ResourceArray", - - // The resource will only be given when the type hint is: - PHPCensor\Plugin\Util\Factory::TYPE_ARRAY - ); -}; diff --git a/src/PHPCensor/Builder.php b/src/PHPCensor/Builder.php index 40ab6ee8..614c19fb 100644 --- a/src/PHPCensor/Builder.php +++ b/src/PHPCensor/Builder.php @@ -109,10 +109,8 @@ class Builder implements LoggerAwareInterface $this->build = $build; $this->store = Factory::getStore('Build', 'PHPCensor'); - $this->buildLogger = new BuildLogger($logger, $build); - - $pluginFactory = $this->buildPluginFactory($build); - $pluginFactory->addConfigFromFile(APP_DIR . "pluginconfig.php"); + $this->buildLogger = new BuildLogger($logger, $build); + $pluginFactory = $this->buildPluginFactory($build); $this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this->buildLogger); $executorClass = 'PHPCensor\Helper\UnixCommandExecutor'; @@ -251,9 +249,12 @@ class Builder implements LoggerAwareInterface $this->build->sendStatusPostback(); $this->build->setFinished(new \DateTime()); - // Clean up: - $this->buildLogger->log("\n" . Lang::get('removing_build')); - $this->build->removeBuildDirectory(); + $removeBuilds = (bool)Config::getInstance()->get('php-censor.build.remove_builds', true); + if ($removeBuilds) { + // Clean up: + $this->buildLogger->log("\n" . Lang::get('removing_build')); + $this->build->removeBuildDirectory(); + } $this->store->save($this->build); }