From e0d8042ffc6068376e0f9e23a2306224bc2ee0c2 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Mon, 16 Apr 2018 19:03:05 +0300 Subject: [PATCH 01/33] composer.json updated for SF4 compatibility --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9e30a266..cfff4a03 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "propel/propel1": "^1.6.8", - "symfony/framework-bundle": "^3.0.2" + "symfony/framework-bundle": "^4.0.8" }, "require-dev": { "phpunit/phpunit": "^4.8.21|^5.0.10", From 84dfd1989343f6555575baf79828daa4d0246dd4 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Mon, 16 Apr 2018 19:18:33 +0300 Subject: [PATCH 02/33] Updated composer.json for SF 4.0 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index cfff4a03..d91e3735 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,13 @@ "require": { "propel/propel1": "^1.6.8", - "symfony/framework-bundle": "^4.0.8" + "symfony/framework-bundle": "^4.0" }, "require-dev": { "phpunit/phpunit": "^4.8.21|^5.0.10", "phing/phing": "^2.12", - "symfony/symfony": "^3.0.2", - "sensio/framework-extra-bundle": "^3.0.2", + "symfony/symfony": "^4.0", + "sensio/framework-extra-bundle": "^4.0", "fzaninotto/faker": "^1.5" }, From abdcc7c8f426779deba4b5e07fc3c1d76cfe59d3 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Mon, 16 Apr 2018 22:01:24 +0300 Subject: [PATCH 03/33] Symfony4 for Propel 1.7 --- .travis.yml | 18 +- Command/AbstractCommand.php | 209 +++++++++++------- Command/FixturesLoadCommand.php | 17 +- Controller/PanelController.php | 31 +-- DataCollector/PropelDataCollector.php | 13 +- DataFixtures/Dumper/YamlDataDumper.php | 3 +- Logger/PropelLogger.php | 13 +- README.markdown | 8 +- Resources/config/propel.xml | 82 ++++++- Tests/Command/AbstractCommandTest.php | 53 +++-- .../Dumper/YamlDataDumperTest.php | 2 +- composer.json | 7 +- 12 files changed, 307 insertions(+), 149 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7d0c57a2..cc222560 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,30 +3,28 @@ sudo: false language: php php: - - 5.5 - - 5.6 - 7.0 - 7.1 - 7.2 - - hhvm cache: directories: - $HOME/.composer/cache/files env: - - SYMFONY_VERSION="^3.0.2" - - SYMFONY_VERSION="^3.0.2" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^3.4.0" + - SYMFONY_VERSION="^4.0.0" + - SYMFONY_VERSION="^4.0.0" COMPOSER_FLAGS="--prefer-lowest" + +allow_failures: + - php: hhvm + - php: nightly + - env: SYMFONY_VERSION="^3.4.0" matrix: fast_finish: true - allow_failures: - - php: 7.2 - - php: hhvm - before_install: - - phpenv config-rm xdebug.ini - composer self-update - if [ "${SYMFONY_VERSION}" != "" ]; then composer require --no-update "symfony/symfony:${SYMFONY_VERSION}"; fi; diff --git a/Command/AbstractCommand.php b/Command/AbstractCommand.php index c14a741a..fa8698aa 100644 --- a/Command/AbstractCommand.php +++ b/Command/AbstractCommand.php @@ -10,9 +10,10 @@ namespace Propel\Bundle\PropelBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Config\FileLocatorInterface; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Question\ConfirmationQuestion; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; use Symfony\Component\HttpKernel\Bundle\Bundle; @@ -29,12 +30,14 @@ abstract class AbstractCommand extends ContainerAwareCommand { /** * Additional Phing args to add in specialized commands. + * * @var array */ protected $additionalPhingArgs = array(); /** * Temporary XML schemas used on command execution. + * * @var array */ protected $tempSchemas = array(); @@ -46,12 +49,13 @@ abstract class AbstractCommand extends ContainerAwareCommand /** * The Phing output. + * * @string */ protected $buffer = null; /** - * @var Symfony\Component\HttpKernel\Bundle\BundleInterface + * @var \Symfony\Component\HttpKernel\Bundle\BundleInterface */ protected $bundle = null; @@ -61,11 +65,25 @@ abstract class AbstractCommand extends ContainerAwareCommand private $alreadyWroteConnection = false; /** - * - * @var InputInterface + * @var \Symfony\Component\Console\Input\InputInterface */ protected $input; + /** + * @var \Symfony\Component\Config\FileLocatorInterface + */ + protected $fileLocator; + + /** + * Set relation on FileLocator + * + * @param \Symfony\Component\Config\FileLocatorInterface $fileLocator + */ + public function setFileLocator(FileLocatorInterface $fileLocator) + { + $this->fileLocator = $fileLocator; + } + /** * Return the package for a given bundle. * @@ -76,7 +94,7 @@ abstract class AbstractCommand extends ContainerAwareCommand */ protected function getPackage(Bundle $bundle, $namespace = '', $baseDirectory = '') { - $path = explode(DIRECTORY_SEPARATOR, realpath($bundle->getPath())); + $path = explode(DIRECTORY_SEPARATOR, realpath($bundle->getPath())); $bundle_namespace = explode('\\', $bundle->getNamespace()); $diff = array_diff($bundle_namespace, $path); @@ -141,8 +159,8 @@ protected function initialize(InputInterface $input, OutputInterface $output) /** * Call a Phing task. * - * @param string $taskName A Propel task name. - * @param array $properties An array of properties to pass to Phing. + * @param string $taskName A Propel task name. + * @param array $properties An array of properties to pass to Phing. */ protected function callPhing($taskName, $properties = array()) { @@ -238,13 +256,13 @@ protected function copySchemas(KernelInterface $kernel, $cacheDir) $tempSchema = $bundle->getName().'-'.$finalSchema->getBaseName(); $this->tempSchemas[$tempSchema] = array( - 'bundle' => $bundle->getName(), - 'basename' => $finalSchema->getBaseName(), - 'path' => $finalSchema->getPathname(), + 'bundle' => $bundle->getName(), + 'basename' => $finalSchema->getBaseName(), + 'path' => $finalSchema->getPathname(), ); $file = $cacheDir.DIRECTORY_SEPARATOR.$tempSchema; - $filesystem->copy((string) $finalSchema, $file, true); + $filesystem->copy((string)$finalSchema, $file, true); // the package needs to be set absolute // besides, the automated namespace to package conversion has @@ -259,8 +277,11 @@ protected function copySchemas(KernelInterface $kernel, $cacheDir) $package = $this->getPackage($bundle, $database['namespace'], $base); } else { throw new \RuntimeException( - sprintf('%s : Please define a `package` attribute or a `namespace` attribute for schema `%s`', - $bundle->getName(), $finalSchema->getBaseName()) + sprintf( + '%s : Please define a `package` attribute or a `namespace` attribute for schema `%s`', + $bundle->getName(), + $finalSchema->getBaseName() + ) ); } @@ -317,7 +338,7 @@ protected function getSchemasFromBundle(BundleInterface $bundle) $finalSchemas = array(); if (is_dir($dir = $bundle->getPath().'/Resources/config')) { - $finder = new Finder(); + $finder = new Finder(); $schemas = $finder->files()->name('*schema.xml')->followLinks()->in($dir); if (iterator_count($schemas)) { @@ -325,7 +346,7 @@ protected function getSchemasFromBundle(BundleInterface $bundle) $logicalName = $this->transformToLogicalName($schema, $bundle); $finalSchema = new \SplFileInfo($this->getFileLocator()->locate($logicalName)); - $finalSchemas[(string) $finalSchema] = array($bundle, $finalSchema); + $finalSchemas[(string)$finalSchema] = array($bundle, $finalSchema); } } } @@ -335,18 +356,22 @@ protected function getSchemasFromBundle(BundleInterface $bundle) /** * @param \SplFileInfo $file + * * @return string */ protected function getRelativeFileName(\SplFileInfo $file) { - return substr(str_replace(realpath($this->getContainer()->getParameter('kernel.root_dir') . '/../'), '', $file), 1); + return substr( + str_replace(realpath($this->getContainer()->getParameter('kernel.root_dir').'/../'), '', $file), + 1 + ); } /** * Create a 'build.properties' file. * * @param KernelInterface $kernel The application kernel. - * @param string $file Should be 'build.properties'. + * @param string $file Should be 'build.properties'. */ protected function createBuildPropertiesFile(KernelInterface $kernel, $file) { @@ -373,14 +398,17 @@ protected function createBuildTimeFile($file) throw new \InvalidArgumentException('Could not find Propel configuration.'); } - $xml = strtr(<< EOT - , array('%default_connection%' => $container->getParameter('propel.dbal.default_connection'))); + , + array('%default_connection%' => $container->getParameter('propel.dbal.default_connection')) + ); $propelConfiguration = $container->get('propel.configuration'); foreach ($propelConfiguration['datasources'] as $name => $datasource) { @@ -388,7 +416,8 @@ protected function createBuildTimeFile($file) continue; } - $xml .= strtr(<< %adapter% @@ -399,13 +428,15 @@ protected function createBuildTimeFile($file) EOT - , array( - '%name%' => $name, - '%adapter%' => $datasource['adapter'], - '%dsn%' => $datasource['connection']['dsn'], - '%username%' => $datasource['connection']['user'], - '%password%' => isset($datasource['connection']['password']) ? $datasource['connection']['password'] : '', - )); + , + array( + '%name%' => $name, + '%adapter%' => $datasource['adapter'], + '%dsn%' => $datasource['connection']['dsn'], + '%username%' => $datasource['connection']['user'], + '%password%' => isset($datasource['connection']['password']) ? $datasource['connection']['password'] : '', + ) + ); } $xml .= <<getContainer()->get('file_locator'); + return $this->fileLocator; } /** @@ -476,15 +509,18 @@ protected function getFileLocator() * Returns the default connection if no option specified or an exception * if the specified connection doesn't exist. * - * @param InputInterface $input + * @param InputInterface $input * @param OutputInterface $output * @throw \InvalidArgumentException If the connection does not exist. + * * @return array */ protected function getConnection(InputInterface $input, OutputInterface $output) { $propelConfiguration = $this->getContainer()->get('propel.configuration'); - $name = $input->getOption('connection') ?: $this->getContainer()->getParameter('propel.dbal.default_connection'); + $name = $input->getOption('connection') ?: $this->getContainer()->getParameter( + 'propel.dbal.default_connection' + ); if (isset($propelConfiguration['datasources'][$name])) { $defaultConfig = $propelConfiguration['datasources'][$name]; @@ -493,8 +529,12 @@ protected function getConnection(InputInterface $input, OutputInterface $output) } if (false === $this->alreadyWroteConnection) { - $output->writeln(sprintf('Use connection named %s in %s environment.', - $name, $this->getApplication()->getKernel()->getEnvironment()) + $output->writeln( + sprintf( + 'Use connection named %s in %s environment.', + $name, + $this->getApplication()->getKernel()->getEnvironment() + ) ); $this->alreadyWroteConnection = true; } @@ -511,6 +551,7 @@ protected function getConnection(InputInterface $input, OutputInterface $output) * Extract the database name from a given DSN * * @param string $dsn A DSN + * * @return string The database name extracted from the given DSN */ protected function parseDbName($dsn) @@ -540,14 +581,14 @@ protected function checkConfiguration() /** * Write Propel output as summary based on a Regexp. * - * @param OutputInterface $output The output object. - * @param string $taskname A task name + * @param OutputInterface $output The output object. + * @param string $taskname A task name */ protected function writeSummary(OutputInterface $output, $taskname) { foreach (explode("\n", $this->buffer) as $line) { - if (false !== strpos($line, '[' . $taskname . ']')) { - $arr = preg_split('#\[' . $taskname . '\] #', $line); + if (false !== strpos($line, '['.$taskname.']')) { + $arr = preg_split('#\['.$taskname.'\] #', $line); $info = $arr[1]; if ('"' === $info[0]) { @@ -561,63 +602,70 @@ protected function writeSummary(OutputInterface $output, $taskname) /** * Comes from the SensioGeneratorBundle. + * * @see https://github.com/sensio/SensioGeneratorBundle/blob/master/Command/Helper/DialogHelper.php#L52 * * @param OutputInterface $output The output. - * @param string $text A text message. - * @param string $style A style to apply on the section. + * @param string|array $text A text message. + * @param string $style A style to apply on the section. */ protected function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white') { - $output->writeln(array( - '', - $this->getHelperSet()->get('formatter')->formatBlock($text, $style, true), - '', - )); + $output->writeln( + array( + '', + $this->getHelperSet()->get('formatter')->formatBlock($text, $style, true), + '', + ) + ); } /** * Renders an error message if a task has failed. * - * @param OutputInterface $output The output. - * @param string $taskName A task name. - * @param Boolean $more Whether to add a 'more details' message or not. + * @param OutputInterface $output The output. + * @param string $taskName A task name. + * @param Boolean $more Whether to add a 'more details' message or not. */ protected function writeTaskError($output, $taskName, $more = true) { $moreText = $more ? ' To get more details, run the command with the "--verbose" option.' : ''; - return $this->writeSection($output, array( - '[Propel] Error', - '', - 'An error has occured during the "' . $taskName . '" task process.' . $moreText - ), 'fg=white;bg=red'); + return $this->writeSection( + $output, + array( + '[Propel] Error', + '', + 'An error has occured during the "'.$taskName.'" task process.'.$moreText, + ), + 'fg=white;bg=red' + ); } /** - * @param OutputInterface $output The output. - * @param string $filename The filename. + * @param OutputInterface $output The output. + * @param string $filename The filename. */ protected function writeNewFile(OutputInterface $output, $filename) { - $output->writeln('>> File+ ' . $filename); + $output->writeln('>> File+ '.$filename); } /** - * @param OutputInterface $output The output. - * @param string $directory The directory. + * @param OutputInterface $output The output. + * @param string $directory The directory. */ protected function writeNewDirectory(OutputInterface $output, $directory) { - $output->writeln('>> Dir+ ' . $directory); + $output->writeln('>> Dir+ '.$directory); } /** * Ask confirmation from the user. * - * @param OutputInterface $output The output. - * @param string $question A given question. - * @param string $default A default response. + * @param OutputInterface $output The output. + * @param string $question A given question. + * @param string $default A default response. */ protected function askConfirmation(OutputInterface $output, $question, $default = null) { @@ -625,14 +673,15 @@ protected function askConfirmation(OutputInterface $output, $question, $default } /** - * @param \SplFileInfo $schema + * @param \SplFileInfo $schema * @param BundleInterface $bundle + * * @return string */ protected function transformToLogicalName(\SplFileInfo $schema, BundleInterface $bundle) { $schemaPath = str_replace( - $bundle->getPath(). DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR, + $bundle->getPath().DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR, '', $schema->getRealPath() ); @@ -642,6 +691,7 @@ protected function transformToLogicalName(\SplFileInfo $schema, BundleInterface /** * Compiles arguments/properties for the Phing process. + * * @return array */ private function getPhingArguments(KernelInterface $kernel, $workingDirectory, $properties) @@ -649,20 +699,23 @@ private function getPhingArguments(KernelInterface $kernel, $workingDirectory, $ $args = array(); // Default properties - $properties = array_merge(array( - 'propel.database' => 'mysql', - 'project.dir' => $workingDirectory, - 'propel.output.dir' => $kernel->getRootDir().'/propel', - 'propel.php.dir' => $kernel->getRootDir().'/..', - 'propel.packageObjectModel' => true, - 'propel.useDateTimeClass' => true, - 'propel.dateTimeClass' => 'DateTime', - 'propel.defaultTimeFormat' => '', - 'propel.defaultDateFormat' => '', - 'propel.addClassLevelComment' => false, - 'propel.defaultTimeStampFormat' => '', - 'propel.builder.pluralizer.class' => 'builder.util.StandardEnglishPluralizer', - ), $properties); + $properties = array_merge( + array( + 'propel.database' => 'mysql', + 'project.dir' => $workingDirectory, + 'propel.output.dir' => $kernel->getRootDir().'/propel', + 'propel.php.dir' => $kernel->getRootDir().'/..', + 'propel.packageObjectModel' => true, + 'propel.useDateTimeClass' => true, + 'propel.dateTimeClass' => 'DateTime', + 'propel.defaultTimeFormat' => '', + 'propel.defaultDateFormat' => '', + 'propel.addClassLevelComment' => false, + 'propel.defaultTimeStampFormat' => '', + 'propel.builder.pluralizer.class' => 'builder.util.StandardEnglishPluralizer', + ), + $properties + ); // Adding user defined properties from the configuration $properties = array_merge( diff --git a/Command/FixturesLoadCommand.php b/Command/FixturesLoadCommand.php index 42f0656a..f36dee11 100644 --- a/Command/FixturesLoadCommand.php +++ b/Command/FixturesLoadCommand.php @@ -155,12 +155,12 @@ protected function execute(InputInterface $input, OutputInterface $output) * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return void + * @return int */ protected function loadFixtures(InputInterface $input, OutputInterface $output, $type = null) { if (null === $type) { - return; + return 0; } $datas = $this->getFixtureFiles($type); @@ -169,14 +169,14 @@ protected function loadFixtures(InputInterface $input, OutputInterface $output, return -1; } - list($name, $defaultConfig) = $this->getConnection($input, $output); + list($name) = $this->getConnection($input, $output); if ('yml' === $type) { $loader = new YamlDataLoader($this->getApplication()->getKernel()->getRootDir(), $this->getContainer()); } elseif ('xml' === $type) { $loader = new XmlDataLoader($this->getApplication()->getKernel()->getRootDir()); } else { - return; + return 0; } try { @@ -200,7 +200,7 @@ protected function loadFixtures(InputInterface $input, OutputInterface $output, * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return void + * @return int */ protected function loadSqlFixtures(InputInterface $input, OutputInterface $output) { @@ -254,6 +254,13 @@ protected function prepareCache($tmpdir) /** * Insert SQL + * + * @param array $config + * @param string $sqlDir + * @param string $schemaDir + * @param \Symfony\Component\Console\Output\OutputInterface $output + * + * @return bool */ protected function insertSql($config, $sqlDir, $schemaDir, $output) { diff --git a/Controller/PanelController.php b/Controller/PanelController.php index 79a1c269..2d7476c8 100644 --- a/Controller/PanelController.php +++ b/Controller/PanelController.php @@ -9,9 +9,11 @@ */ namespace Propel\Bundle\PropelBundle\Controller; +use PropelConfiguration; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Templating\EngineInterface; /** * PanelController is designed to display information in the Propel Panel. @@ -25,19 +27,20 @@ class PanelController implements ContainerAwareInterface /** * This method renders the global Propel configuration. */ - public function configurationAction() + public function configurationAction(EngineInterface $templating, PropelConfiguration $propelConfiguration) { - $templating = $this->container->get('templating'); - - return $templating->renderResponse( - 'PropelBundle:Panel:configuration.html.twig', - array( - 'propel_version' => \Propel::VERSION, - 'configuration' => $this->container->get('propel.configuration')->getParameters(), - 'default_connection' => $this->container->getParameter('propel.dbal.default_connection'), - 'logging' => $this->container->getParameter('propel.logging'), - 'path' => $this->container->getParameter('propel.path'), - 'phing_path' => $this->container->getParameter('propel.phing_path'), + $response = new Response(); + $response->setContent( + $templating->render( + 'PropelBundle:Panel:configuration.html.twig', + array( + 'propel_version' => \Propel::VERSION, + 'configuration' => $propelConfiguration->getParameters(), + 'default_connection' => $this->container->getParameter('propel.dbal.default_connection'), + 'logging' => $this->container->getParameter('propel.logging'), + 'path' => $this->container->getParameter('propel.path'), + 'phing_path' => $this->container->getParameter('propel.phing_path'), + ) ) ); } @@ -45,8 +48,8 @@ public function configurationAction() /** * Renders the profiler panel for the given token. * - * @param string $token The profiler token - * @param string $connection The connection name + * @param string $token The profiler token + * @param string $connection The connection name * @param integer $query * * @return Symfony\Component\HttpFoundation\Response A Response instance diff --git a/DataCollector/PropelDataCollector.php b/DataCollector/PropelDataCollector.php index e0c8a325..8ee60d09 100644 --- a/DataCollector/PropelDataCollector.php +++ b/DataCollector/PropelDataCollector.php @@ -40,7 +40,7 @@ class PropelDataCollector extends DataCollector /** * Constructor. * - * @param PropelLogger $logger A Propel logger. + * @param PropelLogger $logger A Propel logger. * @param \PropelConfiguration $propelConfiguration The Propel configuration object. */ public function __construct(PropelLogger $logger, \PropelConfiguration $propelConfiguration) @@ -99,7 +99,7 @@ public function getTime() { $time = 0; foreach ($this->data['queries'] as $query) { - $time += (float) $query['time']; + $time += (float)$query['time']; } return $time; @@ -144,4 +144,13 @@ private function countQueries() { return count($this->logger->getQueries()); } + + /** + * Resets this data collector to its initial state. + */ + public function reset() + { + $this->data = array(); + $this->logger->reset(); + } } diff --git a/DataFixtures/Dumper/YamlDataDumper.php b/DataFixtures/Dumper/YamlDataDumper.php index dca5686f..89acfd52 100644 --- a/DataFixtures/Dumper/YamlDataDumper.php +++ b/DataFixtures/Dumper/YamlDataDumper.php @@ -27,8 +27,7 @@ protected function transformArrayToData($data) $data, $inline = 3, $indent = 4, - $exceptionOnInvalidType = false, - $objectSupport = true + Yaml::DUMP_OBJECT ); } } diff --git a/Logger/PropelLogger.php b/Logger/PropelLogger.php index 0c4e65b0..6b605142 100644 --- a/Logger/PropelLogger.php +++ b/Logger/PropelLogger.php @@ -45,8 +45,8 @@ class PropelLogger implements \BasicLogger /** * Constructor. * - * @param LoggerInterface $logger A LoggerInterface instance - * @param Stopwatch $stopwatch A Stopwatch instance + * @param LoggerInterface $logger A LoggerInterface instance + * @param Stopwatch $stopwatch A Stopwatch instance */ public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch = null) { @@ -174,4 +174,13 @@ public function getQueries() { return $this->queries; } + + /** + * Resets this logger to its initial state. + */ + public function reset() + { + $this->queries = array(); + $this->isPrepared = false; + } } diff --git a/README.markdown b/README.markdown index 98cec33a..20572d98 100644 --- a/README.markdown +++ b/README.markdown @@ -1,8 +1,7 @@ PropelBundle ============ -[![Build Status](https://secure.travis-ci.org/propelorm/PropelBundle.png)](http://travis-ci.org/propelorm/PropelBundle) -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/propelorm/PropelBundle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/propelorm/PropelBundle.svg?branch=1.7)](https://travis-ci.org/propelorm/PropelBundle) This is the official implementation of [Propel](http://www.propelorm.org/) in Symfony2. @@ -14,6 +13,7 @@ The two major branches being supported are: * The `1.5` branch contains Propel *1.6+* integration for Symfony *2.8 LTS*. * The `1.6` branch contains Propel *1.6+* integration for Symfony *3.0*. +* The `1.7` branch contains Propel *1.6+* integration for Symfony *4.0*. If you are running on an older version, you may require one of the following versions of this bundle. @@ -24,7 +24,9 @@ If you are running on an older version, you may require one of the following ver ### Propel2 integration -* The `2.0` branch will contain `Propel2` integration for Symfony *3.0*. +* The `2.0` branch contains `Propel2` integration for Symfony *2.5-2.8*. +* The `3.0` branch contains `Propel2` integration for Symfony *2.8-3.x*. +* The `4.0` branch contains `Propel2` integration for Symfony *4.x*. **Note:** the `master` branch won't be updated anymore, and will trigger an `E_USER_DEPRECATED` error to notice people. diff --git a/Resources/config/propel.xml b/Resources/config/propel.xml index 5b11918b..1253d9e1 100644 --- a/Resources/config/propel.xml +++ b/Resources/config/propel.xml @@ -45,7 +45,87 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Command/AbstractCommandTest.php b/Tests/Command/AbstractCommandTest.php index ba18e8d7..f994f51a 100644 --- a/Tests/Command/AbstractCommandTest.php +++ b/Tests/Command/AbstractCommandTest.php @@ -12,6 +12,7 @@ use Propel\Bundle\PropelBundle\Command\AbstractCommand; use Propel\Bundle\PropelBundle\Tests\TestCase; use Symfony\Component\HttpKernel\Bundle\BundleInterface; +use Symfony\Component\HttpKernel\Config\FileLocator; use Symfony\Component\HttpKernel\KernelInterface; /** @@ -24,9 +25,21 @@ class AbstractCommandTest extends TestCase */ protected $command; + /** + * @var \Symfony\Component\Config\FileLocator|\PHPUnit_Framework_MockObject_MockObject + */ + protected $fileLocator; + public function setUp() { $this->command = new TestableAbstractCommand('testable-command'); + $this->fileLocator = $this->getMockBuilder('Symfony\Component\Config\FileLocator') + ->setMethods(array( + 'locate' + )) + ->getMock(); + + $this->command->setFileLocator($this->fileLocator); } public function testParseDbName() @@ -94,8 +107,10 @@ public function testGetSchemasFromBundle() $aSchema = realpath(__DIR__ . '/../Fixtures/src/My/SuperBundle/Resources/config/a-schema.xml'); - // hack to by pass the file locator - $this->command->setLocateResponse($aSchema); + $this->fileLocator + ->expects(self::atLeastOnce()) + ->method('locate') + ->willReturn($aSchema); $schemas = $this->command->getSchemasFromBundle($bundle); @@ -160,8 +175,10 @@ public function testGetFinalSchemas() $aSchema = realpath(__DIR__ . '/../Fixtures/src/My/SuperBundle/Resources/config/a-schema.xml'); - // hack to by pass the file locator - $this->command->setLocateResponse($aSchema); + $this->fileLocator + ->expects(self::atLeastOnce()) + ->method('locate') + ->willReturn($aSchema); $kernel ->expects($this->once()) @@ -194,8 +211,10 @@ public function testGetFinalSchemasWithGivenBundle() $aSchema = realpath(__DIR__ . '/../Fixtures/src/My/SuperBundle/Resources/config/a-schema.xml'); - // hack to by pass the file locator - $this->command->setLocateResponse($aSchema); + $this->fileLocator + ->expects(self::atLeastOnce()) + ->method('locate') + ->willReturn($aSchema); $kernel ->expects($this->never()) @@ -214,28 +233,6 @@ public function testGetFinalSchemasWithGivenBundle() class TestableAbstractCommand extends AbstractCommand { - private $locate; - - public function setLocateResponse($locate) - { - $this->locate = $locate; - } - - public function getContainer() - { - return $this; - } - - public function get($service) - { - return $this; - } - - public function locate($file) - { - return $this->locate; - } - public function parseDbName($dsn) { return parent::parseDbName($dsn); diff --git a/Tests/DataFixtures/Dumper/YamlDataDumperTest.php b/Tests/DataFixtures/Dumper/YamlDataDumperTest.php index 0a091a67..dfe1dc61 100644 --- a/Tests/DataFixtures/Dumper/YamlDataDumperTest.php +++ b/Tests/DataFixtures/Dumper/YamlDataDumperTest.php @@ -49,7 +49,7 @@ public function testYamlDump() id: '1' name: 'An important one' author_id: BookAuthor_1 - complementary_infos: !php/object:O:8:"stdClass":1:{s:15:"first_word_date";s:10:"2012-01-01";} + complementary_infos: !php/object 'O:8:"stdClass":1:{s:15:"first_word_date";s:10:"2012-01-01";}' YAML; diff --git a/composer.json b/composer.json index 9e30a266..c6c73f0f 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,14 @@ "require": { "propel/propel1": "^1.6.8", - "symfony/framework-bundle": "^3.0.2" + "symfony/framework-bundle": "^4.0", + "symfony/dependency-injection": "^4.0" }, "require-dev": { "phpunit/phpunit": "^4.8.21|^5.0.10", "phing/phing": "^2.12", - "symfony/symfony": "^3.0.2", - "sensio/framework-extra-bundle": "^3.0.2", + "symfony/symfony": "^4.0", + "sensio/framework-extra-bundle": "^4.0", "fzaninotto/faker": "^1.5" }, From e9d2426b6f977782fba4e9e65c0827cc38c8ce21 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 17 Apr 2018 14:03:56 +0300 Subject: [PATCH 04/33] Update of composer.json --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c6c73f0f..d91e3735 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,7 @@ "require": { "propel/propel1": "^1.6.8", - "symfony/framework-bundle": "^4.0", - "symfony/dependency-injection": "^4.0" + "symfony/framework-bundle": "^4.0" }, "require-dev": { "phpunit/phpunit": "^4.8.21|^5.0.10", From 01b1cee52fb1b8ab67db2372565b00ca15f60386 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 17 Apr 2018 20:30:36 +0300 Subject: [PATCH 05/33] Symfony 4 compatibility changes --- Controller/PanelController.php | 28 +++++++++----------- PropelBundle.php | 48 ++++++++++++++++++++-------------- Resources/config/propel.xml | 10 +++---- 3 files changed, 46 insertions(+), 40 deletions(-) diff --git a/Controller/PanelController.php b/Controller/PanelController.php index 2d7476c8..58f73d32 100644 --- a/Controller/PanelController.php +++ b/Controller/PanelController.php @@ -9,11 +9,9 @@ */ namespace Propel\Bundle\PropelBundle\Controller; -use PropelConfiguration; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Templating\EngineInterface; /** * PanelController is designed to display information in the Propel Panel. @@ -27,20 +25,20 @@ class PanelController implements ContainerAwareInterface /** * This method renders the global Propel configuration. */ - public function configurationAction(EngineInterface $templating, PropelConfiguration $propelConfiguration) + public function configurationAction() { - $response = new Response(); - $response->setContent( - $templating->render( - 'PropelBundle:Panel:configuration.html.twig', - array( - 'propel_version' => \Propel::VERSION, - 'configuration' => $propelConfiguration->getParameters(), - 'default_connection' => $this->container->getParameter('propel.dbal.default_connection'), - 'logging' => $this->container->getParameter('propel.logging'), - 'path' => $this->container->getParameter('propel.path'), - 'phing_path' => $this->container->getParameter('propel.phing_path'), - ) + $templating = $this->container->get('templating'); + $propelConfiguration = $this->container->get('propel.configuration'); + + return $this->container->get('templating')->renderResponse( + 'PropelBundle:Panel:configuration.html.twig', + array( + 'propel_version' => \Propel::VERSION, + 'configuration' => $propelConfiguration->getParameters(), + 'default_connection' => $this->container->getParameter('propel.dbal.default_connection'), + 'logging' => $this->container->getParameter('propel.logging'), + 'path' => $this->container->getParameter('propel.path'), + 'phing_path' => $this->container->getParameter('propel.phing_path'), ) ); } diff --git a/PropelBundle.php b/PropelBundle.php index e151887e..2c51a054 100644 --- a/PropelBundle.php +++ b/PropelBundle.php @@ -28,31 +28,37 @@ public function boot() require_once $this->container->getParameter('propel.path').'/runtime/lib/Propel.php'; if (0 === strncasecmp(PHP_SAPI, 'cli', 3)) { - set_include_path($this->container->getParameter('kernel.root_dir').'/..'.PATH_SEPARATOR. - $this->container->getParameter('propel.phing_path').PATH_SEPARATOR. - $this->container->getParameter('propel.phing_path').'/classes'.PATH_SEPARATOR. - get_include_path()); + set_include_path( + $this->container->getParameter('kernel.root_dir').DIRECTORY_SEPARATOR.'..'.PATH_SEPARATOR. + $this->container->getParameter('propel.phing_path').PATH_SEPARATOR. + $this->container->getParameter('propel.phing_path').DIRECTORY_SEPARATOR.'classes'.PATH_SEPARATOR. + get_include_path() + ); } if (!\Propel::isInit()) { \Propel::setConfiguration($this->container->get('propel.configuration')); if ($this->container->getParameter('propel.logging')) { - $config = $this - ->container - ->get('propel.configuration') - ; - $config->setParameter('debugpdo.logging.methods', array( - 'PropelPDO::exec', - 'PropelPDO::query', - 'PropelPDO::prepare', - 'DebugPDOStatement::execute', - ), false); - $config->setParameter('debugpdo.logging.details', array( - 'time' => array('enabled' => true), - 'mem' => array('enabled' => true), - 'connection' => array('enabled' => true), - )); + $config = $this->container->get('propel.configuration'); + $config->setParameter( + 'debugpdo.logging.methods', + array( + 'PropelPDO::exec', + 'PropelPDO::query', + 'PropelPDO::prepare', + 'DebugPDOStatement::execute', + ), + false + ); + $config->setParameter( + 'debugpdo.logging.details', + array( + 'time' => array('enabled' => true), + 'mem' => array('enabled' => true), + 'connection' => array('enabled' => true), + ) + ); \Propel::setLogger($this->container->get('propel.logger')); } @@ -69,7 +75,9 @@ public function build(ContainerBuilder $container) parent::build($container); if ($container->hasExtension('security')) { - $container->getExtension('security')->addUserProviderFactory(new PropelFactory('propel', 'propel.security.user.provider')); + $container->getExtension('security')->addUserProviderFactory( + new PropelFactory('propel', 'propel.security.user.provider') + ); } } } diff --git a/Resources/config/propel.xml b/Resources/config/propel.xml index 1253d9e1..3497f25c 100644 --- a/Resources/config/propel.xml +++ b/Resources/config/propel.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> default @@ -17,11 +17,11 @@ - + - + - + From a2ce76a53f20bb92cbd054bbf148d0bd572304d7 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 17 Apr 2018 20:41:38 +0300 Subject: [PATCH 06/33] Updated Travis config to be compatible with SF4 --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc222560..134d2b49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ sudo: false language: php php: - - 7.0 - 7.1 - 7.2 @@ -17,8 +16,6 @@ env: - SYMFONY_VERSION="^4.0.0" COMPOSER_FLAGS="--prefer-lowest" allow_failures: - - php: hhvm - - php: nightly - env: SYMFONY_VERSION="^3.4.0" matrix: From c48cf201e5ee67e3a934289f4c323114a36d3e3f Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 18 Apr 2018 14:03:15 +0300 Subject: [PATCH 07/33] Added new test for ModelType class --- Tests/Form/Type/ModelTypeTest.php | 189 ++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 Tests/Form/Type/ModelTypeTest.php diff --git a/Tests/Form/Type/ModelTypeTest.php b/Tests/Form/Type/ModelTypeTest.php new file mode 100644 index 00000000..fea93306 --- /dev/null +++ b/Tests/Form/Type/ModelTypeTest.php @@ -0,0 +1,189 @@ +query = $this->getMockBuilder('\Propel\Bundle\PropelBundle\Tests\Fixtures\Model\BookQuery') + ->disableOriginalConstructor() + ->setMethods(array('getTableMap', 'find')) + ->getMock(); + + $this->query->expects($this->any()) + ->method('getTableMap') + ->willReturn(new BookTableMap()); + + $this->choices = array( + 'Bernhard' => (new Book())->setId(1)->setName('Bernhard'), + 'Fabien' => (new Book())->setId(2)->setName('Fabien'), + 'Kris' => (new Book())->setId(3)->setName('Kris'), + 'Jon' => (new Book())->setId(4)->setName('Jon'), + 'Roman' => (new Book())->setId(5)->setName('Roman'), + ); + } + + protected function getExtensions() + { + return array(new PropelExtension()); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\MissingOptionsException + */ + public function testEmptyClassExpectations() + { + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'class' => null, + ) + ); + } + + /** + * @expectedException Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + */ + public function testInvalidClassTypeExpectations() + { + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'class' => '\stdClass', + ) + ); + } + + public function testChoiceListAndChoicesCanBeEmpty() + { + $this->query->expects($this->any()) + ->method('getTableMap') + ->willReturn(new BookTableMap()); + + $this->query->expects($this->any()) + ->method('find') + ->willReturn(new \PropelObjectCollection()); + + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'query' => $this->query, + 'class' => BookQuery::class, + ) + ); + + static::assertInstanceOf('Symfony\Component\Form\FormInterface', $form); + } + + public function ChoiceListTestMultiple() + { + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'query' => $this->query, + 'class' => BookQuery::class, + 'multiple' => true, + 'expanded' => false, + ) + ); + } + + public function testExpandedCheckboxesAreNeverRequired() + { + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'class' => Book::class, + 'multiple' => true, + 'expanded' => true, + 'required' => true, + 'choices' => $this->choices, + ) + ); + + foreach ($form as $child) { + $this->assertFalse($child->isRequired()); + } + } + + public function testExpandedRadiosAreRequiredIfChoiceChildIsRequired() + { + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'class' => Book::class, + 'multiple' => false, + 'expanded' => true, + 'required' => true, + 'choices' => $this->choices, + ) + ); + + foreach ($form as $child) { + $this->assertTrue($child->isRequired()); + } + } + + public function testExpandedRadiosAreNotRequiredIfChoiceChildIsNotRequired() + { + $form = $this->factory->create( + static::TESTED_TYPE, + null, + array( + 'class' => Book::class, + 'multiple' => false, + 'expanded' => true, + 'required' => false, + 'choices' => $this->choices, + ) + ); + + foreach ($form as $child) { + $this->assertFalse($child->isRequired()); + } + } +} From dbf2335fd038ab26226f8bb1025f22bff1a571b1 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 18 Apr 2018 14:35:06 +0300 Subject: [PATCH 08/33] CS fixes --- Controller/PanelController.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Controller/PanelController.php b/Controller/PanelController.php index 58f73d32..a7078926 100644 --- a/Controller/PanelController.php +++ b/Controller/PanelController.php @@ -24,21 +24,23 @@ class PanelController implements ContainerAwareInterface /** * This method renders the global Propel configuration. + * + * @return \Symfony\Component\HttpFoundation\Response A Response instance */ public function configurationAction() { $templating = $this->container->get('templating'); $propelConfiguration = $this->container->get('propel.configuration'); - return $this->container->get('templating')->renderResponse( + return $templating->renderResponse( 'PropelBundle:Panel:configuration.html.twig', array( - 'propel_version' => \Propel::VERSION, - 'configuration' => $propelConfiguration->getParameters(), + 'propel_version' => \Propel::VERSION, + 'configuration' => $propelConfiguration->getParameters(), 'default_connection' => $this->container->getParameter('propel.dbal.default_connection'), - 'logging' => $this->container->getParameter('propel.logging'), - 'path' => $this->container->getParameter('propel.path'), - 'phing_path' => $this->container->getParameter('propel.phing_path'), + 'logging' => $this->container->getParameter('propel.logging'), + 'path' => $this->container->getParameter('propel.path'), + 'phing_path' => $this->container->getParameter('propel.phing_path'), ) ); } @@ -50,7 +52,7 @@ public function configurationAction() * @param string $connection The connection name * @param integer $query * - * @return Symfony\Component\HttpFoundation\Response A Response instance + * @return \Symfony\Component\HttpFoundation\Response A Response instance */ public function explainAction($token, $connection, $query) { From 8e686eb10c462c68e9a9b95f359cff5b637a311f Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Mon, 23 Apr 2018 15:46:09 +0300 Subject: [PATCH 09/33] DefinitionDecorator replaced with ChildDefinition. CS and annotation improvements. Fixed possible bug related to simplexml_load_file(PHP Bug #73328). OptionsResolverInterface replaced with OptionsResolver --- Command/AbstractCommand.php | 3 ++- DataFixtures/AbstractDataHandler.php | 3 +++ DataFixtures/Dumper/AbstractDataDumper.php | 2 +- DataFixtures/Loader/XmlDataLoader.php | 4 ++-- .../Security/UserProvider/PropelFactory.php | 12 ++++++++++-- Form/BaseAbstractType.php | 4 ++-- Form/PropelTypeGuesser.php | 17 +++++++++++++++-- 7 files changed, 35 insertions(+), 10 deletions(-) diff --git a/Command/AbstractCommand.php b/Command/AbstractCommand.php index fa8698aa..9ee6756e 100644 --- a/Command/AbstractCommand.php +++ b/Command/AbstractCommand.php @@ -164,6 +164,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) */ protected function callPhing($taskName, $properties = array()) { + /** @var KernelInterface $kernel */ $kernel = $this->getApplication()->getKernel(); if (isset($properties['propel.schema.dir'])) { @@ -267,7 +268,7 @@ protected function copySchemas(KernelInterface $kernel, $cacheDir) // the package needs to be set absolute // besides, the automated namespace to package conversion has // not taken place yet so it needs to be done manually - $database = simplexml_load_file($file); + $database = simplexml_load_string(file_get_contents($file)); // workaround for PHP Bug #73328 / Disabling entity loading breaks XMLReader if (isset($database['package'])) { // Do not use the prefix! diff --git a/DataFixtures/AbstractDataHandler.php b/DataFixtures/AbstractDataHandler.php index 5937b0c0..ce227e9f 100644 --- a/DataFixtures/AbstractDataHandler.php +++ b/DataFixtures/AbstractDataHandler.php @@ -21,10 +21,12 @@ abstract class AbstractDataHandler * @var string */ protected $rootDir; + /** * @var \PDO */ protected $con; + /** * @var \DatabaseMap */ @@ -62,6 +64,7 @@ protected function loadMapBuilders($connectionName = null) $this->dbMap = Propel::getDatabaseMap($connectionName); if (0 === count($this->dbMap->getTables())) { $finder = new Finder(); + /** @var Finder $files */ $files = $finder->files()->name('*TableMap.php') ->in($this->getModelSearchPaths($connectionName)) ->exclude('PropelBundle') diff --git a/DataFixtures/Dumper/AbstractDataDumper.php b/DataFixtures/Dumper/AbstractDataDumper.php index d55bda14..3a987c03 100644 --- a/DataFixtures/Dumper/AbstractDataDumper.php +++ b/DataFixtures/Dumper/AbstractDataDumper.php @@ -109,7 +109,7 @@ protected function getDataAsArray($connectionName = null) $adapter = Propel::getDB($connectionName); // Quote fieldnames $countFields = count($in); - for ($i=0;$i<$countFields;$i++) { + for ($i = 0; $i < $countFields; $i++) { $in[$i] = $adapter->quoteIdentifier($in[$i]); } $stmt = $this diff --git a/DataFixtures/Loader/XmlDataLoader.php b/DataFixtures/Loader/XmlDataLoader.php index 9b05534d..dfb90045 100644 --- a/DataFixtures/Loader/XmlDataLoader.php +++ b/DataFixtures/Loader/XmlDataLoader.php @@ -21,13 +21,13 @@ class XmlDataLoader extends AbstractDataLoader */ protected function transformDataToArray($file) { - $xml = simplexml_load_file($file); + $xml = simplexml_load_string(file_get_contents($file)); // fix for PHP Bug #73328 / Disabling entity loading breaks XMLReader return $this->simpleXmlToArray($xml); } /** - * @param SimpleXMLElement $xml + * @param \SimpleXMLElement $xml * @return array */ protected function simpleXmlToArray($xml) diff --git a/DependencyInjection/Security/UserProvider/PropelFactory.php b/DependencyInjection/Security/UserProvider/PropelFactory.php index 8008bc7d..7a90e6b1 100644 --- a/DependencyInjection/Security/UserProvider/PropelFactory.php +++ b/DependencyInjection/Security/UserProvider/PropelFactory.php @@ -14,7 +14,7 @@ use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface; use Symfony\Component\Config\Definition\Builder\NodeDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\DefinitionDecorator; +use Symfony\Component\DependencyInjection\ChildDefinition; /** * PropelFactory creates services for Propel user provider. @@ -38,15 +38,23 @@ public function __construct($key, $providerId) $this->providerId = $providerId; } + /** + * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container + * @param string $id + * @param array $config + */ public function create(ContainerBuilder $container, $id, $config) { $container - ->setDefinition($id, new DefinitionDecorator($this->providerId)) + ->setDefinition($id, new ChildDefinition($this->providerId)) ->addArgument($config['class']) ->addArgument($config['property']) ; } + /** + * @return string + */ public function getKey() { return $this->key; diff --git a/Form/BaseAbstractType.php b/Form/BaseAbstractType.php index 11ef29dd..bbdae891 100644 --- a/Form/BaseAbstractType.php +++ b/Form/BaseAbstractType.php @@ -3,7 +3,7 @@ namespace Propel\Bundle\PropelBundle\Form; use Symfony\Component\Form\AbstractType; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; abstract class BaseAbstractType extends AbstractType { @@ -46,7 +46,7 @@ public function mergeOptions($options) /** * {@inheritdoc} */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function setDefaultOptions(OptionsResolver $resolver) { $resolver->setDefaults($this->options); } diff --git a/Form/PropelTypeGuesser.php b/Form/PropelTypeGuesser.php index da441a67..14a94cdd 100644 --- a/Form/PropelTypeGuesser.php +++ b/Form/PropelTypeGuesser.php @@ -162,22 +162,35 @@ public function guessPattern($class, $property) } } + /** + * @param string $class + * + * @return \TableMap + */ protected function getTable($class) { - if (isset($this->cache[$class])) { + if (array_key_exists($class, $this->cache)) { return $this->cache[$class]; } if (class_exists($queryClass = $class.'Query')) { + /** @var \ModelCriteria $query */ $query = new $queryClass(); return $this->cache[$class] = $query->getTableMap(); } } + /** + * @param string $class + * @param string $property + * + * @return \ColumnMap + * @throws \PropelException + */ protected function getColumn($class, $property) { - if (isset($this->cache[$class.'::'.$property])) { + if (array_key_exists($class.'::'.$property, $this->cache)) { return $this->cache[$class.'::'.$property]; } From a70d96302e167b580efd256c199cb1ec574e5e70 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 25 Apr 2018 18:51:25 +0300 Subject: [PATCH 10/33] Fixed commands examples in documentation --- Resources/doc/commands.markdown | 26 +++++++++++++------------- Resources/doc/fixtures.markdown | 6 +++--- Resources/doc/index.markdown | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Resources/doc/commands.markdown b/Resources/doc/commands.markdown index 34f43266..46930eff 100644 --- a/Resources/doc/commands.markdown +++ b/Resources/doc/commands.markdown @@ -9,14 +9,14 @@ and so on. You can create a **database**: - > php app/console propel:database:create [--connection[=""]] + > php bin/console propel:database:create [--connection[=""]] As usual, `--connection` allows to specify a connection. You can drop a **database**: - > php app/console propel:database:drop [--connection[=""]] [--force] + > php bin/console propel:database:drop [--connection[=""]] [--force] As usual, `--connection` allows to specify a connection. @@ -27,20 +27,20 @@ Note that the `--force` option is needed to actually execute the SQL statements. You can generate stub classes based on your `schema.xml` in a given bundle: - > php app/console propel:form:generate [-f|--force] bundle [models1] ... [modelsN] + > php bin/console propel:form:generate [-f|--force] bundle [models1] ... [modelsN] It will write Form Type classes in `src/YourVendor/YourBundle/Form/Type`. You can choose which Form Type to build by specifing Model names: - > php app/console propel:form:generate @AcmeDemoBundle Book Author + > php bin/console propel:form:generate @AcmeDemoBundle Book Author ## Graphviz ## You can generate **Graphviz** file for your project by using the following command line: - > php app/console propel:graphviz:generate + > php bin/console propel:graphviz:generate It will write files in `app/propel/graph/`. @@ -49,32 +49,32 @@ It will write files in `app/propel/graph/`. Generates SQL diff between the XML schemas and the current database structure: - > php app/console propel:migration:generate-diff [--connection[=""]] + > php bin/console propel:migration:generate-diff [--connection[=""]] As usual, `--connection` allows to specify a connection. Executes the migrations: - > php app/console propel:migration:migrate + > php bin/console propel:migration:migrate Executes the next migration up: - > php app/console propel:migration:migrate --up + > php bin/console propel:migration:migrate --up Executes the previous migration down: - > php app/console propel:migration:migrate --down + > php bin/console propel:migration:migrate --down Lists the migrations yet to be executed: - > php app/console propel:migration:status + > php bin/console propel:migration:status ## Table Manipulations ## You can drop one or several **tables**: - > php app/console propel:table:drop [--force] [--connection[="..."]] [table1] ... [tableN] + > php bin/console propel:table:drop [--force] [--connection[="..."]] [table1] ... [tableN] As usual, `--connection` allows to specify a connection. @@ -87,11 +87,11 @@ Note that the `--force` option is needed to actually execute the deletion. Run the following command to generate an XML schema from your `default` database: - > php app/console propel:reverse + > php bin/console propel:reverse You can define which connection to use: - > php app/console propel:reverse --connection=default + > php bin/console propel:reverse --connection=default [Back to index](index.markdown) diff --git a/Resources/doc/fixtures.markdown b/Resources/doc/fixtures.markdown index 2b1736e5..0fb76972 100644 --- a/Resources/doc/fixtures.markdown +++ b/Resources/doc/fixtures.markdown @@ -8,7 +8,7 @@ like menus, labels, ... you need by default in your database in production. The following command is designed to load fixtures: - > php app/console propel:fixtures:load [-d|--dir[="..."]] [--xml] [--sql] [--yml] [--connection[="..."]] [bundle] + > php bin/console propel:fixtures:load [-d|--dir[="..."]] [--xml] [--sql] [--yml] [--connection[="..."]] [bundle] As you can see, there are many options to allow you to easily load fixtures. @@ -25,7 +25,7 @@ If none of this parameter are set all files YAML, XML and SQL in the directory w You can pass a bundle name to load fixtures from it. A bundle's name starts with `@` like `@AcmeDemoBundle`. - > php app/console propel:fixtures:load @AcmeDemoBundle + > php bin/console propel:fixtures:load @AcmeDemoBundle ### XML Fixtures ### @@ -93,7 +93,7 @@ allows to write strong fixtures efficiently. You can dump data from your database into YAML fixtures file by using this command: - > php app/console propel:fixtures:dump [--connection[="..."]] + > php bin/console propel:fixtures:dump [--connection[="..."]] Dumped files will be written in the fixtures directory: `app/propel/fixtures/` with the following name: `fixtures_99999.yml` where `99999` is a timestamp. diff --git a/Resources/doc/index.markdown b/Resources/doc/index.markdown index f3da3b53..307a95d9 100644 --- a/Resources/doc/index.markdown +++ b/Resources/doc/index.markdown @@ -12,7 +12,7 @@ The recommended way to install this bundle is to rely on [Composer](http://getco { "require": { // ... - "propel/propel-bundle": "1.1.*" + "propel/propel-bundle": "1.4.*" } } ``` @@ -78,11 +78,11 @@ You are almost ready, the next steps are: Now, you can build your model classes, and SQL by running the following command: - > php app/console propel:build [--classes] [--sql] [--insert-sql] [--connection[=""]] + > php bin/console propel:build [--classes] [--sql] [--insert-sql] [--connection[=""]] To insert SQL statements, use the `propel:sql:insert` command: - > php app/console propel:sql:insert [--force] [--connection[=""]] + > php bin/console propel:sql:insert [--force] [--connection[=""]] Note that the `--force` option is needed to actually execute the SQL statements. From 449a96b41a8954d5fee6747138c67f05e1f55570 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 13 Nov 2018 13:16:50 +0200 Subject: [PATCH 11/33] BC changes for Symfony 4.2 Backward compatibility changes for SF 4.1 and bellow. --- DependencyInjection/Configuration.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 69faaebe..38ae72d3 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -42,8 +42,8 @@ public function __construct($debug) */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('propel'); + $treeBuilder = new TreeBuilder('propel'); + $rootNode = $this->getRootNode($treeBuilder, 'propel'); $this->addGeneralSection($rootNode); $this->addDbalSection($rootNode); @@ -259,4 +259,14 @@ private function getDbalConnectionsNode() return $node; } + + private function getRootNode(TreeBuilder $treeBuilder, $name) + { + // BC layer for symfony/config 4.1 and older + if ( ! \method_exists($treeBuilder, 'getRootNode')) { + return $treeBuilder->root($name); + } + + return $treeBuilder->getRootNode(); + } } From 3b4696235c107de18a9cac281609306f7572536f Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 13 Nov 2018 13:33:31 +0200 Subject: [PATCH 12/33] Build fix --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d91e3735..c0e20e03 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "propel/propel-bundle", - "description": "Integration of Propel in Symfony2", + "description": "Integration of Propel in Symfony", "keywords": ["propel", "orm", "persistence"], "type": "symfony-bundle", "license": "MIT", @@ -17,7 +17,7 @@ "require": { "propel/propel1": "^1.6.8", - "symfony/framework-bundle": "^4.0" + "symfony/framework-bundle": "^3.4|^4.0", }, "require-dev": { "phpunit/phpunit": "^4.8.21|^5.0.10", From 1f73530012caf91f8f11da59cecc7a7befea1973 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 13 Nov 2018 13:34:52 +0200 Subject: [PATCH 13/33] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c0e20e03..e849b632 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "propel/propel1": "^1.6.8", - "symfony/framework-bundle": "^3.4|^4.0", + "symfony/framework-bundle": "^3.4|^4.0" }, "require-dev": { "phpunit/phpunit": "^4.8.21|^5.0.10", From d85067c360d3b24390eaa5f7243f354adf63407a Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 17 May 2019 17:30:08 +0300 Subject: [PATCH 14/33] Update FixturesLoadCommand.php Fixed path to directory with cache --- Command/FixturesLoadCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Command/FixturesLoadCommand.php b/Command/FixturesLoadCommand.php index f36dee11..dcf348cd 100644 --- a/Command/FixturesLoadCommand.php +++ b/Command/FixturesLoadCommand.php @@ -204,7 +204,7 @@ protected function loadFixtures(InputInterface $input, OutputInterface $output, */ protected function loadSqlFixtures(InputInterface $input, OutputInterface $output) { - $tmpdir = $this->getApplication()->getKernel()->getRootDir() . '/cache/propel'; + $tmpdir = $this->getApplication()->getKernel()->getCacheDir() . '/propel'; $datas = $this->getFixtureFiles('sql'); $this->prepareCache($tmpdir); From 60e96395e31ec0e478f17619b7aec9c2eb76b501 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 17 May 2019 17:32:11 +0300 Subject: [PATCH 15/33] Update AbstractCommand.php Fixed compatibility with SF4.2 --- Command/AbstractCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Command/AbstractCommand.php b/Command/AbstractCommand.php index 9ee6756e..f03a6a22 100644 --- a/Command/AbstractCommand.php +++ b/Command/AbstractCommand.php @@ -666,9 +666,9 @@ protected function writeNewDirectory(OutputInterface $output, $directory) * * @param OutputInterface $output The output. * @param string $question A given question. - * @param string $default A default response. + * @param boolean $default A default response. */ - protected function askConfirmation(OutputInterface $output, $question, $default = null) + protected function askConfirmation(OutputInterface $output, $question, $default = false) { return $this->getHelper('question')->ask($this->input, $output, new ConfirmationQuestion($question, $default)); } From 7bd16928468b5d5ed022db5273239040c1972ad7 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 29 May 2019 15:17:40 +0300 Subject: [PATCH 16/33] Deprecation fix for TreeBuilder. Added backward compatibility with symfony/config 4.1 and older --- DependencyInjection/Configuration.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 38ae72d3..4817b067 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -43,7 +43,13 @@ public function __construct($debug) public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('propel'); - $rootNode = $this->getRootNode($treeBuilder, 'propel'); + + if (method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + // BC layer for symfony/config 4.1 and older + $rootNode = $treeBuilder->root('propel'); + } $this->addGeneralSection($rootNode); $this->addDbalSection($rootNode); From ad1032fdc2c570c494d46cf0dd80bc604ebf861e Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 29 May 2019 16:04:15 +0300 Subject: [PATCH 17/33] Fixed deprecation for Twig 2.10.0 --- Resources/views/Panel/configuration.html.twig | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/Resources/views/Panel/configuration.html.twig b/Resources/views/Panel/configuration.html.twig index 61e02dae..93120998 100644 --- a/Resources/views/Panel/configuration.html.twig +++ b/Resources/views/Panel/configuration.html.twig @@ -36,42 +36,44 @@ - {% for name, config in configuration.datasources if config is iterable %} - - - {{ name }} - - Adapter - {{ config.adapter }} - - - DSN - {{ config.connection.dsn }} - - - Class - {{ config.connection.classname }} - - - Options - -
    - {% for key, value in config.connection.options %} -
  • {{ key }} : {{ value }}
  • - {% endfor %} -
- - - - Attributes - -
    - {% for key, value in config.connection.attributes %} -
  • {{ key }} : {{ value }}
  • - {% endfor %} -
- - + {% for name, config in configuration.datasources %} + {% if config is iterable %} + + + {{ name }} + + Adapter + {{ config.adapter }} + + + DSN + {{ config.connection.dsn }} + + + Class + {{ config.connection.classname }} + + + Options + +
    + {% for key, value in config.connection.options %} +
  • {{ key }} : {{ value }}
  • + {% endfor %} +
+ + + + Attributes + +
    + {% for key, value in config.connection.attributes %} +
  • {{ key }} : {{ value }}
  • + {% endfor %} +
+ + + {% endif %} {% endfor %} From 77794b989f4ff50e9e4ecd36f3cfb2661ec64786 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 19 Jun 2019 14:31:08 +0300 Subject: [PATCH 18/33] Update .travis.yml --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 134d2b49..225aea3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ language: php php: - 7.1 - 7.2 + - 7.3 cache: directories: @@ -14,6 +15,12 @@ env: - SYMFONY_VERSION="^3.4.0" - SYMFONY_VERSION="^4.0.0" - SYMFONY_VERSION="^4.0.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.1.0" + - SYMFONY_VERSION="^4.1.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.2.0" + - SYMFONY_VERSION="^4.2.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.3.0" + - SYMFONY_VERSION="^4.3.0" COMPOSER_FLAGS="--prefer-lowest" allow_failures: - env: SYMFONY_VERSION="^3.4.0" From 19136119af6a4815c65a7c21519dcb9437976e34 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 19 Jun 2019 23:49:32 +0300 Subject: [PATCH 19/33] Build configuration adjustments --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 225aea3e..c5c87ff3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,15 +13,17 @@ cache: env: - SYMFONY_VERSION="^3.4.0" - - SYMFONY_VERSION="^4.0.0" - - SYMFONY_VERSION="^4.0.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.1.0" - - SYMFONY_VERSION="^4.1.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.2.0" - - SYMFONY_VERSION="^4.2.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.3.0" - - SYMFONY_VERSION="^4.3.0" COMPOSER_FLAGS="--prefer-lowest" - + - SYMFONY_VERSION="4.0.*" + - SYMFONY_VERSION="4.0.*" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="4.1.*" + - SYMFONY_VERSION="4.1.*" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="4.2.*" + - SYMFONY_VERSION="4.2.*" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="4.3.*" + - SYMFONY_VERSION="4.3.*" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.3" + - SYMFONY_VERSION="^4.3" COMPOSER_FLAGS="--prefer-lowest" + allow_failures: - env: SYMFONY_VERSION="^3.4.0" From c2942d0e8d8da9dd273bd9040d1b995ddf8b358b Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Tue, 28 Jan 2020 12:23:38 +0200 Subject: [PATCH 20/33] Update .travis.yml --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5c87ff3..3bda6752 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,9 +20,7 @@ env: - SYMFONY_VERSION="4.2.*" - SYMFONY_VERSION="4.2.*" COMPOSER_FLAGS="--prefer-lowest" - SYMFONY_VERSION="4.3.*" - - SYMFONY_VERSION="4.3.*" COMPOSER_FLAGS="--prefer-lowest" - SYMFONY_VERSION="^4.3" - - SYMFONY_VERSION="^4.3" COMPOSER_FLAGS="--prefer-lowest" allow_failures: - env: SYMFONY_VERSION="^3.4.0" From 146ba88cf7c065c2edcdff29fa96573ed491def4 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 20:27:28 +0300 Subject: [PATCH 21/33] Create .gitattributes --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..84c7add0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +/Tests export-ignore +/phpunit.xml.dist export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore From eafb966cd9418f87e83a7bf314c03ecc25fcfcb9 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 20:29:24 +0300 Subject: [PATCH 22/33] Update .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 84c7add0..e7cefca4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ /phpunit.xml.dist export-ignore /.gitattributes export-ignore /.gitignore export-ignore +/Resources/doc export-ignore From 23e31722cae98fa1b972a0e0deb01e5d9a00b7be Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 22:00:44 +0300 Subject: [PATCH 23/33] Update .travis.yml --- .travis.yml | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bda6752..f443fdd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,38 +2,43 @@ sudo: false language: php -php: - - 7.1 - - 7.2 - - 7.3 - cache: directories: - $HOME/.composer/cache/files +matrix: + fast_finish: true + include: + - php: 7.1.33 + - php: 7.2 + - php: 7.3 + allow_failures: + - php: 7.3 + env: SYMFONY_VERSION=dev + - php: 7.3 + env: SYMFONY_VERSION="^5.0" + env: - SYMFONY_VERSION="^3.4.0" - - SYMFONY_VERSION="4.0.*" - - SYMFONY_VERSION="4.0.*" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="4.1.*" - - SYMFONY_VERSION="4.1.*" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="4.2.*" - - SYMFONY_VERSION="4.2.*" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="4.3.*" + - SYMFONY_VERSION="^4.0" + - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.1" + - SYMFONY_VERSION="^4.1" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.2" + - SYMFONY_VERSION="^4.2" COMPOSER_FLAGS="--prefer-lowest" - SYMFONY_VERSION="^4.3" - -allow_failures: - - env: SYMFONY_VERSION="^3.4.0" - -matrix: - fast_finish: true + - SYMFONY_VERSION="^4.3" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.4" + - SYMFONY_VERSION="^4.4" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^5.0" + - SYMFONY_VERSION="dev" before_install: - composer self-update - if [ "${SYMFONY_VERSION}" != "" ]; then composer require --no-update "symfony/symfony:${SYMFONY_VERSION}"; fi; install: - - composer update ${COMPOSER_FLAGS} --prefer-source + - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --prefer-stable script: - vendor/bin/phpunit --colors From 3a1ab5f3d07701820cee0762a2a2a9589449e979 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 22:14:36 +0300 Subject: [PATCH 24/33] Update .travis.yml --- .travis.yml | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index f443fdd4..0e9f4e8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,32 +10,51 @@ matrix: fast_finish: true include: - php: 7.1.33 + - SYMFONY_VERSION="^3.4.0" + - SYMFONY_VERSION="^4.0" + - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.1" + - SYMFONY_VERSION="^4.2" + - SYMFONY_VERSION="^4.3" + - SYMFONY_VERSION="^4.4" + - SYMFONY_VERSION="^4.4" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^5.0" + - SYMFONY_VERSION="dev" - php: 7.2 + env: + - SYMFONY_VERSION="^3.4.0" + - SYMFONY_VERSION="^4.0" + - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.1" + - SYMFONY_VERSION="^4.2" + - SYMFONY_VERSION="^4.3" + - SYMFONY_VERSION="^4.4" + - SYMFONY_VERSION="^4.4" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^5.0" + - SYMFONY_VERSION="dev" - php: 7.3 + env: + - SYMFONY_VERSION="^3.4.0" + - SYMFONY_VERSION="^4.0" + - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.1" + - SYMFONY_VERSION="^4.2" + - SYMFONY_VERSION="^4.3" + - SYMFONY_VERSION="^4.4" + - SYMFONY_VERSION="^5.0" + - SYMFONY_VERSION="dev" allow_failures: - php: 7.3 env: SYMFONY_VERSION=dev - php: 7.3 env: SYMFONY_VERSION="^5.0" -env: - - SYMFONY_VERSION="^3.4.0" - - SYMFONY_VERSION="^4.0" - - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.1" - - SYMFONY_VERSION="^4.1" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.2" - - SYMFONY_VERSION="^4.2" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.3" - - SYMFONY_VERSION="^4.3" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.4" - - SYMFONY_VERSION="^4.4" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^5.0" - - SYMFONY_VERSION="dev" - before_install: - composer self-update - if [ "${SYMFONY_VERSION}" != "" ]; then composer require --no-update "symfony/symfony:${SYMFONY_VERSION}"; fi; + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi + - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; + - if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; install: - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --prefer-stable From 1c4c6d5f82adb0074b5fe632afa2b53a1b148851 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 22:18:44 +0300 Subject: [PATCH 25/33] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0e9f4e8c..735e7f5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ matrix: fast_finish: true include: - php: 7.1.33 + env: - SYMFONY_VERSION="^3.4.0" - SYMFONY_VERSION="^4.0" - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" From ff804248dad777370a8d61f9ec7942c2a0c6c008 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 22:25:54 +0300 Subject: [PATCH 26/33] Update .travis.yml --- .travis.yml | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 735e7f5d..0400cdf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,47 +6,41 @@ cache: directories: - $HOME/.composer/cache/files -matrix: +jobs: fast_finish: true include: - php: 7.1.33 env: - SYMFONY_VERSION="^3.4.0" - - SYMFONY_VERSION="^4.0" - - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.1" - - SYMFONY_VERSION="^4.2" - - SYMFONY_VERSION="^4.3" - - SYMFONY_VERSION="^4.4" - - SYMFONY_VERSION="^4.4" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^5.0" - - SYMFONY_VERSION="dev" - - php: 7.2 + + - php: 7.1.33 env: - - SYMFONY_VERSION="^3.4.0" - SYMFONY_VERSION="^4.0" + + - php: 7.1.33 + env: - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.1" - - SYMFONY_VERSION="^4.2" - - SYMFONY_VERSION="^4.3" - - SYMFONY_VERSION="^4.4" - - SYMFONY_VERSION="^4.4" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^5.0" - - SYMFONY_VERSION="dev" + - php: 7.3 env: - - SYMFONY_VERSION="^3.4.0" - - SYMFONY_VERSION="^4.0" - - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" - - SYMFONY_VERSION="^4.1" - - SYMFONY_VERSION="^4.2" - SYMFONY_VERSION="^4.3" + + - php: 7.3 + env: - SYMFONY_VERSION="^4.4" + + - php: 7.3 + env: - SYMFONY_VERSION="^5.0" + + - php: 7.3 + env: - SYMFONY_VERSION="dev" + allow_failures: - php: 7.3 env: SYMFONY_VERSION=dev + - php: 7.3 env: SYMFONY_VERSION="^5.0" From 0ac0a899e0d8c11692277bde91f6b6a3010f306d Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 22:29:47 +0300 Subject: [PATCH 27/33] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0400cdf9..8e64b4b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ jobs: allow_failures: - php: 7.3 - env: SYMFONY_VERSION=dev + env: SYMFONY_VERSION="dev" - php: 7.3 env: SYMFONY_VERSION="^5.0" From f25ae1f1d7aced7283777dd91c4c74fd2f22919c Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Wed, 1 Apr 2020 23:22:57 +0300 Subject: [PATCH 28/33] Update .travis.yml --- .travis.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e64b4b1..cd4d8d96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,15 +11,11 @@ jobs: include: - php: 7.1.33 env: - - SYMFONY_VERSION="^3.4.0" - - - php: 7.1.33 - env: - - SYMFONY_VERSION="^4.0" + - SYMFONY_VERSION="^4.3" - - php: 7.1.33 + - php: 7.3 env: - - SYMFONY_VERSION="^4.0" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="^4.3" COMPOSER_FLAGS="--prefer-lowest" - php: 7.3 env: From fd1af1355e257610d2c12346432ad5827aaff570 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 3 Apr 2020 19:23:22 +0300 Subject: [PATCH 29/33] Revert "Update .travis.yml" This reverts commit f25ae1f1d7aced7283777dd91c4c74fd2f22919c. --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cd4d8d96..5e12c7d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,11 +11,15 @@ jobs: include: - php: 7.1.33 env: - - SYMFONY_VERSION="^4.3" + - SYMFONY_VERSION="^3.4.0" - - php: 7.3 + - php: 7.1.33 + env: + - SYMFONY_VERSION="4.0.*" + + - php: 7.1.33 env: - - SYMFONY_VERSION="^4.3" COMPOSER_FLAGS="--prefer-lowest" + - SYMFONY_VERSION="4.0.*" COMPOSER_FLAGS="--prefer-lowest" - php: 7.3 env: From 539d2c8529a5f4e8479a6af6eeec65cc149d58b6 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 3 Apr 2020 19:31:01 +0300 Subject: [PATCH 30/33] Fixed README.markdown --- README.markdown | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index 20572d98..091b4c45 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,7 @@ PropelBundle ============ -[![Build Status](https://travis-ci.org/propelorm/PropelBundle.svg?branch=1.7)](https://travis-ci.org/propelorm/PropelBundle) +[![Build Status](https://travis-ci.org/roman_tymoshyk/PropelBundle.svg?branch=1.7)](https://travis-ci.org/roman_tymoshyk/PropelBundle) This is the official implementation of [Propel](http://www.propelorm.org/) in Symfony2. @@ -11,9 +11,8 @@ This is the official implementation of [Propel](http://www.propelorm.org/) in Sy The two major branches being supported are: -* The `1.5` branch contains Propel *1.6+* integration for Symfony *2.8 LTS*. -* The `1.6` branch contains Propel *1.6+* integration for Symfony *3.0*. -* The `1.7` branch contains Propel *1.6+* integration for Symfony *4.0*. +* The `1.7` branch contains Propel *1.6+* integration for Symfony *3.4*-*4.4*. +* The `1.8` branch contains Propel *1.6+* integration for Symfony *4.3.7*-*5.0*. If you are running on an older version, you may require one of the following versions of this bundle. @@ -21,6 +20,8 @@ If you are running on an older version, you may require one of the following ver * The `1.1` branch contains Propel *1.6* integration for Symfony *2.1*. * The `1.2` branch contains Propel *1.6* integration for Symfony *>2.1*. * The `1.4` branch contains Propel *1.6* integration for Symfony *>2.3*. +* The `1.5` branch contains Propel *1.6+* integration for Symfony *2.8 LTS*. +* The `1.6` branch contains Propel *1.6+* integration for Symfony *3.0*. ### Propel2 integration From 72ee0cb242290917a36ea8fe13dd56eb0081dddf Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 3 Apr 2020 19:33:19 +0300 Subject: [PATCH 31/33] Update README.markdown --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 091b4c45..c6ef53b1 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,7 @@ PropelBundle ============ -[![Build Status](https://travis-ci.org/roman_tymoshyk/PropelBundle.svg?branch=1.7)](https://travis-ci.org/roman_tymoshyk/PropelBundle) +[![Build Status](https://travis-ci.org/romantymoshyk/PropelBundle.svg?branch=1.7)](https://travis-ci.org/roman_tymoshyk/PropelBundle) This is the official implementation of [Propel](http://www.propelorm.org/) in Symfony2. From 5ffc3159d034de0bc5e1e0f407d02687acede790 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 3 Apr 2020 19:33:28 +0300 Subject: [PATCH 32/33] Update README.markdown --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index c6ef53b1..c50b6a35 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,7 @@ PropelBundle ============ -[![Build Status](https://travis-ci.org/romantymoshyk/PropelBundle.svg?branch=1.7)](https://travis-ci.org/roman_tymoshyk/PropelBundle) +[![Build Status](https://travis-ci.org/romantymoshyk/PropelBundle.svg?branch=1.7)](https://travis-ci.org/romantymoshyk/PropelBundle) This is the official implementation of [Propel](http://www.propelorm.org/) in Symfony2. From 84a2c8ac2a9a5f5dd6f8fa4c2e512faaced0dcd5 Mon Sep 17 00:00:00 2001 From: Roman Tymoshyk Date: Fri, 3 Apr 2020 19:31:01 +0300 Subject: [PATCH 33/33] Update README.markdown --- README.markdown | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index 20572d98..c50b6a35 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,7 @@ PropelBundle ============ -[![Build Status](https://travis-ci.org/propelorm/PropelBundle.svg?branch=1.7)](https://travis-ci.org/propelorm/PropelBundle) +[![Build Status](https://travis-ci.org/romantymoshyk/PropelBundle.svg?branch=1.7)](https://travis-ci.org/romantymoshyk/PropelBundle) This is the official implementation of [Propel](http://www.propelorm.org/) in Symfony2. @@ -11,9 +11,8 @@ This is the official implementation of [Propel](http://www.propelorm.org/) in Sy The two major branches being supported are: -* The `1.5` branch contains Propel *1.6+* integration for Symfony *2.8 LTS*. -* The `1.6` branch contains Propel *1.6+* integration for Symfony *3.0*. -* The `1.7` branch contains Propel *1.6+* integration for Symfony *4.0*. +* The `1.7` branch contains Propel *1.6+* integration for Symfony *3.4*-*4.4*. +* The `1.8` branch contains Propel *1.6+* integration for Symfony *4.3.7*-*5.0*. If you are running on an older version, you may require one of the following versions of this bundle. @@ -21,6 +20,8 @@ If you are running on an older version, you may require one of the following ver * The `1.1` branch contains Propel *1.6* integration for Symfony *2.1*. * The `1.2` branch contains Propel *1.6* integration for Symfony *>2.1*. * The `1.4` branch contains Propel *1.6* integration for Symfony *>2.3*. +* The `1.5` branch contains Propel *1.6+* integration for Symfony *2.8 LTS*. +* The `1.6` branch contains Propel *1.6+* integration for Symfony *3.0*. ### Propel2 integration