* added side-by-side patch to prepare core for new installer code (makes it possible...
authorThomas Hempel <thomas.hempel@typo3.org>
Thu, 15 Nov 2007 16:35:41 +0000 (16:35 +0000)
committerThomas Hempel <thomas.hempel@typo3.org>
Thu, 15 Nov 2007 16:35:41 +0000 (16:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2715 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/init.php
typo3/sysext/install/ext_localconf.php
typo3/sysext/install/ext_tables.php
typo3/sysext/install/mod/class.tx_install.php

index f0504a0..de8b788 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2007-11-15  Thomas Hempel <thomas@typo3-unleashed.net>
+       * added side-by-side patch to prepare core for new installer code (makes it possible to run old and new installer side by side)
+
 2007-11-15  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Feature #6672: Add tab filtering and file type filtering to TCA-defined link wizard
index 7c38315..888490c 100755 (executable)
@@ -269,13 +269,78 @@ if (!get_magic_quotes_gpc())      {
 // Check if the install script should be run:
 // ********************************************
 if (defined('TYPO3_enterInstallScript') && TYPO3_enterInstallScript)   {
-       if (!t3lib_extMgm::isLoaded('install')) die('Install Tool is not loaded as an extension.<br/>You must add the key "install" to the list of installed extensions in typo3conf/localconf.php, $TYPO3_CONF_VARS["EXT"]["extList"].');
+       if (!t3lib_extMgm::isLoaded('install') && !t3lib_extMgm::isLoaded('install_old'))       die('Install Tool is not loaded as an extension.<br/>You must add the key "install" to the list of installed extensions in typo3conf/localconf.php, $TYPO3_CONF_VARS["EXT"]["extList"].');
+
+
+
+       /* <beta-code TYPO3 4.2-dev> */
+
+       session_start();
+
+       if($setInstallToolVersion = t3lib_div::_GP('installToolVersion')) {
+               if ($setInstallToolVersion === 'new') {
+                       $lcBackupFileName =  PATH_typo3conf.'localconf-'.date('ymd').'.php';
+                       if (!file_exists($lcBackupFileName))    {
+                               if (!copy(PATH_typo3conf.'localconf.php', $lcBackupFileName)) {
+                                       echo 'Backup of localconf.php failed! Will not start the new install tool.';
+                                       exit;
+                               }
+                       }
+               }
+               $_SESSION['installToolVersion'] = $setInstallToolVersion==='new'?'new':'old';
+       }
+
+       if(!$_SESSION['installToolVersion']) {
+
+               $oldInstallToolLoaded = t3lib_extMgm::isLoaded('install_old');
+               $newInstallToolLoaded = t3lib_extMgm::isLoaded('install');
+
+               echo '
+                       <link rel="stylesheet" href="../stylesheet.css" />
+                       <p style="margin: 20px;">Please select the install tool version to use for this browser session:</p>
+                       <ul>
+                               <li>
+                                       '.($oldInstallToolLoaded?'<a href="index.php?installToolVersion=old&'.htmlspecialchars(t3lib_div::getIndpEnv('QUERY_STRING')).'">':'').'
+                                               Traditional Install Tool
+                                       '.($oldInstallToolLoaded?'</a>':' (The extension "install_old" must be installed for this to work.)').'
+                               </li>
+                               <li>
+                                       '.($newInstallToolLoaded?'<a href="index.php?installToolVersion=new&'.htmlspecialchars(t3lib_div::getIndpEnv('QUERY_STRING')).'">':'').'
+                                               New Install Tool for TYPO3 4.2
+                                       '.($newInstallToolLoaded?'</a>':' (The extension "install" must be installed for this to work.)').'<br /><b>If you choose this option, a backup of the localconf file which is named localconf-YYMMDD.php is automatically created.</b>
+                               </li>
+                       </ul>
+               ';
+               exit();
+       }
+
+       if($_SESSION['installToolVersion'] === 'old') {
+               require_once(t3lib_extMgm::extPath('install_old').'mod/class.tx_install.php');
+               $install_check = t3lib_div::makeInstance('tx_install');
+               $install_check->allowUpdateLocalConf = 1;
+               $install_check->init();
+               exit;
+       } else {
+               require_once(t3lib_extMgm::extPath('install').'mod/class.tx_install.php');
+               $install_check = t3lib_div::makeInstance('tx_install');
+               $install_check->allowUpdateLocalConf = 1;
+               $install_check->init();
+               exit;           
+       }
+
+       /* </beta-code> */
+
+       /*
+       <original-code>
 
        require_once(t3lib_extMgm::extPath('install').'mod/class.tx_install.php');
        $install_check = t3lib_div::makeInstance('tx_install');
        $install_check->allowUpdateLocalConf = 1;
        $install_check->init();
        exit;
+
+       </original-code> 
+       */
 }
 
 
index 9ccae30..15fea68 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_compatversion.php');
+require_once(t3lib_extMgm::extPath('install_old').'updates/class.tx_coreupdates_compatversion.php');
 $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['changeCompatibilityVersion'] = 'tx_coreupdates_compatversion';
 
        // not used yet
index 7e6d23c..c985143 100755 (executable)
@@ -1,5 +1,5 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-if (TYPO3_MODE=='BE')  t3lib_extMgm::addModule('tools','install','',t3lib_extMgm::extPath($_EXTKEY).'mod/');
+if (TYPO3_MODE=='BE')  t3lib_extMgm::addModule('tools','install_old','',t3lib_extMgm::extPath($_EXTKEY).'mod/');
 ?>
\ No newline at end of file
index b496dc4..4658ca0 100755 (executable)
@@ -2487,7 +2487,7 @@ From sub-directory:
         */
        function isGIF()        {
                if (function_exists('imagecreatefromgif') && function_exists('imagegif') && ($this->ImageTypes() & IMG_GIF))    {       // If GIF-functions exists, also do a real test of them:
-                       $im = @imagecreatefromgif(t3lib_extMgm::extPath('install').'imgs/jesus.gif');
+                       $im = @imagecreatefromgif(t3lib_extMgm::extPath('install_old').'imgs/jesus.gif');
                        return $im?1:0;
                }
        }
@@ -2510,7 +2510,7 @@ From sub-directory:
         */
        function isPNG()        {
                if (function_exists('imagecreatefrompng') && function_exists('imagepng') && ($this->ImageTypes() & IMG_PNG))    {
-                       $im = imagecreatefrompng(t3lib_extMgm::extPath('install').'imgs/jesus.png');
+                       $im = imagecreatefrompng(t3lib_extMgm::extPath('install_old').'imgs/jesus.png');
                        return $im?1:0;
                }
        }
@@ -2749,7 +2749,7 @@ From sub-directory:
                                        while(list(,$ext)=each($extArr))        {
                                                if ($this->isExtensionEnabled($ext, $headCode, "Read ".strtoupper($ext)))       {
                                                        $imageProc->IM_commands=array();
-                                                       $theFile = t3lib_extMgm::extPath('install').'imgs/jesus.'.$ext;
+                                                       $theFile = t3lib_extMgm::extPath('install_old').'imgs/jesus.'.$ext;
                                                        if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
 
                                                        $imageProc->imageMagickConvert_forceFileNameBody='read_'.$ext;
@@ -2761,7 +2761,7 @@ From sub-directory:
 
                                        if ($this->isExtensionEnabled('pdf', $headCode, 'Read PDF'))    {
                                                $imageProc->IM_commands=array();
-                                               $theFile = t3lib_extMgm::extPath('install').'imgs/pdf_from_imagemagick.pdf';
+                                               $theFile = t3lib_extMgm::extPath('install_old').'imgs/pdf_from_imagemagick.pdf';
                                                if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
 
                                                $imageProc->imageMagickConvert_forceFileNameBody='read_pdf';
@@ -2771,7 +2771,7 @@ From sub-directory:
                                        }
                                        if ($this->isExtensionEnabled('ai', $headCode, 'Read AI'))      {
                                                $imageProc->IM_commands=array();
-                                               $theFile = t3lib_extMgm::extPath('install').'imgs/typo3logotype.ai';
+                                               $theFile = t3lib_extMgm::extPath('install_old').'imgs/typo3logotype.ai';
                                                if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
 
                                                $imageProc->imageMagickConvert_forceFileNameBody='read_ai';
@@ -2799,7 +2799,7 @@ From sub-directory:
                                if ($imActive)  {
                                                // Writing GIF
                                        $imageProc->IM_commands=array();
-                                       $theFile = t3lib_extMgm::extPath('install').'imgs/jesus.gif';
+                                       $theFile = t3lib_extMgm::extPath('install_old').'imgs/jesus.gif';
                                        if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
 
                                        $imageProc->imageMagickConvert_forceFileNameBody='write_gif';
@@ -2818,7 +2818,7 @@ From sub-directory:
 
                                                // Writing PNG
                                        $imageProc->IM_commands=array();
-                                       $theFile = t3lib_extMgm::extPath('install').'imgs/jesus.gif';
+                                       $theFile = t3lib_extMgm::extPath('install_old').'imgs/jesus.gif';
 
                                        $imageProc->imageMagickConvert_forceFileNameBody='write_png';
                                        $fileInfo = $imageProc->imageMagickConvert($theFile,'png',"",'',"",'',"",1);
@@ -2843,7 +2843,7 @@ From sub-directory:
                                if ($imActive)  {
                                                // Scaling transparent image
                                        $imageProc->IM_commands=array();
-                                       $theFile = t3lib_extMgm::extPath('install').'imgs/jesus2_transp.gif';
+                                       $theFile = t3lib_extMgm::extPath('install_old').'imgs/jesus2_transp.gif';
                                        if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
 
                                        $imageProc->imageMagickConvert_forceFileNameBody='scale_gif';
@@ -2860,7 +2860,7 @@ From sub-directory:
                                        $this->message($headCode,'GIF to GIF, 150 pixels wide',$result[0],$result[1]);
 
                                        $imageProc->IM_commands=array();
-                                       $theFile = t3lib_extMgm::extPath('install').'imgs/jesus2_transp.png';
+                                       $theFile = t3lib_extMgm::extPath('install_old').'imgs/jesus2_transp.png';
                                        if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
 
                                        $imageProc->imageMagickConvert_forceFileNameBody='scale_png';
@@ -2869,7 +2869,7 @@ From sub-directory:
                                        $this->message($headCode,'PNG to PNG, 150 pixels wide',$result[0],$result[1]);
 
                                        $imageProc->IM_commands=array();
-                                       $theFile = t3lib_extMgm::extPath('install').'imgs/jesus2_transp.gif';
+                                       $theFile = t3lib_extMgm::extPath('install_old').'imgs/jesus2_transp.gif';
                                        if (!@is_file($theFile))        die('Error: '.$theFile.' was not a file');
                                        $imageProc->imageMagickConvert_forceFileNameBody='scale_jpg';
                                        $fileInfo = $imageProc->imageMagickConvert($theFile,'jpg',"150",'',"",'',"",1);
@@ -2894,9 +2894,9 @@ From sub-directory:
 
                                if ($imActive)  {
                                        $imageProc->IM_commands=array();
-                                       $input = t3lib_extMgm::extPath('install').'imgs/greenback.gif';
-                                       $overlay = t3lib_extMgm::extPath('install').'imgs/jesus.jpg';
-                                       $mask = t3lib_extMgm::extPath('install').'imgs/blackwhite_mask.gif';
+                                       $input = t3lib_extMgm::extPath('install_old').'imgs/greenback.gif';
+                                       $overlay = t3lib_extMgm::extPath('install_old').'imgs/jesus.jpg';
+                                       $mask = t3lib_extMgm::extPath('install_old').'imgs/blackwhite_mask.gif';
                                                if (!@is_file($input))  die('Error: '.$input.' was not a file');
                                                if (!@is_file($overlay))        die('Error: '.$overlay.' was not a file');
                                                if (!@is_file($mask))   die('Error: '.$mask.' was not a file');
@@ -2909,9 +2909,9 @@ From sub-directory:
 
                                        // Combine
                                        $imageProc->IM_commands=array();
-                                       $input = t3lib_extMgm::extPath('install').'imgs/combine_back.jpg';
-                                       $overlay = t3lib_extMgm::extPath('install').'imgs/jesus.jpg';
-                                       $mask = t3lib_extMgm::extPath('install').'imgs/combine_mask.jpg';
+                                       $input = t3lib_extMgm::extPath('install_old').'imgs/combine_back.jpg';
+                                       $overlay = t3lib_extMgm::extPath('install_old').'imgs/jesus.jpg';
+                                       $mask = t3lib_extMgm::extPath('install_old').'imgs/combine_mask.jpg';
                                                if (!@is_file($input))  die('Error: '.$input.' was not a file');
                                                if (!@is_file($overlay))        die('Error: '.$overlay.' was not a file');
                                                if (!@is_file($mask))   die('Error: '.$mask.' was not a file');
@@ -2960,7 +2960,7 @@ From sub-directory:
 
                                        // GD from image with box
                                        $imageProc->IM_commands=array();
-                                       $input = t3lib_extMgm::extPath('install').'imgs/jesus.'.$imageProc->gifExtension;
+                                       $input = t3lib_extMgm::extPath('install_old').'imgs/jesus.'.$imageProc->gifExtension;
                                                if (!@is_file($input))  die('Error: '.$input.' was not a file');
                                        $im = $imageProc->imageCreateFromFile($input);
                                        $workArea=array(0,0,170,136);
@@ -3127,12 +3127,12 @@ From sub-directory:
                $ex_rows='';
                $errorLevels=array(-1);
                if ($imageFile) {
-                       $verifyFile = t3lib_extMgm::extPath('install').'verify_imgs/'.basename($imageFile);
+                       $verifyFile = t3lib_extMgm::extPath('install_old').'verify_imgs/'.basename($imageFile);
 #debug(array($imageFile,$this->backPath.'../'.substr($imageFile,strlen(PATH_site))),1);
                        $destImg = @getImageSize($imageFile);
                        $destImgCode ='<img src="'.$this->backPath.'../'.substr($imageFile,strlen(PATH_site)).'" '.$destImg[3].'>';
                        $verifyImg = @getImageSize($verifyFile);
-                       $verifyImgCode = '<img src="'.$this->backPath.t3lib_extMgm::extRelPath('install').'verify_imgs/'.basename($verifyFile).'" '.$verifyImg[3].'>';
+                       $verifyImgCode = '<img src="'.$this->backPath.t3lib_extMgm::extRelPath('install_old').'verify_imgs/'.basename($verifyFile).'" '.$verifyImg[3].'>';
                        if (!$verifyImg)        {
                                $gifVersion=1;
                                $verifyFile_alt = substr($verifyFile,0,-3).'gif';