Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_refreshData.php |
— | — | @@ -34,9 +34,8 @@ |
35 | 35 | require_once("{$mwPath}counter.php"); |
36 | 36 | require_once("{$mwPath}commandLine.inc"); |
37 | 37 | |
38 | | -global $smwgIP, $smwgEnableUpdateJobs, $wgServer; |
| 38 | +global $smwgEnableUpdateJobs, $wgServer; |
39 | 39 | $smwgEnableUpdateJobs = false; // do not fork additional update jobs while running this script |
40 | | -require_once($smwgIP . '/includes/SMW_Factbox.php'); |
41 | 40 | |
42 | 41 | if ( isset( $options['server'] ) ) { |
43 | 42 | $wgServer = $options['server']; |
— | — | @@ -115,7 +114,12 @@ |
116 | 115 | |
117 | 116 | global $wgParser; |
118 | 117 | |
119 | | -print "Refreshing all semantic data in the database!\n"; |
| 118 | +print "Refreshing all semantic data in the database!\n---\n" . |
| 119 | +" Some versions of PHP suffer from memory leaks in long-running scripts.\n" . |
| 120 | +" If your machine gets very slow after many pages (typically more than\n" . |
| 121 | +" 1000) were refreshed, please abort with CTRL-C and resume this script\n" . |
| 122 | +" at the last processed page id using the parameter -s (use -v to display\n" . |
| 123 | +" page ids during refresh). Continue this until all pages were refreshed.\n---\n"; |
120 | 124 | print "Processing pages from ID $start to ID $end ...\n"; |
121 | 125 | |
122 | 126 | $num_files = 0; |
Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -1,10 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if (!defined('MEDIAWIKI')) die(); |
5 | | - |
6 | | -global $IP; |
7 | | -include_once($IP . '/includes/SpecialPage.php'); |
8 | | - |
9 | 4 | /** |
10 | 5 | * @author Markus Krötzsch |
11 | 6 | * |
— | — | @@ -32,7 +27,7 @@ |
33 | 28 | } |
34 | 29 | |
35 | 30 | function execute($p = '') { |
36 | | - global $wgOut, $wgRequest, $smwgIP, $smwgQEnabled, $smwgRSSEnabled; |
| 31 | + global $wgOut, $wgRequest, $smwgQEnabled, $smwgRSSEnabled; |
37 | 32 | wfProfileIn('doSpecialAsk (SMW)'); |
38 | 33 | if ( ($wgRequest->getVal( 'query' ) != '') ) { // old processing |
39 | 34 | $this->executeSimpleAsk(); |
— | — | @@ -52,7 +47,7 @@ |
53 | 48 | // This code rather hacky since there are many ways to call that special page, the most involved of |
54 | 49 | // which is the way that this page calls itself when data is submitted via the form (since the shape |
55 | 50 | // of the parameters then is governed by the UI structure, as opposed to being governed by reason). |
56 | | - global $wgRequest, $smwgIP; |
| 51 | + global $wgRequest; |
57 | 52 | |
58 | 53 | // First make all inputs into a simple parameter list that can again be parsed into components later. |
59 | 54 | |
— | — | @@ -80,7 +75,6 @@ |
81 | 76 | } |
82 | 77 | |
83 | 78 | // Now parse parameters and rebuilt the param strings for URLs |
84 | | - include_once( "$smwgIP/includes/SMW_QueryProcessor.php" ); |
85 | 79 | SMWQueryProcessor::processFunctionParams($rawparams,$this->m_querystring,$this->m_params,$this->m_printouts); |
86 | 80 | // Try to complete undefined parameter values from dedicated URL params |
87 | 81 | if ( !array_key_exists('format',$this->m_params) ) { |
— | — | @@ -290,7 +284,7 @@ |
291 | 285 | * certain parameters. |
292 | 286 | */ |
293 | 287 | protected function executeSimpleAsk() { |
294 | | - global $wgRequest, $wgOut, $smwgQEnabled, $smwgQMaxLimit, $wgUser, $smwgQSortingSupport, $smwgIP; |
| 288 | + global $wgRequest, $wgOut, $smwgQEnabled, $smwgQMaxLimit, $wgUser, $smwgQSortingSupport; |
295 | 289 | |
296 | 290 | $skin = $wgUser->getSkin(); |
297 | 291 | |
— | — | @@ -321,7 +315,6 @@ |
322 | 316 | |
323 | 317 | // print results if any |
324 | 318 | if ($smwgQEnabled && ('' != $query) ) { |
325 | | - include_once( "$smwgIP/includes/SMW_QueryProcessor.php" ); |
326 | 319 | $params = array('offset' => $offset, 'limit' => $limit, 'format' => 'broadtable', 'mainlabel' => ' ', 'link' => 'all', 'default' => wfMsg('smw_result_noresults'), 'sort' => $sort, 'order' => $order); |
327 | 320 | $queryobj = SMWQueryProcessor::createQuery($query, $params, false); |
328 | 321 | $res = smwfGetStore()->getQueryResult($queryobj); |
Index: trunk/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php |
— | — | @@ -1,10 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if (!defined('MEDIAWIKI')) die(); |
5 | | - |
6 | | -global $IP; |
7 | | -include_once($IP . '/includes/SpecialPage.php'); |
8 | | - |
9 | 4 | /** |
10 | 5 | * @author Markus Krötzsch |
11 | 6 | * |
— | — | @@ -26,10 +21,6 @@ |
27 | 22 | } |
28 | 23 | |
29 | 24 | public function execute($par = null) { |
30 | | - global $IP; |
31 | | - require_once($IP . '/includes/SpecialPage.php' ); |
32 | | - require_once($IP . '/includes/Title.php' ); |
33 | | - |
34 | 25 | global $wgOut, $wgRequest; |
35 | 26 | global $wgServer; // "http://www.yourserver.org" |
36 | 27 | // (should be equal to 'http://'.$_SERVER['SERVER_NAME']) |
Index: trunk/extensions/SemanticMediaWiki/specials/Relations/SMW_SpecialFlawedAttributes.php |
— | — | @@ -11,14 +11,6 @@ |
12 | 12 | * |
13 | 13 | */ |
14 | 14 | |
15 | | -if (!defined('MEDIAWIKI')) die(); |
16 | | - |
17 | | -global $IP, $smwgIP; |
18 | | - |
19 | | -require_once( "$IP/includes/SpecialPage.php" ); |
20 | | -require_once( "$IP/includes/Title.php" ); |
21 | | -require_once("$IP/includes/QueryPage.php"); |
22 | | - |
23 | 15 | function doSpecialFlawedAttributes($par = null) { |
24 | 16 | list( $limit, $offset ) = wfCheckLimits(); |
25 | 17 | $rep = new FlawedAttributes(); |
— | — | @@ -85,5 +77,3 @@ |
86 | 78 | return "$link ($result->count)"; |
87 | 79 | } |
88 | 80 | } |
89 | | - |
90 | | - |
Index: trunk/extensions/SemanticMediaWiki/specials/URIResolver/SMW_SpecialURIResolver.php |
— | — | @@ -1,10 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if (!defined('MEDIAWIKI')) die(); |
5 | | - |
6 | | -global $IP; |
7 | | -include_once($IP . '/includes/SpecialPage.php'); |
8 | | - |
9 | 4 | /** |
10 | 5 | * @author Denny Vrandecic |
11 | 6 | * |
Index: trunk/extensions/SemanticMediaWiki/specials/OntologyImport/SMW_SpecialOntologyImport.php |
— | — | @@ -9,18 +9,11 @@ |
10 | 10 | * TODO: The code below is still very very messy and undocumented. Cleanup needed! |
11 | 11 | */ |
12 | 12 | |
13 | | -if (!defined('MEDIAWIKI')) die(); |
14 | | - |
15 | | -global $IP; |
16 | | -require_once( "$IP/includes/SpecialPage.php" ); |
17 | | - |
18 | 13 | SpecialPage::addPage( new SpecialPage('OntologyImport','delete',true,'doSpecialImportOntology',false) ); |
19 | 14 | |
20 | | - |
21 | 15 | function doSpecialImportOntology($par = NULL) { |
22 | | - global $IP, $smwgIP; |
| 16 | + global $smwgIP; |
23 | 17 | require_once($smwgIP . '/includes/SMW_Storage.php'); |
24 | | - require_once($IP . '/includes/Title.php' ); |
25 | 18 | |
26 | 19 | global $wgOut, $wgRequest, $wgUser; |
27 | 20 | global $wgServer; // "http://www.yourserver.org" |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialTypes.php |
— | — | @@ -10,16 +10,8 @@ |
11 | 11 | * This only reports on the Type: Wiki pages. |
12 | 12 | */ |
13 | 13 | |
14 | | - |
15 | | -if (!defined('MEDIAWIKI')) die(); |
16 | | - |
17 | | -global $IP; |
18 | | -include_once($IP . '/includes/QueryPage.php'); |
19 | | - |
20 | 14 | function smwfDoSpecialTypes() { |
21 | 15 | wfProfileIn('smwfDoSpecialTypes (SMW)'); |
22 | | - global $smwgIP; |
23 | | - include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
24 | 16 | list( $limit, $offset ) = wfCheckLimits(); |
25 | 17 | $rep = new TypesPage(); |
26 | 18 | $result = $rep->doQuery( $offset, $limit ); |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialProperties.php |
— | — | @@ -2,14 +2,9 @@ |
3 | 3 | /** |
4 | 4 | * @author Markus Krötzsch |
5 | 5 | * |
6 | | - * This page shows all used attributes. |
| 6 | + * This page shows all used properties. |
7 | 7 | */ |
8 | 8 | |
9 | | -if (!defined('MEDIAWIKI')) die(); |
10 | | - |
11 | | -global $smwgIP; |
12 | | -include_once( "$smwgIP/specials/QueryPages/SMW_QueryPage.php" ); |
13 | | - |
14 | 9 | function smwfDoSpecialProperties() { |
15 | 10 | wfProfileIn('smwfDoSpecialProperties (SMW)'); |
16 | 11 | list( $limit, $offset ) = wfCheckLimits(); |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialWantedProperties.php |
— | — | @@ -2,14 +2,9 @@ |
3 | 3 | /** |
4 | 4 | * @author Markus Krötzsch |
5 | 5 | * |
6 | | - * This page shows all used attributes. |
| 6 | + * This page shows all wanted properties (used but not having a page). |
7 | 7 | */ |
8 | 8 | |
9 | | -if (!defined('MEDIAWIKI')) die(); |
10 | | - |
11 | | -global $smwgIP; |
12 | | -include_once( "$smwgIP/specials/QueryPages/SMW_QueryPage.php" ); |
13 | | - |
14 | 9 | function smwfDoSpecialWantedProperties() { |
15 | 10 | wfProfileIn('smwfDoSpecialWantedProperties (SMW)'); |
16 | 11 | list( $limit, $offset ) = wfCheckLimits(); |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_SpecialUnusedProperties.php |
— | — | @@ -2,14 +2,10 @@ |
3 | 3 | /** |
4 | 4 | * @author Markus Krötzsch |
5 | 5 | * |
6 | | - * This page shows all used attributes. |
| 6 | + * This page shows all unused properties. |
7 | 7 | */ |
8 | 8 | |
9 | | -if (!defined('MEDIAWIKI')) die(); |
10 | 9 | |
11 | | -global $smwgIP; |
12 | | -include_once( "$smwgIP/specials/QueryPages/SMW_QueryPage.php" ); |
13 | | - |
14 | 10 | function smwfDoSpecialUnusedProperties() { |
15 | 11 | wfProfileIn('smwfDoSpecialUnusedProperties (SMW)'); |
16 | 12 | list( $limit, $offset ) = wfCheckLimits(); |
Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_QueryPage.php |
— | — | @@ -6,18 +6,11 @@ |
7 | 7 | * data retrieval instead of the SQL-based access used by MW. |
8 | 8 | */ |
9 | 9 | |
10 | | -if (!defined('MEDIAWIKI')) die(); |
11 | | - |
12 | | -global $IP, $smwgIP; |
13 | | -include_once($IP . '/includes/SpecialPage.php'); |
14 | | -include_once($IP . '/includes/Title.php'); |
15 | | -include_once($IP . '/includes/QueryPage.php'); |
16 | | -include_once($smwgIP . '/includes/storage/SMW_Store.php'); |
17 | | - |
18 | 10 | /** |
19 | 11 | * Abstract base class for SMW's variant of the MW QueryPage. |
20 | 12 | * Subclasses must implement getResults() and formatResult(), as |
21 | 13 | * well as some other standard functions of QueryPage. |
| 14 | + * @note AUTOLOADED |
22 | 15 | */ |
23 | 16 | abstract class SMWQueryPage extends QueryPage { |
24 | 17 | |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php |
— | — | @@ -7,11 +7,6 @@ |
8 | 8 | * properties. |
9 | 9 | */ |
10 | 10 | |
11 | | -if (!defined('MEDIAWIKI')) die(); |
12 | | - |
13 | | -global $IP; |
14 | | -include_once($IP . '/includes/SpecialPage.php'); |
15 | | - |
16 | 11 | /** |
17 | 12 | * A class to encapsulate the special page that allows browsing through |
18 | 13 | * the knowledge structure of a Semantic MediaWiki. |
— | — | @@ -32,9 +27,7 @@ |
33 | 28 | } |
34 | 29 | |
35 | 30 | public function execute($query = '') { |
36 | | - global $wgRequest, $wgOut, $wgUser,$wgContLang, $smwgIP; |
37 | | - include_once($smwgIP . '/includes/storage/SMW_Store.php'); |
38 | | - include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
| 31 | + global $wgRequest, $wgOut, $wgUser, $wgContLang; |
39 | 32 | |
40 | 33 | $skin = $wgUser->getSkin(); |
41 | 34 | |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php |
— | — | @@ -9,11 +9,6 @@ |
10 | 10 | * dynamic output pages. |
11 | 11 | */ |
12 | 12 | |
13 | | -if (!defined('MEDIAWIKI')) die(); |
14 | | - |
15 | | -global $IP; |
16 | | -include_once( "$IP/includes/SpecialPage.php" ); |
17 | | - |
18 | 13 | /** |
19 | 14 | * @note AUTOLOAD |
20 | 15 | */ |
— | — | @@ -31,9 +26,7 @@ |
32 | 27 | } |
33 | 28 | |
34 | 29 | public function execute($query = '') { |
35 | | - global $wgRequest, $wgOut, $wgUser, $smwgIP; |
36 | | - include_once($smwgIP . '/includes/storage/SMW_Store.php'); |
37 | | - include_once($smwgIP . '/includes/SMW_Infolink.php'); |
| 30 | + global $wgRequest, $wgOut, $wgUser; |
38 | 31 | |
39 | 32 | $skin = $wgUser->getSkin(); |
40 | 33 | |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -1,10 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if (!defined('MEDIAWIKI')) die(); |
5 | | - |
6 | | -global $IP; |
7 | | -include_once($IP . '/includes/SpecialPage.php'); |
8 | | - |
9 | 4 | /** |
10 | 5 | * @author Denny Vrandecic |
11 | 6 | * |
— | — | @@ -13,7 +8,7 @@ |
14 | 9 | * For example, it shows me all persons born in Croatia, |
15 | 10 | * or all winners of the Academy Award for best actress. |
16 | 11 | * |
17 | | - * @note AUTOLOAD |
| 12 | + * @note AUTOLOADED |
18 | 13 | */ |
19 | 14 | class SMWSearchByProperty extends SpecialPage { |
20 | 15 | |
— | — | @@ -29,8 +24,7 @@ |
30 | 25 | } |
31 | 26 | |
32 | 27 | public function execute($query = '') { |
33 | | - global $wgRequest, $wgOut, $wgUser, $smwgQMaxInlineLimit, $smwgIP; |
34 | | - require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
| 28 | + global $wgRequest, $wgOut, $wgUser, $smwgQMaxInlineLimit; |
35 | 29 | $skin = $wgUser->getSkin(); |
36 | 30 | |
37 | 31 | // get the GET parameters |
— | — | @@ -55,8 +49,6 @@ |
56 | 50 | if ('' == $attributestring) { // empty page. If no attribute given the value does not matter |
57 | 51 | $html .= wfMsg('smw_sbv_docu') . "\n"; |
58 | 52 | } else { |
59 | | - global $smwgIP; |
60 | | - include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
61 | 53 | // Now that we have an attribute, let's figure out the datavalue |
62 | 54 | $value = SMWDataValueFactory::newPropertyObjectValue( $attribute, $valuestring ); |
63 | 55 | if ( $value->isValid() == FALSE ) { // no value understood |
Index: trunk/extensions/SemanticMediaWiki/specials/Statistics/SMW_SpecialStatistics.php |
— | — | @@ -5,12 +5,7 @@ |
6 | 6 | * This special page of the Semantic MediaWiki extension displays some |
7 | 7 | * statistics about properties. |
8 | 8 | */ |
9 | | -if (!defined('MEDIAWIKI')) die(); |
10 | 9 | |
11 | | -global $IP; |
12 | | -require_once( "$IP/includes/SpecialPage.php" ); |
13 | | -require_once( "$IP/includes/Title.php" ); |
14 | | - |
15 | 10 | function smwfExecuteSemanticStatistics() { |
16 | 11 | global $wgOut, $wgLang; |
17 | 12 | $dbr =& wfGetDB( DB_SLAVE ); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php |
— | — | @@ -88,8 +88,6 @@ |
89 | 89 | SMWDataValueFactory::$m_typebyproperty[$propertyname] = $type; |
90 | 90 | return SMWDataValueFactory::newTypeIDValue($smwgPDefaultType,$value,$caption,$propertyname); |
91 | 91 | } else { |
92 | | - global $smwgIP; |
93 | | - include_once($smwgIP . '/includes/SMW_DV_Error.php'); |
94 | 92 | return new SMWErrorValue(wfMsgForContent('smw_manytypes'), $value, $caption); |
95 | 93 | } |
96 | 94 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php |
— | — | @@ -7,17 +7,9 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** |
11 | | - * Protect against register_globals vulnerabilities. |
12 | | - * This line must be present before any global variable is referenced. |
13 | | - */ |
14 | | -if (!defined('MEDIAWIKI')) die(); |
15 | | - |
16 | | -global $smwgIP; |
17 | | -require_once($smwgIP . '/includes/storage/SMW_Store.php'); |
18 | | - |
19 | | -/** |
20 | 11 | * Static class for accessing functions to generate and execute semantic queries |
21 | 12 | * and to serialise their results. |
| 13 | + * @note AUTOLOADED |
22 | 14 | */ |
23 | 15 | class SMWQueryProcessor { |
24 | 16 | |
— | — | @@ -88,7 +80,7 @@ |
89 | 81 | ) && ($mainlabel != '-') |
90 | 82 | ) |
91 | 83 | ) { |
92 | | - $desc->prependPrintRequest(new SMWPrintRequest(SMW_PRINT_THIS, $mainlabel)); |
| 84 | + $desc->prependPrintRequest(new SMWPrintRequest(SMWPrintRequest::PRINT_THIS, $mainlabel)); |
93 | 85 | } |
94 | 86 | |
95 | 87 | $query = new SMWQuery($desc, $inline); |
— | — | @@ -175,14 +167,14 @@ |
176 | 168 | $parts = explode('=',$param,2); |
177 | 169 | $propparts = explode('#',$parts[0],2); |
178 | 170 | if (trim($propparts[0]) == '') { // print "this" |
179 | | - $printmode = SMW_PRINT_THIS; |
| 171 | + $printmode = SMWPrintRequest::PRINT_THIS; |
180 | 172 | if (count($parts) == 1) { // no label found, use empty label |
181 | 173 | $parts[] = ''; |
182 | 174 | } |
183 | 175 | $title = NULL; |
184 | 176 | } elseif ($wgContLang->getNsText(NS_CATEGORY) == ucfirst(trim($propparts[0]))) { // print category |
185 | 177 | $title = NULL; |
186 | | - $printmode = SMW_PRINT_CATS; |
| 178 | + $printmode = SMWPrintRequest::PRINT_CATS; |
187 | 179 | if (count($parts) == 1) { // no label found, use category label |
188 | 180 | $parts[] = $wgContLang->getNSText(NS_CATEGORY); |
189 | 181 | } |
— | — | @@ -192,9 +184,9 @@ |
193 | 185 | continue; |
194 | 186 | } |
195 | 187 | if ($title->getNamespace() == SMW_NS_PROPERTY) { |
196 | | - $printmode = SMW_PRINT_PROP; |
| 188 | + $printmode = SMWPrintRequest::PRINT_PROP; |
197 | 189 | } elseif ($title->getNamespace() == NS_CATEGORY) { |
198 | | - $printmode = SMW_PRINT_CCAT; |
| 190 | + $printmode = SMWPrintRequest::PRINT_CCAT; |
199 | 191 | } //else? |
200 | 192 | if (count($parts) == 1) { // no label found, use property/category name |
201 | 193 | $parts[] = $title->getText(); |
— | — | @@ -591,7 +583,7 @@ |
592 | 584 | $printlabel = $wgContLang->getNSText(NS_CATEGORY); |
593 | 585 | } |
594 | 586 | if ($chunk == ']]') { |
595 | | - return new SMWPrintRequest(SMW_PRINT_CATS, $printlabel); |
| 587 | + return new SMWPrintRequest(SMWPrintRequest::PRINT_CATS, $printlabel); |
596 | 588 | } else { |
597 | 589 | $this->m_errors[] = wfMsgForContent('smw_badprintout'); |
598 | 590 | return NULL; |
— | — | @@ -620,8 +612,6 @@ |
621 | 613 | * string. |
622 | 614 | */ |
623 | 615 | protected function getPropertyDescription($propertyname, &$setNS, &$label) { |
624 | | - global $smwgIP; |
625 | | - include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
626 | 616 | $this->readChunk(); // consume separator ":=" or "::" |
627 | 617 | // first process property chain syntax (e.g. "property1.property2::value"): |
628 | 618 | if ($propertyname{0} == ' ') { // escape |
— | — | @@ -720,7 +710,7 @@ |
721 | 711 | $printlabel = $property->getText(); |
722 | 712 | } |
723 | 713 | if ($chunk == ']]') { |
724 | | - return new SMWPrintRequest(SMW_PRINT_PROP, $printlabel, $property, $pm); |
| 714 | + return new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, $printlabel, $property, $pm); |
725 | 715 | } else { |
726 | 716 | $this->m_errors[] = wfMsgForContent('smw_badprintout'); |
727 | 717 | return NULL; |
— | — | @@ -743,7 +733,7 @@ |
744 | 734 | $printlabel = $property->getText(); |
745 | 735 | } |
746 | 736 | if ($chunk == ']]') { |
747 | | - return new SMWPrintRequest(SMW_PRINT_PROP, $printlabel, $property, $printmodifier); |
| 737 | + return new SMWPrintRequest(SMWPrintRequest::PRINT_PROP, $printlabel, $property, $printmodifier); |
748 | 738 | } else { |
749 | 739 | $this->m_errors[] = wfMsgForContent('smw_badprintout'); |
750 | 740 | return NULL; |
— | — | @@ -831,8 +821,6 @@ |
832 | 822 | * passed as a parameter. |
833 | 823 | */ |
834 | 824 | protected function getArticleDescription($firstchunk, &$setNS, &$label) { |
835 | | - global $smwgIP; |
836 | | - include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
837 | 825 | $chunk = $firstchunk; |
838 | 826 | $result = NULL; |
839 | 827 | $continue = true; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValue.php |
— | — | @@ -338,8 +338,6 @@ |
339 | 339 | * text, but no more. Result might have no entries but is always an array. |
340 | 340 | */ |
341 | 341 | public function getInfolinks() { |
342 | | - global $smwgIP; |
343 | | - include_once($smwgIP . '/includes/SMW_Infolink.php'); |
344 | 342 | if ($this->isValid() && $this->m_property) { |
345 | 343 | if (!$this->m_hasssearchlink) { // add default search link |
346 | 344 | $this->m_hasssearchlink = true; |
Index: trunk/extensions/SemanticMediaWiki/includes/jobs/SMW_UpdateJob.php |
— | — | @@ -8,13 +8,6 @@ |
9 | 9 | * @author Daniel M. Herzig |
10 | 10 | */ |
11 | 11 | |
12 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
13 | | - die( "This file is part of the Semantic MediaWiki extension. It is not a valid entry point.\n" ); |
14 | | -} |
15 | | - |
16 | | -global $IP; |
17 | | -require_once( $IP . "/includes/JobQueue.php" ); |
18 | | - |
19 | 12 | class SMWUpdateJob extends Job { |
20 | 13 | |
21 | 14 | function __construct($title) { |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Hooks.php |
— | — | @@ -13,8 +13,7 @@ |
14 | 14 | * at the end of the article. |
15 | 15 | */ |
16 | 16 | function smwfParserHook(&$parser, &$text) { |
17 | | - global $smwgIP, $smwgStoreAnnotations, $smwgTempStoreAnnotations, $smwgStoreActive; |
18 | | - include_once($smwgIP . '/includes/SMW_Factbox.php'); |
| 17 | + global $smwgStoreAnnotations, $smwgTempStoreAnnotations, $smwgStoreActive; |
19 | 18 | // Init global storage for semantic data of this article. |
20 | 19 | SMWFactbox::initStorage($parser->getTitle()); |
21 | 20 | |
— | — | @@ -112,8 +111,6 @@ |
113 | 112 | * Called before the article is saved. Allows us to check and remember whether an article is new. |
114 | 113 | */ |
115 | 114 | function smwfPreSaveHook(&$article, &$user, &$text, &$summary, $minor, $watch, $sectionanchor, &$flags) { |
116 | | - global $smwgIP; |
117 | | - include_once($smwgIP . '/includes/SMW_Factbox.php'); // Normally this must have happened, but you never know ... |
118 | 115 | if ($flags & EDIT_NEW) { |
119 | 116 | SMWFactbox::setNewArticle(); |
120 | 117 | } |
— | — | @@ -272,10 +269,8 @@ |
273 | 270 | function smwfShowListPage (&$title, &$article){ |
274 | 271 | global $smwgIP; |
275 | 272 | if ($title->getNamespace() == SMW_NS_TYPE){ |
276 | | - include_once($smwgIP . '/includes/articlepages/SMW_TypePage.php'); |
277 | 273 | $article = new SMWTypePage($title); |
278 | 274 | } elseif ( $title->getNamespace() == SMW_NS_PROPERTY ) { |
279 | | - include_once($smwgIP . '/includes/articlepages/SMW_PropertyPage.php'); |
280 | 275 | $article = new SMWPropertyPage($title); |
281 | 276 | } |
282 | 277 | return true; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php |
— | — | @@ -7,19 +7,11 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** |
11 | | - * Protect against register_globals vulnerabilities. |
12 | | - * This line must be present before any global variable is referenced. |
13 | | - */ |
14 | | -if (!defined('MEDIAWIKI')) die(); |
15 | | - |
16 | | -global $smwgIP; |
17 | | -include_once($smwgIP . '/includes/SMW_SemanticData.php'); |
18 | | - |
19 | | -/** |
20 | 11 | * Static class for representing semantic data, which accepts user |
21 | 12 | * inputs and provides methods for printing and storing its contents. |
22 | 13 | * Its main purpose is to provide a persistent storage to keep semantic |
23 | 14 | * data between hooks for parsing and storing. |
| 15 | + * @note AUTOLOADED |
24 | 16 | */ |
25 | 17 | class SMWFactbox { |
26 | 18 | |
— | — | @@ -78,8 +70,7 @@ |
79 | 71 | */ |
80 | 72 | static function addProperty($propertyname, $value, $caption, $storeannotation = true) { |
81 | 73 | wfProfileIn("SMWFactbox::addProperty (SMW)"); |
82 | | - global $smwgContLang, $smwgIP; |
83 | | - include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
| 74 | + global $smwgContLang; |
84 | 75 | // See if this property is a special one, such as e.g. "has type" |
85 | 76 | $propertyname = smwfNormalTitleText($propertyname); //slightly normalize label |
86 | 77 | $special = $smwgContLang->findSpecialPropertyID($propertyname); |
— | — | @@ -247,7 +238,6 @@ |
248 | 239 | } |
249 | 240 | |
250 | 241 | smwfRequireHeadItem(SMW_HEADER_STYLE); |
251 | | - include_once($smwgIP . '/includes/SMW_Infolink.php'); |
252 | 242 | $rdflink = SMWInfolink::newInternalLink(wfMsgForContent('smw_viewasrdf'), $wgContLang->getNsText(NS_SPECIAL) . ':ExportRDF/' . SMWFactbox::$semdata->getSubject()->getPrefixedText(), 'rdflink'); |
253 | 243 | |
254 | 244 | $browselink = SMWInfolink::newBrowsingLink(SMWFactbox::$semdata->getSubject()->getText(), SMWFactbox::$semdata->getSubject()->getPrefixedText(), 'swmfactboxheadbrowse'); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -217,16 +217,16 @@ |
218 | 218 | $row = array(); |
219 | 219 | foreach ($prs as $pr) { |
220 | 220 | switch ($pr->getMode()) { |
221 | | - case SMW_PRINT_THIS: |
| 221 | + case SMWPrintRequest::PRINT_THIS: |
222 | 222 | $row[] = new SMWResultArray(array($qt), $pr); |
223 | 223 | break; |
224 | | - case SMW_PRINT_CATS: |
| 224 | + case SMWPrintRequest::PRINT_CATS: |
225 | 225 | $row[] = new SMWResultArray($this->m_store->getSpecialValues($qt->getTitle(),SMW_SP_INSTANCE_OF), $pr); |
226 | 226 | break; |
227 | | - case SMW_PRINT_PROP: |
| 227 | + case SMWPrintRequest::PRINT_PROP: |
228 | 228 | $row[] = new SMWResultArray($this->m_store->getPropertyValues($qt->getTitle(),$pr->getTitle(), NULL, $pr->getOutputFormat()), $pr); |
229 | 229 | break; |
230 | | - case SMW_PRINT_CCAT: |
| 230 | + case SMWPrintRequest::PRINT_CCAT: |
231 | 231 | $cats = $this->m_store->getSpecialValues($qt->getTitle(),SMW_SP_INSTANCE_OF); |
232 | 232 | $found = '0'; |
233 | 233 | foreach ($cats as $cat) { |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -6,16 +6,6 @@ |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** |
10 | | - * Protect against register_globals vulnerabilities. |
11 | | - * This line must be present before any global variable is referenced. |
12 | | - */ |
13 | | -if (!defined('MEDIAWIKI')) die(); |
14 | | - |
15 | | -global $smwgIP; |
16 | | -require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
17 | | -require_once( "$smwgIP/includes/SMW_DataValueFactory.php" ); |
18 | | - |
19 | | -/** |
20 | 10 | * Storage access class for using the standard MediaWiki SQL database |
21 | 11 | * for keeping semantic data. |
22 | 12 | */ |
— | — | @@ -1143,16 +1133,16 @@ |
1144 | 1134 | $row = array(); |
1145 | 1135 | foreach ($prs as $pr) { |
1146 | 1136 | switch ($pr->getMode()) { |
1147 | | - case SMW_PRINT_THIS: |
| 1137 | + case SMWPrintRequest::PRINT_THIS: |
1148 | 1138 | $row[] = new SMWResultArray(array($qt), $pr); |
1149 | 1139 | break; |
1150 | | - case SMW_PRINT_CATS: |
| 1140 | + case SMWPrintRequest::PRINT_CATS: |
1151 | 1141 | $row[] = new SMWResultArray($this->getSpecialValues($qt->getTitle(),SMW_SP_INSTANCE_OF), $pr); |
1152 | 1142 | break; |
1153 | | - case SMW_PRINT_PROP: |
| 1143 | + case SMWPrintRequest::PRINT_PROP: |
1154 | 1144 | $row[] = new SMWResultArray($this->getPropertyValues($qt->getTitle(),$pr->getTitle(), NULL, $pr->getOutputFormat()), $pr); |
1155 | 1145 | break; |
1156 | | - case SMW_PRINT_CCAT: |
| 1146 | + case SMWPrintRequest::PRINT_CCAT: |
1157 | 1147 | $cats = $this->getSpecialValues($qt->getTitle(),SMW_SP_INSTANCE_OF); |
1158 | 1148 | $found = '0'; |
1159 | 1149 | foreach ($cats as $cat) { |
— | — | @@ -1494,13 +1484,13 @@ |
1495 | 1485 | $string = str_replace(array('_', ' '), array('\_', '\_'), $strcond->string); |
1496 | 1486 | } |
1497 | 1487 | switch ($strcond->condition) { |
1498 | | - case SMW_STRCOND_PRE: |
| 1488 | + case SMWStringCondition::STRCOND_PRE: |
1499 | 1489 | $string .= '%'; |
1500 | 1490 | break; |
1501 | | - case SMW_STRCOND_POST: |
| 1491 | + case SMWStringCondition::STRCOND_POST: |
1502 | 1492 | $string = '%' . $string; |
1503 | 1493 | break; |
1504 | | - case SMW_STRCOND_MID: |
| 1494 | + case SMWStringCondition::STRCOND_MID: |
1505 | 1495 | $string = '%' . $string . '%'; |
1506 | 1496 | break; |
1507 | 1497 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Store.php |
— | — | @@ -6,33 +6,22 @@ |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** |
10 | | - * Protect against register_globals vulnerabilities. |
11 | | - * This line must be present before any global variable is referenced. |
12 | | - */ |
13 | | -if (!defined('MEDIAWIKI')) die(); |
14 | | - |
15 | | -global $smwgIP; |
16 | | -require_once($smwgIP . '/includes/SMW_SemanticData.php'); |
17 | | -require_once($smwgIP . '/includes/storage/SMW_Query.php'); |
18 | | -require_once($smwgIP . '/includes/storage/SMW_QueryResult.php'); |
19 | | - |
20 | | -define('SMW_STRCOND_PRE',0); |
21 | | -define('SMW_STRCOND_POST',1); |
22 | | -define('SMW_STRCOND_MID',2); |
23 | | - |
24 | | -/** |
25 | 10 | * Small data container class for describing filtering conditions on the string |
26 | 11 | * label of some entity. States that a given string should either be prefix, postfix, |
27 | 12 | * or some arbitrary part of labels. |
| 13 | + * @note AUTOLOADED |
28 | 14 | */ |
29 | 15 | class SMWStringCondition { |
| 16 | + const STRCOND_PRE = 0; |
| 17 | + const STRCOND_POST = 1; |
| 18 | + const STRCOND_MID = 2; |
30 | 19 | /** |
31 | 20 | * String to match. |
32 | 21 | */ |
33 | 22 | public $string; |
34 | 23 | /** |
35 | | - * Condition. One of SMW_STRCOND_PRE (string matches prefix), |
36 | | - * SMW_STRCOND_POST (string matches postfix), SMW_STRCOND_MID |
| 24 | + * Condition. One of STRCOND_PRE (string matches prefix), |
| 25 | + * STRCOND_POST (string matches postfix), STRCOND_MID |
37 | 26 | * (string matches to some inner part). |
38 | 27 | */ |
39 | 28 | public $condition; |
— | — | @@ -50,6 +39,7 @@ |
51 | 40 | * to their more complex structure. |
52 | 41 | * Options that should not be used or where default values should be used |
53 | 42 | * can be left as initialised. |
| 43 | + * @note AUTOLOADED |
54 | 44 | */ |
55 | 45 | class SMWRequestOptions { |
56 | 46 | /** |
— | — | @@ -95,7 +85,7 @@ |
96 | 86 | /** |
97 | 87 | * Set a new string condition applied to labels of results (if available). |
98 | 88 | * @param $string the string to match |
99 | | - * @param $condition type of condition, one of SMW_STRCOND_PRE, SMW_STRCOND_POST, SMW_STRCOND_MID |
| 89 | + * @param $condition type of condition, one of STRCOND_PRE, STRCOND_POST, STRCOND_MID |
100 | 90 | */ |
101 | 91 | public function addStringCondition($string, $condition) { |
102 | 92 | $this->stringcond[] = new SMWStringCondition($string, $condition); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_TestStore.php |
— | — | @@ -7,15 +7,6 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** |
11 | | - * Protect against register_globals vulnerabilities. |
12 | | - * This line must be present before any global variable is referenced. |
13 | | - */ |
14 | | -if (!defined('MEDIAWIKI')) die(); |
15 | | - |
16 | | -global $smwgIP; |
17 | | -require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
18 | | - |
19 | | -/** |
20 | 11 | * Storage access class for testing purposes. No persitent storage is implemented, but |
21 | 12 | * all methods return non-empty result sets that can be used for testing purposes. |
22 | 13 | * |
— | — | @@ -160,16 +151,13 @@ |
161 | 152 | $row = array(); |
162 | 153 | foreach ($prs as $pr) { |
163 | 154 | switch ($pr->getMode()) { |
164 | | - case SMW_PRINT_THIS: |
| 155 | + case SMWPrintRequest::PRINT_THIS: |
165 | 156 | $row[] = new SMWResultArray(array($qt), $pr); |
166 | 157 | break; |
167 | | - case SMW_PRINT_RELS: |
168 | | - $row[] = new SMWResultArray($this->getRelationObjects($qt,$pr->getTitle()), $pr); |
169 | | - break; |
170 | | - case SMW_PRINT_CATS: |
| 158 | + case SMWPrintRequest::PRINT_CATS: |
171 | 159 | $row[] = new SMWResultArray($this->getSpecialValues($qt,SMW_SP_INSTANCE_OF), $pr); |
172 | 160 | break; |
173 | | - case SMW_PRINT_ATTS: |
| 161 | + case SMWPrintRequest::PRINT_PROP: |
174 | 162 | ///TODO: respect given datavalue (desired unit), needs extension of getAttributeValues() |
175 | 163 | $row[] = new SMWResultArray($this->getAttributeValues($qt,$pr->getTitle()), $pr); |
176 | 164 | break; |
— | — | @@ -302,13 +290,13 @@ |
303 | 291 | // foreach ($requestoptions->getStringConditions() as $strcond) { |
304 | 292 | // $string = str_replace(array('_', ' '), array('\_', '\_'), $strcond->string); |
305 | 293 | // switch ($strcond->condition) { |
306 | | -// case SMW_STRCOND_PRE: |
| 294 | +// case SMWStringCondition::STRCOND_PRE: |
307 | 295 | // $string .= '%'; |
308 | 296 | // break; |
309 | | -// case SMW_STRCOND_POST: |
| 297 | +// case SMWStringCondition::STRCOND_POST: |
310 | 298 | // $string = '%' . $string; |
311 | 299 | // break; |
312 | | -// case SMW_STRCOND_MID: |
| 300 | +// case SMWStringCondition::STRCOND_MID: |
313 | 301 | // $string = '%' . $string . '%'; |
314 | 302 | // break; |
315 | 303 | // } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -5,16 +5,6 @@ |
6 | 6 | * @author Markus Krötzsch |
7 | 7 | */ |
8 | 8 | |
9 | | -/** |
10 | | - * Protect against register_globals vulnerabilities. |
11 | | - * This line must be present before any global variable is referenced. |
12 | | - */ |
13 | | -if (!defined('MEDIAWIKI')) die(); |
14 | | - |
15 | | -global $smwgIP; |
16 | | -require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
17 | | -require_once( "$smwgIP/includes/SMW_DataValueFactory.php" ); |
18 | | - |
19 | 9 | define('SMW_SQL2_SMWIW',':smw'); // virtual "interwiki prefix" for special SMW objects |
20 | 10 | |
21 | 11 | // Constant flags for identifying tables/retrieval types |
— | — | @@ -1015,9 +1005,9 @@ |
1016 | 1006 | foreach ($requestoptions->getStringConditions() as $strcond) { |
1017 | 1007 | $string = str_replace('_', '\_', $strcond->string); |
1018 | 1008 | switch ($strcond->condition) { |
1019 | | - case SMW_STRCOND_PRE: $string .= '%'; break; |
1020 | | - case SMW_STRCOND_POST: $string = '%' . $string; break; |
1021 | | - case SMW_STRCOND_MID: $string = '%' . $string . '%'; break; |
| 1009 | + case SMWStringCondition::STRCOND_PRE: $string .= '%'; break; |
| 1010 | + case SMWStringCondition::STRCOND_POST: $string = '%' . $string; break; |
| 1011 | + case SMWStringCondition::STRCOND_MID: $string = '%' . $string . '%'; break; |
1022 | 1012 | } |
1023 | 1013 | $sql_conds .= ' AND ' . $labelcol . ' LIKE ' . $db->addQuotes($string); |
1024 | 1014 | } |
— | — | @@ -1074,13 +1064,13 @@ |
1075 | 1065 | } |
1076 | 1066 | foreach ($requestoptions->getStringConditions() as $strcond) { // apply string conditions |
1077 | 1067 | switch ($strcond->condition) { |
1078 | | - case SMW_STRCOND_PRE: |
| 1068 | + case SMWStringCondition::STRCOND_PRE: |
1079 | 1069 | $ok = $ok && (strpos($label,$strcond->string)===0); |
1080 | 1070 | break; |
1081 | | - case SMW_STRCOND_POST: |
| 1071 | + case SMWStringCondition::STRCOND_POST: |
1082 | 1072 | $ok = $ok && (strpos(strrev($label),strrev($strcond->string))===0); |
1083 | 1073 | break; |
1084 | | - case SMW_STRCOND_MID: |
| 1074 | + case SMWStringCondition::STRCOND_MID: |
1085 | 1075 | $ok = $ok && (strpos($label,$strcond->string)!==false); |
1086 | 1076 | break; |
1087 | 1077 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_RAPStore.php |
— | — | @@ -13,10 +13,7 @@ |
14 | 14 | die( 'Not an entry point.' ); |
15 | 15 | } |
16 | 16 | |
17 | | -global $smwgIP,$smwgRAPPath; |
18 | | -require_once( "$smwgIP/includes/storage/SMW_Store.php" ); |
19 | | -require_once( "$smwgIP/includes/storage/SMW_SQLStore.php" ); |
20 | | -require_once( "$smwgIP/includes/SMW_DataValueFactory.php" ); |
| 17 | +global $smwgRAPPath; |
21 | 18 | |
22 | 19 | define('RDFAPI_INCLUDE_DIR',$smwgRAPPath); |
23 | 20 | require_once( "$smwgRAPPath/RdfAPI.php"); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Description.php |
— | — | @@ -6,25 +6,17 @@ |
7 | 7 | * @author Markus Krötzsch |
8 | 8 | */ |
9 | 9 | |
10 | | -// comparators for datavalues: |
11 | | -define('SMW_CMP_EQ',1); // matches only datavalues that are equal to the given value |
12 | | -define('SMW_CMP_LEQ',2); // matches only datavalues that are less or equal than the given value |
13 | | -define('SMW_CMP_GEQ',3); // matches only datavalues that are greater or equal to the given value |
14 | | -define('SMW_CMP_NEQ',4); // matches only datavalues that are unequal to the given value |
15 | | -define('SMW_CMP_LIKE',5); // matches only datavalues that are LIKE the given value |
16 | | - |
17 | | -// print request |
18 | | -define('SMW_PRINT_CATS', 0); // print all direct cateories of the current element |
19 | | -define('SMW_PRINT_PROP', 1); // print all property values of a certain attribute of the current element |
20 | | -define('SMW_PRINT_THIS', 2); // print the current element |
21 | | -define('SMW_PRINT_CCAT', 3); // check whether current element is in given category |
22 | | - |
23 | | - |
24 | 10 | /** |
25 | 11 | * Container class for request for printout, as used in queries to |
26 | 12 | * obtain additional information for the retrieved results. |
| 13 | + * @note: AUTOLOADED |
27 | 14 | */ |
28 | 15 | class SMWPrintRequest { |
| 16 | + const PRINT_CATS = 0; // print all direct cateories of the current element |
| 17 | + const PRINT_PROP = 1; // print all property values of a certain attribute of the current element |
| 18 | + const PRINT_THIS = 2; // print the current element |
| 19 | + const PRINT_CCAT = 3; // check whether current element is in given category |
| 20 | + |
29 | 21 | protected $m_mode; // type of print request |
30 | 22 | protected $m_label; // string for labelling results, contains no markup |
31 | 23 | protected $m_title; // title object to which print request refers (if any) |
— | — | @@ -43,7 +35,7 @@ |
44 | 36 | $this->m_label = $label; |
45 | 37 | $this->m_title = $title; |
46 | 38 | $this->m_outputformat = $outputformat; |
47 | | - if ( ($mode == SMW_PRINT_CCAT) && ($outputformat === '') ) { |
| 39 | + if ( ($mode == SMWPrintRequest::PRINT_CCAT) && ($outputformat === '') ) { |
48 | 40 | $this->m_outputformat = 'x'; // changed default for Boolean case |
49 | 41 | } |
50 | 42 | } |
— | — | @@ -66,10 +58,10 @@ |
67 | 59 | return htmlspecialchars($this->m_label); |
68 | 60 | } |
69 | 61 | switch ($this->m_mode) { |
70 | | - case SMW_PRINT_CATS: return htmlspecialchars($this->m_label); // TODO: link to Special:Categories |
71 | | - case SMW_PRINT_PROP: case SMW_PRINT_CCAT: |
| 62 | + case SMWPrintRequest::PRINT_CATS: return htmlspecialchars($this->m_label); // TODO: link to Special:Categories |
| 63 | + case SMWPrintRequest::PRINT_PROP: case SMWPrintRequest::PRINT_CCAT: |
72 | 64 | return $linker->makeLinkObj($this->m_title, htmlspecialchars($this->m_label)); |
73 | | - case SMW_PRINT_THIS: default: return htmlspecialchars($this->m_label); |
| 65 | + case SMWPrintRequest::PRINT_THIS: default: return htmlspecialchars($this->m_label); |
74 | 66 | } |
75 | 67 | |
76 | 68 | } |
— | — | @@ -82,10 +74,10 @@ |
83 | 75 | return $this->m_label; |
84 | 76 | } else { |
85 | 77 | switch ($this->m_mode) { |
86 | | - case SMW_PRINT_CATS: return $this->m_label; // TODO: link to Special:Categories |
87 | | - case SMW_PRINT_PROP: case SMW_PRINT_CCAT: |
| 78 | + case SMWPrintRequest::PRINT_CATS: return $this->m_label; // TODO: link to Special:Categories |
| 79 | + case SMWPrintRequest::PRINT_PROP: case SMWPrintRequest::PRINT_CCAT: |
88 | 80 | return '[[:' . $this->m_title->getPrefixedText() . '|' . $this->m_label . ']]'; |
89 | | - case SMW_PRINT_THIS: default: return $this->m_label; |
| 81 | + case SMWPrintRequest::PRINT_THIS: default: return $this->m_label; |
90 | 82 | } |
91 | 83 | } |
92 | 84 | } |
— | — | @@ -107,7 +99,7 @@ |
108 | 100 | |
109 | 101 | public function getTypeID() { |
110 | 102 | if ($this->m_typeid === false) { |
111 | | - if ($this->m_mode == SMW_PRINT_PROP) { |
| 103 | + if ($this->m_mode == SMWPrintRequest::PRINT_PROP) { |
112 | 104 | $this->m_typeid = SMWDataValueFactory::getPropertyObjectTypeID($this->m_title); |
113 | 105 | } else { |
114 | 106 | $this->m_typeid = '_wpg'; // return objects might be titles, but anyway |
— | — | @@ -135,7 +127,7 @@ |
136 | 128 | public function getSerialisation() { |
137 | 129 | /// TODO: do not use "= label" if label is the default anyway |
138 | 130 | switch ($this->m_mode) { |
139 | | - case SMW_PRINT_CATS: |
| 131 | + case SMWPrintRequest::PRINT_CATS: |
140 | 132 | global $wgContLang; |
141 | 133 | $catlabel = $wgContLang->getNSText(NS_CATEGORY); |
142 | 134 | $result = '?' . $catlabel; |
— | — | @@ -143,8 +135,8 @@ |
144 | 136 | $result .= '=' . $this->m_label; |
145 | 137 | } |
146 | 138 | return $result; |
147 | | - case SMW_PRINT_PROP: case SMW_PRINT_CCAT: |
148 | | - if ($this->m_mode == SMW_PRINT_CCAT) { |
| 139 | + case SMWPrintRequest::PRINT_PROP: case SMWPrintRequest::PRINT_CCAT: |
| 140 | + if ($this->m_mode == SMWPrintRequest::PRINT_CCAT) { |
149 | 141 | $result = '?' . $this->m_title->getPrefixedText(); |
150 | 142 | if ( $this->m_outputformat != 'x' ) { |
151 | 143 | $result .= '#' . $this->m_outputformat; |
— | — | @@ -159,7 +151,7 @@ |
160 | 152 | $result .= '=' . $this->m_label; |
161 | 153 | } |
162 | 154 | return $result; |
163 | | - case SMW_PRINT_THIS: default: return ''; // no current serialisation |
| 155 | + case SMWPrintRequest::PRINT_THIS: default: return ''; // no current serialisation |
164 | 156 | } |
165 | 157 | } |
166 | 158 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php |
— | — | @@ -13,9 +13,10 @@ |
14 | 14 | * Objects of this class encapsulate the result of a query in SMW. They |
15 | 15 | * provide access to the query result and printed data, and to some |
16 | 16 | * relevant query parameters that were used. |
17 | | - * |
| 17 | + * |
18 | 18 | * While the API does not require this, it is ensured that every result row |
19 | 19 | * returned by this object has the same number of elements (columns). |
| 20 | + * @note: AUTOLOADED |
20 | 21 | */ |
21 | 22 | class SMWQueryResult { |
22 | 23 | protected $m_content; // array (table) of arrays (rows) of arrays (fields, SMWResultArray) |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_Query.php |
— | — | @@ -7,15 +7,6 @@ |
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** |
11 | | - * Protect against register_globals vulnerabilities. |
12 | | - * This line must be present before any global variable is referenced. |
13 | | - */ |
14 | | -if (!defined('MEDIAWIKI')) die(); |
15 | | - |
16 | | -global $smwgIP; |
17 | | -require_once($smwgIP . '/includes/storage/SMW_Description.php'); |
18 | | - |
19 | | -/** |
20 | 11 | * Representation of queries in SMW, each consisting of a query |
21 | 12 | * description and various parameters. Some settings might also lead to |
22 | 13 | * changes in the query description. |
— | — | @@ -23,6 +14,7 @@ |
24 | 15 | * Most additional query parameters (limit, sort, ascending, ...) are |
25 | 16 | * interpreted as in SMWRequestOptions (though the latter contains some |
26 | 17 | * additional settings). |
| 18 | + * @note: AUTOLOADED |
27 | 19 | */ |
28 | 20 | class SMWQuery { |
29 | 21 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Types.php |
— | — | @@ -12,7 +12,6 @@ |
13 | 13 | * @author Markus Krötzsch |
14 | 14 | * @note AUTOLOADED |
15 | 15 | */ |
16 | | -require_once ('SMW_DataValue.php'); |
17 | 16 | class SMWTypesValue extends SMWDataValue { |
18 | 17 | |
19 | 18 | private $m_typelabels = false; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Settings.php |
— | — | @@ -1,5 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | |
| 4 | +if ( !defined( 'MEDIAWIKI' ) ) { |
| 5 | + die( "This file is part of the Semantic MediaWiki extension. It is not a valid entry point.\n" ); |
| 6 | +} |
| 7 | + |
4 | 8 | ### |
5 | 9 | # This is the path to your installation of Semantic MediaWiki as |
6 | 10 | # seen from the web. Change it if required ($wgScriptPath is the |
— | — | @@ -27,11 +31,7 @@ |
28 | 32 | # that is not in use yet. However, it must not be smaller |
29 | 33 | # than 100. |
30 | 34 | ## |
31 | | -if (!isset($smwgNamespaceIndex)) { |
32 | | - smwfInitNamespaces(100); |
33 | | -} else { |
34 | | - smwfInitNamespaces(); |
35 | | -} |
| 35 | +smwfInitNamespaces(); |
36 | 36 | |
37 | 37 | ### |
38 | 38 | # This setting allows you to select in which cases you want to have a factbox |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Timeline.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | if ( !$eventline && ($this->m_tlstart == '') ) { // seek defaults |
58 | 58 | foreach ($res->getPrintRequests() as $pr) { |
59 | | - if ( ($pr->getMode() == SMW_PRINT_PROP) && ($pr->getTypeID() == '_dat') ) { |
| 59 | + if ( ($pr->getMode() == SMWPrintRequest::PRINT_PROP) && ($pr->getTypeID() == '_dat') ) { |
60 | 60 | if ( ($this->m_tlend == '') && ($this->m_tlstart != '') && |
61 | 61 | ($this->m_tlstart != $pr->getTitle()->getDBkey()) ) { |
62 | 62 | $this->m_tlend = $pr->getTitle()->getDBkey(); |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | $header = $pr->getText($outputmode,$this->mLinker) . ' '; |
111 | 111 | } |
112 | 112 | // is this a start date? |
113 | | - if ( ($pr->getMode() == SMW_PRINT_PROP) && |
| 113 | + if ( ($pr->getMode() == SMWPrintRequest::PRINT_PROP) && |
114 | 114 | ($pr->getTitle()->getDBkey() == $this->m_tlstart) ) { |
115 | 115 | //FIXME: Timeline scripts should support XSD format explicitly. They |
116 | 116 | //currently seem to implement iso8601 which deviates from XSD in cases. |
— | — | @@ -119,7 +119,7 @@ |
120 | 120 | $hastime = true; |
121 | 121 | } |
122 | 122 | // is this the end date? |
123 | | - if ( ($pr->getMode() == SMW_PRINT_PROP) && |
| 123 | + if ( ($pr->getMode() == SMWPrintRequest::PRINT_PROP) && |
124 | 124 | ($pr->getTitle()->getDBkey() == $this->m_tlend) ) { |
125 | 125 | //NOTE: We can assume $object to be an SMWDataValue in this case. |
126 | 126 | $curmeta .= '<span class="smwtlend">' . $object->getXSDValue() . '</span>'; |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | } else { |
133 | 133 | $curmeta .= '<span class="smwtltitle">' . $objectlabel . '</span>'; |
134 | 134 | } |
135 | | - if ( ($pr->getMode() == SMW_PRINT_THIS) ) { |
| 135 | + if ( ($pr->getMode() == SMWPrintRequest::PRINT_THIS) ) { |
136 | 136 | // NOTE: type Title of $object implied |
137 | 137 | $curarticle = $object->getLongWikiText(); |
138 | 138 | } |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | $curdata .= $header . $objectlabel; |
144 | 144 | $output = true; |
145 | 145 | } |
146 | | - if ($eventline && ($pr->getMode() == SMW_PRINT_PROP) && ($pr->getTypeID() == '_dat') && ('' != $pr->getLabel()) && ($pr->getTitle()->getText() != $this->m_tlstart) && ($pr->getTitle()->getText() != $this->m_tlend) ) { |
| 146 | + if ($eventline && ($pr->getMode() == SMWPrintRequest::PRINT_PROP) && ($pr->getTypeID() == '_dat') && ('' != $pr->getLabel()) && ($pr->getTitle()->getText() != $this->m_tlstart) && ($pr->getTitle()->getText() != $this->m_tlend) ) { |
147 | 147 | $events[] = array($object->getXSDValue(), $pr->getLabel(), $object->getNumericValue()); |
148 | 148 | } |
149 | 149 | $first_value = false; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SpecialPage.php |
— | — | @@ -1,10 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -if (!defined('MEDIAWIKI')) die(); |
5 | | - |
6 | | -global $IP; |
7 | | -include_once($IP . '/includes/SpecialPage.php'); |
8 | | - |
9 | 4 | /** |
10 | 5 | * A simple extension of SpecialPage that ensures that all relevant SMW-user |
11 | 6 | * messages are loaded when the special page is initialised. This is especially |
Index: trunk/extensions/SemanticMediaWiki/includes/articlepages/SMW_OrderedListPage.php |
— | — | @@ -6,14 +6,9 @@ |
7 | 7 | * Some code adapted from CategoryPage.php |
8 | 8 | * |
9 | 9 | * @author Nikolas Iwan |
10 | | - * @author Markus Krötzsch |
| 10 | + * @author Markus Krötzsch |
11 | 11 | */ |
12 | 12 | |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
14 | | - |
15 | | -global $IP; |
16 | | -require_once( "$IP/includes/Article.php" ); |
17 | | - |
18 | 13 | /** |
19 | 14 | * Abstract subclass of MediaWiki's Article that handles the common tasks of |
20 | 15 | * article pages for Types and Properties. Mostly, it implements general processing |
— | — | @@ -21,6 +16,7 @@ |
22 | 17 | * parameters. |
23 | 18 | * |
24 | 19 | * Some code adapted from CategoryPage.php |
| 20 | + * @note AUTOLOADED |
25 | 21 | */ |
26 | 22 | abstract class SMWOrderedListPage extends Article { |
27 | 23 | |
Index: trunk/extensions/SemanticMediaWiki/includes/articlepages/SMW_TypePage.php |
— | — | @@ -7,15 +7,10 @@ |
8 | 8 | * @author: Markus Krötzsch |
9 | 9 | */ |
10 | 10 | |
11 | | -if( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
12 | | - |
13 | | -global $smwgIP; |
14 | | -include_once($smwgIP . '/includes/articlepages/SMW_OrderedListPage.php'); |
15 | | -include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
16 | | - |
17 | 11 | /** |
18 | 12 | * Implementation of MediaWiki's Article that shows additional information on |
19 | 13 | * Type: pages. Very simliar to CategoryPage. |
| 14 | + * @note AUTOLOADED |
20 | 15 | */ |
21 | 16 | class SMWTypePage extends SMWOrderedListPage { |
22 | 17 | |
Index: trunk/extensions/SemanticMediaWiki/includes/articlepages/SMW_PropertyPage.php |
— | — | @@ -6,15 +6,11 @@ |
7 | 7 | * @author: Markus Krötzsch |
8 | 8 | */ |
9 | 9 | |
10 | | -if( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
11 | | - |
12 | | -global $smwgIP; |
13 | | -require_once( "$smwgIP/includes/articlepages/SMW_OrderedListPage.php"); |
14 | | - |
15 | 10 | /** |
16 | 11 | * Implementation of MediaWiki's Article that shows additional information on |
17 | 12 | * property pages. Very simliar to CategoryPage, but with different printout |
18 | 13 | * that also displays values for each subject with the given property. |
| 14 | + * @note AUTOLOADED |
19 | 15 | */ |
20 | 16 | class SMWPropertyPage extends SMWOrderedListPage { |
21 | 17 | |
— | — | @@ -113,8 +109,6 @@ |
114 | 110 | $r = '<table style="width: 100%; ">'; |
115 | 111 | $prevchar = 'None'; |
116 | 112 | for ($index = $start; $index < $ac; $index++ ) { |
117 | | - global $smwgIP; |
118 | | - include_once($smwgIP . '/includes/SMW_Infolink.php'); |
119 | 113 | // Header for index letters |
120 | 114 | if ($this->articles_start_char[$index] != $prevchar) { |
121 | 115 | $r .= '<tr><th class="smwpropname"><h3>' . htmlspecialchars( $this->articles_start_char[$index] ) . "</h3></th><th></th></tr>\n"; |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | * Global functions and constants for Semantic MediaWiki. |
5 | 5 | */ |
6 | 6 | |
7 | | -define('SMW_VERSION','1.2f-SVN'); |
| 7 | +define('SMW_VERSION','1.2g-SVN'); |
8 | 8 | |
9 | 9 | // constants for special properties, used for datatype assignment and storage |
10 | 10 | define('SMW_SP_HAS_TYPE',1); |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | define('SMW_SP_SUBCLASS_OF',18); |
25 | 25 | |
26 | 26 | // old names, will be removed *two* releases after given version |
27 | | -// SMW 1.1.1 |
| 27 | +// SMW 1.1.2 |
28 | 28 | define('SMW_SP_HAS_CATEGORY',4); // name specific for categories, use "instance of" to distinguish from future explicit "subclass of" |
29 | 29 | |
30 | 30 | // constants for displaying the factbox |
— | — | @@ -51,6 +51,13 @@ |
52 | 52 | define('SMW_OUTPUT_WIKI', 2); |
53 | 53 | define('SMW_OUTPUT_FILE', 3); |
54 | 54 | |
| 55 | +// comparators for datavalues: |
| 56 | +define('SMW_CMP_EQ',1); // matches only datavalues that are equal to the given value |
| 57 | +define('SMW_CMP_LEQ',2); // matches only datavalues that are less or equal than the given value |
| 58 | +define('SMW_CMP_GEQ',3); // matches only datavalues that are greater or equal to the given value |
| 59 | +define('SMW_CMP_NEQ',4); // matches only datavalues that are unequal to the given value |
| 60 | +define('SMW_CMP_LIKE',5); // matches only datavalues that are LIKE the given value |
| 61 | + |
55 | 62 | // HTML items to load in current page, use smwfRequireHeadItem to extend |
56 | 63 | $smwgHeadItems = array(); |
57 | 64 | |
— | — | @@ -79,6 +86,11 @@ |
80 | 87 | ///// All classes registered for autoloading here should be tagged with this information: |
81 | 88 | ///// Add "@note AUTOLOADED" to their class documentation. This avoids useless includes. |
82 | 89 | $wgAutoloadClasses['SMWInfolink'] = $smwgIP . '/includes/SMW_Infolink.php'; |
| 90 | + $wgAutoloadClasses['SMWFactbox'] = $smwgIP . '/includes/SMW_Factbox.php'; |
| 91 | + $wgAutoloadClasses['SMWSemanticData'] = $smwgIP . '/includes/SMW_SemanticData.php'; |
| 92 | + $wgAutoloadClasses['SMWOrderedListPage'] = $smwgIP . '/includes/articlepages/SMW_OrderedListPage.php'; |
| 93 | + $wgAutoloadClasses['SMWTypePage'] = $smwgIP . '/includes/articlepages/SMW_TypePage.php'; |
| 94 | + $wgAutoloadClasses['SMWPropertyPage'] = $smwgIP . '/includes/articlepages/SMW_PropertyPage.php'; |
83 | 95 | //// printers |
84 | 96 | $wgAutoloadClasses['SMWResultPrinter'] = $smwgIP . '/includes/SMW_QueryPrinter.php'; |
85 | 97 | $wgAutoloadClasses['SMWTableResultPrinter'] = $smwgIP . '/includes/SMW_QP_Table.php'; |
— | — | @@ -91,6 +103,9 @@ |
92 | 104 | $wgAutoloadClasses['SMWvCardResultPrinter'] = $smwgIP . '/includes/SMW_QP_vCard.php'; |
93 | 105 | //// datavalues |
94 | 106 | $wgAutoloadClasses['SMWDataValue'] = $smwgIP . '/includes/SMW_DataValue.php'; |
| 107 | + $wgAutoloadClasses['SMWErrorvalue'] = $smwgIP . '/includes/SMW_DV_Error.php'; |
| 108 | + ///NOTE: other DataValues are registered for autoloading later on by the factory, use the hook |
| 109 | + /// smwInitDatatypes to modify paths for datatype implementations and for registering new types. |
95 | 110 | $wgAutoloadClasses['SMWDataValueFactory'] = $smwgIP . '/includes/SMW_DataValueFactory.php'; |
96 | 111 | // the builtin types are registered by SMWDataValueFactory if needed, will be reliably available |
97 | 112 | // to other DV-implementations that register to the factory. |
— | — | @@ -100,15 +115,31 @@ |
101 | 116 | $wgAutoloadClasses['SMWExpElement'] = $smwgIP . '/includes/export/SMW_Exp_Element.php'; |
102 | 117 | $wgAutoloadClasses['SMWExpLiteral'] = $smwgIP . '/includes/export/SMW_Exp_Element.php'; |
103 | 118 | $wgAutoloadClasses['SMWExpResource'] = $smwgIP . '/includes/export/SMW_Exp_Element.php'; |
104 | | - //// stores |
| 119 | + //// stores & queries |
| 120 | + $wgAutoloadClasses['SMWQueryProcessor'] = $smwgIP . '/includes/SMW_QueryProcessor.php'; |
| 121 | + $wgAutoloadClasses['SMWQuery'] = $smwgIP . '/includes/storage/SMW_Query.php'; |
| 122 | + $wgAutoloadClasses['SMWQueryResult'] = $smwgIP . '/includes/storage/SMW_QueryResult.php'; |
| 123 | + $wgAutoloadClasses['SMWStore'] = $smwgIP . '/includes/storage/SMW_Store.php'; |
| 124 | + $wgAutoloadClasses['SMWStringCondition'] = $smwgIP . '/includes/storage/SMW_Store.php'; |
| 125 | + $wgAutoloadClasses['SMWRequestOptions'] = $smwgIP . '/includes/storage/SMW_Store.php'; |
| 126 | + $wgAutoloadClasses['SMWPrintRequest'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 127 | + $wgAutoloadClasses['SMWThingDescription'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 128 | + $wgAutoloadClasses['SMWClassDescription'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 129 | + $wgAutoloadClasses['SMWNamespaceDescription'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 130 | + $wgAutoloadClasses['SMWValueDescription'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 131 | + $wgAutoloadClasses['SMWValueList'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 132 | + $wgAutoloadClasses['SMWConjunction'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 133 | + $wgAutoloadClasses['SMWDisjunction'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
| 134 | + $wgAutoloadClasses['SMWSomeProperty'] = $smwgIP . '/includes/storage/SMW_Description.php'; |
105 | 135 | $wgAutoloadClasses['SMWSQLStore'] = $smwgIP . '/includes/storage/SMW_SQLStore.php'; |
106 | | - $wgAutoloadClasses['SMWSQLStore2'] = $smwgIP . '/includes/storage/SMW_SQLStore2.php'; |
| 136 | + $wgAutoloadClasses['SMWSQLStore2'] = $smwgIP . '/includes/storage/SMW_SQLStore2.php'; |
107 | 137 | // Do not autoload RAPStore, since some special pages load all autoloaded classes, which causes |
108 | 138 | // troubles with RAP store if RAP is not installed (require_once fails). |
109 | 139 | //$wgAutoloadClasses['SMWRAPStore'] = $smwgIP . '/includes/storage/SMW_RAPStore.php'; |
110 | 140 | $wgAutoloadClasses['SMWTestStore'] = $smwgIP . '/includes/storage/SMW_TestStore.php'; |
111 | 141 | |
112 | 142 | ///// Register specials, do that early on in case some other extension calls "addPage" ///// |
| 143 | + $wgAutoloadClasses['SMWQueryPage'] = $smwgIP . '/specials/QueryPages/SMW_QueryPage.php'; |
113 | 144 | $wgAutoloadClasses['SMWAskPage'] = $smwgIP . '/specials/AskSpecial/SMW_SpecialAsk.php'; |
114 | 145 | $wgSpecialPages['Ask'] = array('SMWAskPage'); |
115 | 146 | $wgAutoloadClasses['SMWSpecialBrowse'] = $smwgIP . '/specials/SearchTriple/SMW_SpecialBrowse.php'; |
— | — | @@ -142,7 +173,6 @@ |
143 | 174 | $wgAutoloadClasses['SMWUpdateJob'] = $smwgIP . '/includes/jobs/SMW_UpdateJob.php'; |
144 | 175 | $wgJobClasses['SMWUpdateJob'] = 'SMWUpdateJob'; |
145 | 176 | |
146 | | - |
147 | 177 | return true; |
148 | 178 | } |
149 | 179 | |
— | — | @@ -214,10 +244,9 @@ |
215 | 245 | * The <ask> parser hook processing part. |
216 | 246 | */ |
217 | 247 | function smwfProcessInlineQuery($querytext, $params, &$parser) { |
218 | | - global $smwgQEnabled, $smwgIP, $smwgIQRunningNumber; |
| 248 | + global $smwgQEnabled, $smwgIQRunningNumber; |
219 | 249 | if ($smwgQEnabled) { |
220 | 250 | $smwgIQRunningNumber++; |
221 | | - require_once($smwgIP . '/includes/SMW_QueryProcessor.php'); |
222 | 251 | return SMWQueryProcessor::getResultFromHookParams($querytext,$params,SMW_OUTPUT_HTML); |
223 | 252 | } else { |
224 | 253 | return smwfEncodeMessages(array(wfMsgForContent('smw_iq_disabled'))); |
— | — | @@ -228,10 +257,9 @@ |
229 | 258 | * The {{#ask }} parser function processing part. |
230 | 259 | */ |
231 | 260 | function smwfProcessInlineQueryParserFunction(&$parser) { |
232 | | - global $smwgQEnabled, $smwgIP, $smwgIQRunningNumber; |
| 261 | + global $smwgQEnabled, $smwgIQRunningNumber; |
233 | 262 | if ($smwgQEnabled) { |
234 | 263 | $smwgIQRunningNumber++; |
235 | | - require_once($smwgIP . '/includes/SMW_QueryProcessor.php'); |
236 | 264 | $params = func_get_args(); |
237 | 265 | array_shift( $params ); // we already know the $parser ... |
238 | 266 | return SMWQueryProcessor::getResultFromFunctionParams($params,SMW_OUTPUT_WIKI); |
— | — | @@ -482,8 +510,6 @@ |
483 | 511 | * content (e.g. as a string value for some property). |
484 | 512 | */ |
485 | 513 | function smwfXMLContentEncode($text) { |
486 | | - global $IP; |
487 | | - include_once($IP . '/includes/Sanitizer.php'); |
488 | 514 | return str_replace(array('&','<','>'), array('&','<','>'), Sanitizer::decodeCharReferences($text)); |
489 | 515 | } |
490 | 516 | |
— | — | @@ -492,8 +518,6 @@ |
493 | 519 | * content (e.g. as a string value for some property). |
494 | 520 | */ |
495 | 521 | function smwfHTMLtoUTF8($text) { |
496 | | - global $IP; |
497 | | - include_once($IP . '/includes/Sanitizer.php'); |
498 | 522 | return Sanitizer::decodeCharReferences($text); |
499 | 523 | } |
500 | 524 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_SemanticData.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | * Class for representing chunks of semantic data for one given |
13 | 13 | * article (subject), similar what is typically displayed in the factbox. |
14 | 14 | * This is a light-weight data container. |
| 15 | + * @note: AUTOLOADED |
15 | 16 | */ |
16 | 17 | class SMWSemanticData { |
17 | 18 | protected $attribvals = array(); // text keys and arrays of datavalue objects |