JBZoo\Utils\FS::filename PHP Method

filename() public static method

public static filename ( string $path ) : string
$path string
return string
    public static function filename($path)
    {
        return pathinfo($path, PATHINFO_FILENAME);
    }

Usage Example

Beispiel #1
0
 /**
  * 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;
 }
All Usage Examples Of JBZoo\Utils\FS::filename