コード例 #1
0
ファイル: Route.php プロジェクト: Allopa/ZN-Framework-Starter
 public function run($functionName = '', $functionRun = '')
 {
     $datas = Structure::datas();
     $parameters = $datas['parameters'];
     $isFile = $datas['isFile'];
     $function = $datas['function'];
     if (file_exists($isFile)) {
         if ($functionName === $function) {
             if (is_callable($functionRun)) {
                 if (APP_TYPE === 'local') {
                     set_error_handler('Exceptions::table');
                 }
                 call_user_func_array($functionRun, $parameters);
                 if (APP_TYPE === 'local') {
                     restore_error_handler();
                 }
             } else {
                 // Sayfa bilgisine erişilemezse hata bildir.
                 if (!Config::get('Route', 'show404')) {
                     // Hatayı ekrana yazdır.
                     echo Error::message('Error', 'callUserFuncArrayError', $functionRun);
                     // Hatayı rapor et.
                     report('Error', getMessage('Error', 'callUserFuncArrayError'), 'SystemCallUserFuncArrayError');
                     // Çalışmayı durdur.
                     return false;
                 } else {
                     redirect(Config::get('Route', 'show404'));
                 }
             }
         }
     }
 }