-
Notifications
You must be signed in to change notification settings - Fork 2
/
Core.php
44 lines (29 loc) · 872 Bytes
/
Core.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
<?php
class Wave_Core {
const MODE_DEVELOPMENT = 1;
const MODE_PRODUCTION = 2;
static $_MODE = self::MODE_PRODUCTION;
public static function bootstrap($mode = null){
if($mode == null)
$mode = Wave_Config::get('deploy')->mode;
self::$_MODE = $mode;
require_once(WAVE_CORE_PATH . 'Autoload.php');
Wave_Autoload::register();
Wave_Exception::register();
include_once(WAVE_CORE_PATH . 'Enums.php');
self::checkDependencies();
Wave_Cache::init();
}
private static function checkDependencies(){
$missing = array();
$required_extensions = array();
foreach($required_extensions as $ext){
if(!extension_loaded($ext))
$missing[] = $ext;
}
if(isset($missing[0]))
throw new Wave_Exception('Wave Framework requires the following extensions: '.implode(', ', $missing));
else return true;
}
}
?>