Beispiel #1
0
 /**
  * Get instance of DirectoryScanner with filter options applied
  *
  * @param bool $filter
  * @return DirectoryScanner
  */
 public function getScanner($filter = TRUE)
 {
     $scanner = new DirectoryScanner();
     if ($filter) {
         $scanner->setIncludes($this->config->getInclude());
         $scanner->setExcludes($this->config->getExclude());
     }
     if ($this->config->isFollowSymlinks()) {
         $scanner->setFlag(\FilesystemIterator::FOLLOW_SYMLINKS);
     }
     return $scanner;
 }
Beispiel #2
0
 /**
  * Set the include to be matching for *.txt via setIncludes
  *
  */
 public function testSetIncludes()
 {
     $test = array('*.txt');
     $tmp = new DirectoryScanner();
     $tmp->setIncludes($test);
     $this->assertEquals($test, $tmp->getIncludes());
 }