From 216d9b3001d7d5e86833fbaf8376f667029aea7b Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Thu, 2 Oct 2014 19:19:55 +0200 Subject: [PATCH] Moved autoloader to composer config --- composer.json | 7 +++++++ gruntfile.js | 2 +- public_html/api-dispatch.php | 4 +++- scripts/upgrade.php | 2 +- src/AutoLoader.php | 39 ------------------------------------ src/Bootstrap.php | 30 +++++++++++++++++++++++++++ tests/AbstractTestCase.php | 8 +------- 7 files changed, 43 insertions(+), 49 deletions(-) delete mode 100644 src/AutoLoader.php create mode 100644 src/Bootstrap.php diff --git a/composer.json b/composer.json index c2ceddc1..a538a906 100644 --- a/composer.json +++ b/composer.json @@ -7,5 +7,12 @@ "require-dev": { "jbrooksuk/phpcheckstyle": "dev-master", "phpunit/phpunit": "4.2.*" + }, + + "autoload": { + "psr-4": { + "Szurubooru\\Tests\\": "tests/", + "Szurubooru\\": "src/" + } } } diff --git a/gruntfile.js b/gruntfile.js index 4247b77b..3e5fcd41 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -79,7 +79,7 @@ module.exports = function(grunt) { }, tests: { - command: 'php vendor/phpunit/phpunit/phpunit -v --strict --bootstrap src/AutoLoader.php tests/', + command: 'php vendor/phpunit/phpunit/phpunit -v --strict --bootstrap src/Bootstrap.php tests/', }, upgrade: { diff --git a/public_html/api-dispatch.php b/public_html/api-dispatch.php index d76ac8b1..4bc5a20b 100644 --- a/public_html/api-dispatch.php +++ b/public_html/api-dispatch.php @@ -1,7 +1,9 @@ run($httpHelper->getRequestMethod(), $_GET['q']); diff --git a/scripts/upgrade.php b/scripts/upgrade.php index 89a20d64..9bd127e2 100644 --- a/scripts/upgrade.php +++ b/scripts/upgrade.php @@ -2,7 +2,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'src' - . DIRECTORY_SEPARATOR . 'AutoLoader.php'); + . DIRECTORY_SEPARATOR . 'Bootstrap.php'); $upgradeService = Szurubooru\Injector::get(\Szurubooru\Services\UpgradeService::class); $upgradeService->runUpgradesVerbose(); diff --git a/src/AutoLoader.php b/src/AutoLoader.php deleted file mode 100644 index cbdaa98f..00000000 --- a/src/AutoLoader.php +++ /dev/null @@ -1,39 +0,0 @@ -