-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.php
executable file
·58 lines (47 loc) · 1.28 KB
/
bootstrap.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
54
55
56
57
58
#! /usr/bin/env php
<?php
$_SERVER['SERVER_NAME'] = 'cli';
$_SERVER['SERVER_PORT'] = 0;
$_SERVER['REQUEST_URI'] = '';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['HTTP_HOST'] = 'localhost';
$_SERVER['REQUEST_METHOD'] = 'GET';
define('STATAMIC_VERSION', false);
define("STATAMIC_START", microtime(true));
define("BASE_PATH", 'public');
define("APP_PATH", "public/_app");
date_default_timezone_set('UTC');
require_once APP_PATH . '/vendor/Slim/Slim.php';
require_once APP_PATH . '/vendor/SplClassLoader.php';
\Slim\Slim::registerAutoloader();
$packages = array(
'Buzz',
'Carbon',
'emberlabs',
'Intervention',
'Michelf',
'Netcarver',
'Stampie',
'Symfony',
'Whoops',
'Zeuxisoo',
'erusev',
'Propel'
);
foreach ($packages as $package) {
$loader = new SplClassLoader($package, APP_PATH . '/vendor/');
$loader->register();
}
require_once APP_PATH . '/vendor/Spyc/Spyc.php';
require_once APP_PATH . '/vendor/Lex/Parser.php';
require_once APP_PATH . '/core/exceptions.php';
require_once APP_PATH . '/core/functions.php';
// register the Statamic autoloader
spl_autoload_register("autoload_statamic");
$app = require_once BASE_PATH . '/_app/start.php';
if($argc == 2) {
require_once "commands/{$argv[1]}.php";
}
else {
echo "Usage: bootstrap.php <scriptname>\n";
}