Skip to content

Commit

Permalink
changed initialization files to be more flexible (bootstrap file when…
Browse files Browse the repository at this point in the history
… using the Symfony2 reverse proxy for instance should be different)
  • Loading branch information
fabpot committed Jan 30, 2011
1 parent b71815a commit d3665f9
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 31 deletions.
2 changes: 0 additions & 2 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

require_once __DIR__.'/../src/autoload.php';

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\DependencyInjection\Loader\LoaderInterface;

Expand Down
24 changes: 24 additions & 0 deletions app/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => __DIR__.'/../src/vendor/symfony/src',
'Application' => __DIR__.'/../src',
'Bundle' => __DIR__.'/../src',
'Doctrine\\Common\\DataFixtures' => __DIR__.'/../src/vendor/doctrine-data-fixtures/lib',
'Doctrine\\Common' => __DIR__.'/../src/vendor/doctrine-common/lib',
'Doctrine\\DBAL\\Migrations' => __DIR__.'/../src/vendor/doctrine-migrations/lib',
'Doctrine\\MongoDB' => __DIR__.'/../src/vendor/doctrine-mongodb/lib',
'Doctrine\\ODM\\MongoDB' => __DIR__.'/../src/vendor/doctrine-mongodb-odm/lib',
'Doctrine\\DBAL' => __DIR__.'/../src/vendor/doctrine-dbal/lib',
'Doctrine' => __DIR__.'/../src/vendor/doctrine/lib',
'Zend' => __DIR__.'/../src/vendor/zend/library',
));
$loader->registerPrefixes(array(
'Twig_Extensions_' => __DIR__.'/../src/vendor/twig-extensions/lib',
'Twig_' => __DIR__.'/../src/vendor/twig/lib',
'Swift_' => __DIR__.'/../src/vendor/swiftmailer/lib/classes',
));
$loader->register();
4 changes: 4 additions & 0 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

require_once __DIR__.'/../src/vendor/symfony/src/Symfony/Component/HttpKernel/bootstrap.php';
require_once __DIR__.'/autoload.php';
1 change: 1 addition & 0 deletions app/console
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env php
<?php

require_once __DIR__.'/bootstrap.php';
require_once __DIR__.'/AppKernel.php';

use Symfony\Bundle\FrameworkBundle\Console\Application;
Expand Down
2 changes: 1 addition & 1 deletion app/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
processIsolation="true"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="../src/autoload.php"
bootstrap="bootstrap.php"
>
<testsuites>
<testsuite name="Project Test Suite">
Expand Down
28 changes: 0 additions & 28 deletions src/autoload.php

This file was deleted.

1 change: 1 addition & 0 deletions web/app.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

require_once __DIR__.'/../app/bootstrap.php';
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';

Expand Down
1 change: 1 addition & 0 deletions web/app_dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

require_once __DIR__.'/../app/bootstrap.php';
require_once __DIR__.'/../app/AppKernel.php';

use Symfony\Component\HttpFoundation\Request;
Expand Down

0 comments on commit d3665f9

Please sign in to comment.