|
@@ -64,20 +64,17 @@ class YamlDriver extends BaseYamlDriver
|
|
|
|
|
|
protected function _findMappingFile($className)
|
|
|
{
|
|
|
- if (false !== $pos = strrpos($className, '\\')) {
|
|
|
- $namespace = substr($className, 0, $pos);
|
|
|
- $shortName = substr($className, $pos+1);
|
|
|
- } else {
|
|
|
- $namespace = '';
|
|
|
- $shortName = $className;
|
|
|
- }
|
|
|
-
|
|
|
foreach ($this->_paths as $prefix => $path) {
|
|
|
- if ($prefix === $namespace && file_exists($filename = $path.'/'.$shortName.$this->_fileExtension)) {
|
|
|
+ if (0 !== strpos($className, $prefix.'\\')) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ $subPath = strtr(substr($className, strlen($prefix)), '\\', '/');
|
|
|
+ if (file_exists($filename = $path.$subPath.$this->fileExtension)) {
|
|
|
return $filename;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- throw MappingException::mappingFileNotFound($className, $shortName.$this->_fileExtension);
|
|
|
+ throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\')).$this->_fileExtension);
|
|
|
}
|
|
|
}
|