Require PHP 5.1
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 9 Sep 2007 15:02:33 +0000 (15:02 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 9 Sep 2007 15:02:33 +0000 (15:02 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2500 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_div.php
t3lib/compat_php5.php [deleted file]
t3lib/config_default.php
typo3/init.php
typo3/mod/tools/em/class.em_xmlhandler.php
typo3/sysext/cms/tslib/index_ts.php

index adaec20..9d5ffee 100755 (executable)
@@ -2180,20 +2180,12 @@ class t3lib_div {
                xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0);
 
-                       //  PHP4 doesn't like Unicode byte order marks (BOM), so we have to check for them
-                       // The BOM check comes first, so that the PHP5 preg_match() below doesn't have to check for it
-               if(substr($string,0,3)=="\xEF\xBB\xBF") {
-                       xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'utf-8');
-               }
-                       // PHP 4.x: output charset is the same as the input charset, charsets are handled transparently if not specified in xml_parser_create()
                        // PHP 5.0.0 & 5.0.1: default output charset is ISO-8859-1, only ASCII, ISO-8859-1 and UTF-8 are supported!!!
                        // PHP 5.0.2+: default output charset is UTF-8  , only ASCII, ISO-8859-1 and UTF-8 are supported!!!
-               elseif ((double)phpversion()>=5)        {
-                       $match = array();
-                       preg_match('/^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/',substr($string,0,200),$match);
-                       $theCharset = $match[1] ? $match[1] : ($TYPO3_CONF_VARS['BE']['forceCharset'] ? $TYPO3_CONF_VARS['BE']['forceCharset'] : 'iso-8859-1');
-                       xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);  // us-ascii / utf-8 / iso-8859-1
-               }
+               $match = array();
+               preg_match('/^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/',substr($string,0,200),$match);
+               $theCharset = $match[1] ? $match[1] : ($TYPO3_CONF_VARS['BE']['forceCharset'] ? $TYPO3_CONF_VARS['BE']['forceCharset'] : 'iso-8859-1');
+               xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);  // us-ascii / utf-8 / iso-8859-1
 
                        // Parse content:
                xml_parse_into_struct($parser, $string, $vals, $index);
@@ -2428,16 +2420,7 @@ class t3lib_div {
                                                )
                                        )
                                );
-                       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);
-                               }
-                               fclose($fd);
-                       }
+                       $content = @file_get_contents($url, false, $ctx);
                }
                else    {
                        $content = @file_get_contents($url);
diff --git a/t3lib/compat_php5.php b/t3lib/compat_php5.php
deleted file mode 100644 (file)
index 963a006..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * TYPO3 compatibility layer PHP4 <> PHP5
- * These functions provide PHP5 functionality when not available (in PHP4).
- *
- * @author     RenĂ© Fritz <r.fritz@colorcube.de>
- */
-
-
-/**
- * borrowed from PEAR
- * @author Aidan Lister <aidan@php.net>
- */
-
-eval('
-    function clone($object)
-    {
-        // Sanity check
-        if (!is_object($object)) {
-            user_error(\'clone() __clone method called on non-object\', E_USER_WARNING);
-            return;
-        }
-
-        // Use serialize/unserialize trick to deep copy the object
-        $object = unserialize(serialize($object));
-
-        // If there is a __clone method call it on the "new" class
-        if (method_exists($object, \'__clone\')) {
-            $object->__clone();
-        }
-
-        return $object;
-    }
-');
-
-
-?>
\ No newline at end of file
index 8f17899..17e4db0 100755 (executable)
@@ -366,17 +366,6 @@ function debugEnd() {
 }
 
 
-       // PHP5 version check
-if (version_compare(PHP_VERSION, '5.0', '<')) {
-               // include compatibility functions for PHP4
-       include_once(PATH_t3lib.'compat_php5.php');
-
-               // iconv utility functions are only available in PHP5 and later
-       if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils']==='iconv')     {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] = '';
-       }
-}
-
        // Init services array:
 $T3_SERVICES = array();
 
@@ -444,4 +433,4 @@ unset($LOCAL_LANG);
        // Setting some global vars:
 $EXEC_TIME = time();                                   // $EXEC_TIME is set so that the rest of the script has a common value for the script execution time
 $SIM_EXEC_TIME = $EXEC_TIME;                   // $SIM_EXEC_TIME is set to $EXEC_TIME but can be altered later in the script if we want to simulate another execution-time when selecting from eg. a database
-?>
\ No newline at end of file
+?>
index 092e5f8..7c38315 100755 (executable)
@@ -255,7 +255,7 @@ if (intval($TYPO3_CONF_VARS['BE']['lockSSL']) && !(defined('TYPO3_cliMode') && T
 // *******************************
 // 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())<5001000)     die ('TYPO3 requires PHP 5.1.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())   {
        t3lib_div::addSlashesOnArray($_GET);
index e1dc168..17d9bcc 100644 (file)
@@ -2,7 +2,7 @@
 /* **************************************************************
 *  Copyright notice
 *
-*  (c) 2006 Karsten Dambekalns <karsten@typo3.org>
+*  (c) 2006-2007 Karsten Dambekalns <karsten@typo3.org>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -490,12 +490,10 @@ class SC_mod_tools_em_xmlhandler {
                xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
                xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 0);
 
-               if ((double)phpversion()>=5)    {
-                       $preg_result = array();
-                       preg_match('/^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/',substr($string,0,200),$preg_result);
-                       $theCharset = $preg_result[1] ? $preg_result[1] : ($TYPO3_CONF_VARS['BE']['forceCharset'] ? $TYPO3_CONF_VARS['BE']['forceCharset'] : 'iso-8859-1');
-                       xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);  // us-ascii / utf-8 / iso-8859-1
-               }
+               $preg_result = array();
+               preg_match('/^[[:space:]]*<\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/',substr($string,0,200),$preg_result);
+               $theCharset = $preg_result[1] ? $preg_result[1] : ($TYPO3_CONF_VARS['BE']['forceCharset'] ? $TYPO3_CONF_VARS['BE']['forceCharset'] : 'iso-8859-1');
+               xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);  // us-ascii / utf-8 / iso-8859-1
 
                // Parse content:
                xml_parse_into_struct($parser, $string, $vals, $index);
index dcd7963..5bf3769 100755 (executable)
@@ -111,7 +111,7 @@ $TT->pull();
 // *******************************
 // Checking environment
 // *******************************
-if (t3lib_div::int_from_ver(phpversion())<4003000)     die ('TYPO3 requires PHP 4.3.0 or higher.');
+if (t3lib_div::int_from_ver(phpversion())<5001000)     die ('TYPO3 requires PHP 5.1.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())   {