Registration stub added, naming convention applied, support for PHP code (keep it...
[shipsimu.git] / inc / classes / main / class_BaseFrameworkSystem.php
index f341fc9d33f2335b07cd8966133fc15df9a36337..c1f216eee8f143fe14afa661d16bac5f7944b40d 100644 (file)
@@ -219,8 +219,50 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public final function __call ($methodName, $args) {
                // Implode all given arguments
-               $argsString = implode("|", $args);
-               if (empty($argsString)) $argsString = "NULL";
+               $argsString = "";
+               if (empty($args)) {
+                       // No arguments
+                       $argsString = "NULL";
+               } elseif (is_array($args)) {
+                       // Some arguments are there
+                       foreach ($args as $arg) {
+                               // Check the type
+                               if (is_bool($arg)) {
+                                       // Boolean!
+                                       if ($arg) $argsString .= "true(bool)"; else $argsString .= "false(bool)";
+                               } elseif (is_int($arg)) {
+                                       // Integer
+                                       $argsString .= $arg."(int)";
+                               } elseif (is_float($arg)) {
+                                       // Floating point
+                                       $argsString .= $arg."(float)";
+                               } elseif ($arg instanceof BaseFramework) {
+                                       // Own object instance
+                                       $argsString .= $arg->__toString()."(Object)";
+                               } elseif (is_object($arg)) {
+                                       // External object
+                                       $argsString .= "unknown object(!)";
+                               } elseif (is_array($arg)) {
+                                       // Array
+                                       $argsString .= "Array(array)";
+                               } elseif (is_string($arg)) {
+                                       // String
+                                       $argsString .= "\"".$arg."\"(string)";
+                               } else {
+                                       // Unknown type (please report!)
+                                       $argsString .= $arg."(unknown!)";
+                               }
+
+                               // Add comma
+                               $argsString .= ", ";
+                       }
+
+                       // Remove last comma
+                       if (substr($argsString, -2, 1) === ",") $argsString = substr($argsString, 0, -2);
+               } else {
+                       // Invalid arguments!
+                       $argsString = sprintf("!INVALID:%s!", $args);
+               }
 
                $this->getDebugInstance()->output(sprintf("[%s::%s] Stub! Args: %s",
                        $this->__toString(),
@@ -732,7 +774,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @return      $fileIOInstance An instance to the file I/O sub-system
         */
-       protected final function getFileIOInstance () {
+       protected final function getFileIoInstance () {
                return $this->fileIOInstance;
        }
 
@@ -742,7 +784,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $fileIOInstance An instance to the file I/O sub-system
         * @return      void
         */
-       public final function setFileIOInstance (FileIOHandler $fileIOInstance) {
+       public final function setFileIoInstance (FileIoHandler $fileIOInstance) {
                $this->fileIOInstance = $fileIOInstance;
        }
 
@@ -806,7 +848,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                if ($appInstance->getLanguageInstance() === null) {
                        // Invalid language instance
                        throw new MissingLanguageHandlerException($appInstance, self::EXCEPTION_MISSING_LANGUAGE_HANDLER);
-               } elseif ($appInstance->getFileIOInstance() === null) {
+               } elseif ($appInstance->getFileIoInstance() === null) {
                        // Invalid language instance
                        throw new MissingFileIoHandlerException($appInstance, self::EXCEPTION_MISSING_FILE_IO_HANDLER);
                }
@@ -816,7 +858,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $eval = sprintf("\$tplEngine = %s::create%s(
        \"%s\",
        \$appInstance->getLanguageInstance(),
-       \$appInstance->getFileIOInstance()
+       \$appInstance->getFileIoInstance()
 );",
                        $this->getConfigInstance()->readConfig("tpl_engine"),
                        $this->getConfigInstance()->readConfig("tpl_engine"),