HexMakina /
kadro
| 1 | <?php |
||
| 2 | |||
| 3 | namespace HexMakina\kadro |
||
| 4 | {
|
||
| 5 | use \HexMakina\LocalFS\FileSystem; |
||
| 6 | use \HexMakina\Lezer\Lezer; |
||
| 7 | |||
| 8 | define('KADRO_BASE', APP_BASE.'/lib/kadro/'); // this is project dependant, should be in settings
|
||
| 9 | // define('QIVIVE_BASE', APP_BASE.'/lib/qivive/'); // this is project dependant, should be in settings
|
||
| 10 | |||
| 11 | set_include_path(implode(PATH_SEPARATOR, [get_include_path(), APP_BASE, APP_BASE.'/lib/', APP_BASE.'/vendor/', KADRO_BASE])); |
||
| 12 | |||
| 13 | //--------------------------------------------------------------- autoloader |
||
| 14 | require APP_BASE.'vendor/autoload.php'; |
||
| 15 | |||
| 16 | require 'PSR4Autoloader.class.php'; |
||
| 17 | $loader=new PSR4Autoloader; |
||
| 18 | $loader->register(); //Register loader with SPL autoloader stack. |
||
| 19 | |||
| 20 | $loader->addNamespace('HexMakina', APP_BASE.'/lib/');
|
||
| 21 | |||
| 22 | // $loader->addNamespace('HexMakina\Crudites', APP_BASE.'/lib/Crudites/');
|
||
| 23 | // $loader->addNamespace('HexMakina\ORM', APP_BASE.'/lib/ORM/');
|
||
| 24 | // $loader->addNamespace('HexMakina\Lezer', APP_BASE.'/lib/Lezer/');
|
||
| 25 | // $loader->addNamespace('HexMakina\Format', APP_BASE.'/lib/Format');
|
||
| 26 | |||
| 27 | // $loader->addNamespace('HexMakina\kadro', KADRO_BASE);
|
||
| 28 | // $loader->addNamespace('HexMakina\qivive', QIVIVE_BASE);
|
||
| 29 | // $loader->addNamespace('HexMakina\LocalFS', __DIR__.'/Format/File');
|
||
| 30 | $loader->addNamespaceTree(KADRO_BASE); |
||
| 31 | |||
| 32 | //--------------------------------------------------------------- erara raportado |
||
| 33 | error_reporting(E_ALL); |
||
| 34 | |||
| 35 | set_error_handler('\HexMakina\Logger\LogLaddy::error_handler');
|
||
| 36 | set_exception_handler('\HexMakina\Logger\LogLaddy::exception_handler');
|
||
| 37 | |||
| 38 | \HexMakina\Debugger\Debugger::init(); |
||
| 39 | |||
| 40 | //--------------------------------------------------------------- parametroj |
||
| 41 | require_once APP_BASE.'configs/settings.php'; |
||
| 42 | $box=new Container\LeMarchand($settings); |
||
| 43 | |||
| 44 | foreach($box->get('settings.app.namespaces') as $namespace => $path)
|
||
| 45 | {
|
||
| 46 | $loader->addNamespace($namespace, $path); |
||
| 47 | } |
||
| 48 | |||
| 49 | define('PRODUCTION', $_SERVER['HTTP_HOST'] === $box->get('settings.app.production_host'));
|
||
| 50 | ini_set('display_errors', PRODUCTION ? 0 : 1);
|
||
| 51 | |||
| 52 | //--------------------------------------------------------------- logger |
||
| 53 | $box->register('LoggerInterface', new \HexMakina\Logger\LogLaddy());
|
||
|
0 ignored issues
–
show
|
|||
| 54 | |||
| 55 | //--------------------------------------------------------------- router |
||
| 56 | $box->register('RouterInterface', new Router\hopper($box->get('settings.RouterInterface')));
|
||
| 57 | |||
| 58 | //--------------------------------------------------------------- kuketoj |
||
| 59 | setcookie('cookie_test', 'test_value', time()+(365 * 24 * 60 * 60), "/", "");
|
||
| 60 | $cookies_enabled=isset($_COOKIE['cookie_test']); // houston, do we have cookies ? |
||
| 61 | |||
| 62 | if($cookies_enabled === false) |
||
| 63 | {
|
||
| 64 | ini_set('session.use_cookies', 0);
|
||
| 65 | ini_set('session.use_only_cookies', 0);
|
||
| 66 | ini_set('session.use_trans_sid', 1);
|
||
| 67 | ini_set('session.cache_limiter', 'nocache');
|
||
| 68 | } |
||
| 69 | |||
| 70 | //--------------------------------------------------------------- Session Management |
||
| 71 | $StateAgent=new StateAgent($box->get('settings.app.session_start_options') ?? []);
|
||
| 72 | $StateAgent->add_runtime_filters((array)$box->get('settings.filter'));
|
||
| 73 | $StateAgent->add_runtime_filters((array)($_SESSION['filter'] ?? [])); |
||
| 74 | $StateAgent->add_runtime_filters((array)($_REQUEST['filter'] ?? [])); |
||
| 75 | |||
| 76 | $box->register('StateAgent', $StateAgent);
|
||
| 77 | |||
| 78 | |||
| 79 | //--------------------------------------------------------------- parametroj:signo |
||
| 80 | |||
| 81 | ini_set('default_charset', $box->get('settings.default.charset')); |
||
| 82 | header('Content-type: text/html; charset='.strtolower($box->get('settings.default.charset'))); |
||
| 83 | |||
| 84 | //--------------------------------------------------------------- parametroj:linguo |
||
| 85 | putenv('LANG='.$box->get('settings.default.language')); |
||
| 86 | setlocale(LC_ALL, $box->get('settings.default.language')); |
||
| 87 | |||
| 88 | //--------------------------------------------------------------- parametroj:datoj |
||
| 89 | date_default_timezone_set($box->get('settings.default.timezone')); |
||
| 90 | |||
| 91 | |||
| 92 | //--------------------------------------------------------------- ŝablonoj |
||
| 93 | require_once 'smarty/smarty/libs/Smarty.class.php'; |
||
| 94 | // Load smarty template parser |
||
| 95 | if(is_null($box->get('settings.smarty.template_path')) || is_null($box->get('settings.smarty.compiled_path'))) |
||
| 96 | throw new \Exception("SMARTY CONFIG ERROR: missing parameters"); |
||
| 97 | |||
| 98 | $smarty=new \Smarty(); |
||
| 99 | $box->register('template_engine', $smarty); |
||
| 100 | |||
| 101 | $smarty->setTemplateDir($box->get('RouterInterface')->file_root() . $box->get('settings.smarty.template_path').'app'); |
||
| 102 | $smarty->addTemplateDir($box->get('RouterInterface')->file_root() . $box->get('settings.smarty.template_path')); |
||
| 103 | $smarty->addTemplateDir(KADRO_BASE . 'Views/'); |
||
| 104 | |||
| 105 | $smarty->setCompileDir(APP_BASE . $box->get('settings.smarty.compiled_path')); |
||
| 106 | $smarty->setDebugging($box->get('settings.smarty.debug')); |
||
| 107 | |||
| 108 | $smarty->registerClass('Lezer', '\HexMakina\Lezer\Lezer'); |
||
| 109 | $smarty->registerClass('Marker', '\HexMakina\Format\HTML\Marker'); |
||
| 110 | $smarty->registerClass('Form', '\HexMakina\Format\HTML\Form'); |
||
| 111 | $smarty->registerClass('TableToForm', '\HexMakina\kadro\TableToForm'); |
||
| 112 | $smarty->registerClass('Dato', '\HexMakina\Format\Tempo\Dato'); |
||
| 113 | |||
| 114 | $smarty->assign('APP_NAME', $box->get('settings.app.name')); |
||
| 115 | |||
| 116 | //--------------------------------------------------------------- lingva |
||
| 117 | $locale_path = $box->get('settings.locale.directory_path'); |
||
| 118 | $file_name = $box->get('settings.locale.file_name'); |
||
| 119 | $fallback_lang = $box->get('settings.locale.fallback_lang'); |
||
| 120 | |||
| 121 | $lezer = new Lezer($locale_path.'/'.$file_name, $locale_path.'/cache', $fallback_lang); |
||
| 122 | $language = $lezer->one_language(); |
||
| 123 | |||
| 124 | $lezer->init(); |
||
| 125 | |||
| 126 | $smarty->assign('language', $language); |
||
| 127 | if($cookies_enabled === true) |
||
| 128 | setcookie('lang', $language, time()+(365 * 24 * 60 * 60), "/", ""); |
||
| 129 | |||
| 130 | } |
||
| 131 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths