Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Functions | Variables
bootstrap.php File Reference

Go to the source code of this file.

Functions

 setCustomErrorHandler ()
 

Variables

 $componentRegistrar = new ComponentRegistrar()
 
 $dirSearch = new DirSearch($componentRegistrar, new ReadFactory(new DriverPool()))
 
 $themePackageList = new ThemePackageList($componentRegistrar, new ThemePackageFactory())
 
 $serializer = new \Magento\Framework\Serialize\Serializer\Json()
 
 $regexIteratorFactory = new Magento\Framework\App\Utility\RegexIteratorFactory()
 

Function Documentation

◆ setCustomErrorHandler()

setCustomErrorHandler ( )

Set custom error handler

Definition at line 35 of file bootstrap.php.

36 {
37  set_error_handler(
38  function ($errNo, $errStr, $errFile, $errLine) {
39  if (error_reporting()) {
40  $errorNames = [
41  E_ERROR => 'Error',
42  E_WARNING => 'Warning',
43  E_PARSE => 'Parse',
44  E_NOTICE => 'Notice',
45  E_CORE_ERROR => 'Core Error',
46  E_CORE_WARNING => 'Core Warning',
47  E_COMPILE_ERROR => 'Compile Error',
48  E_COMPILE_WARNING => 'Compile Warning',
49  E_USER_ERROR => 'User Error',
50  E_USER_WARNING => 'User Warning',
51  E_USER_NOTICE => 'User Notice',
52  E_STRICT => 'Strict',
53  E_RECOVERABLE_ERROR => 'Recoverable Error',
54  E_DEPRECATED => 'Deprecated',
55  E_USER_DEPRECATED => 'User Deprecated',
56  ];
57 
58  $errName = isset($errorNames[$errNo]) ? $errorNames[$errNo] : "";
59 
60  throw new \PHPUnit\Framework\Exception(
61  sprintf("%s: %s in %s:%s.", $errName, $errStr, $errFile, $errLine),
62  $errNo
63  );
64  }
65  }
66  );
67 }

Variable Documentation

◆ $componentRegistrar

$componentRegistrar = new ComponentRegistrar()

Definition at line 23 of file bootstrap.php.

◆ $dirSearch

$dirSearch = new DirSearch($componentRegistrar, new ReadFactory(new DriverPool()))

Definition at line 24 of file bootstrap.php.

◆ $regexIteratorFactory

Definition at line 27 of file bootstrap.php.

◆ $serializer

Definition at line 26 of file bootstrap.php.

◆ $themePackageList

$themePackageList = new ThemePackageList($componentRegistrar, new ThemePackageFactory())

Definition at line 25 of file bootstrap.php.