Use array_push() instead of []
authorRoland Häder <roland@mxchange.org>
Sun, 3 Mar 2013 22:35:01 +0000 (22:35 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Mar 2013 22:35:01 +0000 (22:35 +0000)
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/criteria/class_BaseCriteria.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/filter/class_FilterChain.php
inc/classes/main/mailer/class_BaseMailer.php
inc/classes/main/registry/class_BaseRegistry.php
inc/classes/main/response/class_BaseResponse.php
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/third_party/api/wernisportal/class_WernisApi.php
inc/loader/class_ClassLoader.php

index 7f254d3..d9d252c 100644 (file)
@@ -78,7 +78,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
                // So look for array element?
                if (($exists === TRUE) && (!is_null($arrayElement))) {
                        // Get it
-                       $array = $this->offetget($offset);
+                       $array = $this->offsetGet($offset);
 
                        // Is it an array and element is found?
                        if ((is_array($array)) && (isset($array[$arrayElement]))) {
index 9597c14..da80712 100644 (file)
@@ -202,7 +202,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
 
                // Add it
-               $this->criteria['choice'][$this->convertDashesToUnderscores($criteriaKey)][] = (string) $criteriaValue;
+               array_push($this->criteria['choice'][$this->convertDashesToUnderscores($criteriaKey)], (string) $criteriaValue);
        }
 
        /**
index f49a9f1..efc67c3 100644 (file)
@@ -408,7 +408,7 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                                // Entry found!
                                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, TRUE));
-                                               $resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS][] = $dataArray;
+                                               array_push($resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS], $dataArray);
 
                                                // Count found entries up
                                                $limitFound++;
index 3aff638..c192bf3 100644 (file)
@@ -57,7 +57,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
         * @return      void
         */
        public final function addFilter (Filterable $filterInstance) {
-               $this->filters[] = $filterInstance;
+               array_push($this->filters, $filterInstance);
        }
 
        /**
index 71124d2..ffd0bc1 100644 (file)
@@ -79,7 +79,7 @@ class BaseMailer extends BaseFrameworkSystem {
                } // END - if
 
                // Add it as a recipient
-               $this->recipientList[$templateName]['recipients'][] = $userInstance;
+               array_pushh($this->recipientList[$templateName]['recipients'], $userInstance);
        }
 
        /**
index 4fd9aaf..fc0b4c1 100644 (file)
@@ -97,7 +97,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
         */
        public final function addEntry ($key, $value) {
                // Simply add it
-               $this->rawEntries[$key][] = $value;
+               array_push($this->rawEntries[$key], $value);
        }
 
        /**
index c8cfa4f..2533d7c 100644 (file)
@@ -125,7 +125,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessage ($messageId) {
                // Adds the resolved message id to the fatal message list
-               $this->fatalMessages[] = $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId);
+               array_push($this->fatalMessages, $this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
        }
 
        /**
@@ -136,7 +136,7 @@ class BaseResponse extends BaseFrameworkSystem {
         */
        public final function addFatalMessagePlain ($message) {
                // Adds the resolved message id to the fatal message list
-               $this->fatalMessages[] = $message;
+               array_push($this->fatalMessages, $message);
        }
 
        /**
index 46667de..0f7f32f 100644 (file)
@@ -345,7 +345,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $currVars = $this->readCurrentGroup();
 
                // Append our variable
-               $currVars[] = $this->generateVariableArray($variableName, $value);
+               array_push($currVars, $this->generateVariableArray($variableName, $value));
 
                // Add it to the stack
                $this->setVarStack($this->currGroup, $currVars);
@@ -420,7 +420,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Is the variable set?
                if ($index === FALSE) {
                        // Not found, add it
-                       $this->varStack[$varGroup][] = $this->generateVariableArray($variableName, $value);
+                       array_push($this->varStack[$varGroup], $this->generateVariableArray($variableName, $value));
                } else {
                        // Then modify it
                        $this->setVariableValue($this->currGroup, $index, $value);
@@ -879,13 +879,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                                        $this->loadedRawData[$template] = $this->readVariable($template, 'config');
 
                                        // Recursive protection:
-                                       $this->loadedTemplates[] = $template;
+                                       array_push($this->loadedTemplates, $template);
                                } elseif ($this->getVariableIndex($template) !== FALSE) {
                                        // Use that content here
                                        $this->loadedRawData[$template] = $this->readVariable($template);
 
                                        // Recursive protection:
-                                       $this->loadedTemplates[] = $template;
+                                       array_push($this->loadedTemplates, $template);
                                } else {
                                        // Then try to search for code-templates
                                        try {
@@ -895,10 +895,10 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                                                // Remember this template for recursion detection
                                                // RECURSIVE PROTECTION!
-                                               $this->loadedTemplates[] = $template;
+                                               array_push($this->loadedTemplates, $template);
                                        } catch (FileIoException $e) {
                                                // Even this is not done... :/
-                                               $this->rawTemplates[] = $template;
+                                               array_push($this->rawTemplates, $template);
                                        }
                                }
                        } // END - if
@@ -923,7 +923,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                } // END - if
 
                // Remember this template being compiled
-               $this->compiledTemplates[] = $template;
+               array_push($this->compiledTemplates, $template);
 
                // Compile the loaded code in five steps:
                //
@@ -994,7 +994,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
 
                                        // Remember this template for recursion detection
                                        // RECURSIVE PROTECTION!
-                                       $this->loadedTemplates[] = $template;
+                                       array_push($this->loadedTemplates, $template);
                                } catch (FileIoException $e) {
                                        // This template was never found. We silently ignore it
                                        unset($this->rawTemplates[$key]);
index d2e1054..45c42f1 100644 (file)
@@ -392,7 +392,7 @@ class WernisApi extends BaseFrameworkSystem {
                // Generate request header
                $request  = "GET /".trim($script)." HTTP/1.0\r\n";
                $request .= "Host: ".$host."\r\n";
-               $request .= sprintf("User-Agent: Bube oder Dame / 1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
+               $request .= sprintf("User-Agent: WernisApi/1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
 
                // Initialize array
                $response = array();
@@ -402,17 +402,17 @@ class WernisApi extends BaseFrameworkSystem {
 
                // Read response
                while(!feof($fp)) {
-                       $response[] = trim(fgets($fp, 1024));
-               }
+                       array_push($response, trim(fgets($fp, 1024)));
+               } // END - while
 
                // Close socket
                fclose($fp);
 
                // Was the request successfull?
-               if ((!ereg("200 OK", $response[0])) && (empty($response[0]))) {
+               if ((!ereg('200 OK', $response[0])) && (empty($response[0]))) {
                        // Not found / access forbidden
                        $response = array('', '', '');
-               }
+               } // END - if
 
                // Return response
                return $response;
index 7c9afa9..d7c3c33 100644 (file)
@@ -253,10 +253,10 @@ class ClassLoader {
                 * scanning the whole directory structure starting from given base
                 * path.
                 */
-               $ignoreList[] = '.';
-               $ignoreList[] = '..';
-               $ignoreList[] = '.htaccess';
-               $ignoreList[] = '.svn';
+               array_push($ignoreList, '.');
+               array_push($ignoreList, '..');
+               array_push($ignoreList, '.htaccess');
+               array_push($ignoreList, '.svn');
 
                // Keep it in class for later usage
                $this->ignoreList = $ignoreList;
@@ -346,7 +346,7 @@ class ClassLoader {
                        $this->total++;
 
                        // Mark this class as loaded
-                       $this->loadedClasses[] = $this->classes[$fileName];
+                       array_push($this->loadedClasses, $this->classes[$fileName]);
 
                        // Remove it from classes list
                        unset($this->classes[$fileName]);