From 2770e6d1b4a41e9be42e2954671d284f668fd69e Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 15 Apr 2017 12:13:29 -0400 Subject: [PATCH] Remove old file, fix autoloading issues --- app/Http/Routes/APIRoutes.php | 195 ---------------------------------- bootstrap/autoload.php | 19 +--- 2 files changed, 1 insertion(+), 213 deletions(-) delete mode 100755 app/Http/Routes/APIRoutes.php diff --git a/app/Http/Routes/APIRoutes.php b/app/Http/Routes/APIRoutes.php deleted file mode 100755 index 8351bcffd..000000000 --- a/app/Http/Routes/APIRoutes.php +++ /dev/null @@ -1,195 +0,0 @@ -. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -namespace Pterodactyl\Http\Routes; - -use Illuminate\Routing\Router; - -class APIRoutes -{ - /** - * API routes. - * - * @param \Illuminate\Routing\Router $router - * @return void - */ - public function map(Router $router) - { - $api = app('Dingo\Api\Routing\Router'); - $api->version('v1', ['prefix' => 'api/me', 'middleware' => 'api.auth'], function ($api) { - $api->get('/', [ - 'as' => 'api.user.me', - 'uses' => 'Pterodactyl\Http\Controllers\API\User\InfoController@me', - ]); - - $api->get('/server/{uuid}', [ - 'as' => 'api.user.server', - 'uses' => 'Pterodactyl\Http\Controllers\API\User\ServerController@info', - ]); - - $api->post('/server/{uuid}/power', [ - 'as' => 'api.user.server.power', - 'uses' => 'Pterodactyl\Http\Controllers\API\User\ServerController@power', - ]); - - $api->post('/server/{uuid}/command', [ - 'as' => 'api.user.server.command', - 'uses' => 'Pterodactyl\Http\Controllers\API\User\ServerController@command', - ]); - }); - - $api->version('v1', ['prefix' => 'api', 'middleware' => 'api.auth'], function ($api) { - - /* - * User Routes - */ - $api->get('users', [ - 'as' => 'api.admin.users.list', - 'uses' => 'Pterodactyl\Http\Controllers\API\UserController@index', - ]); - - $api->post('users', [ - 'as' => 'api.admin.users.create', - 'uses' => 'Pterodactyl\Http\Controllers\API\UserController@create', - ]); - - $api->get('users/{id}', [ - 'as' => 'api.admin.users.view', - 'uses' => 'Pterodactyl\Http\Controllers\API\UserController@view', - ]); - - $api->patch('users/{id}', [ - 'as' => 'api.admin.users.update', - 'uses' => 'Pterodactyl\Http\Controllers\API\UserController@update', - ]); - - $api->delete('users/{id}', [ - 'as' => 'api.admin.users.delete', - 'uses' => 'Pterodactyl\Http\Controllers\API\UserController@delete', - ]); - - /* - * Server Routes - */ - $api->get('servers', [ - 'as' => 'api.admin.servers.list', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@index', - ]); - - $api->post('servers', [ - 'as' => 'api.admin.servers.create', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@create', - ]); - - $api->get('servers/{id}', [ - 'as' => 'api.admin.servers.view', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@view', - ]); - - $api->patch('servers/{id}/config', [ - 'as' => 'api.admin.servers.config', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@config', - ]); - - $api->patch('servers/{id}/build', [ - 'as' => 'api.admin.servers.build', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@build', - ]); - - $api->post('servers/{id}/suspend', [ - 'as' => 'api.admin.servers.suspend', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@suspend', - ]); - - $api->post('servers/{id}/unsuspend', [ - 'as' => 'api.admin.servers.unsuspend', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@unsuspend', - ]); - - $api->delete('servers/{id}/{force?}', [ - 'as' => 'api.admin.servers.delete', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServerController@delete', - ]); - - /* - * Node Routes - */ - $api->get('nodes', [ - 'as' => 'api.admin.nodes.list', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@index', - ]); - - $api->post('nodes', [ - 'as' => 'api.admin.nodes.create', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@create', - ]); - - $api->get('nodes/allocations', [ - 'as' => 'api.admin.nodes.allocations', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@allocations', - ]); - - $api->get('nodes/allocations/{id}', [ - 'as' => 'api.admin.nodes.allocations', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@allocationsView', - ]); - - $api->get('nodes/{id}', [ - 'as' => 'api.admin.nodes.view', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@view', - ]); - - $api->get('nodes/{id}/config', [ - 'as' => 'api.admin.nodes.view.config', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@config', - ]); - - $api->delete('nodes/{id}', [ - 'as' => 'api.admin.nodes.delete', - 'uses' => 'Pterodactyl\Http\Controllers\API\NodeController@delete', - ]); - - /* - * Location Routes - */ - $api->get('locations', [ - 'as' => 'api.admin.locations.list', - 'uses' => 'Pterodactyl\Http\Controllers\API\LocationController@index', - ]); - - /* - * Service Routes - */ - $api->get('services', [ - 'as' => 'api.admin.services.list', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServiceController@index', - ]); - - $api->get('services/{id}', [ - 'as' => 'api.admin.services.view', - 'uses' => 'Pterodactyl\Http\Controllers\API\ServiceController@view', - ]); - }); - } -} diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index 0f7519510..94adc9977 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -14,21 +14,4 @@ define('LARAVEL_START', microtime(true)); | */ -require __DIR__ . '/../vendor/autoload.php'; - -/* -|-------------------------------------------------------------------------- -| Include The Compiled Class File -|-------------------------------------------------------------------------- -| -| To dramatically increase your application's performance, you may use a -| compiled class file which contains all of the classes commonly used -| by a request. The Artisan "optimize" is used to create this file. -| -*/ - -$compiledPath = __DIR__ . '/cache/compiled.php'; - -if (file_exists($compiledPath)) { - require $compiledPath; -} +require __DIR__.'/../vendor/autoload.php';