+ if version >= distutils.version.LooseVersion("1.17.0"):
+ self.install_1_17_0(options)
+ else:
+ self.install_old(options)
+ def install_1_17_0(self, options):
+ util.soft_unlink("LocalSettings.php")
+ try:
+ result = shell.eval(
+ "php", "maintenance/install.php",
+ "--dbname", options.dsn.database,
+ "--dbpass", options.dsn.password,
+ "--dbserver", options.dsn.host,
+ "--dbuser", options.dsn.username,
+ "--email", options.email,
+ "--pass", options.admin_password,
+ options.title, options.admin_name,
+ log=True)
+ except shell.CallError as e:
+ raise app.RecoverableInstallFailure("Install script returned non-zero exit code\nSTDOUT: %s\nSTDERR: %s" % (e.stdout, e.stderr))
+ logging.debug("Install script output:\n\n" + result)
+ # See [Note: Maintenance script exit codes]
+ results = result.rstrip().split()
+ if not results or not results[-1] == "done":
+ raise app.RecoverableInstallFailure(result)
+
+ def install_old(self, options):