function internalStartingContoller(string $startController = '', array $param = []) { $controllerEx = explode(':', $startController); $controllerPath = !empty($controllerEx[0]) ? $controllerEx[0] : ''; $controllerFunc = !empty($controllerEx[1]) ? $controllerEx[1] : 'main'; $controllerFile = CONTROLLERS_DIR . suffix($controllerPath, '.php'); $controllerClass = divide($controllerPath, '/', -1); if (is_file($controllerFile)) { require_once $controllerFile; if (!is_callable([$controllerClass, $controllerFunc])) { report('Error', lang('Error', 'callUserFuncArrayError', $controllerFunc), 'SystemCallUserFuncArrayError'); die(Errors::message('Error', 'callUserFuncArrayError', $controllerFunc)); } return uselib($controllerClass)->{$controllerFunc}(...$param); } else { report('Error', lang('Error', 'notIsFileError', $controllerFile), 'SystemNotIsFileError'); die(Errors::message('Error', 'notIsFileError', $controllerFile)); } }
//-------------------------------------------------------------------------------------------------- if (Config::get('Htaccess', 'createFile') === true) { internalCreateHtaccessFile(); } //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- // Robots Dosyası Oluşturma İşlemi //-------------------------------------------------------------------------------------------------- if (Config::get('Robots', 'createFile') === true) { internalCreateRobotsFile(); } //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- // Composer Autoloader //-------------------------------------------------------------------------------------------------- $composer = Config::get('Autoloader', 'composer'); if ($composer === true) { $path = 'vendor/autoload.php'; if (file_exists($path)) { require_once $path; } else { report('Error', lang('Error', 'fileNotFound', $path), 'AutoloadComposer'); die(Errors::message('Error', 'fileNotFound', $path)); } } elseif (is_file($composer)) { require_once $composer; } elseif (!empty($composer)) { report('Error', lang('Error', 'fileNotFound', $composer), 'AutoloadComposer'); die(Errors::message('Error', 'fileNotFound', $composer)); } //--------------------------------------------------------------------------------------------------------
} } else { if ($routeShow404 = Config::get('Services', 'route')['show404']) { redirect($routeShow404); } else { report('Error', lang('Error', 'callUserFuncArrayError', $function), 'SystemCallUserFuncArrayError'); die(Errors::message('Error', 'callUserFuncArrayError', $function)); } } } } else { if ($routeShow404 = Config::get('Services', 'route')['show404']) { redirect($routeShow404); } else { report('Error', lang('Error', 'notFoundController', CURRENT_CONTROLLER), 'SystemNotFoundControllerError'); die(Errors::message('Error', 'notFoundController', CURRENT_CONTROLLER)); } } //-------------------------------------------------------------------------------------------------- // Restore Error Handler //-------------------------------------------------------------------------------------------------- // // @mode = 'publication' // //-------------------------------------------------------------------------------------------------- if (PROJECT_MODE !== 'publication') { restore_error_handler(); } else { //---------------------------------------------------------------------------------------------- // Report Error Last Error //----------------------------------------------------------------------------------------------