Index: branches/5.3.x/core/install/upgrades.php =================================================================== diff -u -N -r15677 -r15698 --- branches/5.3.x/core/install/upgrades.php (.../upgrades.php) (revision 15677) +++ branches/5.3.x/core/install/upgrades.php (.../upgrades.php) (revision 15698) @@ -1,6 +1,6 @@ Application->getUnitOption('phrases', 'IDField'); - $table_name = $this->Application->getUnitOption('phrases', 'TableName'); + $config = $this->Application->getUnitConfig('phrases'); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); $sql = 'SELECT LanguageId, Phrase, MIN(LastChanged) AS LastChanged, COUNT(*) AS DupeCount FROM ' . $table_name . ' @@ -1852,7 +1853,7 @@ private function _renameTables($key) { foreach ($this->renamedTables as $prefix => $table_info) { - $this->Application->setUnitOption($prefix, 'TableName', TABLE_PREFIX . $table_info[$key]); + $this->Application->getUnitConfig($prefix)->setTableName(TABLE_PREFIX . $table_info[$key]); } } @@ -1955,7 +1956,7 @@ $delete_ids = Array (); $ml_helper->createFields('phrases'); $languages = $ml_helper->getLanguages(); - $phrase_table = $this->Application->getUnitOption('phrases', 'TableName'); + $phrase_table = $this->Application->getUnitConfig('phrases')->getTableName(); foreach ($source_phrases as $phrase_key => $phrase_info) { $target_phrase_key = $target_prefix . substr($phrase_key, strlen($source_prefix)); @@ -1996,7 +1997,7 @@ protected function getPhrasesByMask($mask) { $sql = 'SELECT * - FROM ' . $this->Application->getUnitOption('phrases', 'TableName') . ' + FROM ' . $this->Application->getUnitConfig('phrases')->getTableName() . ' WHERE PhraseKey LIKE ' . $this->Conn->qstr($mask); return $this->Conn->Query($sql, 'PhraseKey'); @@ -2054,8 +2055,9 @@ */ private function _splitEmailBody() { - $id_field = $this->Application->getUnitOption('email-template', 'IDField'); - $table_name = $this->Application->getUnitOption('email-template', 'TableName'); + $config = $this->Application->getUnitConfig('email-template'); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); $fields = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field'); if ( !isset($fields['l1_Body']) ) { @@ -2111,7 +2113,7 @@ $languages = $ml_helper->getLanguages(); - $event_table = $this->Application->getUnitOption('email-template', 'TableName'); + $event_table = $this->Application->getUnitConfig('email-template')->getTableName(); $sql = 'SELECT * FROM ' . $event_table . ' @@ -2123,7 +2125,7 @@ } $primary_language_id = $this->Application->GetDefaultLanguageId(); - $table_name = $this->Application->getUnitOption('lang', 'TableName'); + $table_name = $this->Application->getUnitConfig('lang')->getTableName(); foreach ($languages as $language_id) { $is_primary = $language_id == $primary_language_id; @@ -2175,7 +2177,7 @@ // make some promo block fields translatable $ml_helper->createFields('promo-block'); - $table_name = $this->Application->getUnitOption('promo-block', 'TableName'); + $table_name = $this->Application->getUnitConfig('promo-block')->getTableName(); $table_structure = $this->Conn->Query('DESCRIBE ' . $table_name, 'Field'); if ( isset($table_structure['Title']) ) { @@ -2189,7 +2191,7 @@ // fix e-mail event translations $languages = $ml_helper->getLanguages(); - $table_name = $this->Application->getUnitOption('email-template', 'TableName'); + $table_name = $this->Application->getUnitConfig('email-template')->getTableName(); $change_fields = Array ('Subject', 'HtmlBody', 'PlainTextBody'); @@ -2220,7 +2222,7 @@ return; } - $table_name = $this->Application->getUnitOption('c', 'TableName'); + $table_name = $this->Application->getUnitConfig('c')->getTableName(); $sql = 'SELECT NamedParentPath, CachedTemplate, CategoryId FROM ' . $table_name; @@ -2253,8 +2255,9 @@ protected function _updateScheduledTaskRunSchedule() { // minute hour day_of_month month day_of_week - $id_field = $this->Application->getUnitOption('scheduled-task', 'IDField'); - $table_name = $this->Application->getUnitOption('scheduled-task', 'TableName'); + $config = $this->Application->getUnitConfig('scheduled-task'); + $id_field = $config->getIDField(); + $table_name = $config->getTableName(); $sql = 'SELECT RunInterval, ' . $id_field . ' FROM ' . $table_name; @@ -2312,7 +2315,7 @@ protected function _updateUserPasswords() { - $user_table = $this->Application->getUnitOption('u', 'TableName'); + $user_table = $this->Application->getUnitConfig('u')->getTableName(); $sql = 'SELECT Password, PortalUserId FROM ' . $user_table . ' @@ -2338,7 +2341,7 @@ $this->Conn->doUpdate($fields_hash, TABLE_PREFIX . 'Users', 'PortalUserId = ' . $user_id); } } - + /** * Update to 5.3.0-B1 *