Page MenuHomeIn-Portal Phabricator

CodeFolderFilterIterator.php
No OneTemporary

File Metadata

Created
Sun, Aug 3, 7:12 AM

CodeFolderFilterIterator.php

<?php
/**
* @version $Id: CodeFolderFilterIterator.php 16252 2015-09-27 06:34:45Z alex $
* @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 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
);
}
}

Event Timeline