diff --git a/lib/Alchemy/Phrasea/Command/Compile/Configuration.php b/lib/Alchemy/Phrasea/Command/Compile/Configuration.php index 76527bc46f..01d19bf29e 100644 --- a/lib/Alchemy/Phrasea/Command/Compile/Configuration.php +++ b/lib/Alchemy/Phrasea/Command/Compile/Configuration.php @@ -20,12 +20,14 @@ class Configuration extends Command public function __construct() { parent::__construct('compile:configuration'); + $this->setDescription('Compiles YAML configuration to plain PHP'); } protected function doExecute(InputInterface $input, OutputInterface $output) { $this->container['configuration.store']->compileAndWrite(); + $output->writeln("Configuration compiled."); return 0; diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php index 6457dc2187..65250cbf3b 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php @@ -144,7 +144,7 @@ class Configuration implements ConfigurationInterface public function setConfig(array $config) { $this->cache = $config; - $this->dumpFile($this->config, $this->parser->dump($config, 7)); + $this->dumpFile($this->config, $this->parser->dump($config, 7), 0660); $this->writeCacheConfig($this->compiler->compile($config)); return $this; @@ -183,7 +183,7 @@ class Configuration implements ConfigurationInterface public function initialize() { $this->delete(); - $this->dumpFile($this->config, $this->loadFile(__DIR__ . static::CONFIG_REF), 0600); + $this->dumpFile($this->config, $this->loadFile(__DIR__ . static::CONFIG_REF), 0660); // force rewrite $this->getConfig(); @@ -211,7 +211,8 @@ class Configuration implements ConfigurationInterface private function writeCacheConfig($content) { - $this->dumpFile($this->compiled, $content, 0600); + $this->dumpFile($this->compiled, $content, 0660); + if(function_exists("opcache_invalidate")) { opcache_invalidate($this->compiled); } @@ -234,6 +235,7 @@ class Configuration implements ConfigurationInterface private function dumpFile($file, $content, $mod = 0600) { $tmpFile = tempnam(dirname($file), basename($file)); + if (false !== @file_put_contents($tmpFile, $content)) { // rename does not work on Win32 before 5.2.6 if (@rename($tmpFile, $file)) { diff --git a/templates/web/admin/collection/collection.html.twig b/templates/web/admin/collection/collection.html.twig index 72d5eff89e..52ab8be189 100644 --- a/templates/web/admin/collection/collection.html.twig +++ b/templates/web/admin/collection/collection.html.twig @@ -29,8 +29,8 @@