From 9778a1551ce708b9f421a181806412a05410f1fb Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Mon, 3 Dec 2018 23:58:59 +0100 Subject: namespacing: \Shaarli\ApplicationUtils Signed-off-by: VirtualTam --- application/ApplicationUtils.php | 75 ++++++++++++++++++++------------------ application/render/PageBuilder.php | 2 +- application/updater/Updater.php | 2 +- 3 files changed, 42 insertions(+), 37 deletions(-) (limited to 'application') diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php index a3b2dcb1..7fe3cb32 100644 --- a/application/ApplicationUtils.php +++ b/application/ApplicationUtils.php @@ -1,4 +1,9 @@ get('resource.theme'), - ) as $path) { - if (! is_readable(realpath($path))) { - $errors[] = '"'.$path.'" '. t('directory is not readable'); + 'application', + 'inc', + 'plugins', + $rainTplDir, + $rainTplDir . '/' . $conf->get('resource.theme'), + ) as $path) { + if (!is_readable(realpath($path))) { + $errors[] = '"' . $path . '" ' . t('directory is not readable'); } } // Check cache and data directories are readable and writable foreach (array( - $conf->get('resource.thumbnails_cache'), - $conf->get('resource.data_dir'), - $conf->get('resource.page_cache'), - $conf->get('resource.raintpl_tmp'), - ) as $path) { - if (! is_readable(realpath($path))) { - $errors[] = '"'.$path.'" '. t('directory is not readable'); + $conf->get('resource.thumbnails_cache'), + $conf->get('resource.data_dir'), + $conf->get('resource.page_cache'), + $conf->get('resource.raintpl_tmp'), + ) as $path) { + if (!is_readable(realpath($path))) { + $errors[] = '"' . $path . '" ' . t('directory is not readable'); } - if (! is_writable(realpath($path))) { - $errors[] = '"'.$path.'" '. t('directory is not writable'); + if (!is_writable(realpath($path))) { + $errors[] = '"' . $path . '" ' . t('directory is not writable'); } } // 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) { - if (! is_file(realpath($path))) { + $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; } - if (! is_readable(realpath($path))) { - $errors[] = '"'.$path.'" '. t('file is not readable'); + if (!is_readable(realpath($path))) { + $errors[] = '"' . $path . '" ' . t('file is not readable'); } - if (! is_writable(realpath($path))) { - $errors[] = '"'.$path.'" '. t('file is not writable'); + if (!is_writable(realpath($path))) { + $errors[] = '"' . $path . '" ' . t('file is not writable'); } } diff --git a/application/render/PageBuilder.php b/application/render/PageBuilder.php index 9a0fe61a..1c5b9251 100644 --- a/application/render/PageBuilder.php +++ b/application/render/PageBuilder.php @@ -2,7 +2,7 @@ namespace Shaarli\Render; -use ApplicationUtils; +use Shaarli\ApplicationUtils; use Exception; use Shaarli\Bookmark\LinkDB; use RainTPL; diff --git a/application/updater/Updater.php b/application/updater/Updater.php index 55251a30..89f0ff7f 100644 --- a/application/updater/Updater.php +++ b/application/updater/Updater.php @@ -2,7 +2,7 @@ namespace Shaarli\Updater; -use ApplicationUtils; +use Shaarli\ApplicationUtils; use Exception; use RainTPL; use ReflectionClass; -- cgit v1.2.3