Project

General

Profile

Actions

Feature #51376

closed

Show sting values for configured [SYS][exceptionalErrors] and similar codes

Added by Michiel Roos about 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
Start date:
2013-08-27
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.4
Tags:
Complexity:
Sprint Focus:

Description

There are several configuration options in the install tool that show a numerical representation of PHP error codes:
  • [SYS][errorHandlerErrors]
  • [SYS][exceptionalErrors]
  • [SYS][syslogErrorReporting]
  • [SYS][belogErrorReporting]

A viewhelper can be made to translate these numbers to strings, so the admin can see the textual configuration of the current value above the input field.

    /**
     * Convert PHP error_reporting integer to string
     *
     * @param $value
     * @return array
     */
    public static function error2string($value) {
        $levelNames = array(
            E_ERROR => 'E_ERROR', E_WARNING => 'E_WARNING',
            E_PARSE => 'E_PARSE', E_NOTICE => 'E_NOTICE',
            E_CORE_ERROR => 'E_CORE_ERROR', E_CORE_WARNING => 'E_CORE_WARNING',
            E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING',
            E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING',
            E_USER_NOTICE => 'E_USER_NOTICE' );
        if (defined('E_STRICT')) {
            $levelNames[E_STRICT] = 'E_STRICT';
        }
        $levels = array();
        if (($value&E_ALL) == E_ALL) {
            $levels[] = 'E_ALL';
            $value &= ~E_ALL;
        }
        foreach ($levelNames as $level => $name) {
            if (($value&$level) == $level) {
                $levels[] = $name;
            }
        }
        return $levels;
    }
Actions

Also available in: Atom PDF