Fixed bug #15576: Enable customization for fatal error messages in the backend and...
authorBenni Mack <benni.mack@typo3.org>
Sat, 16 Oct 2010 17:35:44 +0000 (17:35 +0000)
committerBenni Mack <benni.mack@typo3.org>
Sat, 16 Oct 2010 17:35:44 +0000 (17:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9099 709f56b5-9817-0410-a4d7-c38de5d9e867

19 files changed:
t3lib/class.t3lib_beuserauth.php
t3lib/class.t3lib_treeview.php
t3lib/class.t3lib_userauthgroup.php
t3lib/error/class.t3lib_error_productionexceptionhandler.php
typo3/db_list.php
typo3/file_edit.php
typo3/file_list.php
typo3/file_newfolder.php
typo3/file_rename.php
typo3/file_upload.php
typo3/index.php
typo3/init.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/lang/lang.php
typo3/sysext/simulatestatic/class.tx_simulatestatic.php
typo3/wizard_forms.php
typo3/wizard_table.php

index 886bed6..38d1ef1 100644 (file)
@@ -214,12 +214,10 @@ class t3lib_beUserAuth extends t3lib_userAuthGroup {
                                        $this->backendSetUC();          // Setting the UC array. It's needed with fetchGroupData first, due to default/overriding of values.
                                        $this->emailAtLogin();          // email at login - if option set.
                                } else {
-                                       t3lib_BEfunc::typo3PrintError ('Login-error','TYPO3 is in maintenance mode at the moment. Only administrators are allowed access.',0);
-                                       exit;
+                                       throw new RuntimeException('Login Error: TYPO3 is in maintenance mode at the moment. Only administrators are allowed access.');
                                }
                        } else {
-                               t3lib_BEfunc::typo3PrintError ('Login-error','IP locking prevented you from being authorized. Can\'t proceed, sorry.',0);
-                               exit;
+                               throw new RuntimeException('Login Error: IP locking prevented you from being authorized. Can\'t proceed, sorry.');
                        }
                }
        }
index 5a8383e..03fdd3d 100644 (file)
@@ -772,9 +772,8 @@ class t3lib_treeView {
 
                        $newID = $row['uid'];
 
-                       if ($newID==0)  {
-                               t3lib_BEfunc::typo3PrintError ('Endless recursion detected', 'TYPO3 has detected an error in the database. Please fix it manually (e.g. using phpMyAdmin) and change the UID of '.$this->table.':0 to a new value.<br /><br />See <a href="http://bugs.typo3.org/view.php?id=3495" target="_blank">bugs.typo3.org/view.php?id=3495</a> to get more information about a possible cause.',0);
-                               exit;
+                       if ($newID == 0) {
+                               throw new RuntimeException('Endless recursion detected: TYPO3 has detected an error in the database. Please fix it manually (e.g. using phpMyAdmin) and change the UID of '.$this->table.':0 to a new value.<br /><br />See <a href="http://bugs.typo3.org/view.php?id=3495" target="_blank">bugs.typo3.org/view.php?id=3495</a> to get more information about a possible cause.');
                        }
 
                        $this->tree[]=array();          // Reserve space.
index e1592f3..798c16a 100644 (file)
@@ -267,9 +267,8 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                }
                        }
                }
-               if ($exitOnError)       {
-                       t3lib_BEfunc::typo3PrintError ('Access Error','This page is not within your DB-mounts',0);
-                       exit;
+               if ($exitOnError) {
+                       throw new RuntimeException('Access Error: This page is not within your DB-mounts');
                }
        }
 
