Use configuration property accessor

This commit is contained in:
Romain Neutron
2013-11-18 18:45:25 +01:00
parent 94be7c5498
commit 7e0a3c7338
87 changed files with 209 additions and 265 deletions

View File

@@ -310,9 +310,9 @@ class API_V1_adapter extends API_V1_Abstract
$ret['phraseanet']['environment'] = $app->getEnvironment();
$ret['phraseanet']['debug'] = $app['debug'];
$ret['phraseanet']['maintenance'] = $app['configuration']['main']['maintenance'];
$ret['phraseanet']['maintenance'] = $app['conf']->get(['main', 'maintenance']);
$ret['phraseanet']['errorsLog'] = $app['debug'];
$ret['phraseanet']['serverName'] = $app['configuration']['main']['servername'];
$ret['phraseanet']['serverName'] = $app['conf']->get(['main', 'servername']);
return $ret;
}
@@ -330,7 +330,7 @@ class API_V1_adapter extends API_V1_Abstract
$SEStatus = ['error' => $e->getMessage()];
}
$binaries = $app['configuration']['binaries'];
$binaries = $app['conf']->get('binaries');
return [
'global_values' => [
@@ -341,13 +341,13 @@ class API_V1_adapter extends API_V1_Abstract
'httpServer' => [
'logErrors' => $app['phraseanet.registry']->get('GV_log_errors'),
'phpTimezone' => ini_get('date.timezone'),
'siteId' => $app['configuration']['main']['key'],
'siteId' => $app['conf']->get(['main', 'key']),
'staticUrl' => $app['phraseanet.registry']->get('GV_STATIC_URL'),
'defaultLanguage' => $app['phraseanet.registry']->get('id_GV_default_lng'),
'allowIndexing' => $app['phraseanet.registry']->get('GV_allow_search_engine'),
'modes' => [
'XsendFile' => $app['configuration']['xsendfile']['enabled'],
'XsendFileMapping' => $app['configuration']['xsendfile']['mapping'],
'XsendFile' => $app['conf']->get(['xsendfile', 'enabled']),
'XsendFileMapping' => $app['conf']->get(['xsendfile', 'mapping']),
'h264Streaming' => $app['phraseanet.registry']->get('GV_h264_streaming'),
'authTokenDirectory' => $app['phraseanet.registry']->get('GV_mod_auth_token_directory'),
'authTokenDirectoryPath' => $app['phraseanet.registry']->get('GV_mod_auth_token_directory_path'),

View File

@@ -199,14 +199,12 @@ class API_V1_result
$this->app['dispatcher']->dispatch(PhraseaEvents::API_RESULT, new ApiResultEvent());
$conf = $this->app['configuration'];
$conf = $this->app['configuration.store'];
if (isset($conf['main']['api-timers']) && true === $conf['main']['api-timers']) {
$ret['timers'] = $this->app['api.timers']->toArray();
}
$return_value = false;
switch ($this->response_type) {
case self::FORMAT_JSON:
default: