Differential D68 Diff 168 branches/5.3.x/core/kernel/utility/ClassDiscovery/CodeFolderFilterIterator.php
Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/utility/ClassDiscovery/CodeFolderFilterIterator.php
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | LF |
<?php | |||||
/** | |||||
* @version $Id$ | |||||
* @package In-Portal | |||||
* @copyright Copyright (C) 1997 - 2015 Intechnic. All rights reserved. | |||||
* @license GNU/GPL | |||||
* In-Portal is Open Source software. | |||||
* This means that this software may have been modified pursuant | |||||
* the GNU General Public License, and as distributed it includes | |||||
* or is derivative of works licensed under the GNU General Public License | |||||
* or other free or open source software licenses. | |||||
* See http://www.in-portal.org/license for copyright notices and details. | |||||
*/ | |||||
namespace Intechnic\InPortal\Core\kernel\utility\ClassDiscovery; | |||||
defined('FULL_PATH') or die('restricted access!'); | |||||
class CodeFolderFilterIterator extends \RecursiveFilterIterator | |||||
{ | |||||
/** | |||||
* Folders, that should be ignored. | |||||
* | |||||
* @var array | |||||
*/ | |||||
public $skipFolders = array( | |||||
'CVS', '.svn', '.git', 'admin_templates', 'libchart', | |||||
); | |||||
/** | |||||
* Creates iterator instance. | |||||
* | |||||
* @param \RecursiveDirectoryIterator $directory_iterator Directory iterator. | |||||
*/ | |||||
public function __construct(\RecursiveDirectoryIterator $directory_iterator) | |||||
{ | |||||
parent::__construct($directory_iterator); | |||||
$this->skipFolders[] = basename(EDITOR_PATH); | |||||
} | |||||
/** | |||||
* Accepts only folders with valid names. | |||||
* | |||||
* @return boolean | |||||
*/ | |||||
public function accept() | |||||
{ | |||||
return !in_array( | |||||
$this->current()->getFilename(), | |||||
$this->skipFolders, | |||||
true | |||||
); | |||||
} | |||||
} |