Some rewrites of double-quote to single-quote
authorRoland Häder <roland@mxchange.org>
Fri, 13 Mar 2009 20:26:41 +0000 (20:26 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 13 Mar 2009 20:26:41 +0000 (20:26 +0000)
inc/classes.php
inc/classes/exceptions/class_FrameworkException.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/middleware/compressor/class_CompressorChannel.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/database.php
inc/includes.php
inc/language.php
inc/selector.php

index 4986795..dbeb75a 100644 (file)
@@ -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 <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
-                       $className
+                       $className,
+                       $e->getMessage()
                ));
        } catch (PathIsEmptyException $e) {
                ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
-                       $className
+                       $className,
+                       $e->getMessage()
                ));
        } catch (PathReadProtectedException $e) {
                ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
-                       $className
+                       $className,
+                       $e->getMessage()
                ));
        } catch (DirPointerNotOpenedException $e) {
                ApplicationEntryPoint::app_die(sprintf("[Main:] Could not load framework classes from path <span class=\"exception_data\">%s</span> for the follwing reason: <span class=\"exception_reason\">%s</span>",
-                       $className
+                       $className,
+                       $e->getMessage()
                ));
        }
 }
index 4c1c73a..f3a4289 100644 (file)
@@ -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 <em id=\"debug_id_".$dbgIndex."\">".$dbgIndex."</em> <em id=\"debug_file_".$dbgIndex."\">".$file."</em> (<em id=\"debug_line_".$dbgIndex."\">".$line."</em>) -&gt; ".$dbgInfo['function']."(".$info.")<br />\n";
                } // END - if
+
+               // Add end-message
                $dbgMsg .= "Debug backtrace end<br />\n";
 
+               // Return full debug message
                return $dbgMsg;
        }
 
index 38f9f59..06fddbc 100644 (file)
@@ -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');
index 7a72715..567c4f4 100644 (file)
@@ -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.
index 420421f..f94e20e 100644 (file)
@@ -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;
index f62ab89..3079219 100644 (file)
@@ -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:<br />
-<pre>%s</pre>\n",
-               print_r($db, true)
-       ));
-}
-
 // [EOF]
 ?>
index 367399a..61e8bb9 100644 (file)
@@ -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?
index 8fe7509..7f63099 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 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: <span class=\"exception_reason\">%s</span>",
                $e->getMessage()
index 40789c0..96ed550 100644 (file)
@@ -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;
        }