-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
executable file
·53 lines (43 loc) · 1.59 KB
/
index.php
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/opt/appserver/bin/php
<?php
/**
* index.php
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* PHP version 5
*
* @author Tim Wagner <[email protected]>
* @copyright 2014 TechDivision GmbH <[email protected]>
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @link http://github.com/appserver-io-lab/bootstrap
* @link http://www.appserver.io
*/
namespace AppserverIo\Lab\Bootstrap;
// define a all constants appserver base directory
define('APPSERVER_BP', __DIR__);
// define application servers base dir
define('SERVER_BASEDIR', APPSERVER_BP . DIRECTORY_SEPARATOR);
// query whether we've a composer autoloader defined or not
if (!file_exists($autoloaderFile = SERVER_BASEDIR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php')) {
throw new \Exception(sprintf('Can\' find default autoloader %s', $autoloaderFile));
}
// define the autoloader file
define('SERVER_AUTOLOADER', $autoloaderFile);
// include the autoloader file
require SERVER_AUTOLOADER;
// initialize the storage for the log fromats/streams
$logFormats = new \Stackable();
$logStreams = new \Stackable();
// initialize the storage for the runlevels
$childs = new \Stackable();
foreach (ApplicationServer::$runlevels as $runlevel) {
$childs[$runlevel] = new \Stackable();
}
// initialize and start the application server
$applicationServer = new ApplicationServer($logStreams, $logFormats, $childs);
$applicationServer->join();