Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUI.php |
— | — | @@ -25,13 +25,6 @@ |
26 | 26 | */ |
27 | 27 | protected $uiCore; |
28 | 28 | |
29 | | - /** |
30 | | - * Is auto-complete enabled for these UI elements? |
31 | | - * |
32 | | - * @var mixed SMWQUeryUI::ENABLE_AUTO_SUGGEST | SMWQUeryUI::DISABLE_AUTO_SUGGEST |
33 | | - */ |
34 | | - private $autoCompleteEnabled = false; |
35 | | - |
36 | 29 | const ENABLE_AUTO_SUGGEST = true; |
37 | 30 | const DISABLE_AUTO_SUGGEST = false; |
38 | 31 | |
— | — | @@ -325,7 +318,6 @@ |
326 | 319 | * @return string |
327 | 320 | */ |
328 | 321 | protected function getQueryFormBox() { |
329 | | - global $smwgScriptPath; |
330 | 322 | $this->setUrlArgs( array( 'q' => $this->uiCore->getQueryString() ) ); |
331 | 323 | $result = '<div>' . |
332 | 324 | Html::element( 'textarea', |
— | — | @@ -507,7 +499,6 @@ |
508 | 500 | SMWOutputs::requireResource( 'ext.smw.style' ); |
509 | 501 | |
510 | 502 | $result = '<span id="smwposortbox">'; |
511 | | - $numSortValues = 0; |
512 | 503 | $params = $this->uiCore->getParameters(); |
513 | 504 | |
514 | 505 | // mainlabel |
— | — | @@ -595,7 +586,7 @@ |
596 | 587 | } |
597 | 588 | $printOuts = ( $this->uiCore->getPrintOuts() ); |
598 | 589 | $counter = 0; |
599 | | - foreach ( $printOuts as $poKey => $poValue ) { |
| 590 | + foreach ( $printOuts as $poValue ) { |
600 | 591 | if ( $poValue->getMode() == SMWPrintRequest::PRINT_CATS ) { |
601 | 592 | $categoryValues[$counter] = ' '; |
602 | 593 | $categoryLabelValues[$counter] = $poValue->getLabel(); |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php |
— | — | @@ -439,7 +439,6 @@ |
440 | 440 | $res = $this->queryResult; |
441 | 441 | $printer = SMWQueryProcessor::getResultPrinter( $this->parameters['format'], |
442 | 442 | SMWQueryProcessor::SPECIAL_PAGE ); |
443 | | - $resultMime = $printer->getMimeType( $res ); |
444 | 443 | |
445 | 444 | if ( $res->getCount() > 0 ) { |
446 | 445 | $queryResult = $printer->getResult( $res, $this->params, SMW_OUTPUT_HTML ); |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialQueryCreator.php |
— | — | @@ -31,8 +31,6 @@ |
32 | 32 | * @param string $p |
33 | 33 | */ |
34 | 34 | protected function makePage( $p ) { |
35 | | - global $wgOut; |
36 | | - |
37 | 35 | $htmlOutput = $this->makeForm( $p ); |
38 | 36 | |
39 | 37 | if ( $this->uiCore->getQueryString() != "" ) { |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php |
— | — | @@ -59,7 +59,6 @@ |
60 | 60 | $linker = smwfGetLinker(); |
61 | 61 | list ( $property, $useCount ) = $result; |
62 | 62 | |
63 | | - $typestring = ''; |
64 | 63 | $errors = array(); |
65 | 64 | |
66 | 65 | $diWikiPage = $property->getDiWikiPage(); |
— | — | @@ -68,7 +67,7 @@ |
69 | 68 | if ( $property->isUserDefined() ) { |
70 | 69 | |
71 | 70 | if ( $title === null ) { |
72 | | - continue; |
| 71 | + return ''; |
73 | 72 | } |
74 | 73 | |
75 | 74 | if ( $useCount <= 5 ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_ExportController.php |
— | — | @@ -515,7 +515,6 @@ |
516 | 516 | |
517 | 517 | global $wgSitename, $wgLanguageCode; |
518 | 518 | |
519 | | - $db = & wfGetDB( DB_SLAVE ); |
520 | 519 | $this->prepareSerialization(); |
521 | 520 | $this->delay_flush = 35; // don't do intermediate flushes with default parameters |
522 | 521 | |
Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php |
— | — | @@ -321,7 +321,6 @@ |
322 | 322 | |
323 | 323 | $parts = explode( '-23', $dbKey, 2 ); |
324 | 324 | if ( count( $parts ) == 2 ) { |
325 | | - $dbkey = $parts[0]; |
326 | 325 | $subobjectname = $parts[1]; |
327 | 326 | } else { |
328 | 327 | $subobjectname = ''; |
Index: trunk/extensions/SemanticMediaWiki/includes/datavalues/SMW_DV_Time.php |
— | — | @@ -215,8 +215,8 @@ |
216 | 216 | $calendarmodel = $timezoneoffset = $era = $ampm = false; |
217 | 217 | $hours = $minutes = $seconds = $timeoffset = false; |
218 | 218 | $unclearparts = array(); |
219 | | - $prevmatchwasnumber = $matchisnumber = false; // used for looking back; numbers are days/months/years by default but may be re-interpreted if certain further symbols are found |
220 | | - $prevmatchwasdate = $matchisdate = false; // used for ensuring that date parts are in one block |
| 219 | + $matchisnumber = false; // used for looking back; numbers are days/months/years by default but may be re-interpreted if certain further symbols are found |
| 220 | + $matchisdate = false; // used for ensuring that date parts are in one block |
221 | 221 | |
222 | 222 | foreach ( $matches as $match ) { |
223 | 223 | $prevmatchwasnumber = $matchisnumber; |
— | — | @@ -725,7 +725,6 @@ |
726 | 726 | * @return string |
727 | 727 | */ |
728 | 728 | public function getISO8601Date( $mindefault = true ) { |
729 | | - $yearnum = ( $this->getYear() > 0 ) ? $this->getYear() : 1 - $this->getYear(); |
730 | 729 | $result = ( $this->getYear() > 0 ) ? '' : '-'; |
731 | 730 | $monthnum = $this->getMonth( SMWDITime::CM_GREGORIAN, ( $mindefault ? 1 : 12 ) ); |
732 | 731 | $result .= str_pad( $this->getYear(), 4, "0", STR_PAD_LEFT ) . |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Table.php |
— | — | @@ -31,8 +31,6 @@ |
32 | 32 | } |
33 | 33 | |
34 | 34 | protected function getResultText( SMWQueryResult $res, $outputmode ) { |
35 | | - global $wgVersion; |
36 | | - |
37 | 35 | $result = ''; |
38 | 36 | |
39 | 37 | $columnClasses = array(); |
Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php |
— | — | @@ -178,7 +178,6 @@ |
179 | 179 | $result .= $rowstart; |
180 | 180 | } |
181 | 181 | |
182 | | - $first_col = true; |
183 | 182 | if ( $this->mTemplate !== '' ) { // build template code |
184 | 183 | $this->hasTemplates = true; |
185 | 184 | $wikitext = ( $this->mUserParam ) ? "|userparam=$this->mUserParam" : ''; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_PageSchemas.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | $listSeparator = ','; |
101 | 101 | $allowed_values_str = str_replace( "\\$listSeparator", "\a", $val ); |
102 | 102 | $allowed_values_array = explode( $listSeparator, $allowed_values_str ); |
103 | | - foreach ( $allowed_values_array as $i => $value ) { |
| 103 | + foreach ( $allowed_values_array as $value ) { |
104 | 104 | // replace beep back with comma, trim |
105 | 105 | $value = str_replace( "\a", $listSeparator, trim( $value ) ); |
106 | 106 | $xml .= '<AllowedValue>' . $value . '</AllowedValue>'; |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | $text = wfMsgForContent( 'smw-createproperty-isproperty', $typeTag ); |
196 | 196 | if ( $allowedValues != null) { |
197 | 197 | $text .= "\n\n" . wfMsgExt( 'smw-createproperty-allowedvals', array( 'parsemag', 'content' ), count( $allowedValues ) ); |
198 | | - foreach ( $allowedValues as $i => $value ) { |
| 198 | + foreach ( $allowedValues as $value ) { |
199 | 199 | if ( method_exists( $smwgContLang, 'getPropertyLabels' ) ) { |
200 | 200 | $prop_labels = $smwgContLang->getPropertyLabels(); |
201 | 201 | $text .= "\n* [[" . $prop_labels['_PVAL'] . "::$value]]"; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryParser.php |
— | — | @@ -318,7 +318,6 @@ |
319 | 319 | |
320 | 320 | $typeid = $property->getDataItem()->findPropertyTypeID(); |
321 | 321 | $inverse = $property->isInverse(); |
322 | | - $prevname = $name; |
323 | 322 | $properties[] = $property; |
324 | 323 | } ///NOTE: after iteration, $property and $typeid correspond to last value |
325 | 324 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php |
— | — | @@ -191,7 +191,7 @@ |
192 | 192 | * @param OutputPage $output |
193 | 193 | */ |
194 | 194 | static public function commitToOutputPage( OutputPage $output ) { |
195 | | - foreach ( self::$scripts as $key => $script ) { |
| 195 | + foreach ( self::$scripts as $script ) { |
196 | 196 | $output->addScript( $script ); |
197 | 197 | } |
198 | 198 | foreach ( self::$headItems as $key => $item ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SetRecurringEvent.php |
— | — | @@ -167,7 +167,6 @@ |
168 | 168 | $cur_date = $start_date; |
169 | 169 | $cur_date_jd = self::getJD( $cur_date ); |
170 | 170 | $i = 0; |
171 | | - $reached_end_date = false; |
172 | 171 | |
173 | 172 | do { |
174 | 173 | $i++; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -1054,7 +1054,6 @@ |
1055 | 1055 | if ( $propkey === '' ) { // Sort by first result column (page titles). |
1056 | 1056 | $qobj->sortfields[$propkey] = "$qobj->alias.smw_sortkey"; |
1057 | 1057 | } else { // Try to extend query. |
1058 | | - $extrawhere = ''; |
1059 | 1058 | $sortprop = SMWPropertyValue::makeUserProperty( $propkey ); |
1060 | 1059 | |
1061 | 1060 | if ( $sortprop->isValid() ) { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStoreQueryEngine.php |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | abstract public function isSafe(); |
77 | 77 | |
78 | 78 | public function getWeakConditionString() { |
79 | | - return implode( $this->weakConditions ); |
| 79 | + return implode( '', $this->weakConditions ); |
80 | 80 | } |
81 | 81 | |
82 | 82 | } |
— | — | @@ -278,7 +278,6 @@ |
279 | 279 | $sparqlCondition = $this->getSparqlCondition( $query->getDescription() ); |
280 | 280 | |
281 | 281 | if ( $sparqlCondition instanceof SMWSparqlSingletonCondition ) { |
282 | | - $matchElement = $sparqlCondition->matchElement; |
283 | 282 | if ( $sparqlCondition->condition === '' ) { // all URIs exist, no querying |
284 | 283 | return 1; |
285 | 284 | } else { |
— | — | @@ -357,7 +356,6 @@ |
358 | 357 | $entries = array(); |
359 | 358 | |
360 | 359 | if ( $sparqlCondition instanceof SMWSparqlSingletonCondition ) { |
361 | | - $matchElement = $sparqlCondition->matchElement; |
362 | 360 | if ( $sparqlCondition->condition === '' ) { // all URIs exist, no querying |
363 | 361 | $sparql = 'None (no conditions).'; |
364 | 362 | } else { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -401,7 +401,7 @@ |
402 | 402 | } |
403 | 403 | |
404 | 404 | // First build $select, $from, and $where for the DB query |
405 | | - $select = $where = $from = ''; |
| 405 | + $where = $from = ''; |
406 | 406 | $pid = $this->getSMWPropertyID( $property ); |
407 | 407 | $tableid = self::findPropertyTableID( $property ); |
408 | 408 | |
— | — | @@ -563,7 +563,7 @@ |
564 | 564 | $suboptions = null; |
565 | 565 | } |
566 | 566 | |
567 | | - foreach ( self::getPropertyTables() as $tid => $proptable ) { |
| 567 | + foreach ( self::getPropertyTables() as $proptable ) { |
568 | 568 | $from = $db->tableName( $proptable->name ); |
569 | 569 | |
570 | 570 | if ( $proptable->idsubject ) { |
— | — | @@ -638,7 +638,7 @@ |
639 | 639 | $proptables = self::getPropertyTables(); |
640 | 640 | foreach ( $tableIds as $tid ) { |
641 | 641 | $proptable = $proptables[$tid]; |
642 | | - $select = $where = $from = ''; |
| 642 | + $where = $from = ''; |
643 | 643 | if ( $proptable->fixedproperty == false ) { // join smw_ids to get property titles |
644 | 644 | $from = $db->tableName( 'smw_ids' ) . " INNER JOIN " . $db->tableName( $proptable->name ) . " AS t1 ON t1.p_id=smw_id"; |
645 | 645 | $this->prepareValueQuery( $from, $where, $proptable, $value, 1 ); |
— | — | @@ -847,11 +847,6 @@ |
848 | 848 | if ( $typeid != 'p' ) { |
849 | 849 | $uvals[$fieldname] = current( $dbkeys ); |
850 | 850 | } else { |
851 | | - /// TODO The dbkeys hanlding here is obsolete; a clean handling for the DI system is needed |
852 | | - $title = current( $dbkeys ); |
853 | | - $namespace = next( $dbkeys ); |
854 | | - $iw = next( $dbkeys ); |
855 | | - $sortkey = next( $dbkeys ); // not used; sortkeys are not set on writing objects |
856 | 851 | $uvals[$fieldname] = $this->makeSMWPageID( $di->getDBkey(), $di->getNamespace(), $di->getInterwiki(), $di->getSubobjectName() ); |
857 | 852 | } |
858 | 853 | |
— | — | @@ -1886,9 +1881,7 @@ |
1887 | 1882 | public static function findAllDiTypeTableIds( $dataItemId ) { |
1888 | 1883 | $result = array( self::findDiTypeTableId( $dataItemId ) ); |
1889 | 1884 | |
1890 | | - foreach ( self::$special_tables as $propertyKey => $specialTableId ) { |
1891 | | - $diProperty = new SMWDIProperty( $propertyKey, false ); |
1892 | | - $propertyTypeId = $diProperty->findPropertyTypeId(); |
| 1885 | + foreach ( self::$special_tables as $specialTableId ) { |
1893 | 1886 | if ( $dataItemId == SMWDataValueFactory::getDataItemId( $dataItemId ) ) { |
1894 | 1887 | $result[] = $specialTableId; |
1895 | 1888 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SparqlStore.php |
— | — | @@ -266,7 +266,7 @@ |
267 | 267 | |
268 | 268 | |
269 | 269 | public function getQueryResult( SMWQuery $query ) { |
270 | | - global $smwgIgnoreQueryErrors, $smwgQSortingSupport; |
| 270 | + global $smwgIgnoreQueryErrors; |
271 | 271 | |
272 | 272 | if ( !$smwgIgnoreQueryErrors && |
273 | 273 | ( $query->querymode != SMWQuery::MODE_DEBUG ) && |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLHelpers.php |
— | — | @@ -196,7 +196,6 @@ |
197 | 197 | |
198 | 198 | $res = $db->query( $sql, __METHOD__ ); |
199 | 199 | $curfields = array(); |
200 | | - $result = array(); |
201 | 200 | |
202 | 201 | foreach ( $res as $row ) { |
203 | 202 | if ( $wgDBtype == 'postgres' ) { // postgresql |
— | — | @@ -330,8 +329,7 @@ |
331 | 330 | * @param DatabaseBase or Database $db |
332 | 331 | */ |
333 | 332 | public static function setupIndex( $rawTableName, array $columns, $db ) { |
334 | | - // TODO: $verbose is not a good global name! |
335 | | - global $wgDBtype, $verbose; |
| 333 | + global $wgDBtype; |
336 | 334 | |
337 | 335 | $tableName = $db->tableName( $rawTableName ); |
338 | 336 | |
— | — | @@ -443,7 +441,7 @@ |
444 | 442 | } |
445 | 443 | } |
446 | 444 | |
447 | | - foreach ( $columns as $key => $index ) { // Add the remaining indexes. |
| 445 | + foreach ( $columns as $index ) { // Add the remaining indexes. |
448 | 446 | if ( $index != false ) { |
449 | 447 | $type = 'INDEX'; |
450 | 448 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -273,7 +273,7 @@ |
274 | 274 | * @return SMWStore |
275 | 275 | */ |
276 | 276 | function &smwfGetStore() { |
277 | | - global $smwgMasterStore, $smwgDefaultStore, $smwgIP; |
| 277 | + global $smwgMasterStore, $smwgDefaultStore; |
278 | 278 | |
279 | 279 | if ( is_null( $smwgMasterStore ) ) { |
280 | 280 | $smwgMasterStore = new $smwgDefaultStore(); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | function enableSemantics( $namespace = null, $complete = false ) { |
29 | 29 | global $smwgIP, $wgFooterIcons, $wgExtensionFunctions, |
30 | 30 | $wgExtensionMessagesFiles, |
31 | | - $smwgNamespace, $wgServer, $wgAPIModules; |
| 31 | + $smwgNamespace, $wgAPIModules; |
32 | 32 | |
33 | 33 | $wgExtensionFunctions[] = 'smwfSetupExtension'; |
34 | 34 | $wgExtensionMessagesFiles['SemanticMediaWiki'] = $smwgIP . 'languages/SMW_Messages.php'; |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | */ |
418 | 418 | function smwfSetupExtension() { |
419 | 419 | wfProfileIn( 'smwfSetupExtension (SMW)' ); |
420 | | - global $smwgIP, $smwgScriptPath, $wgHooks, $wgFooterIcons, $smwgMasterStore, $smwgIQRunningNumber, $smwgToolboxBrowseLink; |
| 420 | + global $smwgIP, $smwgScriptPath, $wgFooterIcons, $smwgMasterStore, $smwgIQRunningNumber; |
421 | 421 | |
422 | 422 | $smwgMasterStore = null; |
423 | 423 | $smwgIQRunningNumber = 0; |