Skip to content

Commit

Permalink
ProxyFactory: do not generate long file names
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTvrdik committed Aug 9, 2023
1 parent 47cf50b commit 8199a04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Proxy/ProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ private function getProxyFileName(string $className, string $baseDirectory): str
{
$baseDirectory = $baseDirectory ?: $this->proxyDir;

return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . InternalProxy::MARKER
. str_replace('\\', '', $className) . '.php';
return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . InternalProxy::MARKER . DIRECTORY_SEPARATOR
. str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
}

private function getProxyFactory(string $className): Closure
Expand Down
2 changes: 1 addition & 1 deletion tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function testCommonPersistenceProxy(): void

$restName = str_replace($this->_em->getConfiguration()->getProxyNamespace(), '', get_class($entity));
$restName = substr(get_class($entity), strlen($this->_em->getConfiguration()->getProxyNamespace()) + 1);
$proxyFileName = $this->_em->getConfiguration()->getProxyDir() . DIRECTORY_SEPARATOR . str_replace('\\', '', $restName) . '.php';
$proxyFileName = $this->_em->getConfiguration()->getProxyDir() . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $restName) . '.php';
self::assertTrue(file_exists($proxyFileName), 'Proxy file name cannot be found generically.');

$entity->__load();
Expand Down

0 comments on commit 8199a04

Please sign in to comment.