Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_utility_directory
authorSteffen Kamper <info@sk-typo3.de>
Wed, 24 Nov 2010 23:57:24 +0000 (23:57 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 24 Nov 2010 23:57:24 +0000 (23:57 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9614 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/utility/class.t3lib_utility_client.php
t3lib/utility/class.t3lib_utility_debug.php
t3lib/utility/class.t3lib_utility_dependency.php
t3lib/utility/class.t3lib_utility_http.php
t3lib/utility/class.t3lib_utility_mail.php
t3lib/utility/class.t3lib_utility_phpoptions.php
t3lib/utility/dependency/class.t3lib_utility_dependency_element.php

index d82be12..2c1f01b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 
 2010-11-24  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_utility_directory
        * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_tree_directory
        * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_tceforms_directory
        * Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_stddb_directory
index 59ab6ff..701e8ba 100644 (file)
@@ -66,12 +66,12 @@ final class t3lib_utility_Client {
                        'useragent' => $userAgent,
                );
 
-               // Analyze the userAgent string
-               // Declare known browsers to look for
+                       // Analyze the userAgent string
+                       // Declare known browsers to look for
 
                $known = array('msie', 'firefox', 'webkit', 'opera', 'netscape', 'konqueror',
-                               'gecko', 'chrome', 'safari', 'seamonkey', 'navigator', 'mosaic',
-                               'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
+                                          'gecko', 'chrome', 'safari', 'seamonkey', 'navigator', 'mosaic',
+                                          'lynx', 'amaya', 'omniweb', 'avant', 'camino', 'flock', 'aol');
                $matches = array();
 
                $pattern = '#(?P<browser>' . join('|', $known) . ')[/ ]+(?P<version>[0-9]+(?:\.[0-9]+)?)#';
@@ -116,9 +116,9 @@ final class t3lib_utility_Client {
                        } elseif (strstr($userAgent, 'Win16') || strstr($userAgent, 'Windows 311')) {
                                $browserInfo['system'] = 'win311';
                        }
-               } elseif (strstr($userAgent,'Mac')) {
+               } elseif (strstr($userAgent, 'Mac')) {
                        $browserInfo['system'] = 'mac';
-                       // unixes
+                               // unixes
                } elseif (strstr($userAgent, 'Linux')) {
                        $browserInfo['system'] = 'linux';
                } elseif (strstr($userAgent, 'SGI') && strstr($userAgent, ' IRIX ')) {
@@ -154,7 +154,7 @@ final class t3lib_utility_Client {
                $getDeviceTypeHooks =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/div/class.t3lib_utility_client.php']['getDeviceType'];
                if (is_array($getDeviceTypeHooks)) {
                        foreach ($getDeviceTypeHooks as $hookFunction) {
-                               $returnResult = true;
+                               $returnResult = TRUE;
                                $hookParameters = array(
                                        'userAgent' => &$userAgent,
                                        'returnResult' => &$returnResult,
@@ -174,13 +174,13 @@ final class t3lib_utility_Client {
                $deviceType = '';
 
                        // pda
-               if(strstr($userAgent, 'avantgo')) {
+               if (strstr($userAgent, 'avantgo')) {
                        $deviceType = 'pda';
                }
                        // wap
-               $browser=substr($userAgent, 0, 4);
-               $wapviwer=substr(stristr($userAgent,'wap'), 0, 3);
-               if($wapviwer == 'wap' ||
+               $browser = substr($userAgent, 0, 4);
+               $wapviwer = substr(stristr($userAgent, 'wap'), 0, 3);
+               if ($wapviwer == 'wap' ||
                        $browser == 'noki' ||
                        $browser == 'eric' ||
                        $browser == 'r380' ||
@@ -190,7 +190,7 @@ final class t3lib_utility_Client {
                        $deviceType = 'wap';
                }
                        // grabber
-               if(strstr($userAgent, 'g.r.a.b.') ||
+               if (strstr($userAgent, 'g.r.a.b.') ||
                        strstr($userAgent, 'utilmind httpget') ||
                        strstr($userAgent, 'webcapture') ||
                        strstr($userAgent, 'teleport') ||
@@ -198,7 +198,7 @@ final class t3lib_utility_Client {
                        $deviceType = 'grabber';
                }
                        // robots
-               if(strstr($userAgent, 'crawler') ||
+               if (strstr($userAgent, 'crawler') ||
                        strstr($userAgent, 'spider') ||
                        strstr($userAgent, 'googlebot') ||
                        strstr($userAgent, 'searchbot') ||
@@ -211,4 +211,5 @@ final class t3lib_utility_Client {
                return $deviceType;
        }
 }
+
 ?>
\ No newline at end of file
index 700b28c..88e18e2 100644 (file)
@@ -57,7 +57,7 @@ class t3lib_utility_Debug {
 
 
        public function debug($var = '', $header = '', $group = 'Debug') {
-               // buffer the output of debug if no buffering started before
+                       // buffer the output of debug if no buffering started before
                if (ob_get_level() == 0) {
                        ob_start();
                }
@@ -124,17 +124,17 @@ class t3lib_utility_Debug {
         */
        public static function prepareVariableForJavascript($string, $asObject) {
                if ($asObject) {
-                       $string = str_replace(array (
-                               '"', '/', '<', "\n", "\r"
-                       ), array (
-                               '\"', '\/', '\<', '<br />', ''
-                       ), $string);
+                       $string = str_replace(array(
+                                                                          '"', '/', '<', "\n", "\r"
+                                                                 ), array(
+                                                                                 '\"', '\/', '\<', '<br />', ''
+                                                                        ), $string);
                } else {
-                       $string = str_replace(array (
-                               '"', '/', '<', "\n", "\r"
-                       ), array (
-                               '\"', '\/', '\<', '', ''
-                       ), $string);
+                       $string = str_replace(array(
+                                                                          '"', '/', '<', "\n", "\r"
+                                                                 ), array(
+                                                                                 '\"', '\/', '\<', '', ''
+                                                                        ), $string);
                }
 
                return $string;
@@ -225,7 +225,7 @@ class t3lib_utility_Debug {
                $trail = array_reverse($trail);
                array_pop($trail);
 
-               $path = array ();
+               $path = array();
                foreach ($trail as $dat) {
                        $path[] = $dat['class'] . $dat['type'] . $dat['function'] . '#' . $dat['line'];
                }
@@ -247,13 +247,13 @@ class t3lib_utility_Debug {
                        $firstEl = current($rows);
                        if (is_array($firstEl)) {
                                $headerColumns = array_keys($firstEl);
-                               $tRows = array ();
+                               $tRows = array();
 
-                               // Header:
+                                       // Header:
                                $tRows[] = '<tr><td colspan="' . count($headerColumns) .
-                                       '" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' .
-                                       htmlspecialchars($header) . '</strong></td></tr>';
-                               $tCells = array ();
+                                                  '" style="background-color:#bbbbbb; font-family: verdana,arial; font-weight: bold; font-size: 10px;"><strong>' .
+                                                  htmlspecialchars($header) . '</strong></td></tr>';
+                               $tCells = array();
                                foreach ($headerColumns as $key) {
                                        $tCells[] = '
                                                        <td><font face="Verdana,Arial" size="1"><strong>' . htmlspecialchars($key) . '</strong></font></td>';
@@ -262,14 +262,14 @@ class t3lib_utility_Debug {
                                                <tr>' . implode('', $tCells) . '
                                                </tr>';
 
-                               // Rows:
+                                       // Rows:
                                foreach ($rows as $singleRow) {
-                                       $tCells = array ();
+                                       $tCells = array();
                                        foreach ($headerColumns as $key) {
                                                $tCells[] = '
                                                        <td><font face="Verdana,Arial" size="1">' .
-                                                       (is_array($singleRow[$key]) ? self::debugRows($singleRow[$key], '', TRUE) : htmlspecialchars($singleRow[$key])) .
-                                                       '</font></td>';
+                                                                       (is_array($singleRow[$key]) ? self::debugRows($singleRow[$key], '', TRUE) : htmlspecialchars($singleRow[$key])) .
+                                                                       '</font></td>';
                                        }
                                        $tRows[] = '
                                                <tr>' . implode('', $tCells) . '
@@ -279,12 +279,17 @@ class t3lib_utility_Debug {
                                $table = '
                                        <table border="1" cellpadding="1" cellspacing="0" bgcolor="white">' . implode('', $tRows) . '
                                        </table>';
-                               if ($returnHTML)
+                               if ($returnHTML) {
                                        return $table;
+                               }
                                else
+                               {
                                        echo $table;
+                               }
                        } else
+                       {
                                debug('Empty array of rows', $header);
+                       }
                } else {
                        debug('No array of rows', $header);
                }
@@ -299,8 +304,9 @@ class t3lib_utility_Debug {
         * @deprecated since TYPO3 4.5 - Use t3lib_utility_Debug::debug_ordvalue instead
         */
        public function ordinalValue($string, $characters = 100) {
-               if (strlen($string) < $characters)
+               if (strlen($string) < $characters) {
                        $characters = strlen($string);
+               }
                for ($i = 0; $i < $characters; $i++) {
                        $valuestring .= ' ' . ord(substr($string, $i, 1));
                }
@@ -336,8 +342,8 @@ class t3lib_utility_Debug {
                                                        $string .= print_r($val, TRUE);
                                                }
                                                $result .= '<font face="Verdana,Arial" size="1" color="red">' .
-                                                       nl2br(htmlspecialchars($string)) .
-                                                       '<br /></font>';
+                                                                  nl2br(htmlspecialchars($string)) .
+                                                                  '<br /></font>';
                                        } else {
                                                if (gettype($val) == 'object') {
                                                        $string = 'Unknown object';
@@ -345,8 +351,8 @@ class t3lib_utility_Debug {
                                                        $string = (string) $val;
                                                }
                                                $result .= '<font face="Verdana,Arial" size="1" color="red">' .
-                                                       nl2br(htmlspecialchars($string)) .
-                                                       '<br /></font>';
+                                                                  nl2br(htmlspecialchars($string)) .
+                                                                  '<br /></font>';
                                        }
                                        $result .= '</td>
                                        </tr>';
@@ -357,8 +363,8 @@ class t3lib_utility_Debug {
                        $result = '<table border="1" cellpadding="1" cellspacing="0" bgcolor="white">
                                <tr>
                                        <td><font face="Verdana,Arial" size="1" color="red">' .
-                                       nl2br(htmlspecialchars((string) $array_in)) .
-                                       '<br /></font></td>
+                                         nl2br(htmlspecialchars((string) $array_in)) .
+                                         '<br /></font></td>
                                </tr>
                        </table>'; // Output it as a string.
                }
@@ -378,7 +384,7 @@ class t3lib_utility_Debug {
 }
 
 
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/utility/class.t3lib_utility_debug.php'])    {
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/utility/class.t3lib_utility_debug.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/utility/class.t3lib_utility_debug.php']);
 }
 ?>
\ No newline at end of file
index e021fcd..bdbfc3f 100644 (file)
@@ -89,7 +89,7 @@ class t3lib_utility_Dependency {
         * @return t3lib_utility_Dependency
         */
        public function setOuterMostParentsRequireReferences($outerMostParentsRequireReferences) {
-               $this->outerMostParentsRequireReferences = (bool)$outerMostParentsRequireReferences;
+               $this->outerMostParentsRequireReferences = (bool) $outerMostParentsRequireReferences;
                return $this;
        }
 
@@ -191,3 +191,4 @@ class t3lib_utility_Dependency {
                return $this->factory;
        }
 }
+?>
\ No newline at end of file
index dc1133b..f7ef675 100644 (file)
@@ -1,26 +1,26 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 2009-2010 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script 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.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
+ *  Copyright notice
+ *
+ *  (c) 2009-2010 Ingo Renner <ingo@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script 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.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
 
 
 /**
index 8954690..9e86795 100644 (file)
@@ -45,13 +45,13 @@ final class t3lib_utility_Mail {
         * @param       string          Email address to send to.
         * @param       string          Subject line, non-encoded. (see PHP function mail())
         * @param       string          Message content, non-encoded. (see PHP function mail())
-        * @param       string          Additional headers for the mail (see PHP function mail())
+        * @param       string           Additional headers for the mail (see PHP function mail())
         * @param       string          Additional flags for the sending mail tool (see PHP function mail())
         * @return      boolean         Indicates whether the mail has been sent or not
         * @see         PHP function mail() []
         * @link        http://www.php.net/manual/en/function.mail.php
         */
-       public static function mail($to, $subject, $messageBody, $additionalHeaders = null, $additionalParameters = null) {
+       public static function mail($to, $subject, $messageBody, $additionalHeaders = NULL, $additionalParameters = NULL) {
                $success = TRUE;
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'])) {
                        $parameters = array(
@@ -75,4 +75,5 @@ final class t3lib_utility_Mail {
                return $success;
        }
 }
+
 ?>
\ No newline at end of file
index 760a29e..79f7aa3 100644 (file)
@@ -62,4 +62,5 @@ final class t3lib_utility_PhpOptions {
                return filter_var(ini_get($configOption), FILTER_VALIDATE_BOOLEAN, array(FILTER_REQUIRE_SCALAR, FILTER_NULL_ON_FAILURE));
        }
 }
+
 ?>
index af6978d..559c1af 100644 (file)
@@ -192,7 +192,7 @@ class t3lib_utility_Dependency_Element {
                                '*',
                                'sys_refindex',
                                'tablename=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->table, 'sys_refindex') .
-                                       ' AND recuid=' . $this->id
+                               ' AND recuid=' . $this->id
                        );
                        if (is_array($rows)) {
                                foreach ($rows as $row) {
@@ -224,7 +224,7 @@ class t3lib_utility_Dependency_Element {
                                '*',
                                'sys_refindex',
                                'ref_table=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->table, 'sys_refindex') .
-                                       ' AND deleted=0 AND ref_uid=' . $this->id
+                               ' AND deleted=0 AND ref_uid=' . $this->id
                        );
                        if (is_array($rows)) {
                                foreach ($rows as $row) {