Index: trunk/phase3/includes/specials/SpecialActiveusers.php |
— | — | @@ -165,7 +165,7 @@ |
166 | 166 | * Constructor |
167 | 167 | */ |
168 | 168 | public function __construct() { |
169 | | - parent::__construct( 'Activeusers' ); |
| 169 | + SpecialPage::SpecialPage( 'Activeusers' ); |
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -702,7 +702,16 @@ |
703 | 703 | * @param $file String: file which is included by execute(). It is also constructed from $name by default |
704 | 704 | * @param $includable Boolean: whether the page can be included in normal pages |
705 | 705 | */ |
706 | | - function __construct( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) { |
| 706 | + public function __construct( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) { |
| 707 | + $this->init( $name, $restriction, $listed, $function, $file, $includable ); |
| 708 | + } |
| 709 | + |
| 710 | + /** |
| 711 | + * Do the real work for the constructor, mainly so __call() can intercept |
| 712 | + * calls to SpecialPage() |
| 713 | + * @see __construct() for param docs |
| 714 | + */ |
| 715 | + private function init( $name, $restriction, $listed, $function, $file, $includable ) { |
707 | 716 | $this->mName = $name; |
708 | 717 | $this->mRestriction = $restriction; |
709 | 718 | $this->mListed = $listed; |
— | — | @@ -719,6 +728,29 @@ |
720 | 729 | } |
721 | 730 | } |
722 | 731 | |
| 732 | + /** |
| 733 | + * Use PHP's magic __call handler to get calls to the old PHP4 constructor |
| 734 | + * because PHP E_STRICT yells at you for having __construct() and SpecialPage() |
| 735 | + * |
| 736 | + * @param $name String Name of called method |
| 737 | + * @param $a Array Arguments to the method |
| 738 | + * @deprecated Call isn't deprecated, but SpecialPage::SpecialPage() is |
| 739 | + */ |
| 740 | + public function __call( $fName, $a ) { |
| 741 | + // Sometimes $fName is SpecialPage, sometimes it's specialpage. <3 PHP |
| 742 | + if( strtolower( $fName ) == 'specialpage' ) { |
| 743 | + // Debug messages now, warnings in 1.19 or 1.20? |
| 744 | + wfDebug( "Deprecated SpecialPage::SpecialPage() called, use __construct();\n" ); |
| 745 | + $name = isset( $a[0] ) ? $a[0] : ''; |
| 746 | + $restriction = isset( $a[1] ) ? $a[1] : ''; |
| 747 | + $listed = isset( $a[2] ) ? $a[2] : true; |
| 748 | + $function = isset( $a[3] ) ? $a[3] : false; |
| 749 | + $file = isset( $a[4] ) ? $a[4] : 'default'; |
| 750 | + $includable = isset( $a[5] ) ? $a[5] : false; |
| 751 | + $this->init( $name, $restriction, $listed, $function, $file, $includable ); |
| 752 | + } |
| 753 | + } |
| 754 | + |
723 | 755 | /**#@+ |
724 | 756 | * Accessor |
725 | 757 | * |