diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Tool/Project/Context/Zf/ZfStandardLibraryDirectory.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Tool/Project/Context/Zf/ZfStandardLibraryDirectory.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,104 @@ +_getZfPath(); + if ($zfPath != false) { + $zfIterator = new RecursiveDirectoryIterator($zfPath); + foreach ($rii = new RecursiveIteratorIterator($zfIterator, RecursiveIteratorIterator::SELF_FIRST) as $file) { + $relativePath = preg_replace('#^'.preg_quote(realpath($zfPath), '#').'#', '', realpath($file->getPath())) . DIRECTORY_SEPARATOR . $file->getFilename(); + if (strpos($relativePath, DIRECTORY_SEPARATOR . '.') !== false) { + continue; + } + + if ($file->isDir()) { + mkdir($this->getBaseDirectory() . DIRECTORY_SEPARATOR . $this->getFilesystemName() . $relativePath); + } else { + copy($file->getPathname(), $this->getBaseDirectory() . DIRECTORY_SEPARATOR . $this->getFilesystemName() . $relativePath); + } + + } + } + } + + /** + * _getZfPath() + * + * @return string|false + */ + protected function _getZfPath() + { + require_once 'Zend/Loader.php'; + foreach (Zend_Loader::explodeIncludePath() as $includePath) { + if (!file_exists($includePath) || $includePath[0] == '.') { + continue; + } + + if (realpath($checkedPath = rtrim($includePath, '\\/') . '/Zend/Loader.php') !== false && file_exists($checkedPath)) { + return dirname($checkedPath); + } + } + + return false; + } + +}