Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php |
— | — | @@ -86,6 +86,7 @@ |
87 | 87 | echo $cached; |
88 | 88 | echo "<!-- From cache: $cacheKey -->"; |
89 | 89 | } else { |
| 90 | + wfProfileIn( __METHOD__ . '-not-cached' ); |
90 | 91 | $res = $this->getCategories( $params, $categories, $notCategories ); |
91 | 92 | ob_start(); |
92 | 93 | $this->makeFeed( $feed, $res ); |
— | — | @@ -96,6 +97,7 @@ |
97 | 98 | array( $cacheInvalidationInfo, $output ), |
98 | 99 | $this->maxCacheTime |
99 | 100 | ); |
| 101 | + wfProfileOut( __METHOD__ . '-not-cached' ); |
100 | 102 | } |
101 | 103 | |
102 | 104 | } |
— | — | @@ -195,6 +197,7 @@ |
196 | 198 | * @return String All the above info concatenated. |
197 | 199 | */ |
198 | 200 | private function getCacheInvalidationInfo ( $params, $categories, $notCategories ) { |
| 201 | + wfProfileIn( __METHOD__ ); |
199 | 202 | $dbr = wfGetDB( DB_SLAVE ); |
200 | 203 | $cacheInfo = ''; |
201 | 204 | $categoriesKey = array(); |
— | — | @@ -253,6 +256,7 @@ |
254 | 257 | $cacheInfo .= $ts . '!'; |
255 | 258 | } |
256 | 259 | |
| 260 | + wfProfileOut( __METHOD__ ); |
257 | 261 | return $cacheInfo; |
258 | 262 | } |
259 | 263 | /** |
— | — | @@ -497,6 +501,7 @@ |
498 | 502 | * @return Array of String: list of keywords |
499 | 503 | */ |
500 | 504 | public function getKeywords ( $title ) { |
| 505 | + wfProfileIn( __METHOD__ ); |
501 | 506 | $cats = $title->getParentCategories(); |
502 | 507 | $res = array(); |
503 | 508 | |
— | — | @@ -537,6 +542,7 @@ |
538 | 543 | } |
539 | 544 | } |
540 | 545 | } |
| 546 | + wfProfileOut( __METHOD__ ); |
541 | 547 | return $res; |
542 | 548 | } |
543 | 549 | } |
Index: trunk/extensions/GoogleNewsSitemap/FeedSMItem.php |
— | — | @@ -89,6 +89,7 @@ |
90 | 90 | * @return String |
91 | 91 | */ |
92 | 92 | public function getDescription() { |
| 93 | + wfProfileIn( __METHOD__ ); |
93 | 94 | // This is probably rather inefficient to do for several pages |
94 | 95 | // but not much worse than the rest of this extension. |
95 | 96 | $req = new FauxRequest( array( |
— | — | @@ -99,13 +100,14 @@ |
100 | 101 | $main = new ApiMain( $req ); |
101 | 102 | $main->execute(); |
102 | 103 | $data = $main->getResultData(); |
| 104 | + $result = ''; |
103 | 105 | if ( isset( $data['parse']['text']['*'] ) ) { |
104 | | - return $this->xmlEncode( |
| 106 | + $result = $this->xmlEncode( |
105 | 107 | $data['parse']['text']['*'] |
106 | 108 | ); |
107 | | - } else { |
108 | | - return ''; |
109 | 109 | } |
| 110 | + wfProfileOut( __METHOD__ ); |
| 111 | + return $result; |
110 | 112 | } |
111 | 113 | } |
112 | 114 | |
Index: trunk/extensions/GoogleNewsSitemap/SitemapFeed.php |
— | — | @@ -61,6 +61,8 @@ |
62 | 62 | if ( !( $item instanceof FeedItem ) ) { |
63 | 63 | throw new MWException( "Requires a FeedItem or subclass." ); |
64 | 64 | } |
| 65 | + |
| 66 | + wfProfileIn( __METHOD__ ); |
65 | 67 | if ( !( $item instanceof FeedSMItem ) ) { |
66 | 68 | $item = FeedSMItem::newFromFeedItem( $item ); |
67 | 69 | } |
— | — | @@ -103,6 +105,7 @@ |
104 | 106 | $this->writer->endElement(); |
105 | 107 | } |
106 | 108 | $this->writer->endElement(); // end url |
| 109 | + wfProfileOut( __METHOD__ ); |
107 | 110 | } |
108 | 111 | |
109 | 112 | /** |