fuel/fuel/packages/oil/classes/refine.php
protected static function _discover_tasks()
	{
		$result = array();
		$files = \Finder::instance()->list_files('tasks');

		if (count($files) > 0)
		{
			foreach ($files as $file)
			{
				$task_name = str_replace('.php', '', basename($file));
				$class_name = '\\Fuel\\Tasks\\'.$task_name;

				require $file;

				$reflect = new \ReflectionClass($class_name);

				// Ensure we only pull out the public methods
				$methods = $reflect->getMethods(\ReflectionMethod::IS_PUBLIC);

				$result[$task_name] = array();

				if (count($methods) > 0)
				{
					foreach ($methods as $method)
					{
						strpos($method->name, '_') !== 0 and $result[$task_name][] = $method->name;
					}
				}
			}
		}

		return $result;
	}
protected static function _discover_tasks()
	{
		$result = array();
		$files = \Finder::instance()->list_files('tasks');

		if (count($files) > 0)
		{
			foreach ($files as $file)
			{
				$task_name = str_replace('.php', '', basename($file));
				$class_name = '\\Fuel\\Tasks\\'.$task_name;

				require $file;

				$reflect = new \ReflectionClass($class_name);

				// Ensure we only pull out the public methods
				$methods = $reflect->getMethods(\ReflectionMethod::IS_PUBLIC);

				$result[$task_name] = array();

				if (count($methods) > 0)
				{
					foreach ($methods as $method)
					{
						strpos($method->name, '_') !== 0 and $result[$task_name][] = $method->name;
					}
				}
			}
		}

		return $result;
	}
protected static function _discover_tasks ( ) { $ result = array ( ) ; $ files = \ Finder :: instance ( ) -> list_files ( 'tasks' ) ; if ( count ( $ files ) > 0 ) { foreach ( $ files as $ file ) { $ task_name = str_replace ( '.php' , '' , basename ( $ file ) ) ; $ class_name = '\\Fuel\\Tasks\\' . $ task_name ; require $ file ; $ reflect = new \ ReflectionClass ( $ class_name ) ; // Ensure we only pull out the public methods $ methods = $ reflect -> getMethods ( \ ReflectionMethod :: IS_PUBLIC ) ; $ result [ $ task_name ] = array ( ) ; if ( count ( $ methods ) > 0 ) { foreach ( $ methods as $ method ) { strpos ( $ method -> name , '_' ) !== 0 and $ result [ $ task_name ] [ ] = $ method -> name ; } } } } return $ result ; }
Find all of the task classes in the system and use reflection to discover the
commands we can call.

@return array $taskname => array($taskmethods)
Find all of the task classes in the system and use reflection to discover the commands we can call .