refactoring configuration

This commit is contained in:
El RIDO
2015-09-22 23:21:31 +02:00
parent 9f68658106
commit 6d24ff824e
6 changed files with 308 additions and 139 deletions

View File

@@ -3,6 +3,7 @@ error_reporting( E_ALL | E_STRICT );
// change this, if your php files and data is outside of your webservers document root
if (!defined('PATH')) define('PATH', '..' . DIRECTORY_SEPARATOR);
if (!defined('CONF')) define('CONF', PATH . 'cfg' . DIRECTORY_SEPARATOR . 'conf.ini');
if (!defined('PUBLIC_PATH')) define('PUBLIC_PATH', '..');
require PATH . 'lib/auto.php';
@@ -63,7 +64,6 @@ class helper
return self::$pasteid;
}
/**
* get example paste
*
@@ -76,7 +76,6 @@ class helper
return $example;
}
/**
* get example paste ID
*
@@ -87,7 +86,6 @@ class helper
return self::$commentid;
}
/**
* get example comment
*
@@ -127,6 +125,28 @@ class helper
}
}
/**
* create a backup of the config file
*
* @return void
*/
public static function confBackup()
{
if (!is_file(CONF . '.bak') && is_file(CONF))
rename(CONF, CONF . '.bak');
}
/**
* restor backup of the config file
*
* @return void
*/
public static function confRestore()
{
if (is_file(CONF . '.bak'))
rename(CONF . '.bak', CONF);
}
/**
* create ini file
*