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:
@ -17,12 +17,12 @@
|
||||
* @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: ContextFilter.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: ContextFilter.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class is an iterator that will iterate only over enabled resources
|
||||
*
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
@ -30,32 +30,32 @@
|
||||
*/
|
||||
class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIterator
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array
|
||||
*/
|
||||
protected $_acceptTypes = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array
|
||||
*/
|
||||
protected $_denyTypes = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array
|
||||
*/
|
||||
protected $_acceptNames = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array
|
||||
*/
|
||||
protected $_denyNames = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @var array
|
||||
*/
|
||||
protected $_rawOptions = array();
|
||||
|
||||
|
||||
/**
|
||||
* __construct()
|
||||
*
|
||||
@ -70,7 +70,7 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
$this->setOptions($options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setOptions()
|
||||
*
|
||||
@ -87,7 +87,7 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setAcceptTypes()
|
||||
*
|
||||
@ -99,11 +99,11 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
if (!is_array($acceptTypes)) {
|
||||
$acceptTypes = array($acceptTypes);
|
||||
}
|
||||
|
||||
|
||||
$this->_acceptTypes = $acceptTypes;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setDenyTypes()
|
||||
*
|
||||
@ -115,11 +115,11 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
if (!is_array($denyTypes)) {
|
||||
$denyTypes = array($denyTypes);
|
||||
}
|
||||
|
||||
|
||||
$this->_denyTypes = $denyTypes;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setAcceptNames()
|
||||
*
|
||||
@ -131,11 +131,11 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
if (!is_array($acceptNames)) {
|
||||
$acceptNames = array($acceptNames);
|
||||
}
|
||||
|
||||
|
||||
$this->_acceptNames = $acceptNames;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* setDenyNames()
|
||||
*
|
||||
@ -147,11 +147,11 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
if (!is_array($denyNames)) {
|
||||
$denyNames = array($denyNames);
|
||||
}
|
||||
|
||||
|
||||
$this->_denyNames = $denyNames;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* accept() is required by teh RecursiveFilterIterator
|
||||
*
|
||||
@ -160,33 +160,33 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
public function accept()
|
||||
{
|
||||
$currentItem = $this->current();
|
||||
|
||||
|
||||
if (in_array($currentItem->getName(), $this->_acceptNames)) {
|
||||
return true;
|
||||
} elseif (in_array($currentItem->getName(), $this->_denyNames)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
foreach ($this->_acceptTypes as $acceptType) {
|
||||
if ($currentItem->getContent() instanceof $acceptType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($this->_denyTypes as $denyType) {
|
||||
if ($currentItem->getContext() instanceof $denyType) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getChildren()
|
||||
*
|
||||
*
|
||||
* This is here due to a bug/design issue in PHP
|
||||
* @link
|
||||
* @link
|
||||
*
|
||||
* @return unknown
|
||||
*/
|
||||
@ -199,5 +199,5 @@ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIt
|
||||
|
||||
return $this->ref->newInstance($this->getInnerIterator()->getChildren(), $this->_rawOptions);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
* @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: EnabledResourceFilter.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
* @version $Id: EnabledResourceFilter.php 18951 2009-11-12 16:26:19Z alexander $
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class is an iterator that will iterate only over enabled resources
|
||||
*
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Tool
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
class Zend_Tool_Project_Profile_Iterator_EnabledResourceFilter extends RecursiveFilterIterator
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* accept() is required by teh RecursiveFilterIterator
|
||||
*
|
||||
|
Reference in New Issue
Block a user