diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-23 21:30:55 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-23 21:30:55 +0200 |
commit | b64a882696ba6c403c36f9434230fc636741b7d1 (patch) | |
tree | 7e1ede841a99b4070825b4717d17dac92c47273c /inc/poche/Tools.class.php | |
parent | 8be8c44596247fc7d9345a53ed0217dfcdcce6ca (diff) | |
download | wallabag-b64a882696ba6c403c36f9434230fc636741b7d1.tar.gz wallabag-b64a882696ba6c403c36f9434230fc636741b7d1.tar.zst wallabag-b64a882696ba6c403c36f9434230fc636741b7d1.zip |
notice with poche_version undefined'
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r-- | inc/poche/Tools.class.php | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1baf745d..52d0f2d5 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -238,25 +238,20 @@ class Tools | |||
238 | public static function createMyConfig() | 238 | public static function createMyConfig() |
239 | { | 239 | { |
240 | $myconfig_file = './inc/poche/myconfig.inc.php'; | 240 | $myconfig_file = './inc/poche/myconfig.inc.php'; |
241 | |||
242 | if (!is_writable('./inc/poche/')) { | ||
243 | self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); | ||
244 | die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); | ||
245 | } | ||
241 | 246 | ||
242 | if (version_compare(POCHE_VERSION, '1.0-beta3') == 1) { | 247 | if (!file_exists($myconfig_file)) |
243 | # $myconfig_file is only created with poche > 1.0-beta3 | 248 | { |
244 | # in 1.0-beta3, the update script creates $myconfig_file | 249 | $fp = fopen($myconfig_file, 'w'); |
245 | 250 | fwrite($fp, '<?php'."\r\n"); | |
246 | if (!is_writable('./inc/poche/')) { | 251 | fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n"); |
247 | self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); | 252 | fwrite($fp, "define ('SALT', '" . md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand()) . "');" . "\r\n"); |
248 | die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); | 253 | fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n"); |
249 | } | 254 | fclose($fp); |
250 | |||
251 | if (!file_exists($myconfig_file)) | ||
252 | { | ||
253 | $fp = fopen($myconfig_file, 'w'); | ||
254 | fwrite($fp, '<?php'."\r\n"); | ||
255 | fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n"); | ||
256 | fwrite($fp, "define ('SALT', '" . md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand()) . "');" . "\r\n"); | ||
257 | fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n"); | ||
258 | fclose($fp); | ||
259 | } | ||
260 | } | 255 | } |
261 | } | 256 | } |
262 | } \ No newline at end of file | 257 | } \ No newline at end of file |