forked from symfony/symfony-standard
-
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.
Switch deps loading mode to composer
- Loading branch information
Showing
6 changed files
with
67 additions
and
32 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 |
---|---|---|
@@ -1,50 +1,35 @@ | ||
<?php | ||
|
||
use Symfony\Component\ClassLoader\UniversalClassLoader; | ||
use Doctrine\Common\Annotations\AnnotationRegistry; | ||
if (!$loader = include __DIR__.'/../vendor/.composer/autoload.php') { | ||
$nl = PHP_SAPI === 'cli' ? PHP_EOL : '<br />'; | ||
die('You must set up the project dependencies, run the following commands:'.PHP_EOL. | ||
'curl -s http://getcomposer.org/installer | php'.PHP_EOL. | ||
'php composer.phar install'.PHP_EOL); | ||
} | ||
|
||
$loader = new UniversalClassLoader(); | ||
$loader->registerNamespaces(array( | ||
'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'), | ||
'Sensio' => __DIR__.'/../vendor/bundles', | ||
'JMS' => __DIR__.'/../vendor/bundles', | ||
'Doctrine\\Bundle' => __DIR__.'/../vendor/bundles', | ||
'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib', | ||
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib', | ||
'Doctrine' => __DIR__.'/../vendor/doctrine/lib', | ||
'Monolog' => __DIR__.'/../vendor/monolog/src', | ||
'Assetic' => __DIR__.'/../vendor/assetic/src', | ||
'Metadata' => __DIR__.'/../vendor/metadata/src', | ||
)); | ||
$loader->registerPrefixes(array( | ||
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib', | ||
'Twig_' => __DIR__.'/../vendor/twig/lib', | ||
)); | ||
use Doctrine\Common\Annotations\AnnotationRegistry; | ||
|
||
// intl | ||
if (!function_exists('intl_get_error_code')) { | ||
require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php'; | ||
|
||
$loader->registerPrefixFallback(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'); | ||
$loader->add('IntlDateFormatter', __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'); | ||
$loader->add('Collator', __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'); | ||
$loader->add('Locale', __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'); | ||
$loader->add('NumberFormatter', __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'); | ||
} | ||
|
||
if (!interface_exists('SessionHandlerInterface', false)) { | ||
$loader->registerPrefix('SessionHandlerInterface', __DIR__.'/../vendor/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs'); | ||
$loader->add('SessionHandlerInterface', __DIR__.'/../vendor/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs'); | ||
} | ||
|
||
$loader->registerNamespaceFallbacks(array( | ||
__DIR__.'/../src', | ||
)); | ||
|
||
$loader->register(); | ||
|
||
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'); | ||
AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); | ||
|
||
// Swiftmailer needs a special autoloader to allow | ||
// the lazy loading of the init file (which is expensive) | ||
require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php'; | ||
require_once __DIR__.'/../vendor/swiftmailer/swiftmailer/lib/classes/Swift.php'; | ||
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php'); |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"autoload": { | ||
"psr-0": { "": "src/" } | ||
}, | ||
"require": { | ||
"php": ">=5.3.2", | ||
"symfony/symfony": "2.0.7", | ||
"doctrine/dbal": "2.1.5", | ||
"doctrine/orm": "2.1.4", | ||
"twig/extensions": "master-dev", | ||
"symfony/assetic-bundle": "master-dev", | ||
"sensio/distribution-bundle": "2.0-dev", | ||
"sensio/framework-extra-bundle": "2.0-dev", | ||
"sensio/generator-bundle": "master-dev", | ||
"jms/security-extra-bundle": "1.0.*", | ||
"metadata/metadata": "1.1.0" | ||
}, | ||
"repositories": { | ||
"metadata": { | ||
"package": { | ||
"name": "metadata/metadata", | ||
"version": "1.1.0", | ||
"source": { | ||
"type": "git", | ||
"url": "http://github.com/schmittjoh/metadata.git", | ||
"reference": "1.1.0" | ||
}, | ||
"autoload": { | ||
"psr-0": { "Metadata": "src/" } | ||
} | ||
} | ||
}, | ||
"security-extra-bundle": { | ||
"package": { | ||
"name": "jms/security-extra-bundle", | ||
"version": "1.0.1-dev", | ||
"source": { | ||
"type": "git", | ||
"url": "http://github.com/schmittjoh/JMSSecurityExtraBundle.git", | ||
"reference": "1.0.x" | ||
}, | ||
"autoload": { | ||
"psr-0": { "JMS\\SecurityExtraBundle": "" } | ||
}, | ||
"target-dir": "JMS/SecurityExtraBundle" | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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