protected function _runTasks( $dbtype, array $tasknames, array $stack = array() )
	{
		foreach( $tasknames as $taskname )
		{
			if( in_array( $taskname, $this->_tasksDone ) ) { continue; }

			if( in_array( $taskname, $stack ) ) {
				$msg = 'Circular dependency for "%1$s" detected. Task stack: %2$s';
				throw new MW_Setup_Exception( sprintf( $msg, $taskname, implode( ', ', $stack ) ) );
			}

			$stack[] = $taskname;

			if( isset( $this->_dependencies[$taskname] ) ) {
				$this->_runTasks( $dbtype, (array) $this->_dependencies[$taskname], $stack );
			}

			if( isset( $this->_tasks[$taskname] ) ) {
				$this->_tasks[$taskname]->run( $dbtype );
			}

			$this->_tasksDone[] = $taskname;
		}
	}
protected function _runTasks( $dbtype, array $tasknames, array $stack = array() )
	{
		foreach( $tasknames as $taskname )
		{
			if( in_array( $taskname, $this->_tasksDone ) ) { continue; }

			if( in_array( $taskname, $stack ) ) {
				$msg = 'Circular dependency for "%1$s" detected. Task stack: %2$s';
				throw new MW_Setup_Exception( sprintf( $msg, $taskname, implode( ', ', $stack ) ) );
			}

			$stack[] = $taskname;

			if( isset( $this->_dependencies[$taskname] ) ) {
				$this->_runTasks( $dbtype, (array) $this->_dependencies[$taskname], $stack );
			}

			if( isset( $this->_tasks[$taskname] ) ) {
				$this->_tasks[$taskname]->run( $dbtype );
			}

			$this->_tasksDone[] = $taskname;
		}
	}
protected function _runTasks ( $ dbtype , array $ tasknames , array $ stack = array ( ) ) { foreach ( $ tasknames as $ taskname ) { if ( in_array ( $ taskname , $ this -> _tasksDone ) ) { continue ; } if ( in_array ( $ taskname , $ stack ) ) { $ msg = 'Circular dependency for "%1$s" detected. Task stack: %2$s' ; throw new MW_Setup_Exception ( sprintf ( $ msg , $ taskname , implode ( ', ' , $ stack ) ) ) ; } $ stack [ ] = $ taskname ; if ( isset ( $ this -> _dependencies [ $ taskname ] ) ) { $ this -> _runTasks ( $ dbtype , ( array ) $ this -> _dependencies [ $ taskname ] , $ stack ) ; } if ( isset ( $ this -> _tasks [ $ taskname ] ) ) { $ this -> _tasks [ $ taskname ] -> run ( $ dbtype ) ; } $ this -> _tasksDone [ ] = $ taskname ; } }
Runs the given tasks depending on their dependencies.

@param string $dbtype Database adapter type, e.g. "mysql", "pgsql", etc.
@param array $tasknames List of task names
@param array $stack List of task names that are sheduled after this task
Runs the given tasks depending on their dependencies .