From 4f41ca12a8a611376e9c733b362b50d4e57b42a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 3 Mar 2008 20:25:28 +0000 Subject: [PATCH] some comments fixed, small fix for windows OSes and some other things fixed --- inc/classes.php | 11 ++++------- .../main/class_BaseFrameworkSystem.php | 13 ++++++------- .../main/compressor/class_Bzip2Compressor.php | 19 +++++++++++++++++++ .../main/compressor/class_GzipCompressor.php | 19 +++++++++++++++++++ .../main/compressor/class_NullCompressor.php | 19 +++++++++++++++++++ .../compressor/class_CompressorChannel.php | 2 +- inc/config/class_FrameworkConfiguration.php | 9 ++++++--- inc/selector.php | 2 +- index.php | 2 +- 9 files changed, 76 insertions(+), 20 deletions(-) diff --git a/inc/classes.php b/inc/classes.php index b3d023d63f..64e2bedc58 100644 --- a/inc/classes.php +++ b/inc/classes.php @@ -1,12 +1,11 @@ - * @version 0.3.0 + * @author Roland Haeder + * @version 0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.mxchange.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,9 +21,7 @@ * along with this program. If not, see . */ -/** - * Lower framework classes - */ +// Lower framework classes $lowerClasses = array( 0 => "exceptions", // Exceptions 1 => "interfaces", // Interfaces diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index c29262f1b0..1e536a2013 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -3,12 +3,12 @@ * The simulator system class is the super class of all other classes. This * class handles saving of games etc. * - * @author Roland Haeder + * @author Roland Haeder * @version 0.3.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.mxchange.org - * + * @link http://www.mxchange.org + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -126,7 +126,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { const EXCEPTION_VARIABLE_NOT_SET = 0x02a; const EXCEPTION_ATTRIBUTES_ARE_MISSING = 0x02b; const EXCEPTION_ARRAY_ELEMENTS_MISSING = 0x02c; - const EXCEPTION_NOT_CONSTRUCTABLE = 0x02d; /** * In the super constructor these system classes shall be ignored or else @@ -148,7 +147,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { "GzipCompressor", // GZIP compressor "WebOutput", // Web output sub-system ); - + /** * Private super constructor * @@ -199,7 +198,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->getDebugInstance()->output(sprintf("[%s::%s] Stub! Args: %s", $this->__toString(), $methodName, - $argsString + $argsString )); // Return nothing @@ -475,7 +474,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { private final function generateIdNumber () { return sprintf("%s@%s", $this->__toString(), - md5(sprintf("%s:%s:%s:%s:%s:%s", + md5(sprintf("%s:%s:%s:%s:%s:%s", $this->__toString(), $this->getPartDescr(), time(), diff --git a/inc/classes/main/compressor/class_Bzip2Compressor.php b/inc/classes/main/compressor/class_Bzip2Compressor.php index 78c25714cd..c0c475f442 100644 --- a/inc/classes/main/compressor/class_Bzip2Compressor.php +++ b/inc/classes/main/compressor/class_Bzip2Compressor.php @@ -1,6 +1,25 @@ + * @version 0.3.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.mxchange.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor { /** diff --git a/inc/classes/main/compressor/class_GzipCompressor.php b/inc/classes/main/compressor/class_GzipCompressor.php index d3ed86a9da..0caae9f809 100644 --- a/inc/classes/main/compressor/class_GzipCompressor.php +++ b/inc/classes/main/compressor/class_GzipCompressor.php @@ -1,6 +1,25 @@ + * @version 0.3.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.mxchange.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ class GzipCompressor extends BaseFrameworkSystem implements Compressor { /** diff --git a/inc/classes/main/compressor/class_NullCompressor.php b/inc/classes/main/compressor/class_NullCompressor.php index 4762cb8641..56b2d5f4f8 100644 --- a/inc/classes/main/compressor/class_NullCompressor.php +++ b/inc/classes/main/compressor/class_NullCompressor.php @@ -1,6 +1,25 @@ + * @version 0.3.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.mxchange.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ class NullCompressor extends BaseFrameworkSystem implements Compressor { /** diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index 74d5bbce24..5d5017c6e6 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -1,6 +1,6 @@ * @version 0.3.0 diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 4a82113f16..a1ca42a3ae 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -5,12 +5,12 @@ * NOTE: We cannot put this in inc/classes/ because it would be loaded (again) * in the class loader. See inc/loader/class_ClassLoader.php for instance * - * @see ClassLoader + * @see ClassLoader * @author Roland Haeder * @version 0.3.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.mxchange.org + * @link http://www.mxchange.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -208,8 +208,11 @@ class FrameworkConfiguration { // Cast to string $path = (string) $path; + // Replace backslashes with slashes + $path = str_replace("\\", "/", $path); + // Is it defined or not? - if (!is_dir($path)) { + if ((!is_dir($path)) || (!is_readable($path))) { // Is not a valid path ApplicationEntryPoint::app_die(sprintf("[%s:] Invalid path (not found) specified. Please make sure it is created.", __CLASS__ diff --git a/inc/selector.php b/inc/selector.php index ee54e0ddff..23acabec7e 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -6,7 +6,7 @@ * @version 0.3.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.mxchange.org + * @link http://www.mxchange.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/index.php b/index.php index 244d01c2d2..86b8c446ee 100644 --- a/index.php +++ b/index.php @@ -65,7 +65,7 @@ class ApplicationEntryPoint { if ((class_exists($tpl)) && (is_object($lang)) && (is_object($io))) { // Use the template engine for putting out (nicer look) the message try { - $eval = sprintf("$tplEngine = %s::create%s(\"%s%s\", LanguageSystem::getInstance(), FileIOHandler::getInstance());", + $eval = sprintf("\$tplEngine = %s::create%s(\"%s%s\", LanguageSystem::getInstance(), FileIOHandler::getInstance());", FrameworkConfiguration::getInstance()->readConfig("tpl_engine"), FrameworkConfiguration::getInstance()->readConfig("tpl_engine"), PATH, -- 2.39.5