X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/08c2f03ccc2a4a31d0d30dd4260479ac647d884e:/lib/classes/SetupClass.php..a0dbeabed1a18e9bedb6cb2a6eed4c2b5fbf45cc:/lib/setup/SetupClass.php diff --git a/lib/classes/SetupClass.php b/lib/setup/SetupClass.php similarity index 98% rename from lib/classes/SetupClass.php rename to lib/setup/SetupClass.php index 09f37e51..f31c2353 100755 --- a/lib/classes/SetupClass.php +++ b/lib/setup/SetupClass.php @@ -16,7 +16,7 @@ class SetupFunctions protected $oDB = null; // set in setupDB (earliest) or later in loadData, importData, drop, createSqlFunctions, importTigerData // pgsqlRunPartitionScript, calculatePostcodes, ..if no already set - public function __construct($aCMDResult) + public function __construct($aCMDResult, $callingFunction = 'setup') { // by default, use all but one processor, but never more than 15. $this->iInstances = isset($aCMDResult['threads']) @@ -45,7 +45,6 @@ class SetupFunctions // setting member variables based on command line options stored in $aCMDResult $this->sVerbose = $aCMDResult['verbose']; - $this->bEnableDiffUpdates = $aCMDResult['enable-diff-updates']; //setting default values which are not set by the update.php array if (isset($aCMDResult['ignore-errors'])) { @@ -63,6 +62,14 @@ class SetupFunctions } else { $this->bNoPartitions = false; } + + // if class is instantiated by update.php, we have to set EnableDiffUpdates to true + // otherwise set to value provided comand line to setup.php + if ($callingFunction == 'update') { + $this->bEnableDiffUpdates = true; + } elseif ($callingFunction == 'setup') { + $this->bEnableDiffUpdates = $aCMDResult['enable-diff-updates']; + } } public function createDB() @@ -166,8 +173,8 @@ class SetupFunctions $this->pgsqlRunScript('update country_name set partition = 0'); } - // the following will be needed by create_functions later but - // is only defined in the subsequently called T + // the following will be needed by createFunctions later but + // is only defined in the subsequently called createTables // Create dummies here that will be overwritten by the proper // versions in create-tables. $this->pgsqlRunScript('CREATE TABLE IF NOT EXISTS place_boundingbox ()');