@@ -3,17 +3,17 @@ |
||
3 | 3 | |
4 | 4 | if (!defined('SOURCE_DIR')) define('SOURCE_DIR', __DIR__); |
5 | 5 | if (preg_match('/vendor/', SOURCE_DIR)) { |
6 | - if (!defined('BASE_DIR')) define('BASE_DIR', SOURCE_DIR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'); |
|
7 | - if (!defined('CORE_DIR')) define('CORE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'src'); |
|
8 | -} else { |
|
9 | - if (!defined('BASE_DIR')) define('BASE_DIR', SOURCE_DIR . DIRECTORY_SEPARATOR . '..'); |
|
10 | - if (!defined('CORE_DIR')) define('CORE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'modules'); |
|
6 | + if (!defined('BASE_DIR')) define('BASE_DIR', SOURCE_DIR.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'); |
|
7 | + if (!defined('CORE_DIR')) define('CORE_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'src'); |
|
8 | +}else { |
|
9 | + if (!defined('BASE_DIR')) define('BASE_DIR', SOURCE_DIR.DIRECTORY_SEPARATOR.'..'); |
|
10 | + if (!defined('CORE_DIR')) define('CORE_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'modules'); |
|
11 | 11 | } |
12 | -if (!defined('VENDOR_DIR')) define('VENDOR_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'vendor'); |
|
13 | -if (!defined('LOG_DIR')) define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
14 | -if (!defined('CACHE_DIR')) define('CACHE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'cache'); |
|
15 | -if (!defined('CONFIG_DIR')) define('CONFIG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'config'); |
|
16 | -if (!defined('WEB_DIR')) define('WEB_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'html'); |
|
12 | +if (!defined('VENDOR_DIR')) define('VENDOR_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'vendor'); |
|
13 | +if (!defined('LOG_DIR')) define('LOG_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
14 | +if (!defined('CACHE_DIR')) define('CACHE_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'cache'); |
|
15 | +if (!defined('CONFIG_DIR')) define('CONFIG_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'config'); |
|
16 | +if (!defined('WEB_DIR')) define('WEB_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'html'); |
|
17 | 17 | |
18 | 18 | |
19 | 19 | /** |
@@ -1,19 +1,39 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace PSFS; |
3 | 3 | |
4 | -if (!defined('SOURCE_DIR')) define('SOURCE_DIR', __DIR__); |
|
4 | +if (!defined('SOURCE_DIR')) { |
|
5 | + define('SOURCE_DIR', __DIR__); |
|
6 | +} |
|
5 | 7 | if (preg_match('/vendor/', SOURCE_DIR)) { |
6 | - if (!defined('BASE_DIR')) define('BASE_DIR', SOURCE_DIR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'); |
|
7 | - if (!defined('CORE_DIR')) define('CORE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'src'); |
|
8 | -} else { |
|
9 | - if (!defined('BASE_DIR')) define('BASE_DIR', SOURCE_DIR . DIRECTORY_SEPARATOR . '..'); |
|
10 | - if (!defined('CORE_DIR')) define('CORE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'modules'); |
|
8 | + if (!defined('BASE_DIR')) { |
|
9 | + define('BASE_DIR', SOURCE_DIR . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'); |
|
10 | + } |
|
11 | + if (!defined('CORE_DIR')) { |
|
12 | + define('CORE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'src'); |
|
13 | + } |
|
14 | + } else { |
|
15 | + if (!defined('BASE_DIR')) { |
|
16 | + define('BASE_DIR', SOURCE_DIR . DIRECTORY_SEPARATOR . '..'); |
|
17 | + } |
|
18 | + if (!defined('CORE_DIR')) { |
|
19 | + define('CORE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'modules'); |
|
20 | + } |
|
21 | + } |
|
22 | +if (!defined('VENDOR_DIR')) { |
|
23 | + define('VENDOR_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'vendor'); |
|
24 | +} |
|
25 | +if (!defined('LOG_DIR')) { |
|
26 | + define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
27 | +} |
|
28 | +if (!defined('CACHE_DIR')) { |
|
29 | + define('CACHE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'cache'); |
|
30 | +} |
|
31 | +if (!defined('CONFIG_DIR')) { |
|
32 | + define('CONFIG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'config'); |
|
33 | +} |
|
34 | +if (!defined('WEB_DIR')) { |
|
35 | + define('WEB_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'html'); |
|
11 | 36 | } |
12 | -if (!defined('VENDOR_DIR')) define('VENDOR_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'vendor'); |
|
13 | -if (!defined('LOG_DIR')) define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
14 | -if (!defined('CACHE_DIR')) define('CACHE_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'cache'); |
|
15 | -if (!defined('CONFIG_DIR')) define('CONFIG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'config'); |
|
16 | -if (!defined('WEB_DIR')) define('WEB_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'html'); |
|
17 | 37 | |
18 | 38 | |
19 | 39 | /** |
@@ -46,7 +46,7 @@ |
||
46 | 46 | /* @var $file SplFileInfo */ |
47 | 47 | foreach ($finder as $file) { |
48 | 48 | $path = $file->getRealPath(); |
49 | - if(!in_array($path, $loaded_files)) { |
|
49 | + if (!in_array($path, $loaded_files)) { |
|
50 | 50 | $loaded_files[] = $path; |
51 | 51 | require_once($path); |
52 | 52 | } |