diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -88,14 +88,11 @@ header("Pragma: no-cache"); | |||
88 | 88 | ||
89 | // Directories creations (Note that your web host may require differents rights than 705.) | 89 | // Directories creations (Note that your web host may require differents rights than 705.) |
90 | if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>'); | 90 | if (!is_writable(realpath(dirname(__FILE__)))) die('<pre>ERROR: Shaarli does not have the right to write in its own directory ('.realpath(dirname(__FILE__)).').</pre>'); |
91 | if (!is_dir($GLOBALS['config']['DATADIR'])) { mkdir($GLOBALS['config']['DATADIR'],0705); chmod($GLOBALS['config']['DATADIR'],0705); } | ||
92 | if (!is_dir($GLOBALS['config']['RAINTPL_TMP'])) { mkdir($GLOBALS['config']['RAINTPL_TMP'],0705);chmod($GLOBALS['config']['RAINTPL_TMP'],0705); } // For RainTPL temporary files. | ||
93 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | 91 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['DATADIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. |
94 | // Second check to see if Shaarli can write in its directory, because on some hosts is_writable() is not reliable. | 92 | // Second check to see if Shaarli can write in its directory, because on some hosts is_writable() is not reliable. |
95 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) die('<pre>ERROR: Shaarli does not have the right to write in its data directory ('.realpath($GLOBALS['config']['DATADIR']).').</pre>'); | 93 | if (!is_file($GLOBALS['config']['DATADIR'].'/.htaccess')) die('<pre>ERROR: Shaarli does not have the right to write in its data directory ('.realpath($GLOBALS['config']['DATADIR']).').</pre>'); |
96 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) | 94 | if ($GLOBALS['config']['ENABLE_LOCALCACHE']) |
97 | { | 95 | { |
98 | if (!is_dir($GLOBALS['config']['CACHEDIR'])) { mkdir($GLOBALS['config']['CACHEDIR'],0705); chmod($GLOBALS['config']['CACHEDIR'],0705); } | ||
99 | if (!is_file($GLOBALS['config']['CACHEDIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['CACHEDIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. | 96 | if (!is_file($GLOBALS['config']['CACHEDIR'].'/.htaccess')) { file_put_contents($GLOBALS['config']['CACHEDIR'].'/.htaccess',"Allow from none\nDeny from all\n"); } // Protect data files. |
100 | } | 97 | } |
101 | 98 | ||
@@ -188,7 +185,6 @@ class pageCache | |||
188 | public function cache($page) | 185 | public function cache($page) |
189 | { | 186 | { |
190 | if (!$this->shouldBeCached) return; | 187 | if (!$this->shouldBeCached) return; |
191 | if (!is_dir($GLOBALS['config']['PAGECACHE'])) { mkdir($GLOBALS['config']['PAGECACHE'],0705); chmod($GLOBALS['config']['PAGECACHE'],0705); } | ||
192 | file_put_contents($this->filename,$page); | 188 | file_put_contents($this->filename,$page); |
193 | } | 189 | } |
194 | 190 | ||