Merge branch '2.3' into 2.5
* 2.3: Remove aligned '=>' and '=' Break infinite loop while resolving aliases [Security][listener] change priority of switchuser Improved the phpdoc for security token classes bumped Symfony version to 2.3.22 updated VERSION for 2.3.21 update CONTRIBUTORS for 2.3.21 updated CHANGELOG for 2.3.21 Conflicts: src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php src/Symfony/Bridge/Propel1/Form/Type/ModelType.php src/Symfony/Bridge/Propel1/Logger/PropelLogger.php src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php src/Symfony/Component/Console/Descriptor/JsonDescriptor.php src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php src/Symfony/Component/Console/Helper/ProgressHelper.php src/Symfony/Component/Debug/ErrorHandler.php src/Symfony/Component/DependencyInjection/Container.php src/Symfony/Component/Finder/Shell/Command.php src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php src/Symfony/Component/Form/Extension/Core/Type/FormType.php src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php src/Symfony/Component/Form/Extension/Core/Type/NumberType.php src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php src/Symfony/Component/HttpFoundation/File/UploadedFile.php src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php src/Symfony/Component/Routing/Route.php src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php src/Symfony/Component/Templating/PhpEngine.php src/Symfony/Component/Validator/Constraints/ImageValidator.php src/Symfony/Component/Validator/Constraints/TypeValidator.php
This commit is contained in:
commit
b5b12a54f7
@ -7,6 +7,17 @@ in 2.3 minor versions.
|
||||
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
|
||||
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1
|
||||
|
||||
* 2.3.21 (2014-10-24)
|
||||
|
||||
* bug #11696 [Form] Fix #11694 - Enforce options value type check in some form types (kix)
|
||||
* bug #12209 [FrameworkBundle] Fixed ide links (hason)
|
||||
* bug #12208 Add missing argument (WouterJ)
|
||||
* bug #12197 [TwigBundle] do not pass a template reference to twig (Tobion)
|
||||
* bug #12196 [TwigBundle] show correct fallback exception template in debug mode (Tobion)
|
||||
* bug #12187 [CssSelector] don't raise warnings when exception is thrown (xabbuh)
|
||||
* bug #11998 [Intl] Integrated ICU data into Intl component #2 (webmozart)
|
||||
* bug #11920 [Intl] Integrated ICU data into Intl component #1 (webmozart)
|
||||
|
||||
* 2.3.20 (2014-09-28)
|
||||
|
||||
* bug #9453 [Form][DateTime] Propagate invalid_message & invalid_message_parameters to date & time (egeloen)
|
||||
|
@ -8,8 +8,8 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Bernhard Schussek (bschussek)
|
||||
- Victor Berchet (victor)
|
||||
- Jordi Boggiano (seldaek)
|
||||
- Johannes S (johannes)
|
||||
- Tobias Schultze (tobion)
|
||||
- Johannes S (johannes)
|
||||
- Kris Wallsmith (kriswallsmith)
|
||||
- Christophe Coevoet (stof)
|
||||
- Pascal Borreli (pborreli)
|
||||
@ -27,6 +27,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Martin Hasoň (hason)
|
||||
- Eriksen Costa (eriksencosta)
|
||||
- Nicolas Grekas (nicolas-grekas)
|
||||
- Christian Flothmann (xabbuh)
|
||||
- Jonathan Wage (jwage)
|
||||
- Grégoire Pineau (lyrixx)
|
||||
- Alexandre Salomé (alexandresalome)
|
||||
@ -34,7 +35,6 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- ornicar
|
||||
- stealth35 (stealth35)
|
||||
- Alexander Mols (asm89)
|
||||
- Christian Flothmann (xabbuh)
|
||||
- Bulat Shakirzyanov (avalanche123)
|
||||
- Francis Besset (francisbesset)
|
||||
- Saša Stamenković (umpirsky)
|
||||
@ -76,9 +76,9 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Jacob Dreesen (jdreesen)
|
||||
- Florian Voutzinos (florianv)
|
||||
- Adrien Brault (adrienbrault)
|
||||
- Gábor Egyed (1ed)
|
||||
- Fabien Pennequin (fabienpennequin)
|
||||
- Jérôme Tamarelle (gromnan)
|
||||
- Gábor Egyed (1ed)
|
||||
- Michal Piotrowski (eventhorizon)
|
||||
- Gordon Franke (gimler)
|
||||
- Robert Schönthal (digitalkaoz)
|
||||
@ -89,12 +89,14 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Peter Kokot (maastermedia)
|
||||
- David Buchmann (dbu)
|
||||
- Pablo Godel (pgodel)
|
||||
- Eric GELOEN (gelo)
|
||||
- Jérémie Augustin (jaugustin)
|
||||
- Rafael Dohms (rdohms)
|
||||
- Eric GELOEN (gelo)
|
||||
- Jérémy DERUSSÉ (jderusse)
|
||||
- Tigran Azatyan (tigranazatyan)
|
||||
- Javier Eguiluz (javier.eguiluz)
|
||||
- Richard Shank (iampersistent)
|
||||
- Kévin Dunglas (dunglas)
|
||||
- Clemens Tolboom
|
||||
- Helmer Aaviksoo
|
||||
- Sebastiaan Stok (sstok)
|
||||
@ -106,7 +108,6 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Artur Kotyrba
|
||||
- Guilherme Blanco (guilhermeblanco)
|
||||
- Rouven Weßling (realityking)
|
||||
- Jérémy DERUSSÉ (jderusse)
|
||||
- Stefano Sala (stefano.sala)
|
||||
- Dmitrii Chekaliuk (lazyhammer)
|
||||
- Clément JOBEILI (dator)
|
||||
@ -129,7 +130,6 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Pierre Minnieur (pminnieur)
|
||||
- fivestar
|
||||
- Dominique Bongiraud
|
||||
- Kévin Dunglas (dunglas)
|
||||
- Leszek Prabucki (l3l0)
|
||||
- François Zaninotto (fzaninotto)
|
||||
- Dustin Whittle (dustinwhittle)
|
||||
@ -138,7 +138,9 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Sven Paulus (subsven)
|
||||
- Lars Strojny (lstrojny)
|
||||
- Joel Wurtz (brouznouf)
|
||||
- Peter Rehm (rpet)
|
||||
- Rui Marinho (ruimarinho)
|
||||
- Matthias Pigulla (mpdude)
|
||||
- Julien Brochet (mewt)
|
||||
- Tugdual Saunier (tucksaun)
|
||||
- Sergey Linnik (linniksa)
|
||||
@ -156,10 +158,9 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Xavier Perez
|
||||
- Arjen Brouwer (arjenjb)
|
||||
- Katsuhiro OGAWA
|
||||
- Peter Rehm (rpet)
|
||||
- Alif Rachmawadi
|
||||
- Pierre-Yves LEBECQ (pylebecq)
|
||||
- Matthias Pigulla (mpdude)
|
||||
- Eugene Leonovich (rybakit)
|
||||
- Joseph Rouff (rouffj)
|
||||
- Félix Labrecque (woodspire)
|
||||
- GordonsLondon
|
||||
@ -170,6 +171,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Thomas Adam
|
||||
- Albert Casademont (acasademont)
|
||||
- jdhoek
|
||||
- Nikita Konstantinov
|
||||
- Wodor Wodorski
|
||||
- julien pauli (jpauli)
|
||||
- Beau Simensen (simensen)
|
||||
@ -201,12 +203,13 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Adrian Rudnik (kreischweide)
|
||||
- Francesc Rosàs (frosas)
|
||||
- Julien Galenski (ruian)
|
||||
- Eugene Leonovich (rybakit)
|
||||
- Bongiraud Dominique
|
||||
- janschoenherr
|
||||
- Marco Pivetta (ocramius)
|
||||
- Ricard Clau (ricardclau)
|
||||
- Iltar van der Berg
|
||||
- Erin Millard
|
||||
- John Kary (johnkary)
|
||||
- Matthew Lewinski (lewinski)
|
||||
- alquerci
|
||||
- Francesco Levorato
|
||||
@ -234,6 +237,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Loïc Chardonnet (gnusat)
|
||||
- Marek Kalnik (marekkalnik)
|
||||
- Vyacheslav Salakhutdinov (megazoll)
|
||||
- Alex Pott
|
||||
- Tamas Szijarto
|
||||
- Pavel Volokitin (pvolok)
|
||||
- Endre Fejes
|
||||
@ -258,13 +262,10 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Brian King
|
||||
- Michel Salib (michelsalib)
|
||||
- geoffrey
|
||||
- Nikita Konstantinov
|
||||
- Matthieu Auger (matthieuauger)
|
||||
- Jeanmonod David (jeanmonod)
|
||||
- Iltar van der Berg
|
||||
- Jan Schumann
|
||||
- Niklas Fiekas
|
||||
- John Kary (johnkary)
|
||||
- Ruben Gonzalez (rubenrua)
|
||||
- lancergr
|
||||
- Antonio J. García Lagar (ajgarlag)
|
||||
@ -283,6 +284,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Marcin Sikoń (marphi)
|
||||
- franek (franek)
|
||||
- Adam Harvey
|
||||
- Alex Bakhturin
|
||||
- François-Xavier de Guillebon (de-gui_f)
|
||||
- boombatower
|
||||
- Fabrice Bernhard (fabriceb)
|
||||
@ -312,7 +314,6 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- alexpods
|
||||
- Erik Trapman (eriktrapman)
|
||||
- De Cock Xavier (xdecock)
|
||||
- Alex Pott
|
||||
- Norbert Orzechowicz (norzechowicz)
|
||||
- Matthijs van den Bos (matthijs)
|
||||
- Nils Adermann (naderman)
|
||||
@ -385,7 +386,6 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Arturs Vonda
|
||||
- Sascha Grossenbacher
|
||||
- Ben Davies (bendavies)
|
||||
- Alex Bakhturin
|
||||
- Simon Schick (simonsimcity)
|
||||
- redstar504
|
||||
- Hossein Bukhamsin
|
||||
@ -559,6 +559,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Christian Neff
|
||||
- Per Sandström (per)
|
||||
- Goran Juric
|
||||
- Laurent Ghirardotti (laurentg)
|
||||
- Lin Clark
|
||||
- Jeremy David (jeremy.david)
|
||||
- Troy McCabe
|
||||
@ -579,6 +580,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Benjamin Paap (benjaminpaap)
|
||||
- Christian
|
||||
- Sergii Smertin (nfx)
|
||||
- Artur Eshenbrener
|
||||
- Eddie Jaoude
|
||||
- Haritz Iturbe (hizai)
|
||||
- Nerijus Arlauskas (nercury)
|
||||
@ -628,6 +630,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Patrick Landolt (scube)
|
||||
- WybrenKoelmans
|
||||
- Derek Lambert
|
||||
- MightyBranch
|
||||
- Kacper Gunia (cakper)
|
||||
- Felicitus
|
||||
- Krzysztof Przybyszewski
|
||||
@ -672,6 +675,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Marco Jantke
|
||||
- Saem Ghani
|
||||
- Sebastian Utz
|
||||
- Adrien Gallou (agallou)
|
||||
- Karol Sójko (karolsojko)
|
||||
- sl_toto (sl_toto)
|
||||
- Sébastien HOUZÉ
|
||||
@ -814,6 +818,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Andrey Ryaguzov
|
||||
- Manatsawin Hanmongkolchai
|
||||
- Gunther Konig
|
||||
- Maciej Schmidt
|
||||
- flack
|
||||
- František Bereň
|
||||
- Christoph Nissle (derstoffel)
|
||||
@ -860,6 +865,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Daan van Renterghem
|
||||
- Bram Van der Sype (brammm)
|
||||
- Julien Moulin (lizjulien)
|
||||
- Yannick Warnier (ywarnier)
|
||||
- Kevin Decherf
|
||||
- dened
|
||||
- Sam Ward
|
||||
@ -901,6 +907,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Robert Campbell
|
||||
- Matt Lehner
|
||||
- Ruben Kruiswijk
|
||||
- Michael J
|
||||
- Alex Pods
|
||||
- timaschew
|
||||
- Ian Phillips
|
||||
@ -1088,6 +1095,7 @@ Symfony2 is the result of the work of many people who made the code better
|
||||
- Moritz Borgmann (mborgmann)
|
||||
- Matt Drollette (mdrollette)
|
||||
- Adam Monsen (meonkeys)
|
||||
- Ala Eddine Khefifi (nayzo)
|
||||
- ollie harridge (ollietb)
|
||||
- Paweł Szczepanek (pauluz)
|
||||
- Christian López Espínola (penyaskito)
|
||||
|
@ -1107,7 +1107,7 @@
|
||||
|
||||
```php
|
||||
$view->vars = array_replace($view->vars, array(
|
||||
'help' => 'A text longer than six characters',
|
||||
'help' => 'A text longer than six characters',
|
||||
'error_class' => 'max_length_error',
|
||||
));
|
||||
```
|
||||
|
@ -59,9 +59,9 @@ class DoctrineDataCollector extends DataCollector
|
||||
}
|
||||
|
||||
$this->data = array(
|
||||
'queries' => $queries,
|
||||
'queries' => $queries,
|
||||
'connections' => $this->connections,
|
||||
'managers' => $this->managers,
|
||||
'managers' => $this->managers,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
foreach (array_keys($container->getParameter('kernel.bundles')) as $bundle) {
|
||||
if (!isset($objectManager['mappings'][$bundle])) {
|
||||
$objectManager['mappings'][$bundle] = array(
|
||||
'mapping' => true,
|
||||
'mapping' => true,
|
||||
'is_bundle' => true,
|
||||
);
|
||||
}
|
||||
@ -65,8 +65,8 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
}
|
||||
|
||||
$mappingConfig = array_replace(array(
|
||||
'dir' => false,
|
||||
'type' => false,
|
||||
'dir' => false,
|
||||
'type' => false,
|
||||
'prefix' => false,
|
||||
), (array) $mappingConfig);
|
||||
|
||||
|
@ -160,13 +160,13 @@ abstract class DoctrineType extends AbstractType
|
||||
};
|
||||
|
||||
$resolver->setDefaults(array(
|
||||
'em' => null,
|
||||
'property' => null,
|
||||
'query_builder' => null,
|
||||
'loader' => $loader,
|
||||
'choices' => null,
|
||||
'choice_list' => $choiceList,
|
||||
'group_by' => null,
|
||||
'em' => null,
|
||||
'property' => null,
|
||||
'query_builder' => null,
|
||||
'loader' => $loader,
|
||||
'choices' => null,
|
||||
'choice_list' => $choiceList,
|
||||
'group_by' => null,
|
||||
));
|
||||
|
||||
$resolver->setRequired(array('class'));
|
||||
|
@ -63,7 +63,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
$sql = 'SELECT class, username, value, lastUsed'
|
||||
.' FROM rememberme_token WHERE series=:series';
|
||||
$paramValues = array('series' => $series);
|
||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
|
||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
if ($row) {
|
||||
@ -85,7 +85,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
{
|
||||
$sql = 'DELETE FROM rememberme_token WHERE series=:series';
|
||||
$paramValues = array('series' => $series);
|
||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||
}
|
||||
|
||||
@ -96,12 +96,12 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
{
|
||||
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
|
||||
.' WHERE series=:series';
|
||||
$paramValues = array('value' => $tokenValue,
|
||||
$paramValues = array('value' => $tokenValue,
|
||||
'lastUsed' => $lastUsed,
|
||||
'series' => $series,);
|
||||
$paramTypes = array('value' => \PDO::PARAM_STR,
|
||||
'series' => $series,);
|
||||
$paramTypes = array('value' => \PDO::PARAM_STR,
|
||||
'lastUsed' => DoctrineType::DATETIME,
|
||||
'series' => \PDO::PARAM_STR,);
|
||||
'series' => \PDO::PARAM_STR,);
|
||||
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||
if ($updated < 1) {
|
||||
throw new TokenNotFoundException('No token found.');
|
||||
@ -116,15 +116,15 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
||||
$sql = 'INSERT INTO rememberme_token'
|
||||
.' (class, username, series, value, lastUsed)'
|
||||
.' VALUES (:class, :username, :series, :value, :lastUsed)';
|
||||
$paramValues = array('class' => $token->getClass(),
|
||||
$paramValues = array('class' => $token->getClass(),
|
||||
'username' => $token->getUsername(),
|
||||
'series' => $token->getSeries(),
|
||||
'value' => $token->getTokenValue(),
|
||||
'series' => $token->getSeries(),
|
||||
'value' => $token->getTokenValue(),
|
||||
'lastUsed' => $token->getLastUsed(),);
|
||||
$paramTypes = array('class' => \PDO::PARAM_STR,
|
||||
$paramTypes = array('class' => \PDO::PARAM_STR,
|
||||
'username' => \PDO::PARAM_STR,
|
||||
'series' => \PDO::PARAM_STR,
|
||||
'value' => \PDO::PARAM_STR,
|
||||
'series' => \PDO::PARAM_STR,
|
||||
'value' => \PDO::PARAM_STR,
|
||||
'lastUsed' => DoctrineType::DATETIME,);
|
||||
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
|
||||
public function testShouldSetContainerOnContainerAwareFixture()
|
||||
{
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||
$loader = new ContainerAwareLoader($container);
|
||||
$fixture = new ContainerAwareFixture();
|
||||
$loader = new ContainerAwareLoader($container);
|
||||
$fixture = new ContainerAwareFixture();
|
||||
|
||||
$loader->addFixture($fixture);
|
||||
|
||||
|
@ -68,7 +68,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
|
||||
;
|
||||
|
||||
$dbalLogger->startQuery('SQL', array(
|
||||
'utf8' => 'foo',
|
||||
'utf8' => 'foo',
|
||||
'nonutf8' => "\x7F\xFF",
|
||||
));
|
||||
}
|
||||
@ -97,7 +97,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$dbalLogger->startQuery('SQL', array(
|
||||
'short' => $shortString,
|
||||
'long' => $longString,
|
||||
'long' => $longString,
|
||||
));
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$dbalLogger->startQuery('SQL', array(
|
||||
'short' => $shortString,
|
||||
'long' => $longString,
|
||||
'long' => $longString,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -30,11 +30,11 @@ class DebugHandler extends TestHandler implements DebugLoggerInterface
|
||||
$records = array();
|
||||
foreach ($this->records as $record) {
|
||||
$records[] = array(
|
||||
'timestamp' => $record['datetime']->getTimestamp(),
|
||||
'message' => $record['message'],
|
||||
'priority' => $record['level'],
|
||||
'timestamp' => $record['datetime']->getTimestamp(),
|
||||
'message' => $record['message'],
|
||||
'priority' => $record['level'],
|
||||
'priorityName' => $record['level_name'],
|
||||
'context' => $record['context'],
|
||||
'context' => $record['context'],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,11 @@ class WebProcessorTest extends \PHPUnit_Framework_TestCase
|
||||
public function testUsesRequestServerData()
|
||||
{
|
||||
$server = array(
|
||||
'REQUEST_URI' => 'A',
|
||||
'REMOTE_ADDR' => 'B',
|
||||
'REQUEST_URI' => 'A',
|
||||
'REMOTE_ADDR' => 'B',
|
||||
'REQUEST_METHOD' => 'C',
|
||||
'SERVER_NAME' => 'D',
|
||||
'HTTP_REFERER' => 'E',
|
||||
'SERVER_NAME' => 'D',
|
||||
'HTTP_REFERER' => 'E',
|
||||
);
|
||||
|
||||
$request = new Request();
|
||||
|
@ -55,8 +55,8 @@ class PropelDataCollector extends DataCollector
|
||||
public function collect(Request $request, Response $response, \Exception $exception = null)
|
||||
{
|
||||
$this->data = array(
|
||||
'queries' => $this->buildQueries(),
|
||||
'querycount' => $this->countQueries(),
|
||||
'queries' => $this->buildQueries(),
|
||||
'querycount' => $this->countQueries(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -118,16 +118,16 @@ class PropelDataCollector extends DataCollector
|
||||
$innerGlue = $this->propelConfiguration->getParameter('debugpdo.logging.innerglue', ': ');
|
||||
|
||||
foreach ($this->logger->getQueries() as $q) {
|
||||
$parts = explode($outerGlue, $q, 4);
|
||||
$parts = explode($outerGlue, $q, 4);
|
||||
|
||||
$times = explode($innerGlue, $parts[0]);
|
||||
$con = explode($innerGlue, $parts[2]);
|
||||
$memories = explode($innerGlue, $parts[1]);
|
||||
$times = explode($innerGlue, $parts[0]);
|
||||
$con = explode($innerGlue, $parts[2]);
|
||||
$memories = explode($innerGlue, $parts[1]);
|
||||
|
||||
$sql = trim($parts[3]);
|
||||
$con = trim($con[1]);
|
||||
$time = trim($times[1]);
|
||||
$memory = trim($memories[1]);
|
||||
$sql = trim($parts[3]);
|
||||
$con = trim($con[1]);
|
||||
$time = trim($times[1]);
|
||||
$memory = trim($memories[1]);
|
||||
|
||||
$queries[] = array('connection' => $con, 'sql' => $sql, 'time' => $time, 'memory' => $memory);
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ namespace Symfony\Bridge\Propel1\Form\ChoiceList;
|
||||
use \ModelCriteria;
|
||||
use \BaseObject;
|
||||
use \Persistent;
|
||||
|
||||
use Symfony\Component\Form\Exception\StringCastException;
|
||||
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
|
||||
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
@ -87,9 +86,9 @@ class ModelChoiceList extends ObjectChoiceList
|
||||
*/
|
||||
public function __construct($class, $labelPath = null, $choices = null, $queryObject = null, $groupPath = null, $preferred = array(), PropertyAccessorInterface $propertyAccessor = null, $useAsIdentifier = null)
|
||||
{
|
||||
$this->class = $class;
|
||||
$this->class = $class;
|
||||
|
||||
$queryClass = $this->class.'Query';
|
||||
$queryClass = $this->class.'Query';
|
||||
if (!class_exists($queryClass)) {
|
||||
if (empty($this->class)) {
|
||||
throw new MissingOptionsException('The "class" parameter is empty, you should provide the model class');
|
||||
@ -97,16 +96,16 @@ class ModelChoiceList extends ObjectChoiceList
|
||||
throw new InvalidOptionsException(sprintf('The query class "%s" is not found, you should provide the FQCN of the model class', $queryClass));
|
||||
}
|
||||
|
||||
$query = new $queryClass();
|
||||
$query = new $queryClass();
|
||||
|
||||
$this->query = $queryObject ?: $query;
|
||||
$this->query = $queryObject ?: $query;
|
||||
if ($useAsIdentifier) {
|
||||
$this->identifier = array( $this->query->getTableMap()->getColumn($useAsIdentifier) );
|
||||
$this->identifier = array( $this->query->getTableMap()->getColumn($useAsIdentifier) );
|
||||
} else {
|
||||
$this->identifier = $this->query->getTableMap()->getPrimaryKeys();
|
||||
$this->identifier = $this->query->getTableMap()->getPrimaryKeys();
|
||||
}
|
||||
|
||||
$this->loaded = is_array($choices) || $choices instanceof \Traversable;
|
||||
$this->loaded = is_array($choices) || $choices instanceof \Traversable;
|
||||
|
||||
if ($preferred instanceof ModelCriteria) {
|
||||
$this->preferredQuery = $preferred->mergeWith($this->query);
|
||||
|
@ -38,22 +38,22 @@ class PropelTypeGuesser implements FormTypeGuesserInterface
|
||||
if ($relation->getType() === \RelationMap::MANY_TO_ONE) {
|
||||
if (strtolower($property) === strtolower($relation->getName())) {
|
||||
return new TypeGuess('model', array(
|
||||
'class' => $relation->getForeignTable()->getClassName(),
|
||||
'class' => $relation->getForeignTable()->getClassName(),
|
||||
'multiple' => false,
|
||||
), Guess::HIGH_CONFIDENCE);
|
||||
}
|
||||
} elseif ($relation->getType() === \RelationMap::ONE_TO_MANY) {
|
||||
if (strtolower($property) === strtolower($relation->getPluralName())) {
|
||||
return new TypeGuess('model', array(
|
||||
'class' => $relation->getForeignTable()->getClassName(),
|
||||
'class' => $relation->getForeignTable()->getClassName(),
|
||||
'multiple' => true,
|
||||
), Guess::HIGH_CONFIDENCE);
|
||||
}
|
||||
} elseif ($relation->getType() === \RelationMap::MANY_TO_MANY) {
|
||||
if (strtolower($property) == strtolower($relation->getPluralName())) {
|
||||
return new TypeGuess('model', array(
|
||||
'class' => $relation->getLocalTable()->getClassName(),
|
||||
'multiple' => true,
|
||||
'class' => $relation->getLocalTable()->getClassName(),
|
||||
'multiple' => true,
|
||||
), Guess::HIGH_CONFIDENCE);
|
||||
}
|
||||
}
|
||||
|
@ -85,17 +85,17 @@ class ModelType extends AbstractType
|
||||
};
|
||||
|
||||
$resolver->setDefaults(array(
|
||||
'template' => 'choice',
|
||||
'multiple' => false,
|
||||
'expanded' => false,
|
||||
'class' => null,
|
||||
'property' => null,
|
||||
'query' => null,
|
||||
'choices' => null,
|
||||
'choice_list' => $choiceList,
|
||||
'group_by' => null,
|
||||
'by_reference' => false,
|
||||
'index_property' => null,
|
||||
'template' => 'choice',
|
||||
'multiple' => false,
|
||||
'expanded' => false,
|
||||
'class' => null,
|
||||
'property' => null,
|
||||
'query' => null,
|
||||
'choices' => null,
|
||||
'choice_list' => $choiceList,
|
||||
'group_by' => null,
|
||||
'by_reference' => false,
|
||||
'index_property' => null,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ class PropelLogger implements \BasicLogger
|
||||
*/
|
||||
public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch = null)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
$this->logger = $logger;
|
||||
$this->stopwatch = $stopwatch;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ class PropelUserProvider implements UserProviderInterface
|
||||
public function loadUserByUsername($username)
|
||||
{
|
||||
$queryClass = $this->queryClass;
|
||||
$query = $queryClass::create();
|
||||
$query = $queryClass::create();
|
||||
|
||||
if (null !== $this->property) {
|
||||
$filter = 'filterBy'.ucfirst($this->property);
|
||||
|
@ -38,10 +38,10 @@ class PropelDataCollectorTest extends Propel1TestCase
|
||||
|
||||
$this->assertEquals(array(
|
||||
array(
|
||||
'sql' => "SET NAMES 'utf8'",
|
||||
'time' => '0.000 sec',
|
||||
'sql' => "SET NAMES 'utf8'",
|
||||
'time' => '0.000 sec',
|
||||
'connection' => 'default',
|
||||
'memory' => '1.4 MB',
|
||||
'memory' => '1.4 MB',
|
||||
),
|
||||
), $c->getQueries());
|
||||
$this->assertEquals(1, $c->getQueryCount());
|
||||
@ -60,22 +60,22 @@ class PropelDataCollectorTest extends Propel1TestCase
|
||||
|
||||
$this->assertEquals(array(
|
||||
array(
|
||||
'sql' => "SET NAMES 'utf8'",
|
||||
'time' => '0.000 sec',
|
||||
'sql' => "SET NAMES 'utf8'",
|
||||
'time' => '0.000 sec',
|
||||
'connection' => 'default',
|
||||
'memory' => '1.4 MB',
|
||||
'memory' => '1.4 MB',
|
||||
),
|
||||
array(
|
||||
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
|
||||
'time' => '0.012 sec',
|
||||
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
|
||||
'time' => '0.012 sec',
|
||||
'connection' => 'default',
|
||||
'memory' => '2.4 MB',
|
||||
'memory' => '2.4 MB',
|
||||
),
|
||||
array(
|
||||
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
|
||||
'time' => '0.012 sec',
|
||||
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
|
||||
'time' => '0.012 sec',
|
||||
'connection' => 'default',
|
||||
'memory' => '2.4 MB',
|
||||
'memory' => '2.4 MB',
|
||||
),
|
||||
), $c->getQueries());
|
||||
$this->assertEquals(3, $c->getQueryCount());
|
||||
|
@ -14,18 +14,18 @@ namespace Symfony\Bridge\Propel1\Tests\Fixtures;
|
||||
class ItemQuery
|
||||
{
|
||||
private $map = array(
|
||||
'id' => \PropelColumnTypes::INTEGER,
|
||||
'value' => \PropelColumnTypes::VARCHAR,
|
||||
'price' => \PropelColumnTypes::FLOAT,
|
||||
'is_active' => \PropelColumnTypes::BOOLEAN,
|
||||
'slug' => \PropelColumnTypes::VARCHAR,
|
||||
'enabled' => \PropelColumnTypes::BOOLEAN_EMU,
|
||||
'updated_at' => \PropelColumnTypes::TIMESTAMP,
|
||||
'id' => \PropelColumnTypes::INTEGER,
|
||||
'value' => \PropelColumnTypes::VARCHAR,
|
||||
'price' => \PropelColumnTypes::FLOAT,
|
||||
'is_active' => \PropelColumnTypes::BOOLEAN,
|
||||
'slug' => \PropelColumnTypes::VARCHAR,
|
||||
'enabled' => \PropelColumnTypes::BOOLEAN_EMU,
|
||||
'updated_at' => \PropelColumnTypes::TIMESTAMP,
|
||||
);
|
||||
|
||||
private $caseInsensitiveMap = array(
|
||||
'isactive' => 'is_active',
|
||||
'updatedat' => 'updated_at',
|
||||
'isactive' => 'is_active',
|
||||
'updatedat' => 'updated_at',
|
||||
);
|
||||
|
||||
public static $result = array();
|
||||
|
@ -87,10 +87,10 @@ class CollectionToArrayTransformerTest extends Propel1TestCase
|
||||
|
||||
public function testReverseTransformWithData()
|
||||
{
|
||||
$inputData = array('foo', 'bar');
|
||||
$inputData = array('foo', 'bar');
|
||||
|
||||
$result = $this->transformer->reverseTransform($inputData);
|
||||
$data = $result->getData();
|
||||
$result = $this->transformer->reverseTransform($inputData);
|
||||
$data = $result->getData();
|
||||
|
||||
$this->assertInstanceOf('\PropelObjectCollection', $result);
|
||||
|
||||
|
@ -40,9 +40,9 @@ class RuntimeInstantiatorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testInstantiateProxy()
|
||||
{
|
||||
$instance = new \stdClass();
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||
$definition = new Definition('stdClass');
|
||||
$instance = new \stdClass();
|
||||
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||
$definition = new Definition('stdClass');
|
||||
$instantiator = function () use ($instance) {
|
||||
return $instance;
|
||||
};
|
||||
|
@ -53,10 +53,10 @@ class MessageDataCollector extends DataCollector
|
||||
// only collect when Swiftmailer has already been initialized
|
||||
if (class_exists('Swift_Mailer', false)) {
|
||||
$logger = $this->container->get('swiftmailer.plugin.messagelogger');
|
||||
$this->data['messages'] = $logger->getMessages();
|
||||
$this->data['messages'] = $logger->getMessages();
|
||||
$this->data['messageCount'] = $logger->countMessages();
|
||||
} else {
|
||||
$this->data['messages'] = array();
|
||||
$this->data['messages'] = array();
|
||||
$this->data['messageCount'] = 0;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ class CodeExtension extends \Twig_Extension
|
||||
$formattedValue = sprintf("<em>object</em>(<abbr title=\"%s\">%s</abbr>)", $item[1], $short);
|
||||
} elseif ('array' === $item[0]) {
|
||||
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
|
||||
} elseif ('string' === $item[0]) {
|
||||
} elseif ('string' === $item[0]) {
|
||||
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->charset));
|
||||
} elseif ('null' === $item[0]) {
|
||||
$formattedValue = '<em>null</em>';
|
||||
|
@ -87,7 +87,7 @@ EOT
|
||||
|
||||
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
|
||||
if (is_dir($originDir = $bundle->getPath().'/Resources/public')) {
|
||||
$targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName()));
|
||||
$targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName()));
|
||||
|
||||
$output->writeln(sprintf('Installing assets for <comment>%s</comment> into <comment>%s</comment>', $bundle->getNamespace(), $targetDir));
|
||||
|
||||
|
@ -55,8 +55,8 @@ EOF
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$realCacheDir = $this->getContainer()->getParameter('kernel.cache_dir');
|
||||
$oldCacheDir = $realCacheDir.'_old';
|
||||
$filesystem = $this->getContainer()->get('filesystem');
|
||||
$oldCacheDir = $realCacheDir.'_old';
|
||||
$filesystem = $this->getContainer()->get('filesystem');
|
||||
|
||||
if (!is_writable($realCacheDir)) {
|
||||
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir));
|
||||
@ -147,7 +147,7 @@ EOF
|
||||
}
|
||||
|
||||
// fix references to cached files with the real cache directory name
|
||||
$search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir));
|
||||
$search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir));
|
||||
$replace = str_replace('\\', '/', $realCacheDir);
|
||||
foreach (Finder::create()->files()->in($warmupDir) as $file) {
|
||||
$content = str_replace($search, $replace, file_get_contents($file));
|
||||
@ -155,7 +155,7 @@ EOF
|
||||
}
|
||||
|
||||
// fix references to kernel/container related classes
|
||||
$search = $tempKernel->getName().ucfirst($tempKernel->getEnvironment());
|
||||
$search = $tempKernel->getName().ucfirst($tempKernel->getEnvironment());
|
||||
$replace = $realKernel->getName().ucfirst($realKernel->getEnvironment());
|
||||
foreach (Finder::create()->files()->name($search.'*')->in($warmupDir) as $file) {
|
||||
$content = str_replace($search, $replace, file_get_contents($file));
|
||||
|
@ -84,9 +84,9 @@ EOF
|
||||
}
|
||||
$this->convertController($route);
|
||||
$helper->describe($output, $route, array(
|
||||
'format' => $input->getOption('format'),
|
||||
'format' => $input->getOption('format'),
|
||||
'raw_text' => $input->getOption('raw'),
|
||||
'name' => $name,
|
||||
'name' => $name,
|
||||
));
|
||||
} else {
|
||||
$routes = $this->getContainer()->get('router')->getRouteCollection();
|
||||
@ -96,8 +96,8 @@ EOF
|
||||
}
|
||||
|
||||
$helper->describe($output, $routes, array(
|
||||
'format' => $input->getOption('format'),
|
||||
'raw_text' => $input->getOption('raw'),
|
||||
'format' => $input->getOption('format'),
|
||||
'raw_text' => $input->getOption('raw'),
|
||||
'show_controllers' => $input->getOption('show-controllers'),
|
||||
));
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ class Configuration implements ConfigurationInterface
|
||||
$organizeUrls = function ($urls) {
|
||||
$urls += array(
|
||||
'http' => array(),
|
||||
'ssl' => array(),
|
||||
'ssl' => array(),
|
||||
);
|
||||
|
||||
foreach ($urls as $i => $url) {
|
||||
|
@ -254,13 +254,13 @@ class FrameworkExtension extends Extension
|
||||
|
||||
// Choose storage class based on the DSN
|
||||
$supported = array(
|
||||
'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage',
|
||||
'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage',
|
||||
'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage',
|
||||
'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage',
|
||||
'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage',
|
||||
'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage',
|
||||
'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage',
|
||||
'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage',
|
||||
'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage',
|
||||
'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage',
|
||||
'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage',
|
||||
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
|
||||
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
|
||||
);
|
||||
list($class, ) = explode(':', $config['dsn'], 2);
|
||||
if (!isset($supported[$class])) {
|
||||
@ -425,9 +425,9 @@ class FrameworkExtension extends Extension
|
||||
|
||||
$links = array(
|
||||
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
|
||||
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
|
||||
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
|
||||
'sublime' => 'subl://open?url=file://%%f&line=%%l',
|
||||
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
|
||||
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
|
||||
'sublime' => 'subl://open?url=file://%%f&line=%%l',
|
||||
);
|
||||
|
||||
$container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide);
|
||||
|
@ -31,12 +31,12 @@ class RedirectableUrlMatcher extends BaseMatcher
|
||||
{
|
||||
return array(
|
||||
'_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction',
|
||||
'path' => $path,
|
||||
'permanent' => true,
|
||||
'scheme' => $scheme,
|
||||
'httpPort' => $this->context->getHttpPort(),
|
||||
'httpsPort' => $this->context->getHttpsPort(),
|
||||
'_route' => $route,
|
||||
'path' => $path,
|
||||
'permanent' => true,
|
||||
'scheme' => $scheme,
|
||||
'httpPort' => $this->context->getHttpPort(),
|
||||
'httpsPort' => $this->context->getHttpsPort(),
|
||||
'_route' => $route,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ class CodeHelper extends Helper
|
||||
$formattedValue = sprintf("<em>object</em>(<abbr title=\"%s\">%s</abbr>)", $item[1], $short);
|
||||
} elseif ('array' === $item[0]) {
|
||||
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
|
||||
} elseif ('string' === $item[0]) {
|
||||
} elseif ('string' === $item[0]) {
|
||||
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset()));
|
||||
} elseif ('null' === $item[0]) {
|
||||
$formattedValue = '<em>null</em>';
|
||||
|
@ -23,11 +23,11 @@ class TemplateReference extends BaseTemplateReference
|
||||
public function __construct($bundle = null, $controller = null, $name = null, $format = null, $engine = null)
|
||||
{
|
||||
$this->parameters = array(
|
||||
'bundle' => $bundle,
|
||||
'bundle' => $bundle,
|
||||
'controller' => $controller,
|
||||
'name' => $name,
|
||||
'format' => $format,
|
||||
'engine' => $engine,
|
||||
'name' => $name,
|
||||
'format' => $format,
|
||||
'engine' => $engine,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class ControllerNameParserTest extends TestCase
|
||||
{
|
||||
$this->loader = new ClassLoader();
|
||||
$this->loader->addPrefixes(array(
|
||||
'TestBundle' => __DIR__.'/../Fixtures',
|
||||
'TestBundle' => __DIR__.'/../Fixtures',
|
||||
'TestApplication' => __DIR__.'/../Fixtures',
|
||||
));
|
||||
$this->loader->register();
|
||||
|
@ -35,7 +35,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
$processor = new Processor();
|
||||
$configuration = new Configuration();
|
||||
$config = $processor->processConfiguration($configuration, array(array(
|
||||
'secret' => 's3cr3t',
|
||||
'secret' => 's3cr3t',
|
||||
'trusted_proxies' => $trustedProxies,
|
||||
)));
|
||||
|
||||
@ -90,53 +90,53 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
return array(
|
||||
'http_method_override' => true,
|
||||
'trusted_proxies' => array(),
|
||||
'ide' => null,
|
||||
'default_locale' => 'en',
|
||||
'form' => array(
|
||||
'trusted_proxies' => array(),
|
||||
'ide' => null,
|
||||
'default_locale' => 'en',
|
||||
'form' => array(
|
||||
'enabled' => false,
|
||||
'csrf_protection' => array(
|
||||
'enabled' => null, // defaults to csrf_protection.enabled
|
||||
'field_name' => null,
|
||||
),
|
||||
),
|
||||
'csrf_protection' => array(
|
||||
'enabled' => false,
|
||||
'csrf_protection' => array(
|
||||
'enabled' => false,
|
||||
'field_name' => '_token',
|
||||
),
|
||||
'esi' => array('enabled' => false),
|
||||
'fragments' => array(
|
||||
'esi' => array('enabled' => false),
|
||||
'fragments' => array(
|
||||
'enabled' => false,
|
||||
'path' => '/_fragment',
|
||||
'path' => '/_fragment',
|
||||
),
|
||||
'profiler' => array(
|
||||
'enabled' => false,
|
||||
'only_exceptions' => false,
|
||||
'profiler' => array(
|
||||
'enabled' => false,
|
||||
'only_exceptions' => false,
|
||||
'only_master_requests' => false,
|
||||
'dsn' => 'file:%kernel.cache_dir%/profiler',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'lifetime' => 86400,
|
||||
'collect' => true,
|
||||
'dsn' => 'file:%kernel.cache_dir%/profiler',
|
||||
'username' => '',
|
||||
'password' => '',
|
||||
'lifetime' => 86400,
|
||||
'collect' => true,
|
||||
),
|
||||
'translator' => array(
|
||||
'enabled' => false,
|
||||
'translator' => array(
|
||||
'enabled' => false,
|
||||
'fallback' => 'en',
|
||||
),
|
||||
'validation' => array(
|
||||
'enabled' => false,
|
||||
'validation' => array(
|
||||
'enabled' => false,
|
||||
'enable_annotations' => false,
|
||||
'static_method' => array('loadValidatorMetadata'),
|
||||
'translation_domain' => 'validators',
|
||||
'strict_email' => false,
|
||||
'api' => version_compare(PHP_VERSION, '5.3.9', '<') ? '2.4' : '2.5-bc',
|
||||
),
|
||||
'annotations' => array(
|
||||
'cache' => 'file',
|
||||
'annotations' => array(
|
||||
'cache' => 'file',
|
||||
'file_cache_dir' => '%kernel.cache_dir%/annotations',
|
||||
'debug' => '%kernel.debug%',
|
||||
'debug' => '%kernel.debug%',
|
||||
),
|
||||
'serializer' => array(
|
||||
'serializer' => array(
|
||||
'enabled' => false,
|
||||
),
|
||||
);
|
||||
|
@ -7,7 +7,7 @@ $container->loadFromExtension('framework', array(
|
||||
'http_method_override' => false,
|
||||
'trusted_proxies' => array('127.0.0.1', '10.0.0.1'),
|
||||
'csrf_protection' => array(
|
||||
'enabled' => true,
|
||||
'enabled' => true,
|
||||
'field_name' => '_csrf',
|
||||
),
|
||||
'esi' => array(
|
||||
@ -18,32 +18,32 @@ $container->loadFromExtension('framework', array(
|
||||
'enabled' => false,
|
||||
),
|
||||
'router' => array(
|
||||
'resource' => '%kernel.root_dir%/config/routing.xml',
|
||||
'type' => 'xml',
|
||||
'resource' => '%kernel.root_dir%/config/routing.xml',
|
||||
'type' => 'xml',
|
||||
),
|
||||
'session' => array(
|
||||
'storage_id' => 'session.storage.native',
|
||||
'handler_id' => 'session.handler.native_file',
|
||||
'name' => '_SYMFONY',
|
||||
'storage_id' => 'session.storage.native',
|
||||
'handler_id' => 'session.handler.native_file',
|
||||
'name' => '_SYMFONY',
|
||||
'cookie_lifetime' => 86400,
|
||||
'cookie_path' => '/',
|
||||
'cookie_domain' => 'example.com',
|
||||
'cookie_secure' => true,
|
||||
'cookie_path' => '/',
|
||||
'cookie_domain' => 'example.com',
|
||||
'cookie_secure' => true,
|
||||
'cookie_httponly' => true,
|
||||
'gc_maxlifetime' => 90000,
|
||||
'gc_divisor' => 108,
|
||||
'gc_probability' => 1,
|
||||
'save_path' => '/path/to/sessions',
|
||||
'gc_maxlifetime' => 90000,
|
||||
'gc_divisor' => 108,
|
||||
'gc_probability' => 1,
|
||||
'save_path' => '/path/to/sessions',
|
||||
),
|
||||
'templating' => array(
|
||||
'assets_version' => 'SomeVersionScheme',
|
||||
'assets_version' => 'SomeVersionScheme',
|
||||
'assets_base_urls' => 'http://cdn.example.com',
|
||||
'cache' => '/path/to/cache',
|
||||
'engines' => array('php', 'twig'),
|
||||
'loader' => array('loader.foo', 'loader.bar'),
|
||||
'packages' => array(
|
||||
'cache' => '/path/to/cache',
|
||||
'engines' => array('php', 'twig'),
|
||||
'loader' => array('loader.foo', 'loader.bar'),
|
||||
'packages' => array(
|
||||
'images' => array(
|
||||
'version' => '1.0.0',
|
||||
'version' => '1.0.0',
|
||||
'base_urls' => array('http://images1.example.com', 'http://images2.example.com'),
|
||||
),
|
||||
'foo' => array(
|
||||
@ -53,18 +53,18 @@ $container->loadFromExtension('framework', array(
|
||||
'base_urls' => array('http://bar1.example.com', 'http://bar2.example.com'),
|
||||
),
|
||||
),
|
||||
'form' => array(
|
||||
'resources' => array('theme1', 'theme2'),
|
||||
'form' => array(
|
||||
'resources' => array('theme1', 'theme2'),
|
||||
),
|
||||
'hinclude_default_template' => 'global_hinclude_template',
|
||||
),
|
||||
'translator' => array(
|
||||
'enabled' => true,
|
||||
'enabled' => true,
|
||||
'fallback' => 'fr',
|
||||
),
|
||||
'validation' => array(
|
||||
'enabled' => true,
|
||||
'cache' => 'apc',
|
||||
'cache' => 'apc',
|
||||
),
|
||||
'annotations' => array(
|
||||
'cache' => 'file',
|
||||
|
@ -4,8 +4,8 @@ $container->loadFromExtension('framework', array(
|
||||
'secret' => 's3cr3t',
|
||||
'templating' => array(
|
||||
'assets_base_urls' => 'https://cdn.example.com',
|
||||
'engines' => array('php', 'twig'),
|
||||
'packages' => array(
|
||||
'engines' => array('php', 'twig'),
|
||||
'packages' => array(
|
||||
'images' => array(
|
||||
'base_urls' => 'https://images.example.com',
|
||||
),
|
||||
|
@ -3,7 +3,7 @@
|
||||
$container->loadFromExtension('framework', array(
|
||||
'secret' => 's3cr3t',
|
||||
'validation' => array(
|
||||
'enabled' => true,
|
||||
'enabled' => true,
|
||||
'enable_annotations' => true,
|
||||
),
|
||||
));
|
||||
|
@ -490,12 +490,12 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
protected function createContainer(array $data = array())
|
||||
{
|
||||
return new ContainerBuilder(new ParameterBag(array_merge(array(
|
||||
'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'),
|
||||
'kernel.cache_dir' => __DIR__,
|
||||
'kernel.debug' => false,
|
||||
'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'),
|
||||
'kernel.cache_dir' => __DIR__,
|
||||
'kernel.debug' => false,
|
||||
'kernel.environment' => 'test',
|
||||
'kernel.name' => 'kernel',
|
||||
'kernel.root_dir' => __DIR__,
|
||||
'kernel.name' => 'kernel',
|
||||
'kernel.root_dir' => __DIR__,
|
||||
), $data)));
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ class SubRequestController extends ContainerAware
|
||||
|
||||
// simulates a failure during the rendering of a fragment...
|
||||
// should render fr/json
|
||||
$content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl));
|
||||
$content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl));
|
||||
|
||||
// ...to check that the FragmentListener still references the right Request
|
||||
// when rendering another fragment after the error occurred
|
||||
|
@ -27,12 +27,12 @@ class RedirectableUrlMatcherTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals(array(
|
||||
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
|
||||
'path' => '/foo/',
|
||||
'permanent' => true,
|
||||
'scheme' => null,
|
||||
'httpPort' => $context->getHttpPort(),
|
||||
'httpsPort' => $context->getHttpsPort(),
|
||||
'_route' => null,
|
||||
'path' => '/foo/',
|
||||
'permanent' => true,
|
||||
'scheme' => null,
|
||||
'httpPort' => $context->getHttpPort(),
|
||||
'httpsPort' => $context->getHttpsPort(),
|
||||
'_route' => null,
|
||||
),
|
||||
$matcher->match('/foo')
|
||||
);
|
||||
@ -47,12 +47,12 @@ class RedirectableUrlMatcherTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals(array(
|
||||
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
|
||||
'path' => '/foo',
|
||||
'permanent' => true,
|
||||
'scheme' => 'https',
|
||||
'httpPort' => $context->getHttpPort(),
|
||||
'httpsPort' => $context->getHttpsPort(),
|
||||
'_route' => 'foo',
|
||||
'path' => '/foo',
|
||||
'permanent' => true,
|
||||
'scheme' => 'https',
|
||||
'httpPort' => $context->getHttpPort(),
|
||||
'httpsPort' => $context->getHttpsPort(),
|
||||
'_route' => 'foo',
|
||||
),
|
||||
$matcher->match('/foo')
|
||||
);
|
||||
|
@ -47,11 +47,11 @@ class RouterTest extends \PHPUnit_Framework_TestCase
|
||||
$routes->add('foo', new Route(
|
||||
'/foo',
|
||||
array(
|
||||
'foo' => 'before_%parameter.foo%',
|
||||
'bar' => '%parameter.bar%_after',
|
||||
'baz' => '%%escaped%%',
|
||||
'boo' => array('%parameter%', '%%escaped_parameter%%', array('%bee_parameter%', 'bee')),
|
||||
'bee' => array('bee', 'bee'),
|
||||
'foo' => 'before_%parameter.foo%',
|
||||
'bar' => '%parameter.bar%_after',
|
||||
'baz' => '%%escaped%%',
|
||||
'boo' => array('%parameter%', '%%escaped_parameter%%', array('%bee_parameter%', 'bee')),
|
||||
'bee' => array('bee', 'bee'),
|
||||
),
|
||||
array(
|
||||
)
|
||||
@ -88,9 +88,9 @@ class RouterTest extends \PHPUnit_Framework_TestCase
|
||||
array(
|
||||
),
|
||||
array(
|
||||
'foo' => 'before_%parameter.foo%',
|
||||
'bar' => '%parameter.bar%_after',
|
||||
'baz' => '%%escaped%%',
|
||||
'foo' => 'before_%parameter.foo%',
|
||||
'bar' => '%parameter.bar%_after',
|
||||
'baz' => '%%escaped%%',
|
||||
)
|
||||
));
|
||||
|
||||
|
@ -199,8 +199,8 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
|
||||
->expects($this->at(1))
|
||||
->method('load')
|
||||
->will($this->returnValue($this->getCatalogue('en', array(
|
||||
'foo' => 'foo (EN)',
|
||||
'bar' => 'bar (EN)',
|
||||
'foo' => 'foo (EN)',
|
||||
'bar' => 'bar (EN)',
|
||||
'choice' => '{0} choice 0 (EN)|{1} choice 1 (EN)|]1,Inf] choice inf (EN)',
|
||||
))))
|
||||
;
|
||||
|
@ -51,13 +51,13 @@ class PhpStringTokenParser
|
||||
{
|
||||
protected static $replacements = array(
|
||||
'\\' => '\\',
|
||||
'$' => '$',
|
||||
'n' => "\n",
|
||||
'r' => "\r",
|
||||
't' => "\t",
|
||||
'f' => "\f",
|
||||
'v' => "\v",
|
||||
'e' => "\x1B",
|
||||
'$' => '$',
|
||||
'n' => "\n",
|
||||
'r' => "\r",
|
||||
't' => "\t",
|
||||
'f' => "\f",
|
||||
'v' => "\v",
|
||||
'e' => "\x1B",
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -37,27 +37,27 @@ class SecurityDataCollector extends DataCollector
|
||||
{
|
||||
if (null === $this->context) {
|
||||
$this->data = array(
|
||||
'enabled' => false,
|
||||
'enabled' => false,
|
||||
'authenticated' => false,
|
||||
'token_class' => null,
|
||||
'user' => '',
|
||||
'roles' => array(),
|
||||
'token_class' => null,
|
||||
'user' => '',
|
||||
'roles' => array(),
|
||||
);
|
||||
} elseif (null === $token = $this->context->getToken()) {
|
||||
$this->data = array(
|
||||
'enabled' => true,
|
||||
'enabled' => true,
|
||||
'authenticated' => false,
|
||||
'token_class' => null,
|
||||
'user' => '',
|
||||
'roles' => array(),
|
||||
'token_class' => null,
|
||||
'user' => '',
|
||||
'roles' => array(),
|
||||
);
|
||||
} else {
|
||||
$this->data = array(
|
||||
'enabled' => true,
|
||||
'enabled' => true,
|
||||
'authenticated' => $token->isAuthenticated(),
|
||||
'token_class' => get_class($token),
|
||||
'user' => $token->getUsername(),
|
||||
'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
|
||||
'token_class' => get_class($token),
|
||||
'user' => $token->getUsername(),
|
||||
'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -27,24 +27,24 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
abstract class AbstractFactory implements SecurityFactoryInterface
|
||||
{
|
||||
protected $options = array(
|
||||
'check_path' => '/login_check',
|
||||
'use_forward' => false,
|
||||
'require_previous_session' => true,
|
||||
'check_path' => '/login_check',
|
||||
'use_forward' => false,
|
||||
'require_previous_session' => true,
|
||||
);
|
||||
|
||||
protected $defaultSuccessHandlerOptions = array(
|
||||
'always_use_default_target_path' => false,
|
||||
'default_target_path' => '/',
|
||||
'login_path' => '/login',
|
||||
'target_path_parameter' => '_target_path',
|
||||
'use_referer' => false,
|
||||
'default_target_path' => '/',
|
||||
'login_path' => '/login',
|
||||
'target_path_parameter' => '_target_path',
|
||||
'use_referer' => false,
|
||||
);
|
||||
|
||||
protected $defaultFailureHandlerOptions = array(
|
||||
'failure_path' => null,
|
||||
'failure_forward' => false,
|
||||
'login_path' => '/login',
|
||||
'failure_path_parameter' => '_failure_path',
|
||||
'failure_path' => null,
|
||||
'failure_forward' => false,
|
||||
'login_path' => '/login',
|
||||
'failure_path_parameter' => '_failure_path',
|
||||
);
|
||||
|
||||
public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId)
|
||||
|
@ -143,8 +143,8 @@ class SecurityExtension extends Extension
|
||||
->getDefinition('security.acl.dbal.schema_listener')
|
||||
->addTag('doctrine.event_listener', array(
|
||||
'connection' => $config['connection'],
|
||||
'event' => 'postGenerateSchema',
|
||||
'lazy' => true,
|
||||
'event' => 'postGenerateSchema',
|
||||
'lazy' => true,
|
||||
))
|
||||
;
|
||||
|
||||
@ -297,8 +297,8 @@ class SecurityExtension extends Extension
|
||||
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.logout_listener'));
|
||||
$listener->replaceArgument(3, array(
|
||||
'csrf_parameter' => $firewall['logout']['csrf_parameter'],
|
||||
'intention' => $firewall['logout']['csrf_token_id'],
|
||||
'logout_path' => $firewall['logout']['path'],
|
||||
'intention' => $firewall['logout']['csrf_token_id'],
|
||||
'logout_path' => $firewall['logout']['path'],
|
||||
));
|
||||
$listeners[] = new Reference($listenerId);
|
||||
|
||||
@ -354,14 +354,14 @@ class SecurityExtension extends Extension
|
||||
|
||||
$listeners = array_merge($listeners, $authListeners);
|
||||
|
||||
// Access listener
|
||||
$listeners[] = new Reference('security.access_listener');
|
||||
|
||||
// Switch user listener
|
||||
if (isset($firewall['switch_user'])) {
|
||||
$listeners[] = new Reference($this->createSwitchUserListener($container, $id, $firewall['switch_user'], $defaultProvider));
|
||||
}
|
||||
|
||||
// Access listener
|
||||
$listeners[] = new Reference('security.access_listener');
|
||||
|
||||
// Determine default entry point
|
||||
if (isset($firewall['entry_point'])) {
|
||||
$defaultEntryPoint = $firewall['entry_point'];
|
||||
@ -468,7 +468,7 @@ class SecurityExtension extends Extension
|
||||
// pbkdf2 encoder
|
||||
if ('pbkdf2' === $config['algorithm']) {
|
||||
return array(
|
||||
'class' => new Parameter('security.encoder.pbkdf2.class'),
|
||||
'class' => new Parameter('security.encoder.pbkdf2.class'),
|
||||
'arguments' => array(
|
||||
$config['hash_algorithm'],
|
||||
$config['encode_as_base64'],
|
||||
@ -481,14 +481,14 @@ class SecurityExtension extends Extension
|
||||
// bcrypt encoder
|
||||
if ('bcrypt' === $config['algorithm']) {
|
||||
return array(
|
||||
'class' => new Parameter('security.encoder.bcrypt.class'),
|
||||
'class' => new Parameter('security.encoder.bcrypt.class'),
|
||||
'arguments' => array($config['cost']),
|
||||
);
|
||||
}
|
||||
|
||||
// message digest encoder
|
||||
return array(
|
||||
'class' => new Parameter('security.encoder.digest.class'),
|
||||
'class' => new Parameter('security.encoder.digest.class'),
|
||||
'arguments' => array(
|
||||
$config['algorithm'],
|
||||
$config['encode_as_base64'],
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Parameter;
|
||||
use Symfony\Bundle\SecurityBundle\SecurityBundle;
|
||||
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
|
||||
@ -26,9 +25,9 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$container = $this->getContainer('container1');
|
||||
$this->assertEquals(array(
|
||||
'ROLE_ADMIN' => array('ROLE_USER'),
|
||||
'ROLE_ADMIN' => array('ROLE_USER'),
|
||||
'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'),
|
||||
'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'),
|
||||
'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'),
|
||||
), $container->getParameter('security.role_hierarchy.roles'));
|
||||
}
|
||||
|
||||
@ -82,8 +81,8 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
'security.authentication.listener.basic.secure',
|
||||
'security.authentication.listener.digest.secure',
|
||||
'security.authentication.listener.anonymous.secure',
|
||||
'security.access_listener',
|
||||
'security.authentication.switchuser_listener.secure',
|
||||
'security.access_listener',
|
||||
),
|
||||
array(
|
||||
'security.channel_listener',
|
||||
|
@ -36,7 +36,7 @@ class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
'index_5' => new Reference('qux'),
|
||||
'index_6' => new Reference('bar'),
|
||||
'index_7' => array(
|
||||
'use_forward' => true,
|
||||
'use_forward' => true,
|
||||
),
|
||||
), $definition->getArguments());
|
||||
|
||||
|
@ -22,7 +22,7 @@ class LoginController extends ContainerAware
|
||||
$form = $this->container->get('form.factory')->create('user_login');
|
||||
|
||||
return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:login.html.twig', array(
|
||||
'form' => $form->createView(),
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class LocalizedController extends ContainerAware
|
||||
return $this->container->get('templating')->renderResponse('FormLoginBundle:Localized:login.html.twig', array(
|
||||
// last username entered by the user
|
||||
'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),
|
||||
'error' => $error,
|
||||
'error' => $error,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class LoginController extends ContainerAware
|
||||
return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:login.html.twig', array(
|
||||
// last username entered by the user
|
||||
'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),
|
||||
'error' => $error,
|
||||
'error' => $error,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ class SwitchUserTest extends WebTestCase
|
||||
public function getTestParameters()
|
||||
{
|
||||
return array(
|
||||
'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403),
|
||||
'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200),
|
||||
'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403),
|
||||
'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200),
|
||||
'authorized_user_cannot_switch_to_non_existent' => array('user_can_switch', 'user_does_not_exist', 'user_can_switch', 500),
|
||||
'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200),
|
||||
'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,10 @@ class ExceptionController
|
||||
return new Response($this->twig->render(
|
||||
(string) $this->findTemplate($request, $request->getRequestFormat(), $code, $this->debug),
|
||||
array(
|
||||
'status_code' => $code,
|
||||
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',
|
||||
'exception' => $exception,
|
||||
'logger' => $logger,
|
||||
'status_code' => $code,
|
||||
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',
|
||||
'exception' => $exception,
|
||||
'logger' => $logger,
|
||||
'currentContent' => $currentContent,
|
||||
)
|
||||
));
|
||||
|
@ -41,7 +41,7 @@ class TwigExtension extends Extension
|
||||
foreach ($config['globals'] as $name => $value) {
|
||||
if (is_array($value) && isset($value['key'])) {
|
||||
$config['globals'][$name] = array(
|
||||
'key' => $name,
|
||||
'key' => $name,
|
||||
'value' => $config['globals'][$name],
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$container->loadFromExtension('twig', array(
|
||||
'autoescape_service' => 'my_project.some_bundle.template_escaping_guesser',
|
||||
'autoescape_service' => 'my_project.some_bundle.template_escaping_guesser',
|
||||
'autoescape_service_method' => 'guess',
|
||||
));
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
$container->loadFromExtension('twig', array(
|
||||
'paths' => array(
|
||||
'paths' => array(
|
||||
'namespaced_path3' => 'namespace3',
|
||||
),
|
||||
));
|
||||
|
@ -9,17 +9,17 @@ $container->loadFromExtension('twig', array(
|
||||
'globals' => array(
|
||||
'foo' => '@bar',
|
||||
'baz' => '@@qux',
|
||||
'pi' => 3.14,
|
||||
'pi' => 3.14,
|
||||
'bad' => array('key' => 'foo'),
|
||||
),
|
||||
'auto_reload' => true,
|
||||
'autoescape' => true,
|
||||
'auto_reload' => true,
|
||||
'autoescape' => true,
|
||||
'base_template_class' => 'stdClass',
|
||||
'cache' => '/tmp',
|
||||
'charset' => 'ISO-8859-1',
|
||||
'debug' => true,
|
||||
'strict_variables' => true,
|
||||
'paths' => array(
|
||||
'cache' => '/tmp',
|
||||
'charset' => 'ISO-8859-1',
|
||||
'debug' => true,
|
||||
'strict_variables' => true,
|
||||
'paths' => array(
|
||||
'path1',
|
||||
'path2',
|
||||
'namespaced_path1' => 'namespace1',
|
||||
|
@ -114,14 +114,14 @@ class TwigExtensionTest extends TestCase
|
||||
public function testGlobalsWithDifferentTypesAndValues()
|
||||
{
|
||||
$globals = array(
|
||||
'array' => array(),
|
||||
'false' => false,
|
||||
'float' => 2.0,
|
||||
'array' => array(),
|
||||
'false' => false,
|
||||
'float' => 2.0,
|
||||
'integer' => 3,
|
||||
'null' => null,
|
||||
'object' => new \stdClass(),
|
||||
'string' => 'foo',
|
||||
'true' => true,
|
||||
'null' => null,
|
||||
'object' => new \stdClass(),
|
||||
'string' => 'foo',
|
||||
'true' => true,
|
||||
);
|
||||
|
||||
$container = $this->createContainer();
|
||||
@ -183,10 +183,10 @@ class TwigExtensionTest extends TestCase
|
||||
{
|
||||
$container = new ContainerBuilder(new ParameterBag(array(
|
||||
'kernel.cache_dir' => __DIR__,
|
||||
'kernel.root_dir' => __DIR__.'/Fixtures',
|
||||
'kernel.charset' => 'UTF-8',
|
||||
'kernel.debug' => false,
|
||||
'kernel.bundles' => array('TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle'),
|
||||
'kernel.root_dir' => __DIR__.'/Fixtures',
|
||||
'kernel.charset' => 'UTF-8',
|
||||
'kernel.debug' => false,
|
||||
'kernel.bundles' => array('TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle'),
|
||||
)));
|
||||
|
||||
return $container;
|
||||
|
@ -65,10 +65,10 @@ class ExceptionController
|
||||
return new Response($this->twig->render(
|
||||
$template,
|
||||
array(
|
||||
'status_code' => $code,
|
||||
'status_text' => Response::$statusTexts[$code],
|
||||
'exception' => $exception,
|
||||
'logger' => null,
|
||||
'status_code' => $code,
|
||||
'status_text' => Response::$statusTexts[$code],
|
||||
'exception' => $exception,
|
||||
'logger' => null,
|
||||
'currentContent' => '',
|
||||
)
|
||||
), 200, array('Content-Type' => 'text/html'));
|
||||
|
@ -100,14 +100,14 @@ class ProfilerController
|
||||
}
|
||||
|
||||
return new Response($this->twig->render($this->getTemplateManager()->getName($profile, $panel), array(
|
||||
'token' => $token,
|
||||
'profile' => $profile,
|
||||
'token' => $token,
|
||||
'profile' => $profile,
|
||||
'collector' => $profile->getCollector($panel),
|
||||
'panel' => $panel,
|
||||
'page' => $page,
|
||||
'request' => $request,
|
||||
'panel' => $panel,
|
||||
'page' => $page,
|
||||
'request' => $request,
|
||||
'templates' => $this->getTemplateManager()->getTemplates($profile),
|
||||
'is_ajax' => $request->isXmlHttpRequest(),
|
||||
'is_ajax' => $request->isXmlHttpRequest(),
|
||||
)), 200, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
|
||||
@ -198,11 +198,11 @@ class ProfilerController
|
||||
}
|
||||
|
||||
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
|
||||
'position' => $position,
|
||||
'profile' => $profile,
|
||||
'templates' => $this->getTemplateManager()->getTemplates($profile),
|
||||
'position' => $position,
|
||||
'profile' => $profile,
|
||||
'templates' => $this->getTemplateManager()->getTemplates($profile),
|
||||
'profiler_url' => $url,
|
||||
'token' => $token,
|
||||
'token' => $token,
|
||||
)), 200, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
|
||||
@ -224,31 +224,31 @@ class ProfilerController
|
||||
$this->profiler->disable();
|
||||
|
||||
if (null === $session = $request->getSession()) {
|
||||
$ip =
|
||||
$ip =
|
||||
$method =
|
||||
$url =
|
||||
$start =
|
||||
$end =
|
||||
$limit =
|
||||
$token = null;
|
||||
$url =
|
||||
$start =
|
||||
$end =
|
||||
$limit =
|
||||
$token = null;
|
||||
} else {
|
||||
$ip = $session->get('_profiler_search_ip');
|
||||
$ip = $session->get('_profiler_search_ip');
|
||||
$method = $session->get('_profiler_search_method');
|
||||
$url = $session->get('_profiler_search_url');
|
||||
$start = $session->get('_profiler_search_start');
|
||||
$end = $session->get('_profiler_search_end');
|
||||
$limit = $session->get('_profiler_search_limit');
|
||||
$token = $session->get('_profiler_search_token');
|
||||
$url = $session->get('_profiler_search_url');
|
||||
$start = $session->get('_profiler_search_start');
|
||||
$end = $session->get('_profiler_search_end');
|
||||
$limit = $session->get('_profiler_search_limit');
|
||||
$token = $session->get('_profiler_search_token');
|
||||
}
|
||||
|
||||
return new Response($this->twig->render('@WebProfiler/Profiler/search.html.twig', array(
|
||||
'token' => $token,
|
||||
'ip' => $ip,
|
||||
'token' => $token,
|
||||
'ip' => $ip,
|
||||
'method' => $method,
|
||||
'url' => $url,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'limit' => $limit,
|
||||
'url' => $url,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'limit' => $limit,
|
||||
)), 200, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
|
||||
@ -272,24 +272,24 @@ class ProfilerController
|
||||
|
||||
$profile = $this->profiler->loadProfile($token);
|
||||
|
||||
$ip = $request->query->get('ip');
|
||||
$ip = $request->query->get('ip');
|
||||
$method = $request->query->get('method');
|
||||
$url = $request->query->get('url');
|
||||
$start = $request->query->get('start', null);
|
||||
$end = $request->query->get('end', null);
|
||||
$limit = $request->query->get('limit');
|
||||
$url = $request->query->get('url');
|
||||
$start = $request->query->get('start', null);
|
||||
$end = $request->query->get('end', null);
|
||||
$limit = $request->query->get('limit');
|
||||
|
||||
return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
|
||||
'token' => $token,
|
||||
'profile' => $profile,
|
||||
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
|
||||
'ip' => $ip,
|
||||
'method' => $method,
|
||||
'url' => $url,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'limit' => $limit,
|
||||
'panel' => null,
|
||||
'token' => $token,
|
||||
'profile' => $profile,
|
||||
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
|
||||
'ip' => $ip,
|
||||
'method' => $method,
|
||||
'url' => $url,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'limit' => $limit,
|
||||
'panel' => null,
|
||||
)), 200, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
|
||||
@ -310,13 +310,13 @@ class ProfilerController
|
||||
|
||||
$this->profiler->disable();
|
||||
|
||||
$ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
|
||||
$ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
|
||||
$method = $request->query->get('method');
|
||||
$url = $request->query->get('url');
|
||||
$start = $request->query->get('start', null);
|
||||
$end = $request->query->get('end', null);
|
||||
$limit = $request->query->get('limit');
|
||||
$token = $request->query->get('token');
|
||||
$url = $request->query->get('url');
|
||||
$start = $request->query->get('start', null);
|
||||
$end = $request->query->get('end', null);
|
||||
$limit = $request->query->get('limit');
|
||||
$token = $request->query->get('token');
|
||||
|
||||
if (null !== $session = $request->getSession()) {
|
||||
$session->set('_profiler_search_ip', $ip);
|
||||
@ -335,13 +335,13 @@ class ProfilerController
|
||||
$tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end);
|
||||
|
||||
return new RedirectResponse($this->generator->generate('_profiler_search_results', array(
|
||||
'token' => $tokens ? $tokens[0]['token'] : 'empty',
|
||||
'ip' => $ip,
|
||||
'token' => $tokens ? $tokens[0]['token'] : 'empty',
|
||||
'ip' => $ip,
|
||||
'method' => $method,
|
||||
'url' => $url,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'limit' => $limit,
|
||||
'url' => $url,
|
||||
'start' => $start,
|
||||
'end' => $end,
|
||||
'limit' => $limit,
|
||||
)), 302, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
|
||||
|
@ -74,8 +74,8 @@ class RouterController
|
||||
|
||||
return new Response($this->twig->render('@WebProfiler/Router/panel.html.twig', array(
|
||||
'request' => $request,
|
||||
'router' => $profile->getCollector('router'),
|
||||
'traces' => $matcher->getTraces($request->getPathInfo()),
|
||||
'router' => $profile->getCollector('router'),
|
||||
'traces' => $matcher->getTraces($request->getPathInfo()),
|
||||
)), 200, array('Content-Type' => 'text/html'));
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
class WebDebugToolbarListener implements EventSubscriberInterface
|
||||
{
|
||||
const DISABLED = 1;
|
||||
const ENABLED = 2;
|
||||
const ENABLED = 2;
|
||||
|
||||
protected $twig;
|
||||
protected $urlGenerator;
|
||||
|
@ -133,10 +133,10 @@
|
||||
function CanvasManager(requests, maxRequestTime) {
|
||||
"use strict";
|
||||
|
||||
var _drawingColors = {{ colors|json_encode|raw }},
|
||||
_storagePrefix = 'timeline/',
|
||||
_threshold = 1,
|
||||
_requests = requests,
|
||||
var _drawingColors = {{ colors|json_encode|raw }},
|
||||
_storagePrefix = 'timeline/',
|
||||
_threshold = 1,
|
||||
_requests = requests,
|
||||
_maxRequestTime = maxRequestTime;
|
||||
|
||||
/**
|
||||
@ -183,16 +183,16 @@
|
||||
xc,
|
||||
drawableEvents,
|
||||
mainEvents,
|
||||
elementId = 'timeline_' + request.id,
|
||||
elementId = 'timeline_' + request.id,
|
||||
canvasHeight = 0,
|
||||
gapPerEvent = 38,
|
||||
gapPerEvent = 38,
|
||||
colors = _drawingColors,
|
||||
space = 10.5,
|
||||
ratio = (width - space * 2) / max,
|
||||
space = 10.5,
|
||||
ratio = (width - space * 2) / max,
|
||||
h = space,
|
||||
x = request.left * ratio + space, // position
|
||||
canvas = cache.get(elementId) || cache.set(elementId, document.getElementById(elementId)),
|
||||
ctx = canvas.getContext("2d"),
|
||||
ctx = canvas.getContext("2d"),
|
||||
scaleRatio,
|
||||
devicePixelRatio;
|
||||
|
||||
@ -204,10 +204,10 @@
|
||||
canvasHeight += gapPerEvent * drawableEvents.length;
|
||||
|
||||
// For retina displays so text and boxes will be crisp
|
||||
devicePixelRatio = window.devicePixelRatio == "undefined" ? 1 : window.devicePixelRatio;
|
||||
scaleRatio = devicePixelRatio / 1;
|
||||
devicePixelRatio = window.devicePixelRatio == "undefined" ? 1 : window.devicePixelRatio;
|
||||
scaleRatio = devicePixelRatio / 1;
|
||||
|
||||
canvas.width = width * scaleRatio;
|
||||
canvas.width = width * scaleRatio;
|
||||
canvas.height = canvasHeight * scaleRatio;
|
||||
|
||||
canvas.style.width = width + 'px';
|
||||
@ -256,14 +256,14 @@
|
||||
// For each sub event, ...
|
||||
event.periods.forEach(function(period) {
|
||||
// Set the drawing style.
|
||||
ctx.fillStyle = colors['default'];
|
||||
ctx.fillStyle = colors['default'];
|
||||
ctx.strokeStyle = colors['default'];
|
||||
|
||||
if (colors[event.name]) {
|
||||
ctx.fillStyle = colors[event.name];
|
||||
ctx.fillStyle = colors[event.name];
|
||||
ctx.strokeStyle = colors[event.name];
|
||||
} else if (colors[event.category]) {
|
||||
ctx.fillStyle = colors[event.category];
|
||||
ctx.fillStyle = colors[event.category];
|
||||
ctx.strokeStyle = colors[event.category];
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@
|
||||
{
|
||||
"use strict";
|
||||
|
||||
width = width || getContainerWidth();
|
||||
width = width || getContainerWidth();
|
||||
threshold = threshold || this.getThreshold();
|
||||
|
||||
var self = this;
|
||||
@ -425,15 +425,15 @@
|
||||
}
|
||||
|
||||
// Bind event handlers
|
||||
var elementTimelineControl = query('#timeline-control'),
|
||||
var elementTimelineControl = query('#timeline-control'),
|
||||
elementThresholdControl = query('input[name="threshold"]');
|
||||
|
||||
window.onresize = canvasAutoUpdateOnResizeAndSubmit;
|
||||
window.onresize = canvasAutoUpdateOnResizeAndSubmit;
|
||||
elementTimelineControl.onsubmit = canvasAutoUpdateOnResizeAndSubmit;
|
||||
|
||||
elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
|
||||
elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
|
||||
elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange;
|
||||
elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
|
||||
elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
|
||||
|
||||
window.setTimeout(function() {
|
||||
canvasAutoUpdateOnThresholdChange(null);
|
||||
|
@ -113,7 +113,7 @@ abstract class Client
|
||||
public function setServerParameters(array $server)
|
||||
{
|
||||
$this->server = array_merge(array(
|
||||
'HTTP_HOST' => 'localhost',
|
||||
'HTTP_HOST' => 'localhost',
|
||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||
), $server);
|
||||
}
|
||||
|
@ -62,17 +62,17 @@ class Cookie
|
||||
public function __construct($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = true, $encodedValue = false)
|
||||
{
|
||||
if ($encodedValue) {
|
||||
$this->value = urldecode($value);
|
||||
$this->value = urldecode($value);
|
||||
$this->rawValue = $value;
|
||||
} else {
|
||||
$this->value = $value;
|
||||
$this->value = $value;
|
||||
$this->rawValue = urlencode($value);
|
||||
}
|
||||
$this->name = $name;
|
||||
$this->expires = null === $expires ? null : (int) $expires;
|
||||
$this->path = empty($path) ? '/' : $path;
|
||||
$this->domain = $domain;
|
||||
$this->secure = (bool) $secure;
|
||||
$this->name = $name;
|
||||
$this->expires = null === $expires ? null : (int) $expires;
|
||||
$this->path = empty($path) ? '/' : $path;
|
||||
$this->domain = $domain;
|
||||
$this->secure = (bool) $secure;
|
||||
$this->httponly = (bool) $httponly;
|
||||
}
|
||||
|
||||
@ -141,12 +141,12 @@ class Cookie
|
||||
list($name, $value) = explode('=', array_shift($parts), 2);
|
||||
|
||||
$values = array(
|
||||
'name' => trim($name),
|
||||
'value' => trim($value),
|
||||
'expires' => null,
|
||||
'path' => '/',
|
||||
'domain' => '',
|
||||
'secure' => false,
|
||||
'name' => trim($name),
|
||||
'value' => trim($value),
|
||||
'expires' => null,
|
||||
'path' => '/',
|
||||
'domain' => '',
|
||||
'secure' => false,
|
||||
'httponly' => false,
|
||||
'passedRawValue' => true,
|
||||
);
|
||||
|
@ -39,7 +39,7 @@ class Response
|
||||
public function __construct($content = '', $status = 200, array $headers = array())
|
||||
{
|
||||
$this->content = $content;
|
||||
$this->status = $status;
|
||||
$this->status = $status;
|
||||
$this->headers = $headers;
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
$client = new TestClient();
|
||||
$client->followRedirects(false);
|
||||
$client->setNextResponse(new Response('', 302, array(
|
||||
'Location' => 'http://www.example.com/redirected',
|
||||
'Location' => 'http://www.example.com/redirected',
|
||||
'Set-Cookie' => 'foo=bar',
|
||||
)));
|
||||
$client->request('GET', 'http://www.example.com/');
|
||||
@ -436,16 +436,16 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
public function testFollowRedirectWithHeaders()
|
||||
{
|
||||
$headers = array(
|
||||
'HTTP_HOST' => 'www.example.com',
|
||||
'HTTP_HOST' => 'www.example.com',
|
||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||
'CONTENT_TYPE' => 'application/vnd.custom+xml',
|
||||
'HTTPS' => false,
|
||||
'CONTENT_TYPE' => 'application/vnd.custom+xml',
|
||||
'HTTPS' => false,
|
||||
);
|
||||
|
||||
$client = new TestClient();
|
||||
$client->followRedirects(false);
|
||||
$client->setNextResponse(new Response('', 302, array(
|
||||
'Location' => 'http://www.example.com/redirected',
|
||||
'Location' => 'http://www.example.com/redirected',
|
||||
)));
|
||||
$client->request('GET', 'http://www.example.com/', array(), array(), array(
|
||||
'CONTENT_TYPE' => 'application/vnd.custom+xml',
|
||||
@ -463,15 +463,15 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
public function testFollowRedirectWithPort()
|
||||
{
|
||||
$headers = array(
|
||||
'HTTP_HOST' => 'www.example.com:8080',
|
||||
'HTTP_HOST' => 'www.example.com:8080',
|
||||
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
|
||||
'HTTPS' => false,
|
||||
'HTTP_REFERER' => 'http://www.example.com:8080/',
|
||||
'HTTPS' => false,
|
||||
'HTTP_REFERER' => 'http://www.example.com:8080/',
|
||||
);
|
||||
|
||||
$client = new TestClient();
|
||||
$client->setNextResponse(new Response('', 302, array(
|
||||
'Location' => 'http://www.example.com:8080/redirected',
|
||||
'Location' => 'http://www.example.com:8080/redirected',
|
||||
)));
|
||||
$client->request('GET', 'http://www.example.com:8080/');
|
||||
|
||||
@ -597,10 +597,10 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT'));
|
||||
|
||||
$client->request('GET', 'https://www.example.com/https/www.example.com', array(), array(), array(
|
||||
'HTTP_HOST' => 'testhost',
|
||||
'HTTP_HOST' => 'testhost',
|
||||
'HTTP_USER_AGENT' => 'testua',
|
||||
'HTTPS' => false,
|
||||
'NEW_SERVER_KEY' => 'new-server-key-value',
|
||||
'HTTPS' => false,
|
||||
'NEW_SERVER_KEY' => 'new-server-key-value',
|
||||
));
|
||||
|
||||
$this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST'));
|
||||
|
@ -37,7 +37,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$response = new Response('foo', 200, array(
|
||||
'Content-Type' => 'text/html',
|
||||
'Set-Cookie' => array('foo=bar', 'bar=foo'),
|
||||
'Set-Cookie' => array('foo=bar', 'bar=foo'),
|
||||
));
|
||||
|
||||
$this->assertEquals('text/html', $response->getHeader('Content-Type'), '->getHeader() returns a header of the response');
|
||||
@ -61,7 +61,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$headers = array(
|
||||
'content-type' => 'text/html; charset=utf-8',
|
||||
'set-cookie' => array('foo=bar', 'bar=foo'),
|
||||
'set-cookie' => array('foo=bar', 'bar=foo'),
|
||||
);
|
||||
|
||||
$expected = 'content-type: text/html; charset=utf-8'."\n";
|
||||
|
@ -37,8 +37,8 @@ namespace Symfony\Component\ClassLoader;
|
||||
* // register classes with namespaces
|
||||
* $loader->registerNamespaces(array(
|
||||
* 'Symfony\Component' => __DIR__.'/component',
|
||||
* 'Symfony' => __DIR__.'/framework',
|
||||
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
|
||||
* 'Symfony' => __DIR__.'/framework',
|
||||
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
|
||||
* ));
|
||||
*
|
||||
* // register a library using the PEAR naming convention
|
||||
|
@ -86,7 +86,7 @@ class ClassMapGenerator
|
||||
private static function findClasses($path)
|
||||
{
|
||||
$contents = file_get_contents($path);
|
||||
$tokens = token_get_all($contents);
|
||||
$tokens = token_get_all($contents);
|
||||
|
||||
$classes = array();
|
||||
|
||||
|
@ -48,10 +48,10 @@ than one namespace at once:
|
||||
|
||||
```php
|
||||
$loader->registerNamespaces(array(
|
||||
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
|
||||
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
|
||||
'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
|
||||
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
|
||||
'Monolog' => __DIR__.'/vendor/monolog/src',
|
||||
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
|
||||
'Monolog' => __DIR__.'/vendor/monolog/src',
|
||||
));
|
||||
```
|
||||
|
||||
|
@ -72,9 +72,9 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$data = array(
|
||||
array(__DIR__.'/Fixtures/Namespaced', array(
|
||||
'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php',
|
||||
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
|
||||
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
|
||||
'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php',
|
||||
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
|
||||
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
|
||||
'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
|
||||
),
|
||||
),
|
||||
@ -85,22 +85,22 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||
'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php',
|
||||
)),
|
||||
array(__DIR__.'/Fixtures/Pearlike', array(
|
||||
'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
|
||||
'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
|
||||
'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
|
||||
'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
|
||||
'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
|
||||
'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
|
||||
'Pearlike_WithComments' => realpath(__DIR__).'/Fixtures/Pearlike/WithComments.php',
|
||||
)),
|
||||
array(__DIR__.'/Fixtures/classmap', array(
|
||||
'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
|
||||
'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
|
||||
'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
|
||||
'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
|
||||
'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
|
||||
'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php',
|
||||
'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
|
||||
'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
|
||||
'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
|
||||
'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
|
||||
)),
|
||||
);
|
||||
|
||||
|
@ -32,8 +32,8 @@ namespace Symfony\Component\ClassLoader;
|
||||
* // register classes with namespaces
|
||||
* $loader->registerNamespaces(array(
|
||||
* 'Symfony\Component' => __DIR__.'/component',
|
||||
* 'Symfony' => __DIR__.'/framework',
|
||||
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
|
||||
* 'Symfony' => __DIR__.'/framework',
|
||||
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
|
||||
* ));
|
||||
*
|
||||
* // register a library using the PEAR naming convention
|
||||
|
@ -28,13 +28,13 @@ class NodeBuilder implements NodeParentInterface
|
||||
public function __construct()
|
||||
{
|
||||
$this->nodeMapping = array(
|
||||
'variable' => __NAMESPACE__.'\\VariableNodeDefinition',
|
||||
'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition',
|
||||
'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition',
|
||||
'integer' => __NAMESPACE__.'\\IntegerNodeDefinition',
|
||||
'float' => __NAMESPACE__.'\\FloatNodeDefinition',
|
||||
'array' => __NAMESPACE__.'\\ArrayNodeDefinition',
|
||||
'enum' => __NAMESPACE__.'\\EnumNodeDefinition',
|
||||
'variable' => __NAMESPACE__.'\\VariableNodeDefinition',
|
||||
'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition',
|
||||
'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition',
|
||||
'integer' => __NAMESPACE__.'\\IntegerNodeDefinition',
|
||||
'float' => __NAMESPACE__.'\\FloatNodeDefinition',
|
||||
'array' => __NAMESPACE__.'\\ArrayNodeDefinition',
|
||||
'enum' => __NAMESPACE__.'\\EnumNodeDefinition',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -107,13 +107,13 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase
|
||||
array(
|
||||
array(
|
||||
0 => array(
|
||||
'name' => 'something',
|
||||
'name' => 'something',
|
||||
),
|
||||
5 => array(
|
||||
0 => 'this won\'t work too',
|
||||
0 => 'this won\'t work too',
|
||||
'new_key' => 'some other value',
|
||||
),
|
||||
'string_key' => 'just value',
|
||||
'string_key' => 'just value',
|
||||
),
|
||||
array(
|
||||
0 => array (
|
||||
|
@ -723,9 +723,9 @@ class Application
|
||||
$trace = $e->getTrace();
|
||||
array_unshift($trace, array(
|
||||
'function' => '',
|
||||
'file' => $e->getFile() != null ? $e->getFile() : 'n/a',
|
||||
'line' => $e->getLine() != null ? $e->getLine() : 'n/a',
|
||||
'args' => array(),
|
||||
'file' => $e->getFile() != null ? $e->getFile() : 'n/a',
|
||||
'line' => $e->getLine() != null ? $e->getLine() : 'n/a',
|
||||
'args' => array(),
|
||||
));
|
||||
|
||||
for ($i = 0, $count = count($trace); $i < $count; $i++) {
|
||||
|
@ -21,31 +21,31 @@ namespace Symfony\Component\Console\Formatter;
|
||||
class OutputFormatterStyle implements OutputFormatterStyleInterface
|
||||
{
|
||||
private static $availableForegroundColors = array(
|
||||
'black' => array('set' => 30, 'unset' => 39),
|
||||
'red' => array('set' => 31, 'unset' => 39),
|
||||
'green' => array('set' => 32, 'unset' => 39),
|
||||
'yellow' => array('set' => 33, 'unset' => 39),
|
||||
'blue' => array('set' => 34, 'unset' => 39),
|
||||
'magenta' => array('set' => 35, 'unset' => 39),
|
||||
'cyan' => array('set' => 36, 'unset' => 39),
|
||||
'white' => array('set' => 37, 'unset' => 39),
|
||||
'black' => array('set' => 30, 'unset' => 39),
|
||||
'red' => array('set' => 31, 'unset' => 39),
|
||||
'green' => array('set' => 32, 'unset' => 39),
|
||||
'yellow' => array('set' => 33, 'unset' => 39),
|
||||
'blue' => array('set' => 34, 'unset' => 39),
|
||||
'magenta' => array('set' => 35, 'unset' => 39),
|
||||
'cyan' => array('set' => 36, 'unset' => 39),
|
||||
'white' => array('set' => 37, 'unset' => 39),
|
||||
);
|
||||
private static $availableBackgroundColors = array(
|
||||
'black' => array('set' => 40, 'unset' => 49),
|
||||
'red' => array('set' => 41, 'unset' => 49),
|
||||
'green' => array('set' => 42, 'unset' => 49),
|
||||
'yellow' => array('set' => 43, 'unset' => 49),
|
||||
'blue' => array('set' => 44, 'unset' => 49),
|
||||
'magenta' => array('set' => 45, 'unset' => 49),
|
||||
'cyan' => array('set' => 46, 'unset' => 49),
|
||||
'white' => array('set' => 47, 'unset' => 49),
|
||||
'black' => array('set' => 40, 'unset' => 49),
|
||||
'red' => array('set' => 41, 'unset' => 49),
|
||||
'green' => array('set' => 42, 'unset' => 49),
|
||||
'yellow' => array('set' => 43, 'unset' => 49),
|
||||
'blue' => array('set' => 44, 'unset' => 49),
|
||||
'magenta' => array('set' => 45, 'unset' => 49),
|
||||
'cyan' => array('set' => 46, 'unset' => 49),
|
||||
'white' => array('set' => 47, 'unset' => 49),
|
||||
);
|
||||
private static $availableOptions = array(
|
||||
'bold' => array('set' => 1, 'unset' => 22),
|
||||
'underscore' => array('set' => 4, 'unset' => 24),
|
||||
'blink' => array('set' => 5, 'unset' => 25),
|
||||
'reverse' => array('set' => 7, 'unset' => 27),
|
||||
'conceal' => array('set' => 8, 'unset' => 28),
|
||||
'bold' => array('set' => 1, 'unset' => 22),
|
||||
'underscore' => array('set' => 4, 'unset' => 24),
|
||||
'blink' => array('set' => 5, 'unset' => 25),
|
||||
'reverse' => array('set' => 7, 'unset' => 27),
|
||||
'conceal' => array('set' => 8, 'unset' => 28),
|
||||
);
|
||||
|
||||
private $foreground;
|
||||
|
@ -24,20 +24,20 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
*/
|
||||
class ProgressHelper extends Helper
|
||||
{
|
||||
const FORMAT_QUIET = ' %percent%%';
|
||||
const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%';
|
||||
const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
|
||||
const FORMAT_QUIET_NOMAX = ' %current%';
|
||||
const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]';
|
||||
const FORMAT_QUIET = ' %percent%%';
|
||||
const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%';
|
||||
const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
|
||||
const FORMAT_QUIET_NOMAX = ' %current%';
|
||||
const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]';
|
||||
const FORMAT_VERBOSE_NOMAX = ' %current% [%bar%] Elapsed: %elapsed%';
|
||||
|
||||
// options
|
||||
private $barWidth = 28;
|
||||
private $barChar = '=';
|
||||
private $barWidth = 28;
|
||||
private $barChar = '=';
|
||||
private $emptyBarChar = '-';
|
||||
private $progressChar = '>';
|
||||
private $format = null;
|
||||
private $redrawFreq = 1;
|
||||
private $format = null;
|
||||
private $redrawFreq = 1;
|
||||
|
||||
private $lastMessagesLength;
|
||||
private $barCharOriginal;
|
||||
@ -95,7 +95,7 @@ class ProgressHelper extends Helper
|
||||
*/
|
||||
private $widths = array(
|
||||
'current' => 4,
|
||||
'max' => 4,
|
||||
'max' => 4,
|
||||
'percent' => 3,
|
||||
'elapsed' => 6,
|
||||
);
|
||||
@ -186,11 +186,11 @@ class ProgressHelper extends Helper
|
||||
public function start(OutputInterface $output, $max = null)
|
||||
{
|
||||
$this->startTime = time();
|
||||
$this->current = 0;
|
||||
$this->max = (int) $max;
|
||||
$this->current = 0;
|
||||
$this->max = (int) $max;
|
||||
|
||||
// Disabling output when it does not support ANSI codes as it would result in a broken display anyway.
|
||||
$this->output = $output->isDecorated() ? $output : new NullOutput();
|
||||
$this->output = $output->isDecorated() ? $output : new NullOutput();
|
||||
$this->lastMessagesLength = 0;
|
||||
$this->barCharOriginal = '';
|
||||
|
||||
@ -334,11 +334,11 @@ class ProgressHelper extends Helper
|
||||
}
|
||||
|
||||
if ($this->max > 0) {
|
||||
$this->widths['max'] = $this->strlen($this->max);
|
||||
$this->widths['max'] = $this->strlen($this->max);
|
||||
$this->widths['current'] = $this->widths['max'];
|
||||
} else {
|
||||
$this->barCharOriginal = $this->barChar;
|
||||
$this->barChar = $this->emptyBarChar;
|
||||
$this->barChar = $this->emptyBarChar;
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ class ProgressHelper extends Helper
|
||||
*/
|
||||
private function generate($finish = false)
|
||||
{
|
||||
$vars = array();
|
||||
$vars = array();
|
||||
$percent = 0;
|
||||
if ($this->max > 0) {
|
||||
$percent = (float) $this->current / $this->max;
|
||||
|
@ -49,8 +49,8 @@ class InputArgument
|
||||
throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
$this->mode = $mode;
|
||||
$this->name = $name;
|
||||
$this->mode = $mode;
|
||||
$this->description = $description;
|
||||
|
||||
$this->setDefault($default);
|
||||
|
@ -87,9 +87,9 @@ class InputDefinition
|
||||
*/
|
||||
public function setArguments($arguments = array())
|
||||
{
|
||||
$this->arguments = array();
|
||||
$this->requiredCount = 0;
|
||||
$this->hasOptional = false;
|
||||
$this->arguments = array();
|
||||
$this->requiredCount = 0;
|
||||
$this->hasOptional = false;
|
||||
$this->hasAnArrayArgument = false;
|
||||
$this->addArguments($arguments);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ namespace Symfony\Component\Console\Input;
|
||||
*/
|
||||
class InputOption
|
||||
{
|
||||
const VALUE_NONE = 1;
|
||||
const VALUE_NONE = 1;
|
||||
const VALUE_REQUIRED = 2;
|
||||
const VALUE_OPTIONAL = 4;
|
||||
const VALUE_IS_ARRAY = 8;
|
||||
@ -77,9 +77,9 @@ class InputOption
|
||||
throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode));
|
||||
}
|
||||
|
||||
$this->name = $name;
|
||||
$this->shortcut = $shortcut;
|
||||
$this->mode = $mode;
|
||||
$this->name = $name;
|
||||
$this->shortcut = $shortcut;
|
||||
$this->mode = $mode;
|
||||
$this->description = $description;
|
||||
|
||||
if ($this->isArray() && !$this->acceptValue()) {
|
||||
|
@ -22,15 +22,15 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
||||
*/
|
||||
interface OutputInterface
|
||||
{
|
||||
const VERBOSITY_QUIET = 0;
|
||||
const VERBOSITY_NORMAL = 1;
|
||||
const VERBOSITY_VERBOSE = 2;
|
||||
const VERBOSITY_QUIET = 0;
|
||||
const VERBOSITY_NORMAL = 1;
|
||||
const VERBOSITY_VERBOSE = 2;
|
||||
const VERBOSITY_VERY_VERBOSE = 3;
|
||||
const VERBOSITY_DEBUG = 4;
|
||||
const VERBOSITY_DEBUG = 4;
|
||||
|
||||
const OUTPUT_NORMAL = 0;
|
||||
const OUTPUT_RAW = 1;
|
||||
const OUTPUT_PLAIN = 2;
|
||||
const OUTPUT_RAW = 1;
|
||||
const OUTPUT_PLAIN = 2;
|
||||
|
||||
/**
|
||||
* Writes a message to the output.
|
||||
|
@ -21,13 +21,13 @@ namespace Symfony\Component\CssSelector\Parser;
|
||||
*/
|
||||
class Token
|
||||
{
|
||||
const TYPE_FILE_END = 'eof';
|
||||
const TYPE_DELIMITER = 'delimiter';
|
||||
const TYPE_FILE_END = 'eof';
|
||||
const TYPE_DELIMITER = 'delimiter';
|
||||
const TYPE_WHITESPACE = 'whitespace';
|
||||
const TYPE_IDENTIFIER = 'identifier';
|
||||
const TYPE_HASH = 'hash';
|
||||
const TYPE_NUMBER = 'number';
|
||||
const TYPE_STRING = 'string';
|
||||
const TYPE_HASH = 'hash';
|
||||
const TYPE_NUMBER = 'number';
|
||||
const TYPE_STRING = 'string';
|
||||
|
||||
/**
|
||||
* @var int
|
||||
|
@ -31,13 +31,13 @@ class AttributeMatchingExtension extends AbstractExtension
|
||||
{
|
||||
return array(
|
||||
'exists' => array($this, 'translateExists'),
|
||||
'=' => array($this, 'translateEquals'),
|
||||
'~=' => array($this, 'translateIncludes'),
|
||||
'|=' => array($this, 'translateDashMatch'),
|
||||
'^=' => array($this, 'translatePrefixMatch'),
|
||||
'$=' => array($this, 'translateSuffixMatch'),
|
||||
'*=' => array($this, 'translateSubstringMatch'),
|
||||
'!=' => array($this, 'translateDifferent'),
|
||||
'=' => array($this, 'translateEquals'),
|
||||
'~=' => array($this, 'translateIncludes'),
|
||||
'|=' => array($this, 'translateDashMatch'),
|
||||
'^=' => array($this, 'translatePrefixMatch'),
|
||||
'$=' => array($this, 'translateSuffixMatch'),
|
||||
'*=' => array($this, 'translateSubstringMatch'),
|
||||
'!=' => array($this, 'translateDifferent'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -34,12 +34,12 @@ class FunctionExtension extends AbstractExtension
|
||||
public function getFunctionTranslators()
|
||||
{
|
||||
return array(
|
||||
'nth-child' => array($this, 'translateNthChild'),
|
||||
'nth-last-child' => array($this, 'translateNthLastChild'),
|
||||
'nth-of-type' => array($this, 'translateNthOfType'),
|
||||
'nth-child' => array($this, 'translateNthChild'),
|
||||
'nth-last-child' => array($this, 'translateNthLastChild'),
|
||||
'nth-of-type' => array($this, 'translateNthOfType'),
|
||||
'nth-last-of-type' => array($this, 'translateNthLastOfType'),
|
||||
'contains' => array($this, 'translateContains'),
|
||||
'lang' => array($this, 'translateLang'),
|
||||
'contains' => array($this, 'translateContains'),
|
||||
'lang' => array($this, 'translateLang'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -45,14 +45,14 @@ class HtmlExtension extends AbstractExtension
|
||||
public function getPseudoClassTranslators()
|
||||
{
|
||||
return array(
|
||||
'checked' => array($this, 'translateChecked'),
|
||||
'link' => array($this, 'translateLink'),
|
||||
'checked' => array($this, 'translateChecked'),
|
||||
'link' => array($this, 'translateLink'),
|
||||
'disabled' => array($this, 'translateDisabled'),
|
||||
'enabled' => array($this, 'translateEnabled'),
|
||||
'enabled' => array($this, 'translateEnabled'),
|
||||
'selected' => array($this, 'translateSelected'),
|
||||
'invalid' => array($this, 'translateInvalid'),
|
||||
'hover' => array($this, 'translateHover'),
|
||||
'visited' => array($this, 'translateVisited'),
|
||||
'invalid' => array($this, 'translateInvalid'),
|
||||
'hover' => array($this, 'translateHover'),
|
||||
'visited' => array($this, 'translateVisited'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr;
|
||||
*/
|
||||
class NodeExtension extends AbstractExtension
|
||||
{
|
||||
const ELEMENT_NAME_IN_LOWER_CASE = 1;
|
||||
const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
|
||||
const ELEMENT_NAME_IN_LOWER_CASE = 1;
|
||||
const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
|
||||
const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
|
||||
|
||||
/**
|
||||
@ -79,15 +79,15 @@ class NodeExtension extends AbstractExtension
|
||||
public function getNodeTranslators()
|
||||
{
|
||||
return array(
|
||||
'Selector' => array($this, 'translateSelector'),
|
||||
'Selector' => array($this, 'translateSelector'),
|
||||
'CombinedSelector' => array($this, 'translateCombinedSelector'),
|
||||
'Negation' => array($this, 'translateNegation'),
|
||||
'Function' => array($this, 'translateFunction'),
|
||||
'Pseudo' => array($this, 'translatePseudo'),
|
||||
'Attribute' => array($this, 'translateAttribute'),
|
||||
'Class' => array($this, 'translateClass'),
|
||||
'Hash' => array($this, 'translateHash'),
|
||||
'Element' => array($this, 'translateElement'),
|
||||
'Negation' => array($this, 'translateNegation'),
|
||||
'Function' => array($this, 'translateFunction'),
|
||||
'Pseudo' => array($this, 'translatePseudo'),
|
||||
'Attribute' => array($this, 'translateAttribute'),
|
||||
'Class' => array($this, 'translateClass'),
|
||||
'Hash' => array($this, 'translateHash'),
|
||||
'Element' => array($this, 'translateElement'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -30,14 +30,14 @@ class PseudoClassExtension extends AbstractExtension
|
||||
public function getPseudoClassTranslators()
|
||||
{
|
||||
return array(
|
||||
'root' => array($this, 'translateRoot'),
|
||||
'first-child' => array($this, 'translateFirstChild'),
|
||||
'last-child' => array($this, 'translateLastChild'),
|
||||
'root' => array($this, 'translateRoot'),
|
||||
'first-child' => array($this, 'translateFirstChild'),
|
||||
'last-child' => array($this, 'translateLastChild'),
|
||||
'first-of-type' => array($this, 'translateFirstOfType'),
|
||||
'last-of-type' => array($this, 'translateLastOfType'),
|
||||
'only-child' => array($this, 'translateOnlyChild'),
|
||||
'only-of-type' => array($this, 'translateOnlyOfType'),
|
||||
'empty' => array($this, 'translateEmpty'),
|
||||
'last-of-type' => array($this, 'translateLastOfType'),
|
||||
'only-child' => array($this, 'translateOnlyChild'),
|
||||
'only-of-type' => array($this, 'translateOnlyOfType'),
|
||||
'empty' => array($this, 'translateEmpty'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -33,19 +33,19 @@ class ErrorHandler
|
||||
const TYPE_DEPRECATION = -100;
|
||||
|
||||
private $levels = array(
|
||||
E_WARNING => 'Warning',
|
||||
E_NOTICE => 'Notice',
|
||||
E_USER_ERROR => 'User Error',
|
||||
E_USER_WARNING => 'User Warning',
|
||||
E_USER_NOTICE => 'User Notice',
|
||||
E_STRICT => 'Runtime Notice',
|
||||
E_WARNING => 'Warning',
|
||||
E_NOTICE => 'Notice',
|
||||
E_USER_ERROR => 'User Error',
|
||||
E_USER_WARNING => 'User Warning',
|
||||
E_USER_NOTICE => 'User Notice',
|
||||
E_STRICT => 'Runtime Notice',
|
||||
E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
|
||||
E_DEPRECATED => 'Deprecated',
|
||||
E_USER_DEPRECATED => 'User Deprecated',
|
||||
E_ERROR => 'Error',
|
||||
E_CORE_ERROR => 'Core Error',
|
||||
E_COMPILE_ERROR => 'Compile Error',
|
||||
E_PARSE => 'Parse Error',
|
||||
E_DEPRECATED => 'Deprecated',
|
||||
E_USER_DEPRECATED => 'User Deprecated',
|
||||
E_ERROR => 'Error',
|
||||
E_CORE_ERROR => 'Core Error',
|
||||
E_COMPILE_ERROR => 'Compile Error',
|
||||
E_PARSE => 'Parse Error',
|
||||
);
|
||||
|
||||
private $level;
|
||||
|
@ -66,8 +66,8 @@ class FlattenException
|
||||
foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) {
|
||||
$exceptions[] = array(
|
||||
'message' => $exception->getMessage(),
|
||||
'class' => $exception->getClass(),
|
||||
'trace' => $exception->getTrace(),
|
||||
'class' => $exception->getClass(),
|
||||
'trace' => $exception->getTrace(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -179,14 +179,14 @@ class FlattenException
|
||||
{
|
||||
$this->trace = array();
|
||||
$this->trace[] = array(
|
||||
'namespace' => '',
|
||||
'namespace' => '',
|
||||
'short_class' => '',
|
||||
'class' => '',
|
||||
'type' => '',
|
||||
'function' => '',
|
||||
'file' => $file,
|
||||
'line' => $line,
|
||||
'args' => array(),
|
||||
'class' => '',
|
||||
'type' => '',
|
||||
'function' => '',
|
||||
'file' => $file,
|
||||
'line' => $line,
|
||||
'args' => array(),
|
||||
);
|
||||
foreach ($trace as $entry) {
|
||||
$class = '';
|
||||
@ -198,14 +198,14 @@ class FlattenException
|
||||
}
|
||||
|
||||
$this->trace[] = array(
|
||||
'namespace' => $namespace,
|
||||
'namespace' => $namespace,
|
||||
'short_class' => $class,
|
||||
'class' => isset($entry['class']) ? $entry['class'] : '',
|
||||
'type' => isset($entry['type']) ? $entry['type'] : '',
|
||||
'function' => isset($entry['function']) ? $entry['function'] : null,
|
||||
'file' => isset($entry['file']) ? $entry['file'] : null,
|
||||
'line' => isset($entry['line']) ? $entry['line'] : null,
|
||||
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
|
||||
'class' => isset($entry['class']) ? $entry['class'] : '',
|
||||
'type' => isset($entry['type']) ? $entry['type'] : '',
|
||||
'function' => isset($entry['function']) ? $entry['function'] : null,
|
||||
'file' => isset($entry['file']) ? $entry['file'] : null,
|
||||
'line' => isset($entry['line']) ? $entry['line'] : null,
|
||||
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ EOF;
|
||||
$formattedValue = sprintf("<em>object</em>(%s)", $this->abbrClass($item[1]));
|
||||
} elseif ('array' === $item[0]) {
|
||||
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
|
||||
} elseif ('string' === $item[0]) {
|
||||
} elseif ('string' === $item[0]) {
|
||||
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset));
|
||||
} elseif ('null' === $item[0]) {
|
||||
$formattedValue = '<em>null</em>';
|
||||
|
@ -162,8 +162,8 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
'message' => 'test',
|
||||
'class' => 'Exception',
|
||||
'trace' => array(array(
|
||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123,
|
||||
'args' => array(),
|
||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123,
|
||||
'args' => array(),
|
||||
)),
|
||||
),
|
||||
), $flattened->toArray());
|
||||
@ -214,14 +214,14 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
|
||||
'class' => 'Exception',
|
||||
'trace' => array(
|
||||
array(
|
||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '',
|
||||
'file' => 'foo.php', 'line' => 123,
|
||||
'args' => array(),
|
||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '',
|
||||
'file' => 'foo.php', 'line' => 123,
|
||||
'args' => array(),
|
||||
),
|
||||
array(
|
||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => 'test',
|
||||
'file' => __FILE__, 'line' => 123,
|
||||
'args' => array(
|
||||
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => 'test',
|
||||
'file' => __FILE__, 'line' => 123,
|
||||
'args' => array(
|
||||
array(
|
||||
'incomplete-object', 'BogusTestClass',
|
||||
),
|
||||
|
@ -59,7 +59,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
$this->container = $container;
|
||||
$this->graph = $container->getCompiler()->getServiceReferenceGraph();
|
||||
$this->graph = $container->getCompiler()->getServiceReferenceGraph();
|
||||
$this->graph->clear();
|
||||
|
||||
foreach ($container->getDefinitions() as $id => $definition) {
|
||||
|
@ -58,8 +58,8 @@ class CheckCircularReferencesPass implements CompilerPassInterface
|
||||
private function checkOutEdges(array $edges)
|
||||
{
|
||||
foreach ($edges as $edge) {
|
||||
$node = $edge->getDestNode();
|
||||
$id = $node->getId();
|
||||
$node = $edge->getDestNode();
|
||||
$id = $node->getId();
|
||||
|
||||
if (empty($this->checkedNodes[$id])) {
|
||||
$searchKey = array_search($id, $this->currentPath);
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\DependencyInjection\Compiler;
|
||||
|
||||
use Symfony\Component\DependencyInjection\Alias;
|
||||
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
@ -84,7 +85,12 @@ class ResolveReferencesToAliasesPass implements CompilerPassInterface
|
||||
*/
|
||||
private function getDefinitionId($id)
|
||||
{
|
||||
$seen = array();
|
||||
while ($this->container->hasAlias($id)) {
|
||||
if (isset($seen[$id])) {
|
||||
throw new ServiceCircularReferenceException($id, array_keys($seen));
|
||||
}
|
||||
$seen[$id] = true;
|
||||
$id = (string) $this->container->getAlias($id);
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,10 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
||||
interface ContainerInterface
|
||||
{
|
||||
const EXCEPTION_ON_INVALID_REFERENCE = 1;
|
||||
const NULL_ON_INVALID_REFERENCE = 2;
|
||||
const IGNORE_ON_INVALID_REFERENCE = 3;
|
||||
const SCOPE_CONTAINER = 'container';
|
||||
const SCOPE_PROTOTYPE = 'prototype';
|
||||
const NULL_ON_INVALID_REFERENCE = 2;
|
||||
const IGNORE_ON_INVALID_REFERENCE = 3;
|
||||
const SCOPE_CONTAINER = 'container';
|
||||
const SCOPE_PROTOTYPE = 'prototype';
|
||||
|
||||
/**
|
||||
* Sets a service.
|
||||
|
@ -35,8 +35,8 @@ class GraphvizDumper extends Dumper
|
||||
private $edges;
|
||||
private $options = array(
|
||||
'graph' => array('ratio' => 'compress'),
|
||||
'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'),
|
||||
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5),
|
||||
'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'),
|
||||
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5),
|
||||
'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'),
|
||||
'node.definition' => array('fillcolor' => '#eeeeee'),
|
||||
'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'),
|
||||
|
@ -100,7 +100,7 @@ class PhpDumper extends Dumper
|
||||
public function dump(array $options = array())
|
||||
{
|
||||
$options = array_merge(array(
|
||||
'class' => 'ProjectServiceContainer',
|
||||
'class' => 'ProjectServiceContainer',
|
||||
'base_class' => 'Container',
|
||||
'namespace' => '',
|
||||
), $options);
|
||||
@ -339,9 +339,9 @@ class PhpDumper extends Dumper
|
||||
throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id));
|
||||
}
|
||||
|
||||
$simple = $this->isSimpleInstance($id, $definition);
|
||||
$simple = $this->isSimpleInstance($id, $definition);
|
||||
$isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition);
|
||||
$instantiation = '';
|
||||
$instantiation = '';
|
||||
|
||||
if (!$isProxyCandidate && ContainerInterface::SCOPE_CONTAINER === $definition->getScope()) {
|
||||
$instantiation = "\$this->services['$id'] = ".($simple ? '' : '$instance');
|
||||
@ -559,17 +559,17 @@ EOF;
|
||||
}
|
||||
|
||||
if ($definition->isLazy()) {
|
||||
$lazyInitialization = '$lazyLoad = true';
|
||||
$lazyInitialization = '$lazyLoad = true';
|
||||
$lazyInitializationDoc = "\n * @param bool \$lazyLoad whether to try lazy-loading the service with a proxy\n *";
|
||||
} else {
|
||||
$lazyInitialization = '';
|
||||
$lazyInitialization = '';
|
||||
$lazyInitializationDoc = '';
|
||||
}
|
||||
|
||||
// with proxies, for 5.3.3 compatibility, the getter must be public to be accessible to the initializer
|
||||
$isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition);
|
||||
$visibility = $isProxyCandidate ? 'public' : 'protected';
|
||||
$code = <<<EOF
|
||||
$visibility = $isProxyCandidate ? 'public' : 'protected';
|
||||
$code = <<<EOF
|
||||
|
||||
/**
|
||||
* Gets the '$id' service.$doc
|
||||
|
@ -48,6 +48,17 @@ class ResolveReferencesToAliasesPassTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('foo', (string) $arguments[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
|
||||
*/
|
||||
public function testAliasCircularReference()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$container->setAlias('bar', 'foo');
|
||||
$container->setAlias('foo', 'bar');
|
||||
$this->process($container);
|
||||
}
|
||||
|
||||
protected function process(ContainerBuilder $container)
|
||||
{
|
||||
$pass = new ResolveReferencesToAliasesPass();
|
||||
|
@ -569,7 +569,7 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$container->compile();
|
||||
|
||||
$classesPath = realpath(__DIR__.'/Fixtures/includes/classes.php');
|
||||
$classesPath = realpath(__DIR__.'/Fixtures/includes/classes.php');
|
||||
$matchingResources = array_filter(
|
||||
$container->getResources(),
|
||||
function (ResourceInterface $resource) use ($classesPath) {
|
||||
@ -643,16 +643,16 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testPrivateServiceUser()
|
||||
{
|
||||
$fooDefinition = new Definition('BarClass');
|
||||
$fooDefinition = new Definition('BarClass');
|
||||
$fooUserDefinition = new Definition('BarUserClass', array(new Reference('bar')));
|
||||
$container = new ContainerBuilder();
|
||||
$container = new ContainerBuilder();
|
||||
$container->setResourceTracking(false);
|
||||
|
||||
$fooDefinition->setPublic(false);
|
||||
|
||||
$container->addDefinitions(array(
|
||||
'bar' => $fooDefinition,
|
||||
'bar_user' => $fooUserDefinition,
|
||||
'bar' => $fooDefinition,
|
||||
'bar_user' => $fooUserDefinition,
|
||||
));
|
||||
|
||||
$container->compile();
|
||||
|
@ -41,8 +41,8 @@ class GraphvizDumperTest extends \PHPUnit_Framework_TestCase
|
||||
$dumper = new GraphvizDumper($container);
|
||||
$this->assertEquals($dumper->dump(array(
|
||||
'graph' => array('ratio' => 'normal'),
|
||||
'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'),
|
||||
'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1),
|
||||
'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'),
|
||||
'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1),
|
||||
'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'),
|
||||
'node.definition' => array('fillcolor' => 'grey'),
|
||||
'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'),
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user