renamed 'ManiaControlDir' constant to fit naming conventions

This commit is contained in:
Steffen Schröder
2014-08-08 14:41:58 +02:00
parent 96d3f1eaba
commit 35a431e396
11 changed files with 29 additions and 27 deletions

View File

@ -32,11 +32,11 @@ abstract class BackupUtil {
}
$excludes = array();
$baseFileNames = array('configs', 'core', 'plugins', 'ManiaControl.php');
$pathInfo = pathInfo(ManiaControlDir);
$pathInfo = pathInfo(MANIACONTROL_PATH);
$parentPath = $pathInfo['dirname'] . DIRECTORY_SEPARATOR;
$dirName = $pathInfo['basename'];
$backupZip->addEmptyDir($dirName);
self::zipDirectory($backupZip, ManiaControlDir, strlen($parentPath), $excludes, $baseFileNames);
self::zipDirectory($backupZip, MANIACONTROL_PATH, strlen($parentPath), $excludes, $baseFileNames);
return $backupZip->close();
}
@ -46,7 +46,7 @@ abstract class BackupUtil {
* @return string|bool
*/
private static function getBackupFolder() {
$backupFolder = ManiaControlDir . 'backup' . DIRECTORY_SEPARATOR;
$backupFolder = MANIACONTROL_PATH . 'backup' . DIRECTORY_SEPARATOR;
if (!is_dir($backupFolder) && !mkdir($backupFolder)) {
Logger::logError("Couldn't create backup folder!");
return false;
@ -121,7 +121,7 @@ abstract class BackupUtil {
Logger::logError("Couldn't create backup zip!");
return false;
}
$directory = ManiaControlDir . 'plugins';
$directory = MANIACONTROL_PATH . 'plugins';
$pathInfo = pathInfo($directory);
$parentPath = $pathInfo['dirname'] . DIRECTORY_SEPARATOR;
$dirName = $pathInfo['basename'];

View File

@ -31,7 +31,7 @@ abstract class FileUtil {
* @return \SimpleXMLElement
*/
public static function loadConfig($fileName) {
$fileLocation = ManiaControlDir . 'configs' . DIRECTORY_SEPARATOR . $fileName;
$fileLocation = MANIACONTROL_PATH . 'configs' . DIRECTORY_SEPARATOR . $fileName;
if (!file_exists($fileLocation)) {
Logger::log("Config file doesn't exist! ({$fileName})");
return null;
@ -105,7 +105,7 @@ abstract class FileUtil {
* @return string|bool
*/
public static function getTempFolder() {
$tempFolder = ManiaControlDir . 'temp' . DIRECTORY_SEPARATOR;
$tempFolder = MANIACONTROL_PATH . 'temp' . DIRECTORY_SEPARATOR;
if (!is_dir($tempFolder) && !mkdir($tempFolder)) {
trigger_error("Couldn't create the temp folder!");
return false;
@ -128,7 +128,7 @@ abstract class FileUtil {
$directories = array($directories);
}
foreach ($directories as $directory) {
$dir = new \RecursiveDirectoryIterator(ManiaControlDir . $directory);
$dir = new \RecursiveDirectoryIterator(MANIACONTROL_PATH . $directory);
foreach (new \RecursiveIteratorIterator($dir) as $fileName => $file) {
if (substr($fileName, 0, 1) === '.') {
continue;