diff --git a/install/steps/AuthenticateStep.class b/install/steps/AuthenticateStep.class index b77ca44c..efe13402 100644 --- a/install/steps/AuthenticateStep.class +++ b/install/steps/AuthenticateStep.class @@ -39,7 +39,7 @@ class AuthenticateStep extends InstallStep { function processRequest() { if (!empty($_GET['downloadLogin'])) { - GallerySetupUtilities::generateTextFileForDownload('login.txt', $this->_uniqueKey); + GallerySetupUtilities::generateTextFileForDownload('login.txt', $this::_uniqueKey); return false; } diff --git a/install/steps/CreateConfigFileStep.class b/install/steps/CreateConfigFileStep.class index d7a28404..3317a557 100644 --- a/install/steps/CreateConfigFileStep.class +++ b/install/steps/CreateConfigFileStep.class @@ -36,7 +36,7 @@ class CreateConfigFileStep extends InstallStep { function processRequest() { if (!empty($_GET['downloadConfig'])) { GallerySetupUtilities::generateTextFileForDownload( - 'config.php', $this->_getConfigContents()); + 'config.php', $this::_getConfigContents()); return false; } @@ -132,7 +132,7 @@ class CreateConfigFileStep extends InstallStep { $this->_firstTime = false; } - function _getConfigContents() { + static function _getConfigContents() { global $galleryStub; $configDir = $_SESSION['configPath']; $baseDir = dirname(dirname(dirname(__FILE__))); diff --git a/install/steps/DatabaseSetupStep.class b/install/steps/DatabaseSetupStep.class index 6899568a..7ab53596 100644 --- a/install/steps/DatabaseSetupStep.class +++ b/install/steps/DatabaseSetupStep.class @@ -71,9 +71,9 @@ class DatabaseSetupStep extends InstallStep { $this->_config['type'] = 'mysqli'; $mysqltType = 'mysqli'; } - if ($this->_config['type'] == 'pdo_sqlite') { - $this->_config['database'] = - 'sqlite:' . $galleryStub->getConfig('data.gallery.base') . 'gallery2.db'; + if ($this->_config['type'] == 'pdo_sqlite') { + $this->_config['database'] = + 'sqlite:' . $galleryStub->getConfig('data.gallery.base') . 'gallery2.db'; } switch ($this->_config['type']) { case 'mysql': @@ -154,7 +154,8 @@ class DatabaseSetupStep extends InstallStep { require_once(dirname(__FILE__) . '/../../lib/adodb/adodb.inc.php'); $this->_captureStart(); - $this->_db =& ADONewConnection($this->_config['type']); + $ADOConnection = ADONewConnection($this->_config['type']); + $this->_db =& $ADOConnection; $this->_captureEnd(); if (empty($this->_db)) { @@ -162,7 +163,7 @@ class DatabaseSetupStep extends InstallStep { _('Unable to create a database connection of type %s'), $this->_config['type']); } - + if (empty($templateData['errors'])) { $this->_captureStart(); $this->_db->debug = true; @@ -616,7 +617,7 @@ class DatabaseSetupStep extends InstallStep { $GLOBALS['gallery']->setConfig('plugins.dirname', $galleryStub->getConfig('plugins.dirname')); $GLOBALS['gallery']->setConfig('data.gallery.version', $configPath . 'versions.dat'); - $GLOBALS['gallery']->setConfig('data.gallery.locale', $configPath . 'locale' + $GLOBALS['gallery']->setConfig('data.gallery.locale', $configPath . 'locale' . DIRECTORY_SEPARATOR); } global $gallery; diff --git a/lib/support/GallerySetupUtilities.class b/lib/support/GallerySetupUtilities.class index 4f8cc7e6..22ecdf2a 100644 --- a/lib/support/GallerySetupUtilities.class +++ b/lib/support/GallerySetupUtilities.class @@ -290,13 +290,14 @@ class GallerySetupUtilities { * @param string $name the file's name * @param string $contents the file's contents */ - function generateTextFileForDownload($name, $contents) { - header('Content-Type: text/plain'); - header('Content-Length: ' . strlen($contents)); - header("Content-Description: Download $name to your computer."); - header("Content-Disposition: attachment; filename=$name"); - print $contents; - } + static function generateTextFileForDownload($name, $contents) + { + header('Content-Type: text/plain'); + header('Content-Length: ' . strlen($contents)); + header("Content-Description: Download $name to your computer."); + header("Content-Disposition: attachment; filename=$name"); + print $contents; + } /** * Cleanly start up our session. diff --git a/modules/core/CoreModuleExtras.inc b/modules/core/CoreModuleExtras.inc index c98e9812..af8619b6 100644 --- a/modules/core/CoreModuleExtras.inc +++ b/modules/core/CoreModuleExtras.inc @@ -3319,7 +3319,11 @@ if (!isset($gallery) || !method_exists($gallery, \'setConfig\')) { GalleryCoreApi::requireOnce('modules/core/classes/GalleryEntity.class'); $lock = new GalleryEntity(); - $lock->create(); + $ret = $lock->create(); + if ($ret) { + return $ret; + } + $ret = $lock->save(false); if ($ret) { return $ret;