X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fhelper%2FApplicationUtils.php;h=212dd8e2dc7578aa6da6a3f8d403fff319ae3f42;hb=53054b2bf6a919fd4ff9b44b6ad1986f21f488b6;hp=4b34e114caf380d7c6cf28512c908c200f299b88;hpb=e09bb93e18a333eff8e6a4156f5b58ba9c7d25cd;p=github%2Fshaarli%2FShaarli.git diff --git a/application/helper/ApplicationUtils.php b/application/helper/ApplicationUtils.php index 4b34e114..212dd8e2 100644 --- a/application/helper/ApplicationUtils.php +++ b/application/helper/ApplicationUtils.php @@ -1,4 +1,5 @@ '; @@ -64,8 +65,8 @@ class ApplicationUtils } return str_replace( - array(self::$VERSION_START_TAG, self::$VERSION_END_TAG, PHP_EOL), - array('', '', ''), + [self::$VERSION_START_TAG, self::$VERSION_END_TAG, PHP_EOL], + ['', '', ''], $data ); } @@ -184,13 +185,15 @@ class ApplicationUtils $rainTplDir = rtrim($conf->get('resource.raintpl_tpl'), '/'); // Check script and template directories are readable - foreach ([ - 'application', - 'inc', - 'plugins', - $rainTplDir, - $rainTplDir . '/' . $conf->get('resource.theme'), - ] as $path) { + foreach ( + [ + 'application', + 'inc', + 'plugins', + $rainTplDir, + $rainTplDir . '/' . $conf->get('resource.theme'), + ] as $path + ) { if (!is_readable(realpath($path))) { $errors[] = '"' . $path . '" ' . t('directory is not readable'); } @@ -203,10 +206,10 @@ class ApplicationUtils ]; } else { $folders = [ - $conf->get('resource.thumbnails_cache'), - $conf->get('resource.data_dir'), - $conf->get('resource.page_cache'), - $conf->get('resource.raintpl_tmp'), + $conf->get('resource.thumbnails_cache'), + $conf->get('resource.data_dir'), + $conf->get('resource.page_cache'), + $conf->get('resource.raintpl_tmp'), ]; } @@ -224,13 +227,15 @@ class ApplicationUtils } // Check configuration files are readable and writable - foreach (array( - $conf->getConfigFileExt(), - $conf->get('resource.datastore'), - $conf->get('resource.ban_file'), - $conf->get('resource.log'), - $conf->get('resource.update_check'), - ) as $path) { + foreach ( + [ + $conf->getConfigFileExt(), + $conf->get('resource.datastore'), + $conf->get('resource.ban_file'), + $conf->get('resource.log'), + $conf->get('resource.update_check'), + ] as $path + ) { if (!is_file(realpath($path))) { # the file may not exist yet continue;