@@ -282,9 +281,8 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         */
        function modAccess($conf,$exitOnError)  {
                if (!t3lib_BEfunc::isModuleSetInTBE_MODULES($conf['name']))     {
-                       if ($exitOnError)       {
-                               t3lib_BEfunc::typo3PrintError ('Fatal Error','This module "'.$conf['name'].'" is not enabled in TBE_MODULES',0);
-                               exit;
+                       if ($exitOnError) {
+                               throw new RuntimeException('Fatal Error: This module "'.$conf['name'].'" is not enabled in TBE_MODULES');
                        }
                        return FALSE;
                }
@@ -296,9 +294,8 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                                ($this->workspace>0 && t3lib_div::inList($conf['workspaces'],'custom')))        {
                                        // ok, go on...
                        } else {
-                               if ($exitOnError)       {
-                                       t3lib_BEfunc::typo3PrintError ('Workspace Error','This module "'.$conf['name'].'" is not available under the current workspace',0);
-                                       exit;
+                               if ($exitOnError) {
+                                       throw new RuntimeException('Workspace Error: This module "'.$conf['name'].'" is not available under the current workspace');
                                }
                                return FALSE;
                        }
@@ -312,9 +309,10 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                        $acs = $this->check('modules',$conf['name']);
                }
                if (!$acs && $exitOnError)      {
-                       t3lib_BEfunc::typo3PrintError ('Access Error','You don\'t have access to this module.',0);
-                       exit;
-               } else return $acs;
+                       throw new RuntimeException('Access Error: You don\'t have access to this module.');
+               } else {
+                       return $acs;
+               }
        }
 
        /**
index c86bb17..36e9fb8 100644 (file)
@@ -55,8 +55,8 @@ class t3lib_error_ProductionExceptionHandler extends t3lib_error_AbstractExcepti
                        header("HTTP/1.1 500 Internal Server Error");
                }
                $this->writeLogEntries($exception,self::CONTEXT_WEB);
-
-               t3lib_timeTrack::debug_typo3PrintError(get_class($exception), $exception->getMessage(), 0, t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
+               $messageObj = t3lib_div::makeInstance('t3lib_message_ErrorPageMessage', $exception->getMessage(), get_class($exception));
+               $messageObj->output();
        }
 
        /**
index a0cd9ce..352aac5 100644 (file)
@@ -46,7 +46,7 @@ if (t3lib_extMgm::isLoaded('list')) {
 } else {
        $title = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:extension.not.installed'), 'list');
        $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:link.to.dblist.correctly');
-       t3lib_BEfunc::typo3PrintError($title, $message);
+       throw new RuntimeException($title . ': ' . $message);
 }
 
 ?>
index d83b5e1..5eace83 100644 (file)
@@ -110,9 +110,10 @@ class SC_file_edit {
                        $this->target='';
                }
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
-               if (!$this->target || !$key)    {
-                       t3lib_BEfunc::typo3PrintError($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), '');
-                       exit;
+               if (!$this->target || !$key) {
+                       $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
+                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
+                       throw new RuntimeException($title . ': ' . $message);
                }
                        // Finding the icon
                switch($GLOBALS['FILEMOUNTS'][$key]['type'])    {
index 45a7506..3fd35ea 100644 (file)
@@ -46,6 +46,6 @@ if (t3lib_extMgm::isLoaded('filelist')) {
 } else {
        $title = sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:extension.not.installed'), 'list');
        $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:link.to.filelist.correctly');
-       t3lib_BEfunc::typo3PrintError($title, $message);
+       throw new RuntimeException($title . ': ' . $message);
 }
 ?>
\ No newline at end of file
index 5565017..6f52400 100644 (file)
@@ -133,9 +133,10 @@ class SC_file_newfolder {
                $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet);
                $this->target = $this->basicff->is_directory($this->target);
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
-               if (!$this->target || !$key)    {
-                       t3lib_BEfunc::typo3PrintError ($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), '');
-                       exit;
+               if (!$this->target || !$key) {
+                       $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
+                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
+                       throw new RuntimeException($title . ': ' . $message);
                }
 
                        // Finding the icon
index 75b20f3..022c384 100644 (file)
@@ -121,9 +121,10 @@ class SC_file_rename {
                        $this->target='';
                }
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
-               if (!$this->target || !$key)    {
-                       t3lib_BEfunc::typo3PrintError ($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), '');
-                       exit;
+               if (!$this->target || !$key) {
+                       $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
+                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
+                       throw new RuntimeException($title . ': ' . $message);
                }
 
                        // Finding the icon
index 1cee989..22d2c3f 100644 (file)
@@ -133,8 +133,9 @@ class SC_file_upload {
                $this->target = $this->basicff->is_directory($this->target);
                $key = $this->basicff->checkPathAgainstMounts($this->target . '/');
                if (!$this->target || !$key) {
-                       t3lib_BEfunc::typo3PrintError($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), '');
-                       exit;
+                       $title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
+                       $message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
+                       throw new RuntimeException($title . ': ' . $message);
                }
 
                        // Finding the icon
index 501bc6c..26beda1 100644 (file)
@@ -366,8 +366,7 @@ class SC_index {
                                if ($this->commandLI=='setCookie') {
                                                // we tried it a second time but still no cookie
                                                // 26/4 2005: This does not work anymore, because the saving of challenge values in $_SESSION means the system will act as if the password was wrong.
-                                       t3lib_BEfunc::typo3PrintError ('Login-error',"Yeah, that's a classic. No cookies, no TYPO3.<br /><br />Please accept cookies from TYPO3 - otherwise you'll not be able to use the system.",0);
-                                       exit;
+                                       throw new RuntimeException('Login-error: Yeah, that\'s a classic. No cookies, no TYPO3.<br /><br />Please accept cookies from TYPO3 - otherwise you\'ll not be able to use the system.');
                                } else {
                                                // try it once again - that might be needed for auto login
                                        $this->redirectToURL = 'index.php?commandLI=setCookie';
index 4bb5c3b..3b4df39 100644 (file)
@@ -274,9 +274,8 @@ if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) && basename(PATH_thisScript) ==
 // **********************
 // Check Hardcoded lock on BE:
 // **********************
-if ($TYPO3_CONF_VARS['BE']['adminOnly'] < 0)   {
-       t3lib_BEfunc::typo3printError('Backend locked', 'Backend and Install Tool are locked for maintenance. [BE][adminOnly] is set to "' . intval($TYPO3_CONF_VARS['BE']['adminOnly']) . '".');
-       exit;
+if ($TYPO3_CONF_VARS['BE']['adminOnly'] < 0) {
+       throw new RuntimeException('TYPO3 Backend locked: Backend and Install Tool are locked for maintenance. [BE][adminOnly] is set to "' . intval($TYPO3_CONF_VARS['BE']['adminOnly']) . '".');
 }
 if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) && @is_file(PATH_typo3conf . 'LOCK_BACKEND')) {
        if (TYPO3_PROCEED_IF_NO_USER == 2) {
@@ -286,7 +285,7 @@ if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) && @is_file(PATH_typo3conf . 'L
                if ($fContent)  {
                        header('Location: '.$fContent); // Redirect
                } else {
-                       t3lib_BEfunc::typo3printError('Backend locked', 'Browser backend is locked for maintenance. Remove lock by removing the file "typo3conf/LOCK_BACKEND" or use CLI-scripts.');
+                       throw new RuntimeException('TYPO3 Backend locked: Browser backend is locked for maintenance. Remove lock by removing the file "typo3conf/LOCK_BACKEND" or use CLI-scripts.');
                }
                exit;
        }
@@ -369,15 +368,12 @@ if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL) {
 // *************************
 if ($TYPO3_DB->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password))      {
        if (!TYPO3_db)  {
-               t3lib_BEfunc::typo3PrintError('Database Error', 'No database selected');
-               exit;
+               throw new RuntimeException('Database Error: No database selected', time());
        } elseif (!$TYPO3_DB->sql_select_db(TYPO3_db))  {
-               t3lib_BEfunc::typo3PrintError('Database Error', 'Cannot connect to the current database, "' . TYPO3_db . '"');
-               exit;
+               throw new RuntimeException('Database Error: Cannot connect to the current database, "' . TYPO3_db . '"', time());
        }
 } else {
-       t3lib_BEfunc::typo3PrintError('Database Error', 'The current username, password or host was not accepted when the connection to the database was attempted to be established!');
-       exit;
+       throw new RuntimeException('Database Error: The current username, password or host was not accepted when the connection to the database was attempted to be established!', time());
 }
 
 
@@ -385,8 +381,7 @@ if ($TYPO3_DB->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)
 // Checks for proper browser
 // *******************************
 if (!$CLIENT['BROWSER'] && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) {
-       t3lib_BEfunc::typo3PrintError ('Browser error','Your browser version looks incompatible with this TYPO3 version!',0);
-       exit;
+       throw new RuntimeException('Browser Error: Your browser version looks incompatible with this TYPO3 version!', time());
 }
 
 
index c1d5eda..a416143 100644 (file)
                }
                if ($link !== FALSE) {
                        if (!TYPO3_db)  {
-                               $this->printError('No database selected','Database Error');
+                               throw new RuntimeException('Database Error: No database selected');
                                        // Redirects to the Install Tool:
                                echo '<script type="text/javascript">
                                                /*<![CDATA[*/
                                        $message = 'Cannot connect to the current database, "'.TYPO3_db.'"';
                                        t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
                                        header('HTTP/1.0 503 Service Temporarily Unavailable');
