forked from KnpLabs/KnpBundles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce usage of composer! (also fixed failed tests)
- Loading branch information
Showing
16 changed files
with
535 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
/vendor/* | ||
/app/config/parameters.yml | ||
/app/config/parameters.*.yml | ||
composer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,28 @@ | ||
<?php | ||
|
||
use Symfony\Component\ClassLoader\UniversalClassLoader; | ||
use Doctrine\Common\Annotations\AnnotationRegistry; | ||
|
||
$loader = new UniversalClassLoader(); | ||
$loader->registerNamespaces(array( | ||
'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'), | ||
'Knp\Bundle\KnpBundlesBundle' => __DIR__.'/../src', | ||
'Knp\Bundle\SitemapBundle' => __DIR__.'/../src', | ||
'Knp\Bundle' => __DIR__.'/../vendor/bundles', | ||
'Knp\Menu' => __DIR__.'/../vendor/knp-menu/src', | ||
'Knp\Component' => __DIR__.'/../vendor/knp-components/src', | ||
'Ornicar\GravatarBundle' => __DIR__.'/../vendor/bundles', | ||
'Doctrine\Bundle' => __DIR__.'/../vendor/bundles', | ||
'Doctrine\DBAL\Migrations' => __DIR__.'/../vendor/doctrine-migrations/lib', | ||
'Doctrine\Common' => __DIR__.'/../vendor/doctrine-common/lib', | ||
'Doctrine\Common\DataFixtures' => __DIR__.'/../vendor/doctrine-data-fixtures/lib', | ||
'Doctrine\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib', | ||
'Doctrine' => __DIR__.'/../vendor/doctrine/lib', | ||
'JMS' => __DIR__.'/../vendor/bundles', | ||
'Monolog' => __DIR__.'/../vendor/monolog/src', | ||
'Goutte' => __DIR__.'/../vendor/goutte/src', | ||
'Zend' => __DIR__.'/../vendor/zf/library', | ||
'Etcpasswd' => __DIR__.'/../vendor/bundles', | ||
'Buzz' => __DIR__.'/../vendor/buzz/lib', | ||
'Inori' => __DIR__.'/../vendor/bundles', | ||
'Behat\Gherkin' => __DIR__.'/../vendor/behat/gherkin/src', | ||
'Behat\Behat' => __DIR__.'/../vendor/behat/behat/src', | ||
'Behat\BehatBundle' => __DIR__.'/../vendor/bundles', | ||
'Behat\Mink' => __DIR__.'/../vendor/behat/mink/src', | ||
'Behat\MinkBundle' => __DIR__.'/../vendor/bundles', | ||
'Behat\CommonContext' => __DIR__.'/../vendor/behat/CommonContexts', | ||
'OldSound' => __DIR__.'/../vendor/bundles', | ||
'PhpAmqpLib' => __DIR__.'/../vendor/videlalvaro/php-amqplib', | ||
'Imagine' => __DIR__.'/../vendor/imagine/lib', | ||
'Igorw' => __DIR__.'/../vendor/bundles', | ||
'Nelmio' => __DIR__.'/../vendor/bundles', | ||
'Github' => __DIR__.'/../vendor/php-github-api/lib', | ||
)); | ||
if (!$loader = include __DIR__.'/../vendor/autoload.php') { | ||
$nl = PHP_SAPI === 'cli' ? PHP_EOL : '<br />'; | ||
echo "$nl$nl"; | ||
if (is_writable(dirname(__DIR__)) && $installer = @file_get_contents('http://getcomposer.org/installer')) { | ||
echo 'You must set up the project dependencies.'.$nl; | ||
$installerPath = dirname(__DIR__).'/install-composer.php'; | ||
file_put_contents($installerPath, $installer); | ||
echo 'The composer installer has been downloaded in '.$installerPath.$nl; | ||
die('Run the following commands in '.dirname(__DIR__).':'.$nl.$nl. | ||
'php install-composer.php'.$nl. | ||
'php composer.phar install'.$nl); | ||
} | ||
die('You must set up the project dependencies.'.$nl. | ||
'Run the following commands in '.dirname(__DIR__).':'.$nl.$nl. | ||
'curl -s http://getcomposer.org/installer | php'.$nl. | ||
'php composer.phar install'.$nl); | ||
} | ||
|
||
$loader->registerPrefixes(array( | ||
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib', | ||
'Twig_' => __DIR__.'/../vendor/twig/lib', | ||
'PHPGit_' => __DIR__.'/../vendor/php-git-repo/lib', | ||
'Solarium_' => __DIR__.'/../vendor/solarium/library', | ||
)); | ||
$loader->register(); | ||
use Doctrine\Common\Annotations\AnnotationRegistry; | ||
|
||
// Registering the annotations | ||
AnnotationRegistry::registerLoader(function($class) use ($loader) { | ||
$loader->loadClass($class); | ||
return class_exists($class, false); | ||
}); | ||
AnnotationRegistry::registerFile( | ||
__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php' | ||
); | ||
// intl | ||
if (!function_exists('intl_get_error_code')) { | ||
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php'; | ||
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs'); | ||
} | ||
AnnotationRegistry::registerLoader(array($loader, 'loadClass')); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.