public static function phpErrorHandler($errno, $errstr, $errfile, $errline)
{
static $base = null;
if (is_null($base)) {
$base = dirname(__FILE__) . DIRECTORY_SEPARATOR;
}
if (!(error_reporting() & $errno)) {
return;
}
$errfile = str_replace($base, '', $errfile);
$proc = false;
switch ($errno) {
case E_WARNING:
case E_USER_WARNING:
elFinder::$phpErrors[] = "WARNING: {$errstr} in {$errfile} line {$errline}.";
$proc = true;
break;
case E_NOTICE:
case E_USER_NOTICE:
elFinder::$phpErrors[] = "NOTICE: {$errstr} in {$errfile} line {$errline}.";
$proc = true;
break;
}
return $proc;
}