From b66bceda2b37dcf421e4d8f5bc007c8b7f7863c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 13 Mar 2009 20:26:41 +0000 Subject: [PATCH] Some rewrites of double-quote to single-quote --- inc/classes.php | 12 ++++-- .../exceptions/class_FrameworkException.php | 6 ++- .../main/class_BaseFrameworkSystem.php | 37 +++++++++---------- .../compressor/class_CompressorChannel.php | 4 +- .../database/class_DatabaseConnection.php | 2 +- inc/database.php | 8 ---- inc/includes.php | 2 +- inc/language.php | 6 +-- inc/selector.php | 16 ++++---- 9 files changed, 46 insertions(+), 47 deletions(-) diff --git a/inc/classes.php b/inc/classes.php index 49867957..dbeb75a4 100644 --- a/inc/classes.php +++ b/inc/classes.php @@ -36,19 +36,23 @@ foreach ($lowerClasses as $className) { ClassLoader::getInstance()->scanClassPath(sprintf("inc/classes/%s/", $className)); } catch (PathIsNoDirectoryException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", - $className + $className, + $e->getMessage() )); } catch (PathIsEmptyException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", - $className + $className, + $e->getMessage() )); } catch (PathReadProtectedException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", - $className + $className, + $e->getMessage() )); } catch (DirPointerNotOpenedException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path %s for the follwing reason: %s", - $className + $className, + $e->getMessage() )); } } diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php index 4c1c73a9..f3a42895 100644 --- a/inc/classes/exceptions/class_FrameworkException.php +++ b/inc/classes/exceptions/class_FrameworkException.php @@ -124,8 +124,9 @@ abstract class FrameworkException extends ReflectionException { if (!is_array($debug)) { $info .= $debug.", "; } // END - if - } // END - if + } // END - foreach + // Remove last chars (commata, space) $info = substr($info, 0, -2); } // END - if @@ -147,8 +148,11 @@ abstract class FrameworkException extends ReflectionException { // The message $dbgMsg .= "\t at ".$dbgIndex." ".$file." (".$line.") -> ".$dbgInfo['function']."(".$info.")
\n"; } // END - if + + // Add end-message $dbgMsg .= "Debug backtrace end
\n"; + // Return full debug message return $dbgMsg; } diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 38f9f594..06fddbc5 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -76,17 +76,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { /** * The real class name */ - private $realClass = "FrameworkSystem"; + private $realClass = 'FrameworkSystem'; /** * Thousands seperator */ - private $thousands = "."; // German + private $thousands = '.'; // German /** * Decimal seperator */ - private $decimals = ","; // German + private $decimals = ','; // German /*********************** * Exception codes.... * @@ -161,20 +161,19 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { *---------------------------------------------------------------------* */ private $systemClasses = array( - "DebugMiddleware", // Debug middleware output sub-system - "Registry", // Object registry - "ObjectFactory", // Object factory - "DebugWebOutput", // Debug web output sub-system - "WebOutput", // Web output sub-system - "CompressorChannel", // Compressor sub-system - "DebugConsoleOutput", // Debug console output sub-system - "DebugErrorLogOutput", // Debug error_log() output sub-system - "FrameworkDirectoryPointer", // Directory handler sub-system - "NullCompressor", // Null compressor - "Bzip2Compressor", // BZIP2 compressor - "GzipCompressor", // GZIP compressor + 'DebugMiddleware', // Debug middleware output sub-system + 'Registry', // Object registry + 'ObjectFactory', // Object factory + 'DebugWebOutput', // Debug web output sub-system + 'WebOutput', // Web output sub-system + 'CompressorChannel', // Compressor sub-system + 'DebugConsoleOutput', // Debug console output sub-system + 'DebugErrorLogOutput', // Debug error_log() output sub-system + 'FrameworkDirectoryPointer', // Directory handler sub-system + 'NullCompressor', // Null compressor + 'Bzip2Compressor', // BZIP2 compressor + 'GzipCompressor', // GZIP compressor ); - /** * Protected super constructor * @@ -280,10 +279,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->setWebOutputInstance($outputInstance); // Set the compressor channel - $this->setCompressorChannel(CompressorChannel::createCompressorChannel(sprintf("%s%s", - $this->getConfigInstance()->readConfig('base_path'), + $this->setCompressorChannel(CompressorChannel::createCompressorChannel( + $this->getConfigInstance()->readConfig('base_path'). $this->getConfigInstance()->readConfig('compressor_base_path') - ))); + )); // Initialization done! :D Registry::isInitialized('OK'); diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index 7a727156..567c4f44 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -59,9 +59,9 @@ class CompressorChannel extends BaseMiddleware implements Registerable { $dirPointer = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($baseDir); // Read all directories but no sub directories - while ($dir = $dirPointer->readDirectoryExcept(array("..", ".", ".htaccess", ".svn"))) { + while ($dir = $dirPointer->readDirectoryExcept(array('..', '.', '.htaccess', '.svn'))) { // Is this a class file? - if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == ".php")) { + if ((substr($dir, 0, 6) == 'class_') && (substr($dir, -4, 4) == '.php')) { // Get the compressor's name. That's why you must name // your files like your classes and also that's why you // must keep on class in one file. diff --git a/inc/classes/middleware/database/class_DatabaseConnection.php b/inc/classes/middleware/database/class_DatabaseConnection.php index 420421fd..f94e20e4 100644 --- a/inc/classes/middleware/database/class_DatabaseConnection.php +++ b/inc/classes/middleware/database/class_DatabaseConnection.php @@ -72,7 +72,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re } // Public setter for database connection - public final function setConnectionData ($login, $pass, $dbase, $host="localhost") { + public final function setConnectionData ($login, $pass, $dbase, $host='localhost') { // Transfer connection data $this->connectData['login'] = (string) $login; $this->connectData['pass'] = (string) $pass; diff --git a/inc/database.php b/inc/database.php index f62ab895..30792197 100644 --- a/inc/database.php +++ b/inc/database.php @@ -80,13 +80,5 @@ try { // Is the app variable there and valid? if (is_object($app)) $app->setDatabaseInstance($db); -// Datenbankobjekt debuggen -if (defined('DEBUG_DATABASE_OBJ')) { - DebugMiddleware::getInstance()->output(sprintf("The database sub-system does now look like this:
-
%s
\n", - print_r($db, true) - )); -} - // [EOF] ?> diff --git a/inc/includes.php b/inc/includes.php index 367399ad..61e8bb97 100644 --- a/inc/includes.php +++ b/inc/includes.php @@ -62,7 +62,7 @@ $application = preg_replace('/([^a-z0-9_-])+/i', '', $application); $cfg->setConfigEntry('app_name', $application); // Register auto-load function with the SPL -spl_autoload_register("ClassLoader::autoLoad"); +spl_autoload_register('ClassLoader::autoLoad'); /** * Is the devel package included? diff --git a/inc/language.php b/inc/language.php index 8fe75091..7f63099c 100644 --- a/inc/language.php +++ b/inc/language.php @@ -21,10 +21,10 @@ * along with this program. If not, see . */ try { - $lang = LanguageSystem::createLanguageSystem(sprintf("%s%s", - $cfg->readConfig('base_path'), + $lang = LanguageSystem::createLanguageSystem( + $cfg->readConfig('base_path'). FrameworkConfiguration::getInstance()->readConfig('lang_base_path') - )); + ); } catch (LanguagePathIsEmptyException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] The language sub-system could not be initialized for the following reason: %s", $e->getMessage() diff --git a/inc/selector.php b/inc/selector.php index 40789c0c..96ed5505 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -28,19 +28,19 @@ $cfg = FrameworkConfiguration::getInstance(); // Try to load these includes in the given order $configAppIncludes = array( sprintf("class_%s", $cfg->readConfig('app_helper_class')), // The ApplicationHelper class - "config", // The application's own configuration - "data", // Application data - "init", // The application initializer - "loader", // The application's class loader - "debug", // Some debugging stuff - "exceptions", // The application's own exception handler - "starter", // The application starter (calls entryPoint(), etc.) + 'config', // The application's own configuration + 'data', // Application data + 'init', // The application initializer + 'loader', // The application's class loader + 'debug', // Some debugging stuff + 'exceptions', // The application's own exception handler + 'starter', // The application starter (calls entryPoint(), etc.) ); // Load them all (try only) foreach ($configAppIncludes as $inc) { // Skip starter in test mode - if (($inc == "starter") && (defined('TEST'))) { + if (($inc == 'starter') && (defined('TEST'))) { // Skip it here continue; } -- 2.30.2