From ca311c2e4ced0d3db4679444fa806a2b2ddc3f05 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 12 Apr 2006 08:32:54 +0000 Subject: [PATCH] * PersistentObject removed; it doesn't do anything and was broken besides. All extensions using it have been corrected. --- RELEASE-NOTES | 2 ++ includes/PersistentObject.php | 50 ----------------------------------- includes/Setup.php | 7 ----- 3 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 includes/PersistentObject.php diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5e8c925816..616ec91a79 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -53,6 +53,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Don't force edit summaries when a user is editing their own user/talk page * (bug 5510) Warning produced when using {{SUBPAGENAME}} in some namespaces * (bug 385) Installer support for PostgreSQL, fixes for PG compatibility +* PersistentObject removed; it doesn't do anything and was broken besides. + All extensions using it have been corrected. == Compatibility == diff --git a/includes/PersistentObject.php b/includes/PersistentObject.php deleted file mode 100644 index 100752188b..0000000000 --- a/includes/PersistentObject.php +++ /dev/null @@ -1,50 +0,0 @@ - - * class Extension { ... } - * function myExtension() { new Extension; } - * - * - * Won't work because PHP will destroy any reference to the initialized - * extension when the function goes out of scope, furthermore one might want to - * use some functions in the Extension class that won't exist by the time - * extensions get parsed which would mean lots of nasty workarounds to get - * around initialization and reference issues. - * - * This class allows one to write hir extension as: - * - * - * function myExtension() { - * class Extension { ... } - * new PersistentObject( new Extension ); - * } - * - * - * The class will then not get parsed until everything is properly initialized - * and references to it won't get destroyed meaning that it's possible to do - * something like: - * - * - * $wgParser->setHook( 'tag' , array( &$this, 'tagFunc' ) ); - * - * - * And have it work as expected - * - * @package MediaWiki - * @subpackage Extensions - * - * @author Ævar Arnfjörð Bjarmason - * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later - */ - -$wgPersistentObjects = array(); - -class PersistentObject { - function PersistentObject( &$obj ) { - $wgPersistentObjects[] = $obj; - } -} -?> diff --git a/includes/Setup.php b/includes/Setup.php index 4d2c2577a8..59aff89154 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -203,10 +203,6 @@ wfProfileIn( $fname.'-User' ); # Entries can be added to this variable during the inclusion # of the extension file. Skins can then perform any necessary initialisation. # -# require_once is slow even on the second call, so this needs to be outside the loop -if ( count( $wgSkinExtensionFunctions ) ) { - require_once( 'PersistentObject.php' ); -} foreach ( $wgSkinExtensionFunctions as $func ) { call_user_func( $func ); } @@ -320,9 +316,6 @@ wfProfileIn( $fname.'-extensions' ); # Entries should be added to this variable during the inclusion # of the extension file. This allows the extension to perform # any necessary initialisation in the fully initialised environment -if ( count( $wgExtensionFunctions ) ) { - require_once( 'PersistentObject.php' ); -} foreach ( $wgExtensionFunctions as $func ) { call_user_func( $func ); } -- 2.20.1