-                                       $this->printError($message, 'Database Error');
-                                       exit;
+                                       throw new RuntimeException('Database Error: ' . $message);
                                }
                        }
                } else {
                                $message = 'The current username, password or host was not accepted when the connection to the database was attempted to be established!';
                                t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
                                header('HTTP/1.0 503 Service Temporarily Unavailable');
-                               $this->printError($message, 'Database Error');
-                               exit;
+                               throw new RuntimeException('Database Error: ' . $message);
                        }
                }
 
                                                $message = 'No pages are found on the rootlevel!';
                                                t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
                                                header('HTTP/1.0 503 Service Temporarily Unavailable');
-                                               $this->printError($message);
-                                               exit;
+                                               throw new RuntimeException($message);
                                        }
                                }
                        }
                                        $message = 'The requested page does not exist!';
                                        header('HTTP/1.0 404 Page Not Found');
                                        t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                                       $this->printError($message);
-                                       exit;
+                                       throw new RuntimeException($message);
                                }
                        }
                }
                                $message = 'The requested page does not exist!';
                                header('HTTP/1.0 404 Page Not Found');
                                t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                               $this->printError($message);
-                               exit;
+                               throw new RuntimeException($message);
                        }
                }
 
                                        $message = 'The requested page didn\'t have a proper connection to the tree-root! <br /><br />('.$this->sys_page->error_getRootLine.')';
                                        header('HTTP/1.0 503 Service Temporarily Unavailable');
                                        t3lib_div::sysLog(str_replace('<br /><br />','',$message), 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                                       $this->printError($message);
-                                       exit;
+                                       throw new RuntimeException($message);
                                }
                        }
                        $this->fePreview = 1;
                                        $message = 'The requested page was not accessible!';
                                        header('HTTP/1.0 503 Service Temporarily Unavailable');
                                        t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                                       $this->printError($message);
-                                       exit;
+                                       throw new RuntimeException($message);
                                }
                        } else {
                                $el = reset($this->rootLine);
                                $message = 'Page shortcuts were looping in uids '.implode(',',$pageLog).'...!';
                                header('HTTP/1.0 500 Internal Server Error');
                                t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                               $this->printError($message);
-                               exit;
+                               throw new RuntimeException($message);
                        }
                }
                        // Return resulting page:
        /**
         * Page unavailable handler. Acts a wrapper for the pageErrorHandler method.
         *
-        * @param       mixed           Which type of handling; If a true PHP-boolean or TRUE then a ->printError message is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
+        * @param       mixed           Which type of handling; If a true PHP-boolean or TRUE then a ->t3lib_message_ErrorPageMessage is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
         * @param       string          If set, this is passed directly to the PHP function, header()
         * @param       string          If set, error messages will also mention this as the reason for the page-not-found.
         * @return      void            (The function exits!)
        /**
         * Page not found handler. Acts a wrapper for the pageErrorHandler method.
         *
-        * @param       mixed           Which type of handling; If a true PHP-boolean or TRUE then a ->printError message is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
+        * @param       mixed           Which type of handling; If a true PHP-boolean or TRUE then a ->t3lib_message_ErrorPageMessage is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
         * @param       string          If set, this is passed directly to the PHP function, header()
         * @param       string          If set, error messages will also mention this as the reason for the page-not-found.
         * @return      void            (The function exits!)
         * Generic error page handler.
         * Exits.
         *
-        * @param       mixed           Which type of handling; If a true PHP-boolean or TRUE then a ->printError message is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
+        * @param       mixed           Which type of handling; If a true PHP-boolean or TRUE then a ->t3lib_message_ErrorPageMessage is outputted. If integer an error message with that number is shown. Otherwise the $code value is expected to be a "Location:" header value.
         * @param       string          If set, this is passed directly to the PHP function, header()
         * @param       string          If set, error messages will also mention this as the reason for the page-not-found.
         * @return      void            (The function exits!)
 
                        // Create response:
                if (gettype($code)=='boolean' || !strcmp($code,1))      {       // Simply boolean; Just shows TYPO3 error page with reason:
-                       $this->printError('The page did not exist or was inaccessible.'.($reason ? ' Reason: '.htmlspecialchars($reason) : ''));
+                       throw new RuntimeException('The page did not exist or was inaccessible.' . ($reason ? ' Reason: ' . htmlspecialchars($reason) : ''));
                } elseif (t3lib_div::isFirstPartOfStr($code,'USER_FUNCTION:')) {
                        $funcRef = trim(substr($code,14));
                        $params = array(
                                $fileContent = str_replace('###REASON###', htmlspecialchars($reason), $fileContent);
                                echo $fileContent;
                        } else {
-                               $this->printError('Configuration Error: 404 page "'.$readFile.'" could not be found.');
+                               throw new RuntimeException('Configuration Error: 404 page "' . $readFile.'" could not be found.');
                        }
                } elseif (t3lib_div::isFirstPartOfStr($code,'REDIRECT:')) {
                        t3lib_utility_Http::redirect(substr($code, 9));
                                        $reason = 'Page cannot be found.';
                                }
                                $reason.= LF . LF . 'Additionally, ' . $code . ' was not found while trying to retrieve the error document.';
-                               $this->printError('Reason: '.nl2br(htmlspecialchars($reason)));
-                               exit();
+                               throw new RuntimeException('Reason: ' . nl2br(htmlspecialchars($reason)));
                        }
 
                                // Prepare headers
                                echo $content;  // Output the content
                        }
                } else {
-                       $this->printError($reason ? 'Reason: '.htmlspecialchars($reason) : 'Page cannot be found.');
+                       throw new RuntimeException($reason ? 'Reason: '.htmlspecialchars($reason) : 'Page cannot be found.');
                }
                exit();
        }
                                                $message = 'The page is not configured! [type= '.$this->type.']['.$this->sPre.']';
                                                header('HTTP/1.0 503 Service Temporarily Unavailable');
                                                t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                                               $this->printError($message);
-                                               exit;
+                                               throw new RuntimeException($message);
                                        }
                                } else {
                                        $this->config['config'] = array();
                                        $message = 'No TypoScript template found!';
                                        header('HTTP/1.0 503 Service Temporarily Unavailable');
                                        t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                                       $this->printError($message);
-                                       exit;
+                                       throw new RuntimeException($message);
                                }
                        }
                }
@@ -4281,9 +4270,11 @@ if (version == "n3") {
         * @param       string          Header string
         * @return      void
         * @see t3lib_timeTrack::debug_typo3PrintError()
+        * @see t3lib_message_ErrorPageMessage
         */
-       function printError($label,$header='Error!')    {
-               t3lib_timeTrack::debug_typo3PrintError($header,$label,0,t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
+       function printError($label,$header='Error!') {
+               t3lib_div::logDeprecatedFunction();
+               t3lib_timeTrack::debug_typo3PrintError($header, $label, 0, t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
        }
 
        /**
index 4bf700c..9b5cdfa 100644 (file)
@@ -118,16 +118,14 @@ class TSpagegen {
                        // Base url:
                if ($GLOBALS['TSFE']->config['config']['baseURL'])      {
                        if ($GLOBALS['TSFE']->config['config']['baseURL']==='1')        {
-                                       // Deprecated property, going to be dropped.
+                                       // Deprecated property, going to be dropped in TYPO3 4.7.
                                $error = 'Unsupported TypoScript property was found in this template: "config.baseURL="1"
 
 This setting has been deprecated in TYPO 3.8.1 due to security concerns.
 You need to change this value to the URL of your website root, otherwise TYPO3 will not work!
 
 See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.typo3.org/index.php/TYPO3_3.8.1</a> for more information.';
-
-                               $GLOBALS['TSFE']->printError(nl2br($error));
-                               exit;
+                               throw new RuntimeException(nl2br($error));
                        } else {
                                $GLOBALS['TSFE']->baseUrl = $GLOBALS['TSFE']->config['config']['baseURL'];
                        }
index 743add3..4c87337 100755 (executable)
@@ -284,13 +284,10 @@ class tx_install extends t3lib_install {
                                // Check for mandatory PHP modules
                        $missingPhpModules = $this->getMissingPhpModules();
                        if (count($missingPhpModules) > 0) {
-                               t3lib_BEfunc::typo3PrintError(
-                                       'TYPO3 Installation Error',
-                                       'The following PHP module(s) is/are missing: <em>' .
+                               throw new RuntimeException('TYPO3 Installation Error: The following PHP module(s) is/are missing: <em>' .
                                                implode(', ', $missingPhpModules) .
                                                '</em><br /><br />You need to install and enable these modules first to be able to install TYPO3.'
                                );
-                               die();
                        }
                }
                if (t3lib_div::_GP('step') === 'go') {
index 45a5fdb..19c996b 100755 (executable)
@@ -164,10 +164,7 @@ class language {
                        $this->charSet = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
 
                        if ($this->charSet != 'utf-8' && !$this->csConvObj->initCharset($this->charSet)) {
-                               t3lib_BEfunc::typo3PrintError('Forced charset not found',
-                                       'The forced character set "'. $this->charSet . '" was not found in t3lib/csconvtbl/'
-                               );
-                               exit;
+                               throw new RuntimeException('Forced charset not found: The forced character set "'. $this->charSet . '" was not found in t3lib/csconvtbl/');
                        }
                }
        }
index 240382f..1bd7fa0 100644 (file)
@@ -107,7 +107,8 @@ class tx_simulatestatic {
                                        $message = 'PATH_INFO was not configured for this website, and the URL tries to find the page by PATH_INFO!';
                                        header(t3lib_utility_Http::HTTP_STATUS_503);
                                        t3lib_div::sysLog($message, 'cms', t3lib_div::SYSLOG_SEVERITY_ERROR);
-                                       $parentObject->printError($message.'<br /><br /><a href="' . htmlspecialchars($redirectUrl) . '">Click here to get to the right page.</a>','Error: PATH_INFO not configured');
+                                       $message = 'Error: PATH_INFO not configured: ' . $message . '<br /><br /><a href="' . htmlspecialchars($redirectUrl) . '">Click here to get to the right page.</a>';
+                                       throw new RuntimeException($message);
                                }
                        } else {
                                t3lib_utility_Http::redirect($redirectUrl);
index e75d543..6e35581 100644 (file)
@@ -316,9 +316,8 @@ class SC_wizard_forms {
 
                        // First, check the references by selecting the record:
                $row = t3lib_BEfunc::getRecord($this->P['table'],$this->P['uid']);
-               if (!is_array($row))    {
-                       t3lib_BEfunc::typo3PrintError ('Wizard Error','No reference to record',0);
-                       exit;
+               if (!is_array($row)) {
+                       throw new RuntimeException('Wizard Error: No reference to record');
                }
 
                        // This will get the content of the form configuration code field to us - possibly cleaned up, saved to database etc. if the form has been submitted in the meantime.
index 5bb55d6..5fddca0 100644 (file)
@@ -235,9 +235,8 @@ class SC_wizard_table {
 
                        // First, check the references by selecting the record:
                $row = t3lib_BEfunc::getRecord($this->P['table'],$this->P['uid']);
-               if (!is_array($row))    {
-                       t3lib_BEfunc::typo3PrintError ('Wizard Error','No reference to record',0);
-                       exit;
+               if (!is_array($row)) {
+                       throw new RuntimeException('Wizard Error: No reference to record');
                }
 
                        // This will get the content of the form configuration code field to us - possibly cleaned up, saved to database etc. if the form has been submitted in the meantime.