public static function environment( int $severity, array $configuration = [] ) {

    // setup error reporting in PHP
    $reporting = ~E_ALL;
    foreach( self::SEVERITY as $key => $value ) {
      if( $key <= $severity ) $reporting |= $value;
    }
    error_reporting( $reporting );

    // setup locale
    if( isset( $configuration[ 'locale' ] ) ) {
      setlocale( LC_ALL, $configuration[ 'locale' ] );
    }

    // setup encoding
    if( isset( $configuration[ 'encoding' ] ) ) {
      mb_internal_encoding( $configuration[ 'encoding' ] );
      mb_http_output( $configuration[ 'encoding' ] );
    }

    // setup timezones
    if( isset( $configuration[ 'timezone' ] ) ) {
      date_default_timezone_set( $configuration[ 'timezone' ] );
    }
  }
public static function environment( int $severity, array $configuration = [] ) {

    // setup error reporting in PHP
    $reporting = ~E_ALL;
    foreach( self::SEVERITY as $key => $value ) {
      if( $key <= $severity ) $reporting |= $value;
    }
    error_reporting( $reporting );

    // setup locale
    if( isset( $configuration[ 'locale' ] ) ) {
      setlocale( LC_ALL, $configuration[ 'locale' ] );
    }

    // setup encoding
    if( isset( $configuration[ 'encoding' ] ) ) {
      mb_internal_encoding( $configuration[ 'encoding' ] );
      mb_http_output( $configuration[ 'encoding' ] );
    }

    // setup timezones
    if( isset( $configuration[ 'timezone' ] ) ) {
      date_default_timezone_set( $configuration[ 'timezone' ] );
    }
  }
public static function environment ( int $ severity , array $ configuration = [ ] ) { // setup error reporting in PHP $ reporting = ~ E_ALL ; foreach ( self :: SEVERITY as $ key => $ value ) { if ( $ key <= $ severity ) $ reporting |= $ value ; } error_reporting ( $ reporting ) ; // setup locale if ( isset ( $ configuration [ 'locale' ] ) ) { setlocale ( LC_ALL , $ configuration [ 'locale' ] ) ; } // setup encoding if ( isset ( $ configuration [ 'encoding' ] ) ) { mb_internal_encoding ( $ configuration [ 'encoding' ] ) ; mb_http_output ( $ configuration [ 'encoding' ] ) ; } // setup timezones if ( isset ( $ configuration [ 'timezone' ] ) ) { date_default_timezone_set ( $ configuration [ 'timezone' ] ) ; } }
Global setup of the PHP environment

This SHOULD be done before the application...or anything else in the PHP code

@param int   $severity Maximum severity level tht should be reported
@param array $configuration
Global setup of the PHP environment