protected function _createTasks( array $paths, MW_Setup_DBSchema_Interface $schema, MW_DB_Connection_Interface $conn, $additional )
	{
		$tasks = array();

		foreach( $paths as $path )
		{
			foreach( new DirectoryIterator( $path ) as $item )
			{
				if( $item->isDir() === true || substr( $item->getFilename(), -4 ) != '.php' ) { continue; }

				$this->_includeFile( $item->getPathName() );

				$taskname = substr( $item->getFilename(), 0, -4 );
				$classname = 'MW_Setup_Task_' . $taskname;

				if( class_exists( $classname ) === false ) {
					throw new MW_Setup_Exception( sprintf( 'Class "%1$s" not found', $classname ) );
				}

				$interface = 'MW_Setup_Task_Interface';
				$task = new $classname( $schema, $conn, $additional );

				if( ( $task instanceof $interface ) === false ) {
					throw new MW_Setup_Exception( sprintf( 'Class "%1$s" doesn\'t implement "%2$s"', $classname, 'MW_Setup_Task_Interface' ) );
				}

				$tasks[$taskname] = $task;
			}
		}

		return $tasks;
	}
protected function _createTasks( array $paths, MW_Setup_DBSchema_Interface $schema, MW_DB_Connection_Interface $conn, $additional )
	{
		$tasks = array();

		foreach( $paths as $path )
		{
			foreach( new DirectoryIterator( $path ) as $item )
			{
				if( $item->isDir() === true || substr( $item->getFilename(), -4 ) != '.php' ) { continue; }

				$this->_includeFile( $item->getPathName() );

				$taskname = substr( $item->getFilename(), 0, -4 );
				$classname = 'MW_Setup_Task_' . $taskname;

				if( class_exists( $classname ) === false ) {
					throw new MW_Setup_Exception( sprintf( 'Class "%1$s" not found', $classname ) );
				}

				$interface = 'MW_Setup_Task_Interface';
				$task = new $classname( $schema, $conn, $additional );

				if( ( $task instanceof $interface ) === false ) {
					throw new MW_Setup_Exception( sprintf( 'Class "%1$s" doesn\'t implement "%2$s"', $classname, 'MW_Setup_Task_Interface' ) );
				}

				$tasks[$taskname] = $task;
			}
		}

		return $tasks;
	}
protected function _createTasks ( array $ paths , MW_Setup_DBSchema_Interface $ schema , MW_DB_Connection_Interface $ conn , $ additional ) { $ tasks = array ( ) ; foreach ( $ paths as $ path ) { foreach ( new DirectoryIterator ( $ path ) as $ item ) { if ( $ item -> isDir ( ) === true || substr ( $ item -> getFilename ( ) , - 4 ) != '.php' ) { continue ; } $ this -> _includeFile ( $ item -> getPathName ( ) ) ; $ taskname = substr ( $ item -> getFilename ( ) , 0 , - 4 ) ; $ classname = 'MW_Setup_Task_' . $ taskname ; if ( class_exists ( $ classname ) === false ) { throw new MW_Setup_Exception ( sprintf ( 'Class "%1$s" not found' , $ classname ) ) ; } $ interface = 'MW_Setup_Task_Interface' ; $ task = new $ classname ( $ schema , $ conn , $ additional ) ; if ( ( $ task instanceof $ interface ) === false ) { throw new MW_Setup_Exception ( sprintf ( 'Class "%1$s" doesn\'t implement "%2$s"' , $ classname , 'MW_Setup_Task_Interface' ) ) ; } $ tasks [ $ taskname ] = $ task ; } } return $ tasks ; }
Creates the tasks from the given directories.

@param array $paths List of paths containing setup task classes
@param MW_Setup_DBSchema_Interface $schema Database schema object
@param MW_DB_Connection_Interface $conn Database connection object
@param mixed $additional Additional data that should be handed over to the setup tasks
@return MW_Setup_Task_Interface[] List of setup task objects
Creates the tasks from the given directories .