From 9fa8ff86f8a64e6d70059b3046f88d8729f302d5 Mon Sep 17 00:00:00 2001 From: steffkes Date: Wed, 15 Sep 2010 21:14:15 +0200 Subject: [PATCH] show given path for MappingException::fileMappingDriversRequireConfiguredDirectoryPath --- .../ORM/Mapping/Driver/AbstractFileDriver.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php | 2 +- lib/Doctrine/ORM/Mapping/MappingException.php | 11 +++++++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php index 637971cb5..457b7cda7 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AbstractFileDriver.php @@ -155,7 +155,7 @@ abstract class AbstractFileDriver implements Driver if ($this->_paths) { foreach ((array) $this->_paths as $path) { if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath(); + throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new \RecursiveIteratorIterator( diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index d62370559..e531a27f7 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -435,7 +435,7 @@ class AnnotationDriver implements Driver foreach ($this->_paths as $path) { if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath(); + throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new \RecursiveIteratorIterator( diff --git a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php index 01edab71b..d89b1ed68 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php @@ -78,7 +78,7 @@ class StaticPHPDriver implements Driver foreach ($this->_paths as $path) { if ( ! is_dir($path)) { - throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath(); + throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new \RecursiveIteratorIterator( diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index 9fa5906bf..8ea5be213 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -170,9 +170,16 @@ class MappingException extends \Doctrine\ORM\ORMException ); } - public static function fileMappingDriversRequireConfiguredDirectoryPath() + public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) { - return new self('File mapping drivers must have a valid directory path, however the given path seems to be incorrect!'); + if ( ! empty($path)) { + $path = '[' . $path . ']'; + } + + return new self( + 'File mapping drivers must have a valid directory path, ' . + 'however the given path ' . $path . ' seems to be incorrect!' + ); } /**