import shutil
import logging
import os.path
+import distutils.version
-from wizard import app, install, resolve, util
+from wizard import app, install, resolve, sql, util
from wizard.app import php
#phpBB 104 installs
return os.path.getsize('config.php')
def detectVersion(self, deployment):
- version = self.detectVersionFromFile('install/database_update.php', php.re_var('updates_to_version'))
+ version = str(self.detectVersionFromFile('install/update_to_latest.php', php.re_var('updates_to_version')))
if version.startswith('.'): # blehh, but phpBB2 uses '.0.19'...
version = '2' + version
- return version
+ return distutils.version.LooseVersion(version)
+ @app.throws_database_errors
def remove(self, deployment, options):
- app.remove_database(deployment)
+ sql.drop(deployment.dsn)
def install(self, version, options):
old_mode = os.stat(".").st_mode
logging.debug('install.php output:\n\n' + result)
if 'Thank you' not in result:
raise app.InstallFailure()
+ # Removing these trees will make upgrade merges annoying. Maybe
+ # we should patch out the check and stick .htaccess files which
+ # block access for these folders (we'd probably have to make it
+ # available again for an upgrade though)
#shutil.rmtree('install')
#shutil.rmtree('contrib')