import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -17,7 +17,7 @@
* @subpackage Framework
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: IncludePathLoader.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: IncludePathLoader.php 19145 2009-11-20 22:08:36Z beberlei $
*/
/**
@ -36,9 +36,9 @@ require_once 'Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterat
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_Loader_Abstract
class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_Loader_Abstract
{
/**
* _getFiles()
*
@ -52,19 +52,19 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
$relativeItems = array();
$files = array();
$isZendTraversed = false;
foreach ($paths as $path) {
// default patterns to use
$filterDenyDirectoryPattern = '.*(/|\\\\).svn';
$filterAcceptFilePattern = '.*(?:Manifest|Provider)\.php$';
if (!file_exists($path) || $path[0] == '.') {
continue;
}
$realIncludePath = realpath($path);
// ensure that we only traverse a single version of Zend Framework on all include paths
if (file_exists($realIncludePath . '/Zend/Tool/Framework/Loader/IncludePathLoader.php')) {
if ($isZendTraversed === false) {
@ -74,10 +74,10 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
$filterDenyDirectoryPattern = '.*((/|\\\\).svn|' . preg_quote($realIncludePath . DIRECTORY_SEPARATOR) . 'Zend)';
}
}
// create recursive directory iterator
$rdi = new RecursiveDirectoryIterator($path);
// pass in the RecursiveDirectoryIterator & the patterns
$filter = new Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator(
$rdi,
@ -87,18 +87,22 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
// build the rii with the filter
$iterator = new RecursiveIteratorIterator($filter);
// iterate over the accepted items
foreach ($iterator as $item) {
$file = (string)$item;
if($this->_fileIsBlacklisted($file)) {
continue;
}
// ensure that the same named file from separate include_paths is not loaded
$relativeItem = preg_replace('#^' . preg_quote($realIncludePath . DIRECTORY_SEPARATOR, '#') . '#', '', $item->getRealPath());
// no links allowed here for now
if ($item->isLink()) {
continue;
}
// no items that are relavitely the same are allowed
if (in_array($relativeItem, $relativeItems)) {
continue;
@ -111,5 +115,24 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L
return $files;
}
/**
*
* @param string $file
* @return bool
*/
protected function _fileIsBlacklisted($file)
{
$blacklist = array(
"PHPUnit".DIRECTORY_SEPARATOR."Framework",
"Zend".DIRECTORY_SEPARATOR."OpenId".DIRECTORY_SEPARATOR."Provider"
);
foreach($blacklist AS $blacklitedPattern) {
if(strpos($file, $blacklitedPattern) !== false) {
return true;
}
}
return false;
}
}