Esempio n. 1
0
    /**
     * Handle for 'fatal' errors, uses the standard fatal error view, however
     * it wont use the View library since we can't rely on it at this stage.
     *
     * @param string $message
     * @param string $file
     * @param int $line
     * @param string $title
     */
    protected function fatal($message, $file, $line, $title = '')
    {
        if ($this->_zula->getMode() == 'cli') {
            // Display a more CLI friendly fatal message
            $msg = '**** An internal error has occured and caused the request to halt ****';
            if ($this->detailedErrors) {
                $msg .= "\n\n" . wordwrap($message) . "\n\nFile: {$file}\nLine: {$line}";
            }
        } else {
            $msg = '<h1>Internal Error</h1><p>An internal error has occured and caused the request to halt.</p>';
            if ($this->displayErrors) {
                if (trim($title)) {
                    $msg .= '<p>' . $title . '</p>';
                }
                if ($this->detailedErrors) {
                    $msg .= '<textarea cols="90" rows="10" readonly="readonly" name="error">' . $message . "\n\nFile: " . $file . "\nLine: " . $line . '</textarea>';
                }
            }
            $msg .= '<p>Please refresh the page to try again.</p><hr>
						<p>For details of this error, please check your log files. View the debug manual page for more information:<br>
							<a href="http://manual.tangocms.org/troubleshooting/debug">Troubleshooting/Debug Manual Page</a>
						</p>';
        }
        zula_fatal_error('Internal Error', $msg);
    }
Esempio n. 2
0
        // Check mbstring's configuration
        switch (true) {
            case ini_get('mbstring.func_overload') != 0:
                $errTitle = 'Multibyte string function overloading is enabled';
                $errSetting = 'mbstring.func_overload';
                break;
            case ini_get('mbstring.encoding_translation') != 0:
                $errTitle = 'Multibyte string input conversion is enabled';
                $errSetting = 'mbstring.encoding_translation';
                break;
            case ini_get('mbstring.http_input') != 'pass':
                $errTitle = 'Multibyte string input conversion is enabled';
                $errSetting = 'mbstring.http_input';
                break;
            case ini_get('mbstring.http_output') != 'pass':
                $errTitle = 'Multibyte string output conversion is enabled';
                $errSetting = 'mbstring.http_output';
        }
        if (isset($errTitle, $errSetting)) {
            // mbstring extension not configured correctly
            zula_fatal_error('Error - Zula Framework', '<h1>' . $errTitle . '</h1>
								 <p>Check the <em>' . $errSetting . '</em> setting in your php.ini.</p>
								 <p>Please refer to the <a href="http://www.php.net/mbstring">PHP mbstring documentation</a> for more information.</p>');
        } else {
            // The mbstring extension is loaded and ready to shoot :P
            mb_internal_encoding('UTF-8');
            mb_language('uni');
            define('UNICODE_MBSTRING', true);
        }
    }
}