. */ /** * Doctrine_Search_Indexer_Dir * * @package Doctrine * @subpackage Search * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ * @link www.phpdoctrine.com * @since 1.0 */ class Doctrine_Search_Indexer_Dir { public function add($dir) { if ( ! file_exists($dir)) { throw new Doctrine_Search_Indexer_Exception('Unknown directory ' . $dir); } $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::LEAVES_ONLY); foreach ($it as $file) { $this->indexFile($file); } } }