-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbootstrap.php
More file actions
36 lines (29 loc) · 814 Bytes
/
bootstrap.php
File metadata and controls
36 lines (29 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
use MoeFront\RestfulTests\Util;
use SSX\Utility\Serve;
if (php_sapi_name() !== 'cli') {
exit;
}
// Errors on full!
ini_set('display_errors', 1);
error_reporting(E_ALL | E_STRICT);
Util::downloadTypecho();
// Start build-in server
$server[] = new Serve(array(
'address' => getenv('WEB_SERVER_HOST'),
'port' => getenv('WEB_SERVER_PORT'),
'document_root' => getenv('WEB_SERVER_DOCROOT'),
));
$server[] = new Serve(array(
'address' => getenv('WEB_SERVER_HOST'),
'port' => getenv('FORKED_WEB_SERVER_PORT'),
'document_root' => getenv('WEB_SERVER_DOCROOT'),
));
$server[0]->start();
$server[1]->start();
// Kill the web server when the process ends
register_shutdown_function(function () use ($server) {
$server[0]->stop();
$server[1]->stop();
});
Util::installTypecho();