interface AjaxResponse {
returnValues: {
+ invokeAgain: boolean;
pluginName: string;
target: string;
timeElapsed: string;
this.buttons.get(identifier)!.disabled = false;
this.buttonStatus.get(identifier)!.innerHTML = data.returnValues.timeElapsed;
- this.syncNext();
+ if (data.returnValues.invokeAgain) {
+ this.sync(data.returnValues.pluginName, data.returnValues.target);
+ } else {
+ this.syncNext();
+ }
}
_ajaxFailure(
const identifier = this.getButtonIdentifier(data.returnValues.pluginName, data.returnValues.target);
this.buttons.get(identifier).disabled = false;
this.buttonStatus.get(identifier).innerHTML = data.returnValues.timeElapsed;
- this.syncNext();
+ if (data.returnValues.invokeAgain) {
+ this.sync(data.returnValues.pluginName, data.returnValues.target);
+ }
+ else {
+ this.syncNext();
+ }
}
_ajaxFailure(data, responseText, xhr, requestData) {
const identifier = this.getButtonIdentifier(requestData.parameters.pluginName, requestData.parameters.target);
$start = \microtime(true);
+ $invokeAgain = false;
try {
$pip->update();
} catch (SplitNodeException $e) {
- throw new \RuntimeException("PIP '{$this->packageInstallationPlugin->pluginName}' is not allowed to throw a 'SplitNodeException'.");
+ if ($this->parameters['pluginName'] !== 'database') {
+ throw new \RuntimeException("PIP '{$this->packageInstallationPlugin->pluginName}' is not allowed to throw a 'SplitNodeException'.");
+ }
+
+ $invokeAgain = true;
}
SearchIndexManager::getInstance()->createSearchIndices();
}
return [
+ 'invokeAgain' => $invokeAgain,
'pluginName' => $this->packageInstallationPlugin->pluginName,
'target' => $this->parameters['target'],
'timeElapsed' => WCF::getLanguage()->getDynamicVariable(
use wcf\data\devtools\project\DevtoolsProject;
use wcf\data\package\installation\plugin\PackageInstallationPlugin;
use wcf\system\application\ApplicationHandler;
+use wcf\system\package\plugin\DatabasePackageInstallationPlugin;
use wcf\system\package\plugin\IPackageInstallationPlugin;
use wcf\system\WCF;
use wcf\util\FileUtil;
// these pips are satisfied by definition
return [$defaultFilename];
+ case 'database':
+ foreach (\glob("{$path}wcfsetup/install/files/{$defaultFilename}") as $file) {
+ $targets[] = \basename($file);
+ }
+
+ // `glob()` returns files in an arbitrary order
+ \sort($targets, \SORT_NATURAL);
+
+ return $targets;
+
case 'language':
foreach (\glob($path . 'wcfsetup/install/lang/*.xml') as $file) {
$targets[] = \basename($file);
break;
+ case 'database':
+ $instructions['value'] = DatabasePackageInstallationPlugin::SCRIPT_DIR . $target;
+
+ $tar->registerFile($instructions['value'], $project->path . 'wcfsetup/install/files/' . $target);
+
+ break;
+
case 'language':
$tar->registerFile($target, $project->path . 'wcfsetup/install/lang/' . $target);