Skip to content
Browse files

Update to the lastest Symfony version, remove useless bunldes & add b…

…uzz bundle
  • Loading branch information...
1 parent 9b73d9c commit b1a33680f4068a69e639b28762ca486627e54d30 Xavier Hermans committed
Showing with 55 additions and 190 deletions.
  1. +0 −1 app/AppKernel.php
  2. +23 −8 app/autoload.php
  3. +1 −15 app/config/config.yml
  4. +0 −13 app/config/config_prod.yml
  5. +0 −41 app/phpunit.xml.dist
  6. +0 −1 bin/.htaccess
  7. +0 −41 bin/build_bootstrap
  8. +0 −59 bin/vendors
  9. +31 −11 composer.json
View
1 app/AppKernel.php
@@ -15,7 +15,6 @@ public function registerBundles()
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
- new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle(),
@dguyon Plemi member
dguyon added a note

Since you removed this bundle, you should update the README too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
View
31 app/autoload.php 100755 → 100644
@@ -1,20 +1,35 @@
<?php
-use Doctrine\Common\Annotations\AnnotationRegistry;
+if (!$loader = include __DIR__.'/../vendor/.composer/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 = require_once __DIR__.'/../vendor/.composer/autoload.php';
+use Doctrine\Common\Annotations\AnnotationRegistry;
// intl
if (!function_exists('intl_get_error_code')) {
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
- $loader->add(null, __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
+
+ $loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
}
-AnnotationRegistry::registerLoader(function($class) use ($loader) {
- $loader->loadClass($class);
- return class_exists($class, false);
-});
+AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
-// Swiftmailer needs a special autoloader to allow the lazy loading of the init file (which is expensive)
+// Swiftmailer needs a special autoloader to allow
+// the lazy loading of the init file (which is expensive)
require_once __DIR__.'/../vendor/swiftmailer/swiftmailer/lib/classes/Swift.php';
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/swiftmailer/lib/swift_init.php');
View
16 app/config/config.yml
@@ -45,18 +45,4 @@ swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
- password: %mailer_password%
-
-# Doctrine MongoDB Configuration
-doctrine_mongodb:
- connections:
- default:
- server: %mongodb_server%
- options:
- connect: true
- default_database: %mongodb_database%_%kernel.environment%
- document_managers:
- default:
- auto_mapping: true
- metadata_cache_driver:
- type: array
+ password: %mailer_password%
View
13 app/config/config_prod.yml
@@ -1,19 +1,6 @@
imports:
- { resource: config.yml }
-# Doctrine MongoDB Configuration
-doctrine_mongodb:
- document_managers:
- default:
- metadata_cache_driver:
- type: memcache
- class: Doctrine\Common\Cache\MemcacheCache
- host: localhost
- port: 11211
- instance_class: Memcache
- auto_generate_proxy_classes: false
- auto_generate_hydrator_classes: false
-
monolog:
handlers:
main:
View
41 app/phpunit.xml.dist
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
-<phpunit
- backupGlobals = "false"
- backupStaticAttributes = "false"
- colors = "true"
- convertErrorsToExceptions = "true"
- convertNoticesToExceptions = "true"
- convertWarningsToExceptions = "true"
- processIsolation = "false"
- stopOnFailure = "false"
- syntaxCheck = "false"
- bootstrap = "bootstrap.php.cache" >
-
- <testsuites>
- <testsuite name="Project Test Suite">
- <directory>../src/*/*Bundle/Tests</directory>
- <directory>../src/*/Bundle/*Bundle/Tests</directory>
- </testsuite>
- </testsuites>
-
- <!--
- <php>
- <server name="KERNEL_DIR" value="/path/to/your/app/" />
- </php>
- -->
-
- <filter>
- <whitelist>
- <directory>../src</directory>
- <exclude>
- <directory>../src/*/*Bundle/Resources</directory>
- <directory>../src/*/*Bundle/Tests</directory>
- <directory>../src/*/Bundle/*Bundle/Resources</directory>
- <directory>../src/*/Bundle/*Bundle/Tests</directory>
- </exclude>
- </whitelist>
- </filter>
-
-</phpunit>
View
1 bin/.htaccess
@@ -1 +0,0 @@
-deny from all
View
41 bin/build_bootstrap
@@ -1,41 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-/*
- * This file is part of the Symfony Standard Edition.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-$baseDir = dirname(__DIR__);
-$autoload = require_once $baseDir.'/vendor/.composer/autoload.php';
-
-use Symfony\Component\ClassLoader\ClassCollectionLoader;
-
-$file = $baseDir.'/app/bootstrap.php.cache';
-if (file_exists($file)) {
- unlink($file);
-}
-
-ClassCollectionLoader::load(array(
- 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface',
- // Cannot be included because annotations will parse the big compiled class file
- //'Symfony\\Component\\DependencyInjection\\ContainerAware',
- 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
- 'Symfony\\Component\\DependencyInjection\\Container',
- 'Symfony\\Component\\HttpKernel\\HttpKernelInterface',
- 'Symfony\\Component\\HttpKernel\\KernelInterface',
- 'Symfony\\Component\\HttpKernel\\Kernel',
- 'Symfony\\Component\\ClassLoader\\ClassCollectionLoader',
- 'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
- 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle',
- 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface',
- 'Symfony\\Component\\Config\\ConfigCache',
- // cannot be included as commands are discovered based on the path to this class via Reflection
- //'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle',
-), dirname($file), basename($file, '.php.cache'), false, false, '.php.cache');
-
-file_put_contents($file, "<?php\n\nnamespace { require_once __DIR__.'/autoload.php'; }\n\n".substr(file_get_contents($file), 5));
View
59 bin/vendors
@@ -1,59 +0,0 @@
-#!/usr/bin/env php
-<?php
-
-/*
- * This file is part of the Symfony Standard Edition.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-set_time_limit(0);
-
-$rootDir = dirname(__DIR__);
-$vendorDir = $rootDir.'/vendor';
-
-array_shift($argv);
-if (!isset($argv[0])) {
- exit(<<<EOF
-Symfony2 vendors script management.
-
-Specify a command to run:
-
- install: install vendors as specified in composer.json or composer.lock (recommended)
- update: update vendors to their latest versions (as specified in composer.json)
-
-EOF
- );
-}
-
-// php on windows can't use the shebang line from system()
-$interpreter = defined('PHP_WINDOWS_VERSION_BUILD') ? 'php.exe' : 'php';
-
-if (!in_array($command = array_shift($argv), array('install', 'update'))) {
- exit(sprintf("Command \"%s\" does not exist.\n", $command));
-}
-
-if (!file_exists($rootDir.'/composer.phar')) {
- // Download composer if not downloaded yet
- file_put_contents($rootDir.'/composer.phar',
- file_get_contents('http://getcomposer.org/composer.phar')
- );
-} else {
- // Update composer to latest version
- system(sprintf('%s %s self-update', $interpreter, escapeshellarg($rootDir.'/composer.phar')));
-}
-
-// Install/update dependencies
-system(sprintf('%s %s %s', $interpreter, escapeshellarg($rootDir.'/composer.phar'), $command));
-
-// Update the bootstrap files
-system(sprintf('%s %s', $interpreter, escapeshellarg($rootDir.'/bin/build_bootstrap')));
-
-// Update assets
-system(sprintf('%s %s assets:install %s', $interpreter, escapeshellarg($rootDir.'/app/console'), escapeshellarg($rootDir.'/web/')));
-
-// Remove the cache
-system(sprintf('%s %s cache:clear --no-warmup', $interpreter, escapeshellarg($rootDir.'/app/console')));
View
42 composer.json
@@ -2,18 +2,38 @@
"require": {
"php": ">=5.3.6",
"symfony/symfony": "2.1.*",
- "twig/extensions": "master-dev",
- "symfony/monolog-bundle": "master-dev",
- "symfony/swiftmailer-bundle": "master-dev",
- "symfony/assetic-bundle": "master-dev",
- "sensio/framework-extra-bundle": "master-dev",
- "doctrine/mongodb-odm-bundle": "master-dev",
- "behat/behat-bundle": "*"
+ "twig/extensions": "dev-master",
+ "symfony/monolog-bundle": "dev-master",
+ "symfony/swiftmailer-bundle": "dev-master",
+ "symfony/assetic-bundle": "dev-master",
+ "sensio/buzz-bundle": "dev-master",
+ "sensio/distribution-bundle": "dev-master",
+ "sensio/framework-extra-bundle": "dev-master"
+ },
+ "suggest": {
+ "mageekguy/atoum": "dev-xunit",
+ "behat/behat-bundle": "dev-master"
},
-
"autoload": {
- "psr-0": {
- "Acme": "src/"
- }
+ "psr-0": { "": "src/" }
+ },
+ "scripts": {
+ "post-install-cmd": [
+ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
+ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
+ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
+ ],
+ "post-update-cmd": [
+ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
+ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
+ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets"
+ ]
+ },
+ "config": {
+ "bin-dir": "bin"
+ },
+ "extra": {
+ "symfony-app-dir": "app",
+ "symfony-web-dir": "web"
}
}

0 comments on commit b1a3368

Please sign in to comment.
Something went wrong with that request. Please try again.