1 | <?php |
||
2 | /** @var object $loader - defined in composer Autoload */ |
||
3 | // check if loader is initialized |
||
4 | if (!defined('root')) { |
||
5 | die('Hack attempt'); |
||
6 | } |
||
7 | |||
8 | // global environment |
||
9 | define('env_name', 'Front'); |
||
10 | define('env_no_uri', true); |
||
11 | define('env_type', 'html'); |
||
12 | |||
13 | require_once(root . '/Loader/Autoload.php'); |
||
14 | |||
15 | // make fast-access alias \App::$Object |
||
16 | // class_alias('Ffcms\Core\App', 'App'); |
||
17 | class App extends Ffcms\Core\App |
||
0 ignored issues
–
show
|
|||
18 | { |
||
19 | } |
||
20 | /** |
||
21 | * Alias for translate function for fast usage. Example: __('Welcome my friend') |
||
22 | * @param string $text |
||
23 | * @param array $params |
||
24 | * @return string |
||
25 | */ |
||
26 | function __($text, array $params = []) |
||
27 | { |
||
28 | return \App::$Translate->translate($text, $params); |
||
29 | } |
||
30 | |||
31 | try { |
||
32 | $app = \App::factory([ |
||
33 | 'Database' => true, |
||
34 | 'Session' => true, |
||
35 | 'Debug' => true, |
||
36 | 'User' => true, |
||
37 | 'Mailer' => true, |
||
38 | 'Captcha' => true, |
||
39 | 'Cache' => true |
||
40 | ], $loader); |
||
41 | $app->run(); |
||
42 | } catch (Exception $e) { |
||
43 | echo (new \Ffcms\Core\Exception\NativeException($e->getMessage()))->display(); |
||
44 | } |
||
45 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.