bug #14841 [DoctrineBridge] Fixed #14840 (saksmt)

This PR was squashed before being merged into the 2.3 branch (closes #14841).

Discussion
----------

[DoctrineBridge] Fixed #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 | #14840
| License       | MIT
| Doc PR        | none

Commits
-------

92ad5df [DoctrineBridge] Fixed #14840
This commit is contained in:
Fabien Potencier 2015-09-14 09:11:55 +02:00
commit dcc6581206
1 changed files with 6 additions and 2 deletions

View File

@ -129,11 +129,15 @@ abstract class AbstractDoctrineExtension extends Extension
*/
protected function setMappingDriverConfig(array $mappingConfig, $mappingName)
{
if (!is_dir($mappingConfig['dir'])) {
$mappingDirectory = $mappingConfig['dir'];
if (!is_dir($mappingDirectory)) {
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
}
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingConfig['dir']);
if (substr($mappingDirectory, 0, 7) !== 'phar://') {
$mappingDirectory = realpath($mappingDirectory);
}
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory;
}
/**