filename() 공개 정적인 메소드

public static filename ( string $path ) : string
$path string
리턴 string
예제 #1
0
파일: App.php 프로젝트: JBZoo/Console
 /**
  * Register commands
  *
  * @param $commandsDir
  * @return bool
  */
 protected function _registerCommands($commandsDir)
 {
     $files = FS::ls($commandsDir);
     if (empty($files)) {
         return false;
     }
     foreach ($files as $file) {
         require_once $file;
         $reflection = new \ReflectionClass(__NAMESPACE__ . '\\Command\\' . FS::filename($file));
         if ($reflection->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$reflection->isAbstract()) {
             $this->add($reflection->newInstance());
         }
     }
     return true;
 }
예제 #2
0
 public function testFilename()
 {
     isSame('image', FS::filename('image.png'));
     isSame('image.jpg', FS::filename('image.jpg.png'));
     isSame('image.jpg', FS::filename('/file/path/image.jpg.png'));
     isSame('image', FS::filename('image'));
     isSame('', FS::filename(''));
     isSame('', FS::filename(null));
     isSame('', FS::filename(false));
 }