Skip to content

Commit

Permalink
[Issue #137] Actualiza a beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
ajessu committed Jun 18, 2011
1 parent cf70999 commit f391637
Show file tree
Hide file tree
Showing 19 changed files with 309 additions and 248 deletions.
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

19 changes: 19 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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
{
Expand Down Expand Up @@ -30,6 +33,22 @@ 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');
Expand Down
14 changes: 11 additions & 3 deletions app/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
'Monolog' => __DIR__.'/../vendor/monolog/src',
'Assetic' => __DIR__.'/../vendor/assetic/src',

'Metadata' => __DIR__.'/../vendor/metadata/src',

'Desymfony' => __DIR__.'/../src',
));
$loader->registerPrefixes(array(
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
'Twig_' => __DIR__.'/../vendor/twig/lib',
'Swift_' => __DIR__.'/../vendor/swiftmailer/lib/classes',
));
$loader->register();
$loader->registerPrefixFallbacks(array(
__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs',
));
$loader->registerNamespaceFallbacks(array(
__DIR__.'/../src',
));
$loader->register();

// 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');
145 changes: 50 additions & 95 deletions app/check.php

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ framework:
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
session:
default_locale: %locale%
lifetime: 3600
auto_start: true

# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
extensions: [twig.extension.text]
globals:
idiomas: { es: 'Español', en: 'Inglés' }

Expand Down Expand Up @@ -69,4 +67,3 @@ services:
class: Desymfony\DesymfonyBundle\RequestListener
tags:
- { name: kernel.listener, event: core.request, method: onCoreRequest }

3 changes: 3 additions & 0 deletions app/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ web_profiler:
toolbar: false
intercept_redirects: false

swiftmailer:
disable_delivery: true

# Doctrine Configuration
doctrine:
dbal:
Expand Down
27 changes: 15 additions & 12 deletions app/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="bootstrap.php.cache"
>
<!-- 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>
Expand All @@ -22,7 +24,7 @@
<php>
<server name="KERNEL_DIR" value="/path/to/your/app/" />
</php>
//-->
-->

<filter>
<whitelist>
Expand All @@ -35,4 +37,5 @@
</exclude>
</whitelist>
</filter>

</phpunit>
13 changes: 0 additions & 13 deletions bin/2.0.0BETA2.deps

This file was deleted.

13 changes: 0 additions & 13 deletions bin/2.0.0BETA4.deps

This file was deleted.

12 changes: 5 additions & 7 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

DIR=`php -r "echo realpath(dirname(\\$_SERVER['argv'][0]));"`
cd $DIR
VERSION=`cat VERSION`
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.php
$DIR/bin/build_bootstrap
$DIR/app/console assets:install web/

# Without vendors
Expand All @@ -27,7 +27,8 @@ cp -r src /tmp/Symfony/
cp -r web /tmp/Symfony/
cp -r README.rst /tmp/Symfony/
cp -r LICENSE /tmp/Symfony/
cp -r VERSION /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
Expand Down Expand Up @@ -56,9 +57,6 @@ fi

cp -r $DIR/vendor/* $TARGET/

# Assetic
cd $TARGET/assetic && rm -rf phpunit.xml* README* tests

# Doctrine ORM
cd $TARGET/doctrine && rm -rf UPGRADE* build* bin tests tools lib/vendor

Expand Down Expand Up @@ -96,4 +94,4 @@ 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
zip -rq $DIR/build/Symfony_Standard_Vendors_$VERSION.zip Symfony
2 changes: 1 addition & 1 deletion bin/build_bootstrap.php → bin/build_bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@
'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));
file_put_contents($file, "<?php\n\nnamespace { require_once __DIR__.'/autoload.php'; }\n\n".substr(file_get_contents($file), 5));
16 changes: 0 additions & 16 deletions bin/deps

This file was deleted.

107 changes: 107 additions & 0 deletions bin/vendors
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env php
<?php

/*
* This file is part of the Symfony Standard Edition.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$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 deps or deps.lock (recommended)
update: update vendors to their latest versions (as specified in deps)
EOF
);
}

if (!in_array($command = array_shift($argv), array('install', 'update'))) {
exit(sprintf("Command \"%s\" does not exist.\n", $command));
}

if (!is_dir($vendorDir)) {
mkdir($vendorDir, 0777, true);
}

// versions
$versions = array();
if ('install' === $command && file_exists($rootDir.'/deps.lock')) {
foreach (file($rootDir.'/deps.lock', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) {
$parts = array_values(array_filter(explode(' ', $line)));
if (2 !== count($parts)) {
exit(sprintf('The deps version file is not valid (near "%s")', $line));
}
$versions[$parts[0]] = $parts[1];
}
}

$newversions = array();
$deps = parse_ini_file($rootDir.'/deps', true, INI_SCANNER_RAW);
foreach ($deps as $name => $dep) {
// revision
if (isset($versions[$name])) {
$rev = $versions[$name];
} else {
$rev = isset($dep['version']) ? $dep['version'] : 'origin/HEAD';
}

// install dir
$installDir = isset($dep['target']) ? $vendorDir.'/'.$dep['target'] : $vendorDir.'/'.$name;
if (in_array('--reinstall', $argv)) {
if (PHP_OS == 'WINNT') {
system(sprintf('rmdir /S /Q %s', escapeshellarg(realpath($installDir))));
} else {
system(sprintf('rm -rf %s', escapeshellarg($installDir)));
}
}

echo "> Installing/Updating $name\n";

// url
if (!isset($dep['git'])) {
exit(sprintf('The "git" value for the "%s" dependency must be set.', $name));
}
$url = $dep['git'];

if (!is_dir($installDir)) {
system(sprintf('git clone %s %s', escapeshellarg($url), escapeshellarg($installDir)));
}

system(sprintf('cd %s && git fetch origin && git reset --hard %s', escapeshellarg($installDir), escapeshellarg($rev)));

if ('update' === $command) {
ob_start();
system(sprintf('cd %s && git log -n 1 --format=%%H', escapeshellarg($installDir)));
$newversions[] = trim($name.' '.ob_get_clean());
}
}

// update?
if ('update' === $command) {
file_put_contents($rootDir.'/deps.lock', implode("\n", $newversions));
}

// php on windows can't use the shebang line from system()
$interpreter = PHP_OS == 'WINNT' ? 'php.exe' : '';

// 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')));
Loading

0 comments on commit f391637

Please sign in to comment.