$continue = explode( '||', $continue );
$this->dieContinueUsageIf( count( $continue ) !== 2 );
$this->generatorDone = ( $continue[0] === '-' );
+ $skip = explode( '|', $continue[1] );
if ( !$this->generatorDone ) {
$this->generatorParams = explode( '|', $continue[0] );
+ } else {
+ // When the generator is complete, don't run any modules that
+ // depend on it.
+ $skip += $this->continueGeneratedModules;
}
- $skip = explode( '|', $continue[1] );
}
$this->continueAllModules = array();
} else {
$key = 'continue';
$data = array();
+ $batchcomplete = false;
$finishedModules = array_diff(
array_keys( $this->continueAllModules ),
$finishedModules = array_diff(
$finishedModules, $this->continueGeneratedModules
);
+ $batchcomplete = true;
} else {
// Generator and prop modules are all done. Mark it so.
$this->generatorDone = true;
+ $batchcomplete = true;
}
// Set 'continue' if any continuation data is set or if the generator
( $this->generatorDone ? '-' : join( '|', $this->generatorParams ) ) .
'||' . join( '|', $finishedModules );
}
+
+ if ( $batchcomplete ) {
+ $this->addValue( null, 'batchcomplete', '', ApiResult::ADD_ON_TOP | ApiResult::NO_SIZE_CHECK );
+ }
}
if ( $data ) {
$this->addValue( null, $key, $data, ApiResult::ADD_ON_TOP | ApiResult::NO_SIZE_CHECK );