Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Hooks.php |
— | — | @@ -41,6 +41,7 @@ |
42 | 42 | * link. |
43 | 43 | */ |
44 | 44 | function smwfParsePropertiesCallback($semanticLink) { |
| 45 | + wfProfileIn("smwfParsePropertiesCallback (SMW)"); |
45 | 46 | if (array_key_exists(2,$semanticLink)) { |
46 | 47 | $attribute = $semanticLink[2]; |
47 | 48 | } else { $attribute = ''; } |
— | — | @@ -57,7 +58,9 @@ |
58 | 59 | $attr = SMWFactbox::addProperty($singleAttribute,$value,$valueCaption); |
59 | 60 | } |
60 | 61 | |
61 | | - return $attr->getShortWikitext(true); |
| 62 | + $result = $attr->getShortWikitext(true); |
| 63 | + wfProfileOut("smwfParsePropertiesCallback (SMW)"); |
| 64 | + return $result; |
62 | 65 | } |
63 | 66 | |
64 | 67 | |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php |
— | — | @@ -53,6 +53,7 @@ |
54 | 54 | * various formats. |
55 | 55 | */ |
56 | 56 | static function addProperty($propertyname, $value, $caption) { |
| 57 | + wfProfileIn("SMWFactbox::addProperty (SMW)"); |
57 | 58 | global $smwgContLang, $smwgStoreActive, $smwgIP; |
58 | 59 | include_once($smwgIP . '/includes/SMW_DataValueFactory.php'); |
59 | 60 | // See if this attribute is a special one like e.g. "Has unit" |
— | — | @@ -66,9 +67,12 @@ |
67 | 68 | if ($smwgStoreActive) { |
68 | 69 | SMWFactbox::$semdata->addPropertyValue($propertyname,$result); |
69 | 70 | } |
| 71 | + wfProfileOut("SMWFactbox::addProperty (SMW)"); |
70 | 72 | return $result; |
71 | 73 | case SMW_SP_IMPORTED_FROM: // this requires special handling |
72 | | - return SMWFactbox::addImportedDefinition($value,$caption); |
| 74 | + $result = SMWFactbox::addImportedDefinition($value,$caption); |
| 75 | + wfProfileOut("SMWFactbox::addProperty (SMW)"); |
| 76 | + return $result; |
73 | 77 | default: // generic special attribute |
74 | 78 | if ( $special === SMW_SP_SERVICE_LINK ) { // do some custom formatting in this case |
75 | 79 | global $wgContLang; |
— | — | @@ -83,6 +87,7 @@ |
84 | 88 | if ($smwgStoreActive) { |
85 | 89 | SMWFactbox::$semdata->addSpecialValue($special,$result); |
86 | 90 | } |
| 91 | + wfProfileOut("SMWFactbox::addProperty (SMW)"); |
87 | 92 | return $result; |
88 | 93 | } |
89 | 94 | } |
— | — | @@ -189,11 +194,15 @@ |
190 | 195 | */ |
191 | 196 | static function printFactbox(&$text) { |
192 | 197 | global $wgContLang, $wgServer, $smwgShowFactbox, $smwgStoreActive, $smwgIP; |
193 | | - if (!$smwgStoreActive) return true; |
| 198 | + if (!$smwgStoreActive) return; |
| 199 | + wfProfileIn("SMWFactbox::printFactbox (SMW)"); |
194 | 200 | switch ($smwgShowFactbox) { |
195 | | - case SMW_FACTBOX_HIDDEN: return true; |
| 201 | + case SMW_FACTBOX_HIDDEN: |
| 202 | + wfProfileOut("SMWFactbox::printFactbox (SMW)"); |
| 203 | + return; |
196 | 204 | case SMW_FACTBOX_NONEMPTY: |
197 | 205 | if ( (!SMWFactbox::$semdata->hasProperties()) && (!SMWFactbox::$semdata->hasSpecialProperties()) ) { |
| 206 | + wfProfileOut("SMWFactbox::printFactbox (SMW)"); |
198 | 207 | return; |
199 | 208 | } |
200 | 209 | } |
— | — | @@ -213,6 +222,7 @@ |
214 | 223 | SMWFactbox::printProperties($text); |
215 | 224 | SMWFactbox::printSpecialProperties($text); |
216 | 225 | $text .= '</table></div>'; |
| 226 | + wfProfileOut("SMWFactbox::printFactbox (SMW)"); |
217 | 227 | } |
218 | 228 | |
219 | 229 | /** |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php |
— | — | @@ -34,19 +34,24 @@ |
35 | 35 | * can be set later on. |
36 | 36 | */ |
37 | 37 | static public function newPropertyValue($propertyname, $value=false, $caption=false) { |
| 38 | + wfProfileIn("SMWDataValueFactory::newPropertyValue (SMW)"); |
38 | 39 | if(array_key_exists($propertyname,SMWDataValueFactory::$m_typelabels)) { // use cache |
39 | | - return SMWDataValueFactory::newTypeObjectValue(SMWDataValueFactory::$m_typelabels[$propertyname], $value, $caption, $propertyname); |
| 40 | + $result = SMWDataValueFactory::newTypeObjectValue(SMWDataValueFactory::$m_typelabels[$propertyname], $value, $caption, $propertyname); |
| 41 | + wfProfileOut("SMWDataValueFactory::newPropertyValue (SMW)"); |
| 42 | + return $result; |
40 | 43 | } // else: find type for property: |
41 | 44 | |
42 | 45 | $ptitle = Title::newFromText($propertyname, SMW_NS_PROPERTY); |
43 | 46 | if ($ptitle !== NULL) { |
44 | | - return SMWDataValueFactory::newPropertyObjectValue($ptitle,$value,$caption); |
| 47 | + $result = SMWDataValueFactory::newPropertyObjectValue($ptitle,$value,$caption); |
45 | 48 | } else { |
46 | 49 | $type = SMWDataValueFactory::newTypeIDValue('__typ'); |
47 | 50 | $type->setXSDValue('_wpg'); |
48 | 51 | SMWDataValueFactory::$m_typelabels[$propertyname] = $type; |
49 | | - return SMWDataValueFactory::newTypeIDValue('_wpg',$value,$caption,$propertyname); |
| 52 | + $result = SMWDataValueFactory::newTypeIDValue('_wpg',$value,$caption,$propertyname); |
50 | 53 | } |
| 54 | + wfProfileOut("SMWDataValueFactory::newPropertyValue (SMW)"); |
| 55 | + return $result; |
51 | 56 | } |
52 | 57 | |
53 | 58 | /** |