Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $format = $wgRequest->getVal( 'showformatoptions' ); |
51 | 51 | $params = $wgRequest->getArray( 'params' ); |
52 | 52 | $wgOut->disable(); |
53 | | - echo self::showFormatOptions( $format, $params ); |
| 53 | + echo $this->showFormatOptions( $format, $params ); |
54 | 54 | } else { |
55 | 55 | $this->extractQueryParameters( $p ); |
56 | 56 | $this->makeHTMLResult(); |
— | — | @@ -578,7 +578,7 @@ |
579 | 579 | |
580 | 580 | $result .= "</select></p>\n"; |
581 | 581 | $result .= '<fieldset><legend>' . wfMsg( 'smw_ask_otheroptions' ) . "</legend>\n"; |
582 | | - $result .= "<div id=\"other_options\">" . self::showFormatOptions( $this->m_params['format'], $this->m_params ) . "</div>"; |
| 582 | + $result .= "<div id=\"other_options\">" . $this->showFormatOptions( $this->m_params['format'], $this->m_params ) . "</div>"; |
583 | 583 | $result .= "</fieldset>\n"; |
584 | 584 | $urltail = str_replace( '&eq=yes', '', $urltail ) . '&eq=no'; |
585 | 585 | |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exp_Element.php |
— | — | @@ -77,9 +77,9 @@ |
78 | 78 | $this->m_namespace = $namespace; |
79 | 79 | $this->m_namespaceid = $namespaceid; |
80 | 80 | $this->m_localname = $name; |
81 | | - SMWExpElement::__construct( $namespace . $name, $dv ); |
| 81 | + parent::__construct( $namespace . $name, $dv ); |
82 | 82 | } else { |
83 | | - SMWExpElement::__construct( $name, $dv ); |
| 83 | + parent::__construct( $name, $dv ); |
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | */ |
144 | 144 | public function __construct( $name, $dv = null, $datatype = false ) { |
145 | 145 | $this->m_datatype = $datatype; |
146 | | - SMWExpElement::__construct( $name, $dv ); |
| 146 | + parent::__construct( $name, $dv ); |
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_ExportController.php |
— | — | @@ -510,7 +510,7 @@ |
511 | 511 | , 'SMW::RDF::PrintPageList', array( 'ORDER BY' => 'page_id ASC', 'OFFSET' => $offset, 'LIMIT' => $limit ) ); |
512 | 512 | $foundpages = false; |
513 | 513 | |
514 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 514 | + foreach ( $res as $row ) { |
515 | 515 | $foundpages = true; |
516 | 516 | $st = new SMWSmallTitle(); |
517 | 517 | $st->dbkey = $row->page_title; |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_URI.php |
— | — | @@ -36,8 +36,8 @@ |
37 | 37 | return SMWDataValue::TYPE_URI; |
38 | 38 | } |
39 | 39 | |
40 | | - public function SMWURIValue( $typeid ) { |
41 | | - SMWDataValue::__construct( $typeid ); |
| 40 | + public function __construct( $typeid ) { |
| 41 | + parent::__construct( $typeid ); |
42 | 42 | switch ( $typeid ) { |
43 | 43 | case '_ema': |
44 | 44 | $this->m_mode = SMW_URI_MODE_EMAIL; |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_String.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | public function getInfolinks() { |
118 | 118 | $this->unstub(); |
119 | 119 | if ( ( $this->m_typeid != '_txt' ) && ( $this->m_typeid != '_cod' ) ) { |
120 | | - return SMWDataValue::getInfolinks(); |
| 120 | + return parent::getInfolinks(); |
121 | 121 | } else { |
122 | 122 | return $this->m_infolinks; |
123 | 123 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RSSlink.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | protected $m_description = ''; |
19 | 19 | |
20 | 20 | protected function readParameters( $params, $outputmode ) { |
21 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 21 | + parent::readParameters( $params, $outputmode ); |
22 | 22 | if ( array_key_exists( 'title', $this->m_params ) ) { |
23 | 23 | $this->m_title = trim( $this->m_params['title'] ); |
24 | 24 | // for backward compatibiliy |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | protected $m_embedformat; |
25 | 25 | |
26 | 26 | protected function readParameters( $params, $outputmode ) { |
27 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 27 | + parent::readParameters( $params, $outputmode ); |
28 | 28 | |
29 | 29 | $this->m_showhead = !array_key_exists( 'embedonly', $params ); |
30 | 30 | $this->m_embedformat = array_key_exists( 'embedformat', $params ) ? trim( $params['embedformat'] ) : 'h1'; |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_CSV.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | protected $m_sep; |
17 | 17 | |
18 | 18 | protected function readParameters( $params, $outputmode ) { |
19 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 19 | + parent::readParameters( $params, $outputmode ); |
20 | 20 | if ( array_key_exists( 'sep', $params ) ) { |
21 | 21 | $this->m_sep = str_replace( '_', ' ', $params['sep'] ); |
22 | 22 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | protected $mOutroTemplate = ''; |
28 | 28 | |
29 | 29 | protected function readParameters( $params, $outputmode ) { |
30 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 30 | + parent::readParameters( $params, $outputmode ); |
31 | 31 | |
32 | 32 | if ( array_key_exists( 'sep', $params ) ) { |
33 | 33 | $this->mSep = str_replace( '_', ' ', $params['sep'] ); |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_RDF.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | protected $syntax; |
20 | 20 | |
21 | 21 | protected function readParameters( $params, $outputmode ) { |
22 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 22 | + parent::readParameters( $params, $outputmode ); |
23 | 23 | if ( array_key_exists( 'syntax', $params ) ) { |
24 | 24 | $this->syntax = $params['syntax']; |
25 | 25 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_DSV.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | protected $fileName = 'result.dsv'; |
20 | 20 | |
21 | 21 | protected function readParameters( $params, $outputmode ) { |
22 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 22 | + parent::readParameters( $params, $outputmode ); |
23 | 23 | |
24 | 24 | if ( array_key_exists( 'separator', $this->m_params ) && $this->m_params['separator'] != '\\' ) { |
25 | 25 | $this->separator = trim( $this->m_params['separator'] ); |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Category.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | protected $mNumColumns = 3; |
24 | 24 | |
25 | 25 | protected function readParameters( $params, $outputmode ) { |
26 | | - SMWResultPrinter::readParameters( $params, $outputmode ); |
| 26 | + parent::readParameters( $params, $outputmode ); |
27 | 27 | |
28 | 28 | if ( array_key_exists( 'delim', $params ) ) { |
29 | 29 | $this->mDelim = str_replace( '_', ' ', $params['delim'] ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStoreLight.php |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | } |
89 | 89 | $res = $db->select( $tablename, array( 'propname', 'value' ), array( 'pageid' => $sid ), |
90 | 90 | 'SMW::getSemanticData', array( 'DISTINCT' ) ); |
91 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 91 | + foreach ( $res as $row ) { |
92 | 92 | $value = ( $tablename == 'smwsimple_special' ) ? array( $row->value ) : unserialize( $row->value ); |
93 | 93 | $this->m_semdata[$sid]->addPropertyStubValue( $row->propname, $value ); |
94 | 94 | } |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | $res = $db->select( $tablename, array( 'value' ), array( 'propname' => $property->getDBkey() ), |
126 | 126 | 'SMW::getPropertyValues', $this->getSQLOptions( $requestoptions, 'value' ) + array( 'DISTINCT' ) ); |
127 | 127 | $result = array(); |
128 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 128 | + foreach ( $res as $row ) { |
129 | 129 | $dv = SMWDataValueFactory::newPropertyObjectValue( $property ); |
130 | 130 | if ( $outputformat != '' ) $dv->setOutputFormat( $outputformat ); |
131 | 131 | $dv->setDBkeys( ( $tablename == 'smwsimple_special' ) ? array( $row->value ) : unserialize( $row->value ) ); |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | $where . $this->getSQLConditions( $requestoptions, 'p.page_title', 'p.page_title' ), |
164 | 164 | 'SMW::getPropertySubjects', |
165 | 165 | $this->getSQLOptions( $requestoptions, 'p.page_title' ) + array( 'DISTINCT' ) ); |
166 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 166 | + foreach ( $res as $row ) { |
167 | 167 | $result[] = SMWWikiPageValue::makePage( $row->title, $row->namespace, $row->title ); |
168 | 168 | } |
169 | 169 | $db->freeResult( $res ); |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | $res = $db->select( $tablename, 'DISTINCT propname', |
203 | 203 | 'pageid=' . $db->addQuotes($sid) . $this->getSQLConditions( $suboptions, 'propname', 'propname' ), |
204 | 204 | 'SMW::getProperties', $this->getSQLOptions( $suboptions, 'propname' ) ); |
205 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 205 | + foreach ( $res as $row ) { |
206 | 206 | $result[] = new SMWDIProperty( $row->propname ); |
207 | 207 | } |
208 | 208 | $db->freeResult( $res ); |
— | — | @@ -241,7 +241,7 @@ |
242 | 242 | $res = $db->select( $tablename, 'DISTINCT propname', // select sortkey since it might be used in ordering (needed by Postgres) |
243 | 243 | $where . $this->getSQLConditions( $suboptions, 'propname', 'propname' ), |
244 | 244 | 'SMW::getInProperties', $this->getSQLOptions( $suboptions, 'propname' ) ); |
245 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 245 | + foreach ( $res as $row ) { |
246 | 246 | $result[] = new SMWDIProperty( $row->propname ); |
247 | 247 | } |
248 | 248 | $db->freeResult( $res ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -353,7 +353,7 @@ |
354 | 354 | ( $usedistinct ? $this->getSQLOptions( $requestoptions, $valuecolumn ) + array( 'DISTINCT' ) : |
355 | 355 | $this->getSQLOptions( $requestoptions, $valuecolumn ) ) ); |
356 | 356 | |
357 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 357 | + foreach ( $res as $row ) { |
358 | 358 | if ( !$issubject ) { |
359 | 359 | $propertyname = 'fixed'; // irrelevant, but use this to check if the data is good |
360 | 360 | } elseif ( !$proptable->fixedproperty ) { // use joined or predefined property name |
— | — | @@ -474,7 +474,7 @@ |
475 | 475 | 'SMW::getPropertySubjects', |
476 | 476 | $this->getSQLOptions( $requestoptions, 'smw_sortkey' ) ); |
477 | 477 | |
478 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 478 | + foreach ( $res as $row ) { |
479 | 479 | try { |
480 | 480 | $result[] = new SMWDIWikiPage( $row->title, $row->namespace, '' ); |
481 | 481 | } catch ( SMWDataItemException $e ) { |
— | — | @@ -618,7 +618,7 @@ |
619 | 619 | $where . $this->getSQLConditions( $suboptions, 'smw_sortkey', 'smw_sortkey' ), |
620 | 620 | 'SMW::getProperties', $this->getSQLOptions( $suboptions, 'smw_sortkey' ) ); |
621 | 621 | |
622 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 622 | + foreach ( $res as $row ) { |
623 | 623 | $result[] = new SMWDIProperty( $row->smw_title ); |
624 | 624 | } |
625 | 625 | } else { // just check if subject occurs in table |
— | — | @@ -684,7 +684,7 @@ |
685 | 685 | $where . $this->getSQLConditions( $suboptions, 'smw_sortkey', 'smw_sortkey', $where != '' ), |
686 | 686 | 'SMW::getInProperties', $this->getSQLOptions( $suboptions, 'smw_sortkey' ) ); |
687 | 687 | |
688 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 688 | + foreach ( $res as $row ) { |
689 | 689 | $result[] = new SMWDIProperty( $row->smw_title ); |
690 | 690 | } |
691 | 691 | } else { |
— | — | @@ -1018,7 +1018,7 @@ |
1019 | 1019 | $res = $db->query( $query, 'SMW::getPropertySubjects' ); |
1020 | 1020 | $result = array(); |
1021 | 1021 | |
1022 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 1022 | + foreach ( $res as $row ) { |
1023 | 1023 | $result[] = array( new SMWDIProperty( $row->smw_title ), $row->count ); |
1024 | 1024 | } |
1025 | 1025 | |
— | — | @@ -1098,7 +1098,7 @@ |
1099 | 1099 | |
1100 | 1100 | $result = array(); |
1101 | 1101 | |
1102 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 1102 | + foreach ( $res as $row ) { |
1103 | 1103 | $result[] = new SMWDIProperty( $row->title ); |
1104 | 1104 | } |
1105 | 1105 | |
— | — | @@ -1140,7 +1140,7 @@ |
1141 | 1141 | 'smw_title, COUNT(*) as count', 'smw_id > 50 AND page_id IS NULL GROUP BY smw_title', |
1142 | 1142 | 'SMW::getWantedPropertiesSpecial', $options ); |
1143 | 1143 | |
1144 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 1144 | + foreach ( $res as $row ) { |
1145 | 1145 | $result[] = array( new SMWDIProperty( $row->smw_title ), $row->count ); |
1146 | 1146 | } |
1147 | 1147 | } |
— | — | @@ -2278,7 +2278,7 @@ |
2279 | 2279 | $res = $db->select( 'smw_ids', 'smw_id', array( 'smw_title' => '', 'smw_namespace' => $id, 'smw_iw' => SMW_SQL2_SMWIW ), "$fname::selectBnodes" ); |
2280 | 2280 | |
2281 | 2281 | // ... and delete them as well |
2282 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 2282 | + foreach ( $res as $row ) { |
2283 | 2283 | foreach ( self::getPropertyTables() as $proptable ) { |
2284 | 2284 | if ( $proptable->idsubject ) { |
2285 | 2285 | $db->delete( $proptable->name, array( 's_id' => $row->smw_id ), "$fname::deleteBnodes" ); |
— | — | @@ -2357,7 +2357,7 @@ |
2358 | 2358 | if ( ( $subject_ns == SMW_NS_PROPERTY ) && ( $proptable->fixedproperty == false ) ) { |
2359 | 2359 | $res = $db->select( $from, $select, array( 'p_id' => $old_tid ), $fname ); |
2360 | 2360 | |
2361 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 2361 | + foreach ( $res as $row ) { |
2362 | 2362 | $jobs[] = new SMWUpdateJob( Title::makeTitle( $row->namespace, $row->title ) ); |
2363 | 2363 | } |
2364 | 2364 | |
— | — | @@ -2368,7 +2368,7 @@ |
2369 | 2369 | if ( $type == 'p' ) { |
2370 | 2370 | $res = $db->select( $from, $select, array( $fieldname => $old_tid ), $fname ); |
2371 | 2371 | |
2372 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 2372 | + foreach ( $res as $row ) { |
2373 | 2373 | $jobs[] = new SMWUpdateJob( Title::makeTitle( $row->namespace, $row->title ) ); |
2374 | 2374 | } |
2375 | 2375 | |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLHelpers.php |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | $curfields = array(); |
195 | 195 | $result = array(); |
196 | 196 | |
197 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 197 | + foreach ( $res as $row ) { |
198 | 198 | $type = strtoupper( $row->Type ); |
199 | 199 | |
200 | 200 | if ( $wgDBtype == 'postgres' ) { // postgresql |
— | — | @@ -335,10 +335,8 @@ |
336 | 336 | if ( !$res ) { |
337 | 337 | return false; |
338 | 338 | } |
339 | | - |
340 | | - $indexes = array(); |
341 | | - |
342 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 339 | + |
| 340 | + foreach ( $res as $row ) { |
343 | 341 | // Remove the unneeded indexes, let indexes alone that already exist in the correct fashion. |
344 | 342 | if ( array_key_exists( $row->indexcolumns, $columns ) ) { |
345 | 343 | $columns[$row->indexcolumns] = false; |
— | — | @@ -372,7 +370,7 @@ |
373 | 371 | |
374 | 372 | $indexes = array(); |
375 | 373 | |
376 | | - while ( $row = $db->fetchObject( $res ) ) { |
| 374 | + foreach ( $res as $row ) { |
377 | 375 | if ( !array_key_exists( $row->Key_name, $indexes ) ) { |
378 | 376 | $indexes[$row->Key_name] = array(); |
379 | 377 | } |