]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - application/ApplicationUtils.php
3 * Shaarli (application) utilities
9 * Checks Shaarli has the proper access permissions to its resources
11 * @param array $globalConfig The $GLOBALS['config'] array
13 * @return array A list of the detected configuration issues
15 public static function checkResourcePermissions($globalConfig)
19 // Check script and template directories are readable
24 $globalConfig['RAINTPL_TPL']
26 if (! is_readable(realpath($path))) {
27 $errors[] = '"'.$path.'" directory is not readable';
31 // Check cache and data directories are readable and writeable
33 $globalConfig['CACHEDIR'],
34 $globalConfig['DATADIR'],
35 $globalConfig['PAGECACHE'],
36 $globalConfig['RAINTPL_TMP']
38 if (! is_readable(realpath($path))) {
39 $errors[] = '"'.$path.'" directory is not readable';
41 if (! is_writable(realpath($path))) {
42 $errors[] = '"'.$path.'" directory is not writable';
46 // Check configuration files are readable and writeable
48 $globalConfig['CONFIG_FILE'],
49 $globalConfig['DATASTORE'],
50 $globalConfig['IPBANS_FILENAME'],
51 $globalConfig['LOG_FILE'],
52 $globalConfig['UPDATECHECK_FILENAME']
54 if (! is_file(realpath($path))) {
55 # the file may not exist yet
59 if (! is_readable(realpath($path))) {
60 $errors[] = '"'.$path.'" file is not readable';
62 if (! is_writable(realpath($path))) {
63 $errors[] = '"'.$path.'" file is not writable';