Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -315,4 +315,23 @@ |
316 | 316 | return $smwgSparqlDatabaseMaster; |
317 | 317 | } |
318 | 318 | |
319 | | -function |
\ No newline at end of file |
| 319 | +/** |
| 320 | + * Compatibility helper for using Linker methods. |
| 321 | + * MW 1.16 has a Linker with non-static methods, |
| 322 | + * where in MW 1.19 they are static, and a DummyLinker |
| 323 | + * class is introduced, which can be instantaited for |
| 324 | + * compat reasons. |
| 325 | + * |
| 326 | + * @since 1.6 |
| 327 | + * |
| 328 | + * @return Linker or DummyLinker |
| 329 | + */ |
| 330 | +function smwfGetLinker() { |
| 331 | + static $linker = false; |
| 332 | + |
| 333 | + if ( $linker === false ) { |
| 334 | + $linker = class_exists( 'DummyLinker' ) ? new DummyLinker() : new Linker(); |
| 335 | + } |
| 336 | + |
| 337 | + return $linker; |
| 338 | +} |
\ No newline at end of file |