Skip to content

Commit

Permalink
Moved the Composer autoload to start.php
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbyoung committed Oct 23, 2017
1 parent c1afe22 commit f5dd19e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions bootstrap/console/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
*/
$paths = require_once __DIR__ . '/../../config/paths.php';

/**
* ----------------------------------------------------------
* Autoload your dependencies
* ----------------------------------------------------------
*/
require "{$paths['vendor']}/autoload.php";

/**
* ----------------------------------------------------------
* Set up the environment
Expand Down
7 changes: 7 additions & 0 deletions bootstrap/http/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
*/
$paths = require_once __DIR__ . '/../../config/paths.php';

/**
* ----------------------------------------------------------
* Autoload your dependencies
* ----------------------------------------------------------
*/
require "{$paths['vendor']}/autoload.php";

/**
* ----------------------------------------------------------
* Set up the environment
Expand Down
7 changes: 1 addition & 6 deletions config/paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Define the list of paths needed by this application
* ----------------------------------------------------------
*/
$paths = [
return [
/**
* ----------------------------------------------------------
* Configs
Expand Down Expand Up @@ -149,8 +149,3 @@
'views.compiled' => realpath(__DIR__ . '/../tmp/framework/http/views'),
'views.raw' => realpath(__DIR__ . '/../resources/views')
];

// Get the autoloader
require "{$paths['vendor']}/autoload.php";

return $paths;
2 changes: 1 addition & 1 deletion tests/src/Application/Console/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IntegrationTestCase extends BaseIntegrationTestCase
*/
public function setUp()
{
require __DIR__ . '/../../../../config/paths.php';
$paths = require __DIR__ . '/../../../../config/paths.php';
require __DIR__ . '/../../../../config/environment.php';
require __DIR__ . '/../../../../config/application.php';
/** @var IContainer $container */
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Application/Http/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IntegrationTestCase extends BaseIntegrationTestCase
*/
public function setUp()
{
require __DIR__ . '/../../../../config/paths.php';
$paths = require __DIR__ . '/../../../../config/paths.php';
require __DIR__ . '/../../../../config/environment.php';
/** @var LoggerInterface $logger */
/** @var IExceptionRenderer $exceptionRenderer */
Expand Down

0 comments on commit f5dd19e

Please sign in to comment.