Currently registering a special page with a factory by passing the
callback string does not work because the is_string check comes
before the is_callback check. If we change the order of this if-
clauses we can also support callbacks like 'Factory::createPage'.
Change-Id: I751f97026ed8c580732c74d66b2804dd180ed16f
if ( isset( $specialPageList[$realName] ) ) {
$rec = $specialPageList[$realName];
if ( isset( $specialPageList[$realName] ) ) {
$rec = $specialPageList[$realName];
- if ( is_string( $rec ) ) {
- $className = $rec;
- $page = new $className;
- } elseif ( is_callable( $rec ) ) {
+ if ( is_callable( $rec ) ) {
// Use callback to instantiate the special page
$page = call_user_func( $rec );
// Use callback to instantiate the special page
$page = call_user_func( $rec );
+ } elseif ( is_string( $rec ) ) {
+ $className = $rec;
+ $page = new $className;
} elseif ( is_array( $rec ) ) {
$className = array_shift( $rec );
// @deprecated, officially since 1.18, unofficially since forever
} elseif ( is_array( $rec ) ) {
$className = array_shift( $rec );
// @deprecated, officially since 1.18, unofficially since forever