Skip to content

Commit 00822ff

Browse files
committed
Add bootstrap
1 parent 76a1049 commit 00822ff

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

boot.php

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
error_reporting(E_ALL);
4+
5+
if(PHP_INT_SIZE < 8){
6+
trigger_error("64-bit PHP required", E_USER_ERROR);
7+
}
8+
9+
ini_set('display_errors', 'stderr');
10+
ini_set('error_prepend_string', '');
11+
ini_set('error_append_string', '');
12+
ini_set('html_errors', false);
13+
ini_set('max_execution_time', 0);
14+
ini_set('output_buffering', 0);
15+
ini_set('memory_limit', '2048M');
16+
17+
spl_autoload_register();
18+
19+
$root = realpath(__DIR__);
20+
21+
# Include paths
22+
$LIBS = [
23+
$root,
24+
$root.DIRECTORY_SEPARATOR.'lib'
25+
];
26+
$include_path = array_unique(array_merge($LIBS, explode(PATH_SEPARATOR, ini_get('include_path'))));
27+
ini_set('include_path', join(PATH_SEPARATOR, $include_path));
28+
29+
require_once('lib/stdlib.php');
30+
require_once('config.php');
31+

console.php

-20
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
11
<?php
22

3-
error_reporting(E_ALL);
4-
5-
if(PHP_INT_SIZE < 8){
6-
trigger_error("64-bit PHP required", E_USER_ERROR);
7-
}
8-
9-
$debug = 1;
10-
$threads = 7;
11-
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__));
12-
13-
require_once('stdlib.inc.php');
14-
153
$CONSOLE_START = mt();
164

175
function __console_shutdown(){
186
fprintf(STDERR, "\nTotal run time: %s\n", print_time($GLOBALS['CONSOLE_START'], mt()));
197
fprintf(STDERR, "Total memory usage: %.2fMB\n", print_memory(memory_get_peak_usage(true)));
208
}
219

22-
ini_set('display_errors', 'stderr');
23-
ini_set('error_prepend_string', '');
24-
ini_set('error_append_string', '');
25-
ini_set('html_errors', false);
26-
ini_set('max_execution_time', 0);
27-
ini_set('output_buffering', 0);
28-
ini_set('memory_limit', '2048M');
29-
3010
//if(!empty($PRINT_STATS))
3111
register_shutdown_function('__console_shutdown');

0 commit comments

Comments
 (0)