1 ) { $err .= $argv[1]; } $exists = \tts\main\registry::get('di')->exists('log'); if ($exists) { $log = \tts\main\registry::get('di')->get_service('log', ['CLI_404s']); $log->write($err); } echo $err; exit(1); } /** * Displays 404 Page not Found */ public static function tts_error404(): void { if (\tts\console_app::is_cli()) { self::tts_error404_cli(); } else { $use_api = \tts\request::is_api(); } if ($use_api === true) { self::tts_api_method_not_found(); } $resource = \tts\main\configure::get('tts', '404_page'); if ($resource === null) { echo "404 Page Not Found!"; exit(1); } $loaded = \tts\requires::secure_include('views/404', $resource); // Show 404, Page Not Found Error Page! if ($loaded === false) { echo "404 Page Not Found!"; } exit(1); } /** * API Method was not found do API 400 Error */ private static function tts_api_method_not_found(): void { $status = 400; // Bad Request $bad_request = \tts\api::BAD_REQUEST; \tts\api::error(array('response' => $bad_request, 'code' => $status, 'reason' => 'Command not found')); } }