From bb5a7d9ede48558c6f096dc3c8e267f12513ec4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 16 Aug 2013 20:19:31 +0200 Subject: updating script --- inc/poche/Tools.class.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'inc/poche/Tools.class.php') 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 return $minutes; } + + + public static function createMyConfig() + { + $myconfig_file = './inc/poche/myconfig.inc.php'; + + if (version_compare(POCHE_VERSION, '1.0-beta3') == 1) { + # $myconfig_file is only created with poche > 1.0-beta3 + # in 1.0-beta3, the update script creates $myconfig_file + + if (!is_writable('./inc/poche/')) { + self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); + die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); + } + + if (!file_exists($myconfig_file)) + { + $fp = fopen($myconfig_file, 'w'); + fwrite($fp, '