forked from NetCommons3/NetCommons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
50 lines (44 loc) · 1.6 KB
/
bootstrap.php
File metadata and controls
50 lines (44 loc) · 1.6 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
<?php
/**
* NetCommons bootstrap
*
* @author Jun Nishikawa <topaz2@m0n0m0n0.com>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
// 多数ファイルをインクルードしていて、xdebugの制限に引っかかるため
if (ini_get('xdebug.max_nesting_level')) {
ini_set('xdebug.max_nesting_level', 200);
}
// Load all plugins
$plugins = App::objects('plugins');
foreach ($plugins as $plugin) {
$options = array();
$pluginPath = ROOT . DS . 'app' . DS . 'Plugin' . DS . $plugin;
is_readable($pluginPath . DS . 'Config' . DS . 'bootstrap.php') && $options['bootstrap'] = true;
is_readable($pluginPath . DS . 'Config' . DS . 'routes.php') && $options['routes'] = true;
if (!CakePlugin::loaded($plugin)) {
CakePlugin::load($plugin, $options);
}
}
// Load application configurations
$conf = array();
$files = array('application.yml', 'application.local.yml');
foreach ($files as $file) {
if (file_exists(APP . 'Config' . DS . $file)) {
$conf = array_merge($conf, Spyc::YAMLLoad(APP . 'Config' . DS . $file));
Configure::write($conf);
}
}
if (! Configure::read('Config.language')) {
Configure::write('Config.language', 'ja');
}
App::uses('Router', 'Routing');
Router::parseExtensions();
//インストールのapplication.ymlがない場合、Noticeになるため
if (! Configure::read('NetCommons.installed') && CakePlugin::loaded('Install')) {
App::uses('InstallUtil', 'Install.Utility');
$InstallUtil = new InstallUtil();
}