Skip to content

Commit dcc6581

Browse files
committed
bug symfony#14841 [DoctrineBridge] Fixed symfony#14840 (saksmt)
This PR was squashed before being merged into the 2.3 branch (closes symfony#14841). Discussion ---------- [DoctrineBridge] Fixed symfony#14840 [DoctrineBridge] Fixed compatibility with entities packed in Phar | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#14840 | License | MIT | Doc PR | none Commits ------- 92ad5df [DoctrineBridge] Fixed symfony#14840
2 parents f6bade0 + 92ad5df commit dcc6581

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,15 @@ protected function setMappingDriverAlias($mappingConfig, $mappingName)
129129
*/
130130
protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
131131
{
132-
if (!is_dir($mappingConfig['dir'])) {
132+
$mappingDirectory = $mappingConfig['dir'];
133+
if (!is_dir($mappingDirectory)) {
133134
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
134135
}
135136

136-
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
137+
if (substr($mappingDirectory, 0, 7) !== 'phar://') {
138+
$mappingDirectory = realpath($mappingDirectory);
139+
}
140+
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory;
137141
}
138142

139143
/**

0 commit comments

Comments
 (0)