Remove checks for PHP version earlier than 4.3.
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 28 Jan 2007 20:29:09 +0000 (20:29 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 28 Jan 2007 20:29:09 +0000 (20:29 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1953 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_cs.php
t3lib/class.t3lib_db.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_stdgraphic.php
t3lib/class.t3lib_svbase.php
t3lib/class.t3lib_tstemplate.php
t3lib/thumbs.php
typo3/sysext/cms/tslib/index_ts.php
typo3/sysext/install/mod/class.tx_install.php

index 036aca9..c518e98 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2003-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 2003-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the Typo3 project. The Typo3 project is
@@ -1538,7 +1538,7 @@ class t3lib_cs {
         * @see strtolower(), strtoupper()
         */
        function conv_case($charset,$string,$case)      {
-               if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring' && (float)phpversion() >= 4.3)   {
+               if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring') {
                        if ($case == 'toLower') {
                                $string = mb_strtolower($string,$charset);
                        } else {
index c137693..925c1e9 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2004-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 2004-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -551,11 +551,7 @@ class t3lib_DB {
         * @see quoteStr()
         */
        function fullQuoteStr($str, $table)     {
-               if (function_exists('mysql_real_escape_string'))        {
-                       return '\''.mysql_real_escape_string($str, $this->link).'\'';
-               } else {
-                       return '\''.mysql_escape_string($str).'\'';
-               }
+               return '\''.mysql_real_escape_string($str, $this->link).'\'';
        }
 
        /**
@@ -595,11 +591,7 @@ class t3lib_DB {
         * @see quoteStr()
         */
        function quoteStr($str, $table) {
-               if (function_exists('mysql_real_escape_string'))        {
-                       return mysql_real_escape_string($str, $this->link);
-               } else {
-                       return mysql_escape_string($str);
-               }
+               return mysql_real_escape_string($str, $this->link);
        }
 
        /**
@@ -1113,16 +1105,14 @@ class t3lib_DB {
                if (!$res) {
                        $trace = FALSE;
                        $msg = 'Invalid database result resource detected';
-                       if (version_compare(phpversion(), '4.3.0', '>=')) {
-                               $trace = debug_backtrace();
-                               array_shift($trace);
-                               $cnt = count($trace);
-                               for ($i=0; $i<$cnt; $i++)       {
-                                               // complete objects are too large for the log
-                                       if (isset($trace['object']))    unset($trace['object']);
-                               }
-                               $msg .= ': function t3lib_DB->' . $trace[0]['function'] . ' called from file ' . substr($trace[0]['file'],strlen(PATH_site)+2) . ' in line ' . $trace[0]['line'];
+                       $trace = debug_backtrace();
+                       array_shift($trace);
+                       $cnt = count($trace);
+                       for ($i=0; $i<$cnt; $i++)       {
+                                       // complete objects are too large for the log
+                               if (isset($trace['object']))    unset($trace['object']);
                        }
+                       $msg .= ': function t3lib_DB->' . $trace[0]['function'] . ' called from file ' . substr($trace[0]['file'],strlen(PATH_site)+2) . ' in line ' . $trace[0]['line'];
                        t3lib_div::sysLog($msg.'. Use a devLog extension to get more details.', 'Core/t3lib_db', 3);
                        t3lib_div::devLog($msg.'.', 'Core/t3lib_db', 3, $trace);
 
index ae66b73..e64d8b5 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -2377,36 +2377,27 @@ class t3lib_div {
                        }
                        fclose($fp);
 
-               } elseif (is_array($requestHeaders) && function_exists('stream_context_create'))        {
-
+               } elseif (is_array($requestHeaders))    {
                        $ctx = stream_context_create(array(
                                                'http' => array(
                                                        'header' => implode("\r\n", $requestHeaders)
                                                )
                                        )
                                );
-
-                       if (function_exists('file_get_contents') && version_compare(phpversion(), '5.0', '>=')) {
+                       if (version_compare(phpversion(), '5.0', '>=')) {
                                $content = @file_get_contents($url, false, $ctx);
                        }
                        elseif (false !== ($fd = @fopen($url, 'rb', false, $ctx)))      {
                                $content = '';
                                while (!feof($fd))      {
-                                       $content.= fread($fd, 4096);
+                                       $content.= @fread($fd, 4096);
                                }
                                fclose($fd);
                        }
                }
-               elseif (function_exists('file_get_contents'))   {
+               else    {
                        $content = @file_get_contents($url);
                }
-               elseif (false !== ($fd = @fopen($url, 'rb')))   {
-                       $content = '';
-                       while (!feof($fd))      {
-                               $content.= fread($fd, 4096);
-                       }
-                       fclose($fd);
-               }
 
                return $content;
        }
@@ -2841,18 +2832,16 @@ class t3lib_div {
         * @return      string
         */
        function debug_trail()  {
-               if (function_exists('debug_backtrace')) {
-                       $trail = debug_backtrace();
-                       $trail = array_reverse($trail);
-                       array_pop($trail);
-
-                       $path = array();
-                       foreach($trail as $dat) {
-                               $path[] = $dat['class'].$dat['type'].$dat['function'];
-                       }
+               $trail = debug_backtrace();
+               $trail = array_reverse($trail);
+               array_pop($trail);
+
+               $path = array();
+               foreach($trail as $dat) {
+                       $path[] = $dat['class'].$dat['type'].$dat['function'];
+               }
 
-                       return implode(' // ',$path);
-               } else return 'N/A';
+               return implode(' // ',$path);
        }
 
        /**
@@ -4410,10 +4399,7 @@ class t3lib_div {
 
                        // do custom logging
                if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'])) {
-                       $params = array('msg'=>$msg, 'extKey'=>$extKey);
-                       if (function_exists('debug_backtrace')) {
-                               $params['backTrace'] = debug_backtrace();
-                       }
+                       $params = array('msg'=>$msg, 'extKey'=>$extKey, 'backTrace'=>debug_backtrace());
                        $fakeThis = FALSE;
                        foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLog'] as $hookMethod)       {
                                t3lib_div::callUserFunction($hookMethod,$params,$fakeThis);
@@ -4615,4 +4601,4 @@ class t3lib_div {
 
 }
 
-?>
\ No newline at end of file
+?>
index d4b7590..a807c7e 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -2267,11 +2267,7 @@ class t3lib_stdGraphic   {
        function cacheImageDimensions($identifyResult)  {
                global $TYPO3_DB;
                        // Create a md5 hash of the filename
-               if (function_exists('md5_file')) {
-                       $md5Hash = md5_file($identifyResult[3]);
-               } else {
-                       $md5Hash = md5 (t3lib_div::getURL($identifyResult[3]));
-               }
+               $md5Hash = md5_file($identifyResult[3]);
                if ($md5Hash) {
                        $fieldArr = array (
                                'md5hash' => $md5Hash,
@@ -2299,11 +2295,7 @@ class t3lib_stdGraphic   {
        function getCachedImageDimensions($imageFile)   {
                global $TYPO3_DB;
                        // Create a md5 hash of the filename
-               if(function_exists('md5_file')) {
-                       $md5Hash = md5_file($imageFile);
-               } else {
-                       $md5Hash = md5(t3lib_div::getURL ($imageFile));
-               }
+               $md5Hash = md5_file($imageFile);
                ereg('([^\.]*)$',$imageFile,$reg);
                $res = $TYPO3_DB->exec_SELECTquery ('md5hash, imagewidth, imageheight', 'cache_imagesizes', 'md5filename='.$TYPO3_DB->fullQuoteStr(md5($imageFile),'cache_imagesizes'));
                if ($res) {
index 06e046b..49835e5 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the Typo3 project. The Typo3 project is
@@ -448,14 +448,9 @@ class t3lib_svbase {
        function readFile ($absFile, $length=0) {
                $out = FALSE;
 
-               if ($this->checkInputFile ($absFile)) {
-                       if ($fd = fopen ($absFile, 'rb')) {
-                               $length = intval($length) ? intval($length) : filesize ($absFile);
-                               if ($length > 0) {
-                                       $out = fread ($fd, $length);
-                               }
-                               fclose ($fd);
-                       } else {
+               if ($this->checkInputFile($absFile)) {
+                       $out = file_get_contents($absFile);
+                       if ($out===FALSE)       {
                                $this->errorPush(T3_ERR_SV_FILE_READ, 'Can not read from file: '.$absFile);
                        }
                }
@@ -719,4 +714,4 @@ if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["t3lib/class
 }
 */
 
-?>
\ No newline at end of file
+?>
index e9a92b5..0fbd177 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -1223,7 +1223,7 @@ class t3lib_TStemplate    {
 
        /**
         * Reads the fileContent of $fName and returns it.
-        * The same as t3lib_div::getUrl()
+        * Similar to t3lib_div::getUrl()
         *
         * @param       string          Absolute filepath to record
         * @return      string          The content returned
@@ -1231,13 +1231,8 @@ class t3lib_TStemplate   {
         */
        function fileContent($fName)    {
                $incFile = $this->getFileName($fName);
-               if ($incFile && $fd=fopen($incFile,'rb'))       {
-                       $content = '';
-                       while (!feof($fd))      {
-                               $content.=fread($fd, 5000);
-                       }
-                       fclose( $fd );
-                       return $content;
+               if ($incFile)   {
+                       return @file_get_contents($incFile);
                }
        }
 
@@ -1569,4 +1564,4 @@ class t3lib_TStemplate    {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tstemplate.php'])       {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tstemplate.php']);
 }
-?>
\ No newline at end of file
+?>
index 88df0f2..460eab7 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -242,10 +242,8 @@ class SC_t3lib_thumbs {
                                        // The thumbnail is read and output to the browser
                                if($fd = @fopen($this->output,'rb'))    {
                                        header('Content-type: image/'.$outext);
-                                       while (!feof($fd))      {
-                                               echo fread($fd, 10000);
-                                       }
-                                       fclose( $fd );
+                                       fpassthru($fd);
+                                       fclose($fd);
                                } else {
                                        $this->errorGif('Read problem!','',$this->output);
                                }
@@ -400,4 +398,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/thumb
 $SOBE = t3lib_div::makeInstance('SC_t3lib_thumbs');
 $SOBE->init();
 $SOBE->main();
-?>
\ No newline at end of file
+?>
index 97b555a..a960ae0 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -111,7 +111,7 @@ $TT->pull();
 // *******************************
 // Checking environment
 // *******************************
-if (t3lib_div::int_from_ver(phpversion())<4001000)     die ('TYPO3 runs with PHP4.1.0+ only');
+if (t3lib_div::int_from_ver(phpversion())<4003000)     die ('TYPO3 requires PHP 4.3.0 or higher.');
 
 if (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS']))       die('You cannot set the GLOBALS-array from outside the script.');
 if (!get_magic_quotes_gpc())   {
index 6120dc2..186143a 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2007 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -2504,9 +2504,7 @@ From sub-directory:
         * @return      [type]          ...
         */
        function ImageTypes()   {
-               if (phpversion()!='4.1.2')      {
-                       return imagetypes();
-               } else return IMG_GIF+IMG_JPG+IMG_PNG; // all...
+               return imagetypes();
        }
 
        /**
@@ -5068,4 +5066,4 @@ a:hover {color: #006; text-decoration:underline:}
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/install/mod/class.tx_install.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/install/mod/class.tx_install.php']);
 }
-?>
\ No newline at end of file
+?>