1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

doc blocks added

This commit is contained in:
zYne 2007-11-25 21:16:44 +00:00
parent 2174bc99e7
commit 391cdfab01

View file

@ -32,23 +32,33 @@
*/ */
class Doctrine_Search_File extends Doctrine_Search class Doctrine_Search_File extends Doctrine_Search
{ {
/**
* constructor
*
* @param array $options an array of plugin options
*/
public function __construct(array $options = array()) public function __construct(array $options = array())
{ {
parent::__construct($options); parent::__construct($options);
if ( ! isset($this->_options['resource'])) { if ( ! isset($this->_options['resource'])) {
$table = new Doctrine_Table('File', Doctrine_Manager::connection()); $table = new Doctrine_Table('File', Doctrine_Manager::connection());
$table->setColumn('url', 'string', 255, array('primary' => true)); $table->setColumn('url', 'string', 255, array('primary' => true));
} }
if (empty($this->_options['fields'])) { if (empty($this->_options['fields'])) {
$this->_options['fields'] = array('url', 'content'); $this->_options['fields'] = array('url', 'content');
} }
$this->buildPluginDefinition($table); $this->buildPluginDefinition($table);
} }
/**
* indexes given directory
*
* @param string $dir the name of the directory to index
* @return void
*/
public function indexDirectory($dir) public function indexDirectory($dir)
{ {
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir),