Compare commits

..

29 Commits

Author SHA1 Message Date
Jonathan H. Wage 984535cadc Preparing v2.5.12 release 2017-10-23 13:21:04 -05:00
Jonathan H. Wage 35a579efdc Merge pull request #6733 from fabpot/patch-2
Allow Symfony 4
2017-10-23 12:50:36 -05:00
Fabien Potencier a2b4e5b293 Allow Symfony 4 2017-09-27 15:33:54 -07:00
Marco Pivetta 24d95796bb Bumping development version to v2.5.12-DEV 2017-09-18 08:52:10 +02:00
Marco Pivetta 249b737094 Preparing v2.5.11 release 2017-09-18 08:50:20 +02:00
Marco Pivetta 36dc28d43e Merge pull request #6635 from davidbarratt/instantiator
Allow installation of `doctrine/instantiator:^1.0.1`
2017-08-19 18:47:32 +02:00
David Barratt 0ec9e53c8d Fix doctrine/instantiator constraint
The current constraint prevents doctrine from being installed on PHP 7.1
2017-08-19 11:51:46 -04:00
Marco Pivetta aa80f6c0b5 Removed PHPUnit 5.6+ API usage 2017-08-18 21:24:47 +02:00
Marco Pivetta fd6d4890c4 Bumping development release to 2.5.11-DEV 2017-08-18 21:23:23 +02:00
Marco Pivetta c78afd5172 Preparing v2.5.10 release 2017-08-18 21:17:35 +02:00
Marco Pivetta fb7b78c004 Merge branch 'fix/#6633-#3788-avoid-xml-external-entity-loading-errors-in-xml-mapping-driver-2.5' into 2.5
Backport #6633
Backport #3788
2017-08-18 21:12:12 +02:00
Marco Pivetta 0de69e5a80 #6633 #3788 documenting why simplexml_load_file() was not used 2017-08-18 21:10:45 +02:00
Aljosha Papsch d7e1f883d8 XmlDriver: Avoid PHP bug #62577 by avoiding simplexml_load_file.
Doctrine is affected by PHP bug #62577. simplexml_load_file is not
able to load files if libxml_disable_entity_loader(true) has been
called. simplexml_load_file fails with the message:

I/O warning : failed to load external entity "/my/mappings/my_entity.dcm.xml"
in /path-to/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php on line 711

This error occurs even if there are no external entities in the XML file.

Waiting for the PHP bug to be resolved is infeasible, because it is
unresolved since years. Therefore Doctrine needs to circumvent the bug
by replacing simplexml_load_file with simplexml_load_string while getting
the file contents itself. simplexml_load_string is not affected by the
PHP bug.
2017-08-18 21:10:11 +02:00
Marco Pivetta 82e0d7e21a Removing ::class meta-constant for tests that need to run against my grandparents' PHP 2017-08-16 20:06:14 +02:00
Marco Pivetta 26880983fc Removing ::class meta-constant for tests that need to run against my grandparents' PHP 2017-08-16 19:24:39 +02:00
Marco Pivetta d9899732ca Bumping development release to v2.5.10DEV 2017-08-16 15:30:59 +02:00
Marco Pivetta 4f96fc62ce Preparing v2.5.9 release 2017-08-16 15:30:32 +02:00
Marco Pivetta 6184343fd5 Merge branch 'fix/#6626-skip-proxy-generation-for-embeddable-classes-2.5' into 2.5
Backport #6626
Backport #6625
2017-08-16 15:21:29 +02:00
Marco Pivetta ee22be27a5 #6625 #6626 removing PHP 5.3 incompatibilities (required for backport) 2017-08-16 15:21:14 +02:00
Marco Pivetta 8f77210955 #6626 #6625 minor CS fixes (removed useless assignments) 2017-08-16 15:20:10 +02:00
Issei.M f736acc8f5 Replace double quote with single quote 2017-08-16 15:20:01 +02:00
Issei.M f1534610e1 Fix CS / Add annotation 2017-08-16 15:18:15 +02:00
Issei.M 6622bbbbf3 Skip embeddable classes proxy generation 2017-08-16 15:18:04 +02:00
Marco Pivetta 1554af0c07 Merge branch 'fix/#6623-#1515-ensure-abstracthydrator-hydrateall-cleans-up-on-unit-of-work-clear-2.5' into 2.5
Close #6623
2017-08-16 14:50:13 +02:00
Nikolas Tsiongas 814aa9f322 fix AbstractHydrator addEventListener on hydrateAll() 2017-08-16 14:49:22 +02:00
Marco Pivetta f311dd1dd1 Bumping development version to v2.5.9-DEV 2017-08-13 20:47:26 +02:00
Marco Pivetta e3aa3f2d1d Preparing v2.5.8 release 2017-08-13 20:46:56 +02:00
Marco Pivetta c83f479633 Merge pull request #6621 from Powerhamster/patch-1
fixed undefined variable
2017-08-13 20:27:18 +02:00
Thomas Rothe 741f1db198 fixed undefined variable
changed $conditions to $condition so $isConditionalJoin is working
2017-08-12 11:33:11 +02:00
8 changed files with 103 additions and 7 deletions
+3 -3
View File
@@ -17,13 +17,13 @@
"ext-pdo": "*",
"doctrine/collections": "~1.2",
"doctrine/dbal": ">=2.5-dev,<2.7-dev",
"doctrine/instantiator": "~1.0.1",
"doctrine/instantiator": "^1.0.1",
"doctrine/common": ">=2.5-dev,<2.9-dev",
"doctrine/cache": "~1.4",
"symfony/console": "~2.5|~3.0"
"symfony/console": "~2.5|~3.0|~4.0"
},
"require-dev": {
"symfony/yaml": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0|~4.0",
"phpunit/phpunit": "~4.0"
},
"suggest": {
@@ -142,6 +142,9 @@ abstract class AbstractHydrator
$this->_rsm = $resultSetMapping;
$this->_hints = $hints;
$evm = $this->_em->getEventManager();
$evm->addEventListener(array(Events::onClear), $this);
$this->prepare();
$result = $this->hydrateAllData();
@@ -811,7 +811,8 @@ class XmlDriver extends FileDriver
protected function loadMappingFile($file)
{
$result = array();
$xmlElement = simplexml_load_file($file);
// Note: we do not use `simplexml_load_file()` because of https://bugs.php.net/bug.php?id=62577
$xmlElement = simplexml_load_string(file_get_contents($file));
if (isset($xmlElement->entity)) {
foreach ($xmlElement->entity as $entityElement) {
+3 -1
View File
@@ -91,7 +91,9 @@ class ProxyFactory extends AbstractProxyFactory
protected function skipClass(ClassMetadata $metadata)
{
/* @var $metadata \Doctrine\ORM\Mapping\ClassMetadataInfo */
return $metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract();
return $metadata->isMappedSuperclass
|| $metadata->isEmbeddedClass
|| $metadata->getReflectionClass()->isAbstract();
}
/**
+1 -1
View File
@@ -1143,7 +1143,7 @@ class SqlWalker implements TreeWalker
$dqlAlias = $joinDeclaration->aliasIdentificationVariable;
$tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias);
$condition = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')';
$isUnconditionalJoin = empty($conditions);
$isUnconditionalJoin = empty($condition);
$condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER && $isUnconditionalJoin)
? ' AND '
: ' ON ';
+1 -1
View File
@@ -36,7 +36,7 @@ class Version
/**
* Current Doctrine Version
*/
const VERSION = '2.5.5-DEV';
const VERSION = '2.5.12';
/**
* Compares a Doctrine version with the current one.
@@ -0,0 +1,63 @@
<?php
namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\ORM\Events;
use Doctrine\ORM\Internal\Hydration\AbstractHydrator;
use Doctrine\Tests\OrmFunctionalTestCase;
/**
* @covers \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/
class AbstractHydratorTest extends OrmFunctionalTestCase
{
/**
* @group DDC-3146
* @group #1515
*
* Verify that the number of added events to the event listener from the abstract hydrator class is equal to the
* number of removed events
*/
public function testOnClearEventListenerIsDetachedOnCleanup()
{
$mockConnection = $this->getMockBuilder('Doctrine\DBAL\Connection')->disableOriginalConstructor()->getMock();
$mockEntityManagerInterface = $this->getMock('Doctrine\ORM\EntityManagerInterface');
$mockEventManager = $this->getMock('Doctrine\Common\EventManager');
$mockStatement = $this->getMock('Doctrine\DBAL\Driver\Statement');
$mockResultMapping = $this->getMock('Doctrine\ORM\Query\ResultSetMapping');
$mockEntityManagerInterface->expects(self::any())->method('getEventManager')->willReturn($mockEventManager);
$mockEntityManagerInterface->expects(self::any())->method('getConnection')->willReturn($mockConnection);
$mockStatement->expects(self::once())->method('fetch')->willReturn(false);
/* @var $mockAbstractHydrator AbstractHydrator */
$mockAbstractHydrator = $this
->getMockBuilder('Doctrine\ORM\Internal\Hydration\AbstractHydrator')
->setConstructorArgs([$mockEntityManagerInterface])
->setMethods(['hydrateAllData'])
->getMock();
$mockEventManager
->expects(self::at(0))
->method('addEventListener')
->with([Events::onClear], $mockAbstractHydrator);
$mockEventManager
->expects(self::at(1))
->method('removeEventListener')
->with([Events::onClear], $mockAbstractHydrator);
$mockEventManager
->expects(self::at(2))
->method('addEventListener')
->with([Events::onClear], $mockAbstractHydrator);
$mockEventManager
->expects(self::at(3))
->method('removeEventListener')
->with([Events::onClear], $mockAbstractHydrator);
iterator_to_array($mockAbstractHydrator->iterate($mockStatement, $mockResultMapping));
$mockAbstractHydrator->hydrateAll($mockStatement, $mockResultMapping);
}
}
@@ -71,6 +71,33 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase
$proxy->getDescription();
}
public function testSkipMappedSuperClassesOnGeneration()
{
$cm = new ClassMetadata('stdClass');
$cm->isMappedSuperclass = true;
self::assertSame(
0,
$this->proxyFactory->generateProxyClasses([$cm]),
'No proxies generated.'
);
}
/**
* @group 6625
*/
public function testSkipEmbeddableClassesOnGeneration()
{
$cm = new ClassMetadata('stdClass');
$cm->isEmbeddedClass = true;
self::assertSame(
0,
$this->proxyFactory->generateProxyClasses([$cm]),
'No proxies generated.'
);
}
/**
* @group DDC-1771
*/