diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-16 20:19:31 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-16 20:19:31 +0200 |
commit | bb5a7d9ede48558c6f096dc3c8e267f12513ec4e (patch) | |
tree | fb85a197e1916c9a4e880edfabd0f99e25b23750 /inc/poche/Tools.class.php | |
parent | 1c9cd3463b820b874610f4fd13e0193dc9e6429c (diff) | |
download | wallabag-bb5a7d9ede48558c6f096dc3c8e267f12513ec4e.tar.gz wallabag-bb5a7d9ede48558c6f096dc3c8e267f12513ec4e.tar.zst wallabag-bb5a7d9ede48558c6f096dc3c8e267f12513ec4e.zip |
updating script
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r-- | inc/poche/Tools.class.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 0eb0d9ea..1baf745d 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -233,4 +233,30 @@ class Tools | |||
233 | 233 | ||
234 | return $minutes; | 234 | return $minutes; |
235 | } | 235 | } |
236 | |||
237 | |||
238 | public static function createMyConfig() | ||
239 | { | ||
240 | $myconfig_file = './inc/poche/myconfig.inc.php'; | ||
241 | |||
242 | if (version_compare(POCHE_VERSION, '1.0-beta3') == 1) { | ||
243 | # $myconfig_file is only created with poche > 1.0-beta3 | ||
244 | # in 1.0-beta3, the update script creates $myconfig_file | ||
245 | |||
246 | if (!is_writable('./inc/poche/')) { | ||
247 | self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); | ||
248 | die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); | ||
249 | } | ||
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 | } | ||
261 | } | ||
236 | } \ No newline at end of file | 262 | } \ No newline at end of file |