mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Merge 4.0 into master
This commit is contained in:
@@ -20,12 +20,14 @@ class Configuration extends Command
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct('compile:configuration');
|
parent::__construct('compile:configuration');
|
||||||
|
|
||||||
$this->setDescription('Compiles YAML configuration to plain PHP');
|
$this->setDescription('Compiles YAML configuration to plain PHP');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function doExecute(InputInterface $input, OutputInterface $output)
|
protected function doExecute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$this->container['configuration.store']->compileAndWrite();
|
$this->container['configuration.store']->compileAndWrite();
|
||||||
|
|
||||||
$output->writeln("Configuration compiled.");
|
$output->writeln("Configuration compiled.");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -144,7 +144,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
public function setConfig(array $config)
|
public function setConfig(array $config)
|
||||||
{
|
{
|
||||||
$this->cache = $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));
|
$this->writeCacheConfig($this->compiler->compile($config));
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@@ -183,7 +183,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
public function initialize()
|
public function initialize()
|
||||||
{
|
{
|
||||||
$this->delete();
|
$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
|
// force rewrite
|
||||||
$this->getConfig();
|
$this->getConfig();
|
||||||
@@ -211,7 +211,8 @@ class Configuration implements ConfigurationInterface
|
|||||||
|
|
||||||
private function writeCacheConfig($content)
|
private function writeCacheConfig($content)
|
||||||
{
|
{
|
||||||
$this->dumpFile($this->compiled, $content, 0600);
|
$this->dumpFile($this->compiled, $content, 0660);
|
||||||
|
|
||||||
if(function_exists("opcache_invalidate")) {
|
if(function_exists("opcache_invalidate")) {
|
||||||
opcache_invalidate($this->compiled);
|
opcache_invalidate($this->compiled);
|
||||||
}
|
}
|
||||||
@@ -234,6 +235,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
private function dumpFile($file, $content, $mod = 0600)
|
private function dumpFile($file, $content, $mod = 0600)
|
||||||
{
|
{
|
||||||
$tmpFile = tempnam(dirname($file), basename($file));
|
$tmpFile = tempnam(dirname($file), basename($file));
|
||||||
|
|
||||||
if (false !== @file_put_contents($tmpFile, $content)) {
|
if (false !== @file_put_contents($tmpFile, $content)) {
|
||||||
// rename does not work on Win32 before 5.2.6
|
// rename does not work on Win32 before 5.2.6
|
||||||
if (@rename($tmpFile, $file)) {
|
if (@rename($tmpFile, $file)) {
|
||||||
|
@@ -29,8 +29,8 @@
|
|||||||
|
|
||||||
<ul class="unstyled">
|
<ul class="unstyled">
|
||||||
<li>{{ 'phraseanet:: adresse' | trans }} : {{ collection.get_databox().get_serialized_server_info() }}</li>
|
<li>{{ 'phraseanet:: adresse' | trans }} : {{ collection.get_databox().get_serialized_server_info() }}</li>
|
||||||
|
<li>{{ 'admin::base:collection: identifiant' | trans }} : {{ collection.get_base_id() }}</li>
|
||||||
<li>{{ 'admin::base:collection: numero de collection distante' | trans }} : {{ collection.get_coll_id() }}</li>
|
<li>{{ 'admin::base:collection: numero de collection distante' | trans }} : {{ collection.get_coll_id() }}</li>
|
||||||
<li>{{ 'admin::base:collection: numero de collection locale' | trans }} : {{ collection.get_base_id() }}</li>
|
|
||||||
<li>{{ 'admin::base:collection: etat de la collection' | trans }} : {{ collection.is_active() ? "admin::base:collection: activer la collection"| trans : "admin::base:collection: descativer la collection"|trans }}</li>
|
<li>{{ 'admin::base:collection: etat de la collection' | trans }} : {{ collection.is_active() ? "admin::base:collection: activer la collection"| trans : "admin::base:collection: descativer la collection"|trans }}</li>
|
||||||
<li>{{ collection.get_record_amount() }} records <a class="ajax" target="rights" href="{{ path('admin_collection_display_document_details', { 'bas_id' : collection.get_base_id() }) }}">{{ 'phraseanet:: details' | trans }}</a></li>
|
<li>{{ collection.get_record_amount() }} records <a class="ajax" target="rights" href="{{ path('admin_collection_display_document_details', { 'bas_id' : collection.get_base_id() }) }}">{{ 'phraseanet:: details' | trans }}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
Reference in New Issue
Block a user