-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaiz.php
More file actions
71 lines (61 loc) · 1.92 KB
/
Laiz.php
File metadata and controls
71 lines (61 loc) · 1.92 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Laiz - Web application framework
*
* PHP versions 5.3
*
* @package Laiz
* @author Satoshi Nishimura <nishim314@gmail.com>
* @copyright 2005-2010 Satoshi Nishimura
*/
use \laiz\autoloader\BasicLoader;
use \laiz\core\Configure;
use \laiz\core\Controller;
use \laiz\error\Creator;
/**
* Laiz Framework Class
*
* @package Laiz
* @author Satoshi Nishimura <nishim314@gmail.com>
*/
class Laiz
{
static public function laze($projectDir = '../'){
/** setting base include path */
$laizDir = dirname(__FILE__) . '/';
ini_set('include_path',
$laizDir . PATH_SEPARATOR .
ini_get('include_path'));
/** autoload */
require_once 'laiz/autoloader/BasicLoader.php';
BasicLoader::init();
/** get base setting */
Configure::setProjectDir($projectDir);
$configs = Configure::get('base');
$appDir = rtrim($configs['APP_DIR'], '/');
ini_set('include_path',
$appDir . PATH_SEPARATOR .
ini_get('include_path'));
/** php.ini */
$phpIniConfigs = Configure::get('ini');
foreach ($phpIniConfigs as $key => $value)
ini_set($key, $value);
/** setting timezone by configure */
date_default_timezone_set($configs['TIMEZONE']);
/** error class used by laiz */
/** not include by command line */
if (!isset($_SERVER['argv']) && $configs['USING_LAIZ_ERROR_UTILS']){
require_once 'laiz/error/Creator.php';
Creator::register();
}
/* start controller of laiz framework */
$controller = new Controller();
try {
$controller->execute();
}catch (Exception $e){
trigger_error($e->getMessage() . ' in ' .
$e->getFile() . ':' . $e->getLine(),
E_USER_ERROR);
}
}
}