aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/ApplicationUtils.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-05-18 21:48:24 +0200
committerArthurHoaro <arthur@hoa.ro>2016-06-11 09:30:56 +0200
commit684e662a58b02bde225e44d3677987b6fc3adf0b (patch)
treedb0d4ca1d9b53341cc108b0e7671ffde0e9caee9 /application/ApplicationUtils.php
parent59404d7909b21682ec0782778452a8a70e38b25e (diff)
downloadShaarli-684e662a58b02bde225e44d3677987b6fc3adf0b.tar.gz
Shaarli-684e662a58b02bde225e44d3677987b6fc3adf0b.tar.zst
Shaarli-684e662a58b02bde225e44d3677987b6fc3adf0b.zip
Replace $GLOBALS configuration with the configuration manager in the whole code base
Diffstat (limited to 'application/ApplicationUtils.php')
-rw-r--r--application/ApplicationUtils.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php
index 978fc9da..ed9abc39 100644
--- a/application/ApplicationUtils.php
+++ b/application/ApplicationUtils.php
@@ -132,32 +132,32 @@ 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
136 *
137 * @return array A list of the detected configuration issues 135 * @return array A list of the detected configuration issues
138 */ 136 */
139 public static function checkResourcePermissions($globalConfig) 137 public static function checkResourcePermissions()
140 { 138 {
141 $errors = array(); 139 $errors = array();
140 $conf = ConfigManager::getInstance();
142 141
143 // Check script and template directories are readable 142 // Check script and template directories are readable
144 foreach (array( 143 foreach (array(
145 'application', 144 'application',
146 'inc', 145 'inc',
147 'plugins', 146 'plugins',
148 $globalConfig['RAINTPL_TPL'] 147 $conf->get('config.RAINTPL_TPL'),
149 ) as $path) { 148 ) as $path) {
150 if (! is_readable(realpath($path))) { 149 if (! is_readable(realpath($path))) {
151 $errors[] = '"'.$path.'" directory is not readable'; 150 $errors[] = '"'.$path.'" directory is not readable';
152 } 151 }
153 } 152 }
154 153
154 $datadir = $conf->get('config.DATADIR');
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('config.CACHEDIR'),
158 $globalConfig['DATADIR'], 158 $datadir,
159 $globalConfig['PAGECACHE'], 159 $conf->get('config.PAGECACHE'),
160 $globalConfig['RAINTPL_TMP'] 160 $conf->get('config.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->getConfigFile(),
173 $globalConfig['DATASTORE'], 173 $conf->get('config.DATASTORE'),
174 $globalConfig['IPBANS_FILENAME'], 174 $conf->get('config.IPBANS_FILENAME'),
175 $globalConfig['LOG_FILE'], 175 $conf->get('config.LOG_FILE'),
176 $globalConfig['UPDATECHECK_FILENAME'] 176 $conf->get('config.UPDATECHECK_FILENAME'),
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