Permalink
Browse files

Actualizacion a version Stable

  • Loading branch information...
robertobermejo authored and ajessu committed Aug 14, 2011
1 parent e30b501 commit bf0a42d936fa1af04e3cd204b21785306e63dd13
View
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2010 Fabien Potencier
+Copyright (c) 2004-2011 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -2,9 +2,6 @@
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
-use Symfony\Component\ClassLoader\DebugUniversalClassLoader;
-use Symfony\Component\HttpKernel\Debug\ErrorHandler;
-use Symfony\Component\HttpKernel\Debug\ExceptionHandler;
class AppKernel extends Kernel
{
@@ -21,7 +18,7 @@ public function registerBundles()
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
-
+
new Desymfony\DesymfonyBundle\DesymfonyBundle(),
);
@@ -33,22 +30,6 @@ public function registerBundles()
return $bundles;
}
- public function init()
- {
- if ($this->debug) {
- ini_set('display_errors', 1);
- error_reporting(-1);
-
- DebugUniversalClassLoader::enable();
- ErrorHandler::register();
- if ('cli' !== php_sapi_name()) {
- ExceptionHandler::register();
- }
- } else {
- ini_set('display_errors', 0);
- }
- }
-
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
View
@@ -1,6 +1,7 @@
<?php
use Symfony\Component\ClassLoader\UniversalClassLoader;
+use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
@@ -21,15 +22,27 @@
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
'Twig_' => __DIR__.'/../vendor/twig/lib',
));
-$loader->registerPrefixFallbacks(array(
- __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs',
-));
+
+// intl
+if (!function_exists('intl_get_error_code')) {
+ require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
+
+ $loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/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');
+
// 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';
Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
+
View
@@ -28,7 +28,7 @@
check(is_writable(__DIR__.'/../app/cache'), sprintf('Checking that app/cache/ directory is writable'), 'Change the permissions of the app/cache/ directory so that the web server can write in it', true);
check(is_writable(__DIR__.'/../app/logs'), sprintf('Checking that the app/logs/ directory is writable'), 'Change the permissions of the app/logs/ directory so that the web server can write in it', true);
check(function_exists('json_encode'), 'Checking that the json_encode() is available', 'Install and enable the json extension', true);
-check(class_exists('SQLite3') || in_array('sqlite', PDO::getAvailableDrivers()), 'Install and enable the SQLite3 or PDO_SQLite extension.', true);
+check(class_exists('SQLite3') || in_array('sqlite', PDO::getAvailableDrivers()), 'Checking that the SQLite3 or PDO_SQLite extension is available', 'Install and enable the SQLite3 or PDO_SQLite extension.', true);
// warnings
echo_title("Optional checks");
@@ -52,13 +52,13 @@
ob_start();
$reflector->info();
- $output = ob_get_clean();
+ $output = strip_tags(ob_get_clean());
- preg_match('/^ICU version => (.*)$/m', $output, $matches);
+ preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
$version = $matches[1];
}
- check(version_compare($matches[1], '4.0', '>='), 'Checking that the intl ICU version is at least 4+', 'Upgrade your intl extension with a newer ICU version (4+)', false);
+ check(version_compare($version, '4.0', '>='), 'Checking that the intl ICU version is at least 4+', 'Upgrade your intl extension with a newer ICU version (4+)', false);
}
$accelerator =
View
@@ -8,7 +8,7 @@ use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
$input = new ArgvInput();
-$env = $input->getParameterOption(array('--env', '-e'), 'dev');
+$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
$debug = !$input->hasParameterOption(array('--no-debug', ''));
$kernel = new AppKernel($env, $debug);
View
@@ -1,97 +0,0 @@
-#!/bin/sh
-
-# 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.
-
-DIR=`php -r "echo realpath(dirname(\\$_SERVER['argv'][0]));"`
-cd $DIR
-VERSION=`grep 'VERSION' vendor/symfony/src/Symfony/Component/HttpKernel/Kernel.php | sed -E "s/.*'(.+)'.*/\1/g"`
-
-if [ ! -d "$DIR/build" ]; then
- mkdir -p $DIR/build
-fi
-
-$DIR/bin/build_bootstrap
-$DIR/app/console assets:install web/
-
-# Without vendors
-rm -rf /tmp/Symfony
-mkdir /tmp/Symfony
-cp -r app /tmp/Symfony/
-cp -r bin /tmp/Symfony/
-cp -r src /tmp/Symfony/
-cp -r web /tmp/Symfony/
-cp -r README.rst /tmp/Symfony/
-cp -r LICENSE /tmp/Symfony/
-cp -r deps /tmp/Symfony/
-cp -r deps.lock /tmp/Symfony/
-cd /tmp/Symfony
-sudo rm -rf app/cache/* app/logs/* .git*
-chmod 777 app/cache app/logs
-
-# DS_Store cleanup
-find . -name .DS_Store | xargs rm -rf -
-
-cd ..
-# avoid the creation of ._* files
-export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
-export COPYFILE_DISABLE=true
-tar zcpf $DIR/build/Symfony_Standard_$VERSION.tgz Symfony
-sudo rm -f $DIR/build/Symfony_Standard_$VERSION.zip
-zip -rq $DIR/build/Symfony_Standard_$VERSION.zip Symfony
-
-# With vendors
-cd $DIR
-rm -rf /tmp/vendor
-mkdir /tmp/vendor
-TARGET=/tmp/vendor
-
-if [ ! -d "$DIR/vendor" ]; then
- echo "The master vendor directory does not exist"
- exit
-fi
-
-cp -r $DIR/vendor/* $TARGET/
-
-# Doctrine ORM
-cd $TARGET/doctrine && rm -rf UPGRADE* build* bin tests tools lib/vendor
-
-# Doctrine DBAL
-cd $TARGET/doctrine-dbal && rm -rf bin build* tests lib/vendor
-
-# Doctrine Common
-cd $TARGET/doctrine-common && rm -rf build* tests lib/vendor
-
-# Swiftmailer
-cd $TARGET/swiftmailer && rm -rf CHANGES README* build* docs notes test-suite tests create_pear_package.php package*
-
-# Symfony
-cd $TARGET/symfony && rm -rf README.md phpunit.xml* tests *.sh vendor
-
-# Twig
-cd $TARGET/twig && rm -rf AUTHORS CHANGELOG README.markdown bin doc package.xml.tpl phpunit.xml* test
-
-# Twig Extensions
-cd $TARGET/twig-extensions && rm -rf README doc phpunit.xml* test
-
-# Monolog
-cd $TARGET/monolog && rm -rf README.markdown phpunit.xml* tests
-
-# Metadata
-cd $TARGET/metadata && rm -rf README.rst phpunit.xml* tests
-
-# cleanup
-find $TARGET -name .git | xargs rm -rf -
-find $TARGET -name .gitignore | xargs rm -rf -
-find $TARGET -name .gitmodules | xargs rm -rf -
-find $TARGET -name .svn | xargs rm -rf -
-
-cd /tmp/
-mv /tmp/vendor /tmp/Symfony/
-tar zcpf $DIR/build/Symfony_Standard_Vendors_$VERSION.tgz Symfony
-sudo rm -f $DIR/build/Symfony_Standard_Vendors_$VERSION.zip
-zip -rq $DIR/build/Symfony_Standard_Vendors_$VERSION.zip Symfony
View
@@ -1,92 +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.
- */
-
-require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-
-/*
- * This file is part of the Symfony package.
- *
- * (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.
- */
-
-use Symfony\Component\ClassLoader\UniversalClassLoader;
-use Symfony\Component\ClassLoader\ClassCollectionLoader;
-
-$loader = new UniversalClassLoader();
-$loader->registerNamespaces(array('Symfony' => __DIR__.'/../vendor/symfony/src'));
-$loader->register();
-
-$file = __DIR__.'/../app/bootstrap.php.cache';
-if (file_exists($file)) {
- unlink($file);
-}
-
-ClassCollectionLoader::load(array(
- 'Symfony\\Component\\DependencyInjection\\ContainerInterface',
- 'Symfony\\Component\\DependencyInjection\\Container',
- 'Symfony\\Component\\DependencyInjection\\ContainerAwareInterface',
- 'Symfony\\Component\\DependencyInjection\\ContainerAware',
-
- 'Symfony\\Component\\HttpKernel\\Bundle\\BundleInterface',
- 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle',
- 'Symfony\\Component\\HttpKernel\\Debug\\ErrorHandler',
- 'Symfony\\Component\\HttpKernel\\HttpKernelInterface',
- 'Symfony\\Component\\HttpKernel\\HttpKernel',
- 'Symfony\\Component\\HttpKernel\\KernelInterface',
- 'Symfony\\Component\\HttpKernel\\Kernel',
-
- 'Symfony\\Component\\HttpFoundation\\ParameterBag',
- 'Symfony\\Component\\HttpFoundation\\FileBag',
- 'Symfony\\Component\\HttpFoundation\\ServerBag',
- 'Symfony\\Component\\HttpFoundation\\HeaderBag',
- 'Symfony\\Component\\HttpFoundation\\Request',
- 'Symfony\\Component\\HttpFoundation\\ApacheRequest',
-
- 'Symfony\\Component\\ClassLoader\\ClassCollectionLoader',
- 'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
- 'Symfony\\Component\\ClassLoader\\MapFileClassLoader',
-
- 'Symfony\\Component\\Config\\ConfigCache',
-), 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));
-
-$file = __DIR__.'/../app/bootstrap_cache.php.cache';
-if (file_exists($file)) {
- unlink($file);
-}
-
-ClassCollectionLoader::load(array(
- 'Symfony\\Component\\HttpKernel\\KernelInterface',
- 'Symfony\\Component\\HttpKernel\\Kernel',
- 'Symfony\\Component\\HttpKernel\\HttpKernelInterface',
- 'Symfony\\Component\\HttpKernel\\HttpCache\\HttpCache',
- 'Symfony\\Component\\HttpKernel\\HttpCache\\StoreInterface',
- 'Symfony\\Component\\HttpKernel\\HttpCache\\Store',
- 'Symfony\\Component\\HttpKernel\\HttpCache\\Esi',
-
- 'Symfony\\Component\\HttpFoundation\\ParameterBag',
- 'Symfony\\Component\\HttpFoundation\\FileBag',
- 'Symfony\\Component\\HttpFoundation\\ServerBag',
- 'Symfony\\Component\\HttpFoundation\\HeaderBag',
- 'Symfony\\Component\\HttpFoundation\\Request',
- 'Symfony\\Component\\HttpFoundation\\ApacheRequest',
- 'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag',
- 'Symfony\\Component\\HttpFoundation\\Response',
-
- 'Symfony\\Component\\ClassLoader\\UniversalClassLoader',
-), 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
@@ -32,6 +32,21 @@ if (!in_array($command = array_shift($argv), array('install', 'update'))) {
exit(sprintf("Command \"%s\" does not exist.\n", $command));
}
+/*
+ * Check wether this project is based on the Standard Edition that was
+ * shipped with vendors or not.
+ */
+if (is_dir($vendorDir.'/symfony') && !is_dir($vendorDir.'/symfony/.git') && !in_array('--reinstall', $argv)) {
+ exit(<<<EOF
+Your project seems to be based on a Standard Edition that includes vendors.
+
+Try to run ./bin/vendors install --reinstall
+
+
+EOF
+ );
+}
+
if (!is_dir($vendorDir)) {
mkdir($vendorDir, 0777, true);
}
@@ -50,7 +65,12 @@ if ('install' === $command && file_exists($rootDir.'/deps.lock')) {
$newversions = array();
$deps = parse_ini_file($rootDir.'/deps', true, INI_SCANNER_RAW);
+if (false === $deps) {
+ exit("The deps file is not valid ini syntax. Perhaps missing a trailing newline?\n");
+}
foreach ($deps as $name => $dep) {
+ $dep = array_map('trim', $dep);
+
// revision
if (isset($versions[$name])) {
$rev = $versions[$name];
@@ -98,7 +118,7 @@ if ('update' === $command) {
$interpreter = PHP_OS == 'WINNT' ? 'php.exe' : '';
// Update the bootstrap files
-system(sprintf('%s %s', $interpreter, escapeshellarg($rootDir.'/bin/build_bootstrap')));
+system(sprintf('%s %s', $interpreter, escapeshellarg($rootDir.'/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php')));
// Update assets
system(sprintf('%s %s assets:install %s', $interpreter, escapeshellarg($rootDir.'/app/console'), escapeshellarg($rootDir.'/web/')));
Oops, something went wrong.

0 comments on commit bf0a42d

Please sign in to comment.