Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install/steps/AuthenticateStep.class
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions install/steps/CreateConfigFileStep.class
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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__)));
Expand Down
13 changes: 7 additions & 6 deletions install/steps/DatabaseSetupStep.class
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -154,15 +154,16 @@ 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)) {
$templateData['errors'][] = sprintf(
_('Unable to create a database connection of type %s'),
$this->_config['type']);
}

if (empty($templateData['errors'])) {
$this->_captureStart();
$this->_db->debug = true;
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 8 additions & 7 deletions lib/support/GallerySetupUtilities.class
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion modules/core/CoreModuleExtras.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down