r24775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24774‎ | r24775 | r24776 >
Date:08:10, 14 August 2007
Author:proes
Status:old
Tags:
Comment:
Removed the need for old omega wiki attributes by using $GLOBALS array in OmegaWikiAttributes.
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -31,7 +31,7 @@
3232 * -this is what RecordHelpers are for.
3333 */
3434 function initializeOmegaWikiAttributes(ViewInformation $viewInformation){
35 - initializeOmegaWikiAttributesOld($viewInformation); //backward compatibility, will be removed!
 35+// initializeOmegaWikiAttributesOld($viewInformation); //backward compatibility, will be removed!
3636 $init_and_discard_this = OmegaWikiAttributes::getInstance($viewInformation);
3737 }
3838
@@ -39,7 +39,7 @@
4040 * Original initializeOmegaWikiAttributes, Do not call.
4141 * @deprecated use/update OmegaWikiAttributes->hardValues instead for now.
4242 */
43 -function initializeOmegaWikiAttributesOld(ViewInformation $viewInformation) {
 43+/*function initializeOmegaWikiAttributesOld(ViewInformation $viewInformation) {
4444 global
4545 $languageAttribute, $spellingAttribute, $textAttribute,
4646 $wgLanguageAttributeName, $wgSpellingAttributeName, $wgTextAttributeName;
@@ -357,6 +357,7 @@
358358 }
359359
360360 }
 361+*/
361362
362363
363364 class OmegaWikiAttributes {
@@ -594,8 +595,10 @@
595596 $attributes=&$this->attributes;
596597 $attributes[$key] = $value;
597598
598 - if ($value instanceof Attribute && !isset($GLOBALS[$key . "Attribute"]))
599 - throw new Exception("Could not find attribute global with key: " . $key);
 599+ if ($value instanceof Attribute)
 600+ $GLOBALS[$key . "Attribute"] = $value;
 601+ else
 602+ $GLOBALS[$key] = $value;
600603 }
601604
602605 public function __get($key) {

Status & tagging log