Catch empty sources dir.
authorGunnar Wrobel <p@rdus.de>
Mon, 18 Oct 2010 15:06:59 +0000 (17:06 +0200)
committerGunnar Wrobel <p@rdus.de>
Mon, 18 Oct 2010 15:06:59 +0000 (17:06 +0200)
components/lib/Components/Pear/InstallLocation.php

index 18bbc87..75f952c 100644 (file)
@@ -376,6 +376,9 @@ class Components_Pear_InstallLocation
 
     private function _identifyMatchingLocalPackage($package)
     {
+        if (empty($this->_source_directory)) {
+            return false;
+        }
         foreach (new DirectoryIterator($this->_source_directory) as $file) {
             if (preg_match('/' . $package . '-[0-9]+(\.[0-9]+)+([a-z0-9]+)?/', $file->getBasename('.tgz'), $matches)) {
                 return $file->getPathname();