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

defined('MTF_BOOT_FILE')||define('MTF_BOOT_FILE' __FILE__
 
defined('MTF_TESTS_PATH')||define('MTF_TESTS_PATHMTF_BP
 
 $umaskFile = BP . '/magento_umask'
 
 $mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002
 

Function Documentation

◆ setCustomErrorHandler()

setCustomErrorHandler ( )

Set custom error handler

Definition at line 31 of file bootstrap.php.

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

Variable Documentation

◆ $mask

$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002

Definition at line 19 of file bootstrap.php.

◆ $umaskFile

$umaskFile = BP . '/magento_umask'

Definition at line 18 of file bootstrap.php.

◆ __FILE__

defined ( 'MTF_BOOT_FILE')||define( 'MTF_BOOT_FILE' __FILE__

Copyright © Magento, Inc. All rights reserved. See COPYING.txt for license details.

Definition at line 7 of file bootstrap.php.

◆ MTF_BP

defined ( 'MTF_STATES_PATH')||define( 'MTF_STATES_PATH' MTF_BP

Definition at line 10 of file bootstrap.php.