framework/console/CConsoleCommandRunner.php
public function findCommands($path)
	{
		if(($dir=@opendir($path))===false)
			return array();
		$commands=array();
		while(($name=readdir($dir))!==false)
		{
			$file=$path.DIRECTORY_SEPARATOR.$name;
			if(!strcasecmp(substr($name,-11),'Command.php') && is_file($file))
				$commands[strtolower(substr($name,0,-11))]=$file;
		}
		closedir($dir);
		return $commands;
	}
public function findCommands($path)
	{
		if(($dir=@opendir($path))===false)
			return array();
		$commands=array();
		while(($name=readdir($dir))!==false)
		{
			$file=$path.DIRECTORY_SEPARATOR.$name;
			if(!strcasecmp(substr($name,-11),'Command.php') && is_file($file))
				$commands[strtolower(substr($name,0,-11))]=$file;
		}
		closedir($dir);
		return $commands;
	}
public function findCommands ( $ path ) { if ( ( $ dir = @ opendir ( $ path ) ) === false ) return array ( ) ; $ commands = array ( ) ; while ( ( $ name = readdir ( $ dir ) ) !== false ) { $ file = $ path . DIRECTORY_SEPARATOR . $ name ; if ( ! strcasecmp ( substr ( $ name , - 11 ) , 'Command.php' ) && is_file ( $ file ) ) $ commands [ strtolower ( substr ( $ name , 0 , - 11 ) ) ] = $ file ; } closedir ( $ dir ) ; return $ commands ; }
Searches for commands under the specified directory.
@param string $path the directory containing the command class files.
@return array list of commands (command name=>command class file)
Searches for commands under the specified directory .