-
Notifications
You must be signed in to change notification settings - Fork 20
/
psalm.bootstrap.php
59 lines (48 loc) · 1.67 KB
/
psalm.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
59
<?php
/**
* Psalm bootstrap
*
* @package Dotclear
*
* @copyright Olivier Meunier & Association Dotclear
* @copyright AGPL-3.0
*/
declare(strict_types=1);
// Composer Autoloader
require_once __DIR__ . '/vendor/autoload.php';
// Dotclear Autoloader
require_once __DIR__ . '/src/Autoloader.php';
$autoloader = new Autoloader('', '', true);
$autoloader->addNamespace('Dotclear', implode(DIRECTORY_SEPARATOR, [__DIR__, 'src']));
// Clearbricks Autoloader (deprecated)
$__autoload = [
// Core
'dcCore' => implode(DIRECTORY_SEPARATOR, [__DIR__, 'inc', 'core', 'class.dc.core.php']),
'dcUtils' => implode(DIRECTORY_SEPARATOR, [__DIR__, 'inc', 'core', 'class.dc.utils.php']),
// Moved to src
'form' => implode(DIRECTORY_SEPARATOR, [__DIR__, 'src', 'Helper', 'Html', 'Form', 'Legacy.php']),
'formSelectOption' => implode(DIRECTORY_SEPARATOR, [__DIR__, 'src', 'Helper', 'Html', 'Form', 'Legacy.php']),
];
spl_autoload_register(function ($name) use ($__autoload) {if (isset($__autoload[$name])) { require_once $__autoload[$name]; }});
// Ensure L10n functions exist
require_once implode(DIRECTORY_SEPARATOR, [__DIR__, 'src', 'Helper','L10n.php']);
/**
* Local error handler
*
* @param string $summary The summary
* @param string $message The message
* @param int $code The code
*/
function __error(string $summary, string $message, int $code = 0)
{
# Error codes
# 10 : no config file
# 20 : database issue
# 30 : blog is not defined
# 40 : template files creation
# 50 : no default theme
# 60 : template processing error
# 70 : blog is offline
trigger_error($summary, E_USER_ERROR);
exit;
}