mirror of
https://github.com/standardebooks/web.git
synced 2025-07-09 16:20:27 -04:00
Add Composer autoloading functions and PHPStan for testing
This commit is contained in:
parent
e198c4db65
commit
f5d7d4e02a
1518 changed files with 169063 additions and 30 deletions
31
lib/Core.php
31
lib/Core.php
|
@ -3,35 +3,8 @@ mb_internal_encoding('UTF-8');
|
|||
mb_http_output('UTF-8');
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
require_once('Constants.php');
|
||||
|
||||
// Convenience alias of var_dump.
|
||||
function vd($var){
|
||||
var_dump($var);
|
||||
}
|
||||
|
||||
// var_dump($var) then die().
|
||||
function vdd($var){
|
||||
var_dump($var);
|
||||
die();
|
||||
}
|
||||
|
||||
// var_dump into a string.
|
||||
function vds($var){
|
||||
ob_start();
|
||||
var_dump($var);
|
||||
$str = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $str;
|
||||
}
|
||||
|
||||
spl_autoload_register(function($class){
|
||||
try{
|
||||
include($class . '.php');
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
}
|
||||
});
|
||||
// Composer auto-loads the lib/ directory in composer.json
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Custom error handler to output more details about the specific Apache request that caused an exception.
|
||||
set_exception_handler(function($ex){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue