* configuration file in the server's document root
* @var string
*/
- const CONFIGURATION_FILE = 'wsc-dev-config-54.json';
+ const CONFIGURATION_FILE = 'wsc-dev-config-55.json';
/**
* configuration data
return (isset($this->configuration['configuration']['devtools']) && !empty($this->configuration['configuration']['devtools']['importFromPath'])) ? $this->configuration['configuration']['devtools']['importFromPath'] : '';
}
+ /**
+ * Returns the login data for the WoltLab package servers.
+ */
+ public function getPackageServerLogin(): array
+ {
+ if (isset($this->configuration['packageServerLogin']['username']) && $this->configuration['packageServerLogin']['password']) {
+ return $this->configuration['packageServerLogin'];
+ }
+
+ return [];
+ }
+
/**
* Returns the raw configuration data.
*
);
if (WCF::getSession()->getVar('__wcfSetup_developerMode')) {
- $statement->execute([
- 1,
- 'enable_debug_mode',
- ]);
- $statement->execute([
- 'public',
- 'exception_privacy',
- ]);
- $statement->execute([
- 'debugFolder',
- 'mail_send_method',
- ]);
- $statement->execute([
- 1,
- 'enable_developer_tools',
- ]);
- $statement->execute([
- 1,
- 'log_missing_language_items',
- ]);
-
- foreach (DevtoolsSetup::getInstance()->getOptionOverrides() as $optionName => $optionValue) {
- $statement->execute([
- $optionValue,
- $optionName,
- ]);
- }
-
- foreach (DevtoolsSetup::getInstance()->getUsers() as $newUser) {
- try {
- (new UserAction([], 'create', [
- 'data' => [
- 'email' => $newUser['email'],
- 'password' => $newUser['password'],
- 'username' => $newUser['username'],
- ],
- 'groups' => [
- 1,
- 3,
- ],
- ]))->executeAction();
- } catch (SystemException $e) {
- // ignore errors due to event listeners missing at this
- // point during installation
- }
- }
-
- if (($importPath = DevtoolsSetup::getInstance()->getDevtoolsImportPath()) !== '') {
- (new DevtoolsProjectAction([], 'quickSetup', [
- 'path' => $importPath,
- ]))->executeAction();
- }
+ $this->setupDeveloperMode();
}
if (WCF::getSession()->getVar('__wcfSetup_imagick')) {
return $step;
}
+ /**
+ * @since 5.5
+ */
+ protected function setupDeveloperMode(): void
+ {
+ $sql = "UPDATE wcf" . WCF_N . "_option
+ SET optionValue = ?
+ WHERE optionName = ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+
+ $statement->execute([
+ 1,
+ 'enable_debug_mode',
+ ]);
+ $statement->execute([
+ 'public',
+ 'exception_privacy',
+ ]);
+ $statement->execute([
+ 'debugFolder',
+ 'mail_send_method',
+ ]);
+ $statement->execute([
+ 1,
+ 'enable_developer_tools',
+ ]);
+ $statement->execute([
+ 1,
+ 'log_missing_language_items',
+ ]);
+
+ foreach (DevtoolsSetup::getInstance()->getOptionOverrides() as $optionName => $optionValue) {
+ $statement->execute([
+ $optionValue,
+ $optionName,
+ ]);
+ }
+
+ foreach (DevtoolsSetup::getInstance()->getUsers() as $newUser) {
+ try {
+ (new UserAction([], 'create', [
+ 'data' => [
+ 'email' => $newUser['email'],
+ 'password' => $newUser['password'],
+ 'username' => $newUser['username'],
+ ],
+ 'groups' => [
+ 1,
+ 3,
+ ],
+ ]))->executeAction();
+ } catch (SystemException $e) {
+ // ignore errors due to event listeners missing at this
+ // point during installation
+ }
+ }
+
+ $importPath = DevtoolsSetup::getInstance()->getDevtoolsImportPath();
+ if ($importPath !== '') {
+ (new DevtoolsProjectAction([], 'quickSetup', [
+ 'path' => $importPath,
+ ]))->executeAction();
+ }
+
+ $packageServerLogin = DevtoolsSetup::getInstance()->getPackageServerLogin();
+ if (!empty($packageServerLogin)) {
+ // All update servers installed at this point are only our own servers for which the same
+ // login data can be used.
+ $sql = "UPDATE wcf1_package_update_server
+ SET loginUsername = ?,
+ loginPassword = ?";
+ $statement = WCF::getDB()->prepare($sql);
+ $statement->execute([
+ $packageServerLogin['username'],
+ $packageServerLogin['password'],
+ ]);
+ }
+ }
+
/**
* Logs an installation step.
*