Permalink
Browse files

Switch deps loading mode to composer

  • Loading branch information...
Seldaek committed Dec 18, 2011
1 parent 32a0f51 commit 214c0bb69cb15bccde098422a53a2ba1c3e43010
Showing with 67 additions and 32 deletions.
  1. +14 −29 app/autoload.php
  2. +1 −1 app/console
  3. +49 −0 composer.json
  4. +1 −0 composer.lock
  5. +1 −1 web/app.php
  6. +1 −1 web/app_dev.php
@@ -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');
@@ -7,7 +7,7 @@
set_time_limit(0);
require_once __DIR__.'/bootstrap.php.cache';
require_once __DIR__.'/autoload.php';
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\Console\Application;
@@ -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.

Oops, something went wrong.
@@ -1,6 +1,6 @@
<?php
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/autoload.php';
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';
@@ -14,7 +14,7 @@
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/autoload.php';
require_once __DIR__.'/../app/AppKernel.php';
use Symfony\Component\HttpFoundation\Request;

0 comments on commit 214c0bb

Please sign in to comment.