public function __construct($sSubPathExt = "", $arSubPathFiles = array()) { parent::__construct(); $this->_arPathFiles = $arSubPathFiles; $this->_sSubPathStyle = TFW_SUBPATH_STYLEDS; $this->_sSubPathPlugin = TFW_SUBPATH_PLUGINDS; $this->_sSubPathExt = $sSubPathExt; }
if (!Config::get('app.debug')) { if (Request::ajax() || Request::is('api/*')) { return MainHelper::response(null, $exception->getMessage(), 'error', 500); } else { View::share('page_title', 'Fatal Error'); return Response::view('system.error', compact('exception', 'code'), 500); } } if (Request::is('api/*')) { return MainHelper::response([['message' => $exception->getMessage(), 'line' => $exception->getLine(), 'file' => $exception->getFile()]], 'Fatal Error', 'error', 500); } } }); App::missing(function () { if (Request::is('api/*')) { return MainHelper::response(null, 'Resource Not Found', 'error', 404); } View::share('page_title', 'Page Not Found'); return Response::view('system.notfound', [], 404); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () {
<?php use BFACP\Option; $options = []; $format = function (&$options, $keys, $value) use(&$format) { $keys ? $format($options[array_shift($keys)], $keys, $value) : ($options = $value); }; try { foreach (Option::all() as $option) { if ($option->option_value === 1 || $option->option_value === '1' || $option->option_value === 'true') { $format($options, explode('.', $option->option_key), true); } elseif ($option->option_value === 0 || $option->option_value === '0' || $option->option_value === 'false') { $format($options, explode('.', $option->option_key), false); } else { if ($option->option_key == 'site.languages') { $values = []; foreach (explode(',', $option->option_value) as $value) { $values[$value] = MainHelper::languages($value); } $format($options, explode('.', $option->option_key), $values); } else { $format($options, explode('.', $option->option_key), $option->option_value); } } } } catch (\Illuminate\Database\QueryException $e) { $options = []; } return $options;
Route::get('{player}/overview', ['as' => 'api.battlelog.players.overview', function (BFACP\Battlefield\Player $player) { $battlelog = App::make('BFACP\\Libraries\\Battlelog\\BPlayer', [$player]); return MainHelper::response($battlelog->getOverviewStats(), null, null, null, false, true); }])->where('player', '[0-9]+'); Route::get('{player}/vehicles', ['as' => 'api.battlelog.players.vehicles', function (BFACP\Battlefield\Player $player) { $battlelog = App::make('BFACP\\Libraries\\Battlelog\\BPlayer', [$player]); return MainHelper::response($battlelog->getVehicleStats(), null, null, null, false, true); }])->where('player', '[0-9]+'); Route::get('{player}/reports', ['as' => 'api.battlelog.players.reports', function (BFACP\Battlefield\Player $player) { $battlelog = App::make('BFACP\\Libraries\\Battlelog\\BPlayer', [$player]); return MainHelper::response($battlelog->getBattleReports(), null, null, null, false, true); }])->where('player', '[0-9]+'); Route::get('{player}/acs', ['as' => 'api.battlelog.players.acs', function (BFACP\Battlefield\Player $player) { $acs = App::make('BFACP\\Libraries\\AntiCheat', [$player]); $data = $acs->parse($acs->battlelog->getWeaponStats())->get(); return MainHelper::response($data, null, null, null, false, true); }])->where('player', '[0-9]+'); }); }); /*================================ = API Bans = ================================*/ Route::group(['prefix' => 'bans'], function () { Route::get('latest', ['as' => 'api.bans.latest', 'uses' => 'BansController@latest']); Route::get('stats', ['as' => 'api.bans.stats', 'uses' => 'BansController@stats']); Route::group(['prefix' => 'metabans'], function () { Route::get('/', ['as' => 'api.bans.metabans.index', 'uses' => 'MetabansController@getIndex']); Route::get('feed', ['as' => 'api.bans.metabans.feed', 'uses' => 'MetabansController@getFeed']); Route::get('assessments', ['as' => 'api.bans.metabans.assessments', 'uses' => 'MetabansController@getAssessments']); Route::get('feed_assessments', ['as' => 'api.bans.metabans.feed_assessments', 'uses' => 'MetabansController@getFeedAssessments']); });