Skip to content

Commit

Permalink
Removed INSTALLATION_IN_PROGRESS const (was always true and used badly)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcuenod committed Oct 17, 2016
1 parent 7402757 commit 075d389
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 0 additions & 3 deletions common/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ public static function getSettingsFor($module_name) {
}

public static function loadTemporaryDBSettings($database_settings) {
if (!INSTALLATION_IN_PROGRESS)
throw new Exception("This method can only be used during installation.", self::ERR_NOT_INSTALLING);

if (!isset(self::$module_settings["database"]))
self::$module_settings["database"] = [];
self::$module_settings["database"] = array_merge(self::$module_settings["database"], $database_settings);
Expand Down
7 changes: 3 additions & 4 deletions common/DBService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DBService extends Object {
protected static $db = null;
protected $error;

public function __construct($dbname = null)
public function __construct($databaseName = null)
{
if (!self::$db)
{
Expand Down Expand Up @@ -62,9 +62,8 @@ public function __construct($dbname = null)
}
}

// Allow db not to be selected if installation in progress
if ($dbname !== false && INSTALLATION_IN_PROGRESS)
self::selectDB($dbname ? $dbname : Config::dbInfo("name"));
if ($databaseName !== false)
self::selectDB($databaseName ? $databaseName : Config::dbInfo("name"));
}

public function getError()
Expand Down
4 changes: 0 additions & 4 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@
$INSTALLATION_VERSION = "2.0.0";
$INSTALLATION_VERSIONS = ["1.9.0", "2.0.0"];

// TODO: if /index.php is calling this all the time, these lines make no sense
// (we shouldn't set these constants for every page).
const INSTALLATION_IN_PROGRESS = true;


function is_installed()
{
Expand Down

0 comments on commit 075d389

Please sign in to comment.