aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/ApplicationUtils.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-07-09 07:19:48 +0200
committerGitHub <noreply@github.com>2016-07-09 07:19:48 +0200
commit649af5b501d2a90448242f53764ff693e9854039 (patch)
tree23cde80a7ee2949e552c48939ae22fa462cfa0fc /application/ApplicationUtils.php
parenta9cfa38df92bd2e1e2c00a67b6ac1516a2116ade (diff)
parent5ff23f02b80ec6ddee28dee869171ee8e3656b7c (diff)
downloadShaarli-649af5b501d2a90448242f53764ff693e9854039.tar.gz
Shaarli-649af5b501d2a90448242f53764ff693e9854039.tar.zst
Shaarli-649af5b501d2a90448242f53764ff693e9854039.zip
Merge pull request #570 from ArthurHoaro/config-manager
Introduce a configuration manager
Diffstat (limited to 'application/ApplicationUtils.php')
-rw-r--r--application/ApplicationUtils.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php
index 978fc9da..e67b2902 100644
--- a/application/ApplicationUtils.php
+++ b/application/ApplicationUtils.php
@@ -132,11 +132,11 @@ class ApplicationUtils
132 /** 132 /**
133 * Checks Shaarli has the proper access permissions to its resources 133 * Checks Shaarli has the proper access permissions to its resources
134 * 134 *
135 * @param array $globalConfig The $GLOBALS['config'] array 135 * @param ConfigManager $conf Configuration Manager instance.
136 * 136 *
137 * @return array A list of the detected configuration issues 137 * @return array A list of the detected configuration issues
138 */ 138 */
139 public static function checkResourcePermissions($globalConfig) 139 public static function checkResourcePermissions($conf)
140 { 140 {
141 $errors = array(); 141 $errors = array();
142 142
@@ -145,7 +145,7 @@ class ApplicationUtils
145 'application', 145 'application',
146 'inc', 146 'inc',
147 'plugins', 147 'plugins',
148 $globalConfig['RAINTPL_TPL'] 148 $conf->get('resource.raintpl_tpl'),
149 ) as $path) { 149 ) as $path) {
150 if (! is_readable(realpath($path))) { 150 if (! is_readable(realpath($path))) {
151 $errors[] = '"'.$path.'" directory is not readable'; 151 $errors[] = '"'.$path.'" directory is not readable';
@@ -154,10 +154,10 @@ class ApplicationUtils
154 154
155 // Check cache and data directories are readable and writeable 155 // Check cache and data directories are readable and writeable
156 foreach (array( 156 foreach (array(
157 $globalConfig['CACHEDIR'], 157 $conf->get('resource.thumbnails_cache'),
158 $globalConfig['DATADIR'], 158 $conf->get('resource.data_dir'),
159 $globalConfig['PAGECACHE'], 159 $conf->get('resource.page_cache'),
160 $globalConfig['RAINTPL_TMP'] 160 $conf->get('resource.raintpl_tmp'),
161 ) as $path) { 161 ) as $path) {
162 if (! is_readable(realpath($path))) { 162 if (! is_readable(realpath($path))) {
163 $errors[] = '"'.$path.'" directory is not readable'; 163 $errors[] = '"'.$path.'" directory is not readable';
@@ -169,11 +169,11 @@ class ApplicationUtils
169 169
170 // Check configuration files are readable and writeable 170 // Check configuration files are readable and writeable
171 foreach (array( 171 foreach (array(
172 $globalConfig['CONFIG_FILE'], 172 $conf->getConfigFileExt(),
173 $globalConfig['DATASTORE'], 173 $conf->get('resource.datastore'),
174 $globalConfig['IPBANS_FILENAME'], 174 $conf->get('resource.ban_file'),
175 $globalConfig['LOG_FILE'], 175 $conf->get('resource.log'),
176 $globalConfig['UPDATECHECK_FILENAME'] 176 $conf->get('resource.update_check'),
177 ) as $path) { 177 ) as $path) {
178 if (! is_file(realpath($path))) { 178 if (! is_file(realpath($path))) {
179 # the file may not exist yet 179 # the file may not exist yet