aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Tools.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-17 11:27:13 -0700
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-17 11:27:13 -0700
commit7ba37bd91a43321196e6d867caf9e298e82c6d6c (patch)
tree280b6c5d270c28457219859f189e3cb6c3895939 /inc/poche/Tools.class.php
parent667009727a38890eb651815843c1bc02869a4119 (diff)
parent9067b484ce8289eec6979cf6c8e3cbfb3bd5b10c (diff)
downloadwallabag-7ba37bd91a43321196e6d867caf9e298e82c6d6c.tar.gz
wallabag-7ba37bd91a43321196e6d867caf9e298e82c6d6c.tar.zst
wallabag-7ba37bd91a43321196e6d867caf9e298e82c6d6c.zip
Merge pull request #141 from inthepoche/dev1.0-beta3
beta3
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r--inc/poche/Tools.class.php26
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