Index: trunk/phase3/includes/PersistentObject.php |
— | — | @@ -1,50 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * Sometimes one wants to make an extension that defines a class that one wants |
5 | | - * to backreference somewhere else in the code, doing something like: |
6 | | - * <code> |
7 | | - * class Extension { ... } |
8 | | - * function myExtension() { new Extension; } |
9 | | - * </class> |
10 | | - * |
11 | | - * Won't work because PHP will destroy any reference to the initialized |
12 | | - * extension when the function goes out of scope, furthermore one might want to |
13 | | - * use some functions in the Extension class that won't exist by the time |
14 | | - * extensions get parsed which would mean lots of nasty workarounds to get |
15 | | - * around initialization and reference issues. |
16 | | - * |
17 | | - * This class allows one to write hir extension as: |
18 | | - * |
19 | | - * <code> |
20 | | - * function myExtension() { |
21 | | - * class Extension { ... } |
22 | | - * new PersistentObject( new Extension ); |
23 | | - * } |
24 | | - * </code> |
25 | | - * |
26 | | - * The class will then not get parsed until everything is properly initialized |
27 | | - * and references to it won't get destroyed meaning that it's possible to do |
28 | | - * something like: |
29 | | - * |
30 | | - * <code> |
31 | | - * $wgParser->setHook( 'tag' , array( &$this, 'tagFunc' ) ); |
32 | | - * </code> |
33 | | - * |
34 | | - * And have it work as expected |
35 | | - * |
36 | | - * @package MediaWiki |
37 | | - * @subpackage Extensions |
38 | | - * |
39 | | - * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com> |
40 | | - * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason |
41 | | - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
42 | | - */ |
43 | | - |
44 | | -$wgPersistentObjects = array(); |
45 | | - |
46 | | -class PersistentObject { |
47 | | - function PersistentObject( &$obj ) { |
48 | | - $wgPersistentObjects[] = $obj; |
49 | | - } |
50 | | -} |
51 | | -?> |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -203,10 +203,6 @@ |
204 | 204 | # Entries can be added to this variable during the inclusion |
205 | 205 | # of the extension file. Skins can then perform any necessary initialisation. |
206 | 206 | # |
207 | | -# require_once is slow even on the second call, so this needs to be outside the loop |
208 | | -if ( count( $wgSkinExtensionFunctions ) ) { |
209 | | - require_once( 'PersistentObject.php' ); |
210 | | -} |
211 | 207 | foreach ( $wgSkinExtensionFunctions as $func ) { |
212 | 208 | call_user_func( $func ); |
213 | 209 | } |
— | — | @@ -320,9 +316,6 @@ |
321 | 317 | # Entries should be added to this variable during the inclusion |
322 | 318 | # of the extension file. This allows the extension to perform |
323 | 319 | # any necessary initialisation in the fully initialised environment |
324 | | -if ( count( $wgExtensionFunctions ) ) { |
325 | | - require_once( 'PersistentObject.php' ); |
326 | | -} |
327 | 320 | foreach ( $wgExtensionFunctions as $func ) { |
328 | 321 | call_user_func( $func ); |
329 | 322 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -53,6 +53,8 @@ |
54 | 54 | * Don't force edit summaries when a user is editing their own user/talk page |
55 | 55 | * (bug 5510) Warning produced when using {{SUBPAGENAME}} in some namespaces |
56 | 56 | * (bug 385) Installer support for PostgreSQL, fixes for PG compatibility |
| 57 | +* PersistentObject removed; it doesn't do anything and was broken besides. |
| 58 | + All extensions using it have been corrected. |
57 | 59 | |
58 | 60 | |
59 | 61 | == Compatibility == |