예제 #1
0
 public function testFindHandler()
 {
     $f = new Finder();
     $f->addPath(__DIR__ . '/../resources/one');
     $f->returnHandlers();
     $this->assertInstanceOf('Fuel\\FileSystem\\File', $f->findFile('a'));
     $f = new Finder();
     $f->addPath(__DIR__ . '/../resources/one');
     $f->addPath(__DIR__ . '/../resources');
     $f->asHandlers();
     $this->assertInstanceOf('Fuel\\FileSystem\\File', $f->findFile('a'));
     $f->asHandlers();
     $this->assertInstanceOf('Fuel\\FileSystem\\Directory', $f->findDir('one'));
     $f->returnHandlers();
     $this->assertContainsOnlyInstancesOf('Fuel\\FileSystem\\File', $f->findAllFiles('a'));
     $this->assertContainsOnlyInstancesOf('Fuel\\FileSystem\\Directory', $f->findAllDirs('one'));
 }
예제 #2
0
 /**
  * Adds a path
  *
  * @param string $path
  *
  * @return $this
  */
 public function addPath($path)
 {
     $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
     $this->finder->addPath($path);
     if ($this->environment) {
         $this->finder->addPath($path . $this->environment);
     }
     return $this;
 }
예제 #3
0
 protected function addPath(ComponentInterface $component)
 {
     $this->finder->addPath($component->getPath());
 }
예제 #4
0
파일: Asset.php 프로젝트: fuelphp/asset
 /**
  * Adds a path that contains asset files
  *
  * @param string $path
  */
 public function addPath($path)
 {
     $this->finder->addPath($path);
 }