Updated to Symfony 2.1 BETA3

This commit is contained in:
Polonkai Gergely
2012-07-16 21:40:19 +02:00
parent 7a06301624
commit 9d0d2ce524
1551 changed files with 157774 additions and 5177 deletions

View File

@@ -429,11 +429,11 @@ class SymfonyRequirements extends RequirementCollection
);
if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
$this->addRequirement(
(in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())),
sprintf('Default timezone is deprecated (%s)', date_default_timezone_get()),
'Fix your <strong>php.ini</strong> file (list of deprecated timezones http://us.php.net/manual/en/timezones.others.php).'
);
$this->addRequirement(
(in_array(date_default_timezone_get(), DateTimeZone::listIdentifiers())),
sprintf('Default timezone "%s" is not supported by your installation of PHP', date_default_timezone_get()),
'Fix your <strong>php.ini</strong> file (check for typos and have a look at the list of deprecated timezones http://php.net/manual/en/timezones.others.php).'
);
}
$this->addRequirement(
@@ -492,6 +492,12 @@ class SymfonyRequirements extends RequirementCollection
/* optional recommendations follow */
$this->addRecommendation(
version_compare($installedPhpVersion, '5.3.4', '>='),
sprintf('Your project might not work properly ("Notice: Trying to get property of non-object") due to the PHP bug #52083 before PHP 5.3.4 (%s installed)', $installedPhpVersion),
'Install PHP 5.3.4 or newer'
);
$this->addRecommendation(
version_compare($installedPhpVersion, '5.3.8', '>='),
sprintf('Annotations might not work properly due to the PHP bug #55156 before PHP 5.3.8 (%s installed)', $installedPhpVersion),

View File

@@ -13,7 +13,7 @@ namespace Symfony\Component\DependencyInjection
interface ContainerAwareInterface
{
function setContainer(ContainerInterface $container = null);
public function setContainer(ContainerInterface $container = null);
}
}
@@ -35,37 +35,37 @@ interface ContainerInterface
const SCOPE_PROTOTYPE = 'prototype';
function set($id, $service, $scope = self::SCOPE_CONTAINER);
public function set($id, $service, $scope = self::SCOPE_CONTAINER);
function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
function has($id);
public function has($id);
function getParameter($name);
public function getParameter($name);
function hasParameter($name);
public function hasParameter($name);
function setParameter($name, $value);
public function setParameter($name, $value);
function enterScope($name);
public function enterScope($name);
function leaveScope($name);
public function leaveScope($name);
function addScope(ScopeInterface $scope);
public function addScope(ScopeInterface $scope);
function hasScope($name);
public function hasScope($name);
function isScopeActive($name);
public function isScopeActive($name);
}
}
@@ -79,7 +79,7 @@ namespace Symfony\Component\DependencyInjection
interface IntrospectableContainerInterface extends ContainerInterface
{
function initialized($id);
public function initialized($id);
}
}
@@ -340,13 +340,13 @@ class Container implements IntrospectableContainerInterface
}
static public function camelize($id)
public static function camelize($id)
{
return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);
}
static public function underscore($id)
public static function underscore($id)
{
return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.')));
}
@@ -356,23 +356,6 @@ class Container implements IntrospectableContainerInterface
namespace Symfony\Component\HttpKernel
{
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
interface TerminableInterface
{
function terminate(Request $request, Response $response);
}
}
namespace Symfony\Component\HttpKernel
{
@@ -386,7 +369,7 @@ interface HttpKernelInterface
const SUB_REQUEST = 2;
function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
}
}
@@ -405,55 +388,72 @@ use Symfony\Component\Config\Loader\LoaderInterface;
interface KernelInterface extends HttpKernelInterface, \Serializable
{
function registerBundles();
public function registerBundles();
function registerContainerConfiguration(LoaderInterface $loader);
public function registerContainerConfiguration(LoaderInterface $loader);
function boot();
public function boot();
function shutdown();
public function shutdown();
function getBundles();
public function getBundles();
function isClassInActiveBundle($class);
public function isClassInActiveBundle($class);
function getBundle($name, $first = true);
public function getBundle($name, $first = true);
function locateResource($name, $dir = null, $first = true);
public function locateResource($name, $dir = null, $first = true);
function getName();
public function getName();
function getEnvironment();
public function getEnvironment();
function isDebug();
public function isDebug();
function getRootDir();
public function getRootDir();
function getContainer();
public function getContainer();
function getStartTime();
public function getStartTime();
function getCacheDir();
public function getCacheDir();
function getLogDir();
public function getLogDir();
function getCharset();
public function getCharset();
}
}
namespace Symfony\Component\HttpKernel
{
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
interface TerminableInterface
{
public function terminate(Request $request, Response $response);
}
}
@@ -502,12 +502,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface
protected $classes;
protected $errorReportingLevel;
const VERSION = '2.1.0-BETA2';
const VERSION = '2.1.0-DEV';
const VERSION_ID = '20100';
const MAJOR_VERSION = '2';
const MINOR_VERSION = '1';
const RELEASE_VERSION = '0';
const EXTRA_VERSION = 'BETA';
const EXTRA_VERSION = 'DEV';
public function __construct($environment, $debug)
@@ -516,7 +516,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
$this->debug = (Boolean) $debug;
$this->booted = false;
$this->rootDir = $this->getRootDir();
$this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
$this->name = $this->getName();
$this->classes = array();
if ($this->debug) {
@@ -706,6 +706,10 @@ abstract class Kernel implements KernelInterface, TerminableInterface
public function getName()
{
if (null === $this->name) {
$this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
}
return $this->name;
}
@@ -975,7 +979,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
}
static public function stripComments($source)
public static function stripComments($source)
{
if (!function_exists('token_get_all')) {
return $source;
@@ -1084,28 +1088,28 @@ use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
interface BundleInterface extends ContainerAwareInterface
{
function boot();
public function boot();
function shutdown();
public function shutdown();
function build(ContainerBuilder $container);
public function build(ContainerBuilder $container);
function getContainerExtension();
public function getContainerExtension();
function getParent();
public function getParent();
function getName();
public function getName();
function getNamespace();
public function getNamespace();
function getPath();
public function getPath();
}
}
@@ -1348,6 +1352,7 @@ namespace Symfony\Component\HttpKernel
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -1450,14 +1455,27 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
$e = $event->getException();
if (!$event->hasResponse()) {
throw $e;
}
$response = $event->getResponse();
if (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) {
if ($e instanceof HttpExceptionInterface) {
$response->setStatusCode($e->getStatusCode());
$response->headers->add($e->getHeaders());
} else {
$response->setStatusCode(500);
}
}
try {
return $this->filterResponse($event->getResponse(), $request, $type);
return $this->filterResponse($response, $request, $type);
} catch (\Exception $e) {
return $event->getResponse();
return $response;
}
}