[DCOM-96] Moving proxy generation and autoloading to common #406

Merged
merged 3 commits into from Feb 14, 2013

Conversation

Projects
None yet
5 participants
Owner

Ocramius commented Jul 21, 2012

This PR is related to doctrine/common#168.

In this PR, the ProxyFactory has been reduced to an object builder and it's public API has been kept intact (While the proxy Autoloader has been moved to doctrine/common). It would be interesting to define what this builder could do with the ProxyFactory to get its own customizations introduced.

Also fixes DDC-1734

This pull request fails (merged a7b18c15 into 93cef61).

This pull request fails (merged 58a03c2b into 93cef61).

This pull request passes (merged 9572e81c into 93cef61).

.gitmodules
@@ -1,6 +1,6 @@
[submodule "lib/vendor/doctrine-common"]
path = lib/vendor/doctrine-common
- url = git://github.com/doctrine/common.git
+ url = git://github.com/Ocramius/common.git
@Ocramius

Ocramius Jul 22, 2012

Owner

To be changed before merge

This pull request passes (merged 44556a00 into 93cef61).

This pull request passes (merged 43a125dd into 93cef61).

lib/Doctrine/ORM/Proxy/ProxyFactory.php
- Doctrine\ORM\Mapping\ClassMetadata,
- Doctrine\ORM\Mapping\AssociationMapping,
- Doctrine\Common\Util\ClassUtils;
+use Doctrine\ORM\EntityManager;
@guilhermeblanco

guilhermeblanco Jul 23, 2012

Owner

Reorder these uses. Less dependent ones should be at the top.

lib/Doctrine/ORM/Proxy/ProxyFactory.php
- $sleepImpl,
- $cloneImpl
- );
+ $fqn = $this->getGenerator()->getProxyClass($this->em->getClassMetadata($className));
@guilhermeblanco

guilhermeblanco Jul 23, 2012

Owner

Rename the variable. FQN is not obvious. Rule #5: Do not abbreviate.
I'd recommend: $proxyClassName.
Also, align the = signs.

tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php
@@ -2,6 +2,8 @@
namespace Doctrine\Tests\ORM\Functional;
+require_once __DIR__ . '/../../TestInit.php';
@stof

stof Nov 21, 2012

Member

Do we really need this ? I thought it was useless since the switch to the XML config for phpunit (it is used as the phpunit bootstrap file).

Check that you don't have an outdate phpunit.xml file

tests/Doctrine/Tests/ORM/Proxy/ProxtFactoryTest.php
+{
+ private $_connectionMock;
+ private $_uowMock;
+ private $_emMock;
@stof

stof Nov 21, 2012

Member

you should remove the underscores for these private properties

Owner

Ocramius commented Jan 11, 2013

Mergeable (freezed at last commit before giant composer BC break)

*/
public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = false)
{
- if ( ! $proxyDir) {
Owner

Ocramius commented Feb 4, 2013

Rebased on #570

@@ -1 +1 @@
-Subproject commit d514e3920656921ba1148f16a4089222c58bc83a
+Subproject commit d5843a462a4dfe4a42daf4645fc867c431a4170e
@stof

stof Feb 12, 2013

Member

you are not removing the submodules

@Ocramius

Ocramius Feb 12, 2013

Owner

That must be first handled in #570

tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php
+
+use Doctrine\Tests\Models\DDC1734\DDC1734Article;
+
+require_once __DIR__ . '/../../../TestInit.php';
@stof

stof Feb 12, 2013

Member

this line should be removed

tests/Doctrine/Tests/ORM/Proxy/ProxtFactoryTest.php
+use Doctrine\Tests\Mocks\UnitOfWorkMock;
+use Doctrine\Tests\Mocks\DriverMock;
+
+require_once __DIR__ . '/../../TestInit.php';
@stof

stof Feb 12, 2013

Member

this should be removed

beberlei added a commit that referenced this pull request Feb 14, 2013

Merge pull request #406 from Ocramius/DCOM-96
[DCOM-96] Moving proxy generation and autoloading to common

@beberlei beberlei merged commit afee16e into doctrine:master Feb 14, 2013

1 check passed

default The Travis build passed
Details

@Ocramius Ocramius deleted the Ocramius:DCOM-96 branch Jan 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment