. $wgExtensionCredits['other'][] = array( 'name' => 'Skin-by-URL 2', 'author' => 'Glen E. Ivey', 'url' => 'http://github.com/gleneivey/skin-by-url-2', 'version' => '0.1', 'description' => "Force page's skin by altering page's URL. " . "Replace 'index.php' with 'askin.php' to force any page to " . "display with 'askin'." ); # this extension's initialization; use a function for local variable scope $wg_SBU2_skinNameFromUrl = ''; function wf_SBU2_checkUrlAndConfigure(){ global $wg_SBU2_skinNameFromUrl; global $wgScriptExtension; global $wgHooks; global $wgUsePathInfo; if ( preg_match( "/\/([^\/]+)\\" . $wgScriptExtension . "/", $_SERVER['PHP_SELF'], $substrings ) ){ $wg_SBU2_skinNameFromUrl = $substrings[1]; if ( $wg_SBU2_skinNameFromUrl != "index" ){ $wgHooks['OutputPageParserOutput'][] = 'wf_SBU2_oppoCallback'; $wgHooks['GetLocalURL'][] = 'wf_SBU2_gluCallback'; $wgUsePathInfo = false; } } } # actually do extension initialization wf_SBU2_checkUrlAndConfigure(); # for hook OutputPageParseOutput; our moment to change the skin to be used function wf_SBU2_oppoCallback( &$out, $parseroutput ){ global $wg_SBU2_skinNameFromUrl; global $wgValidSkinNames; global $wgDefaultSkin; global $wgUser; if ( array_key_exists( $wg_SBU2_skinNameFromUrl, $wgValidSkinNames ) ){ $wgDefaultSkin = $wg_SBU2_skinNameFromUrl; $wgUser->setOption( 'skin', $wg_SBU2_skinNameFromUrl ); } return true; } # for hook GetLocalURL; maybe replace "index.php" with skin-specifying string function wf_SBU2_gluCallback( $title, $url, $query ){ global $wg_SBU2_skinNameFromUrl; global $wgScriptPath; global $wgScriptExtension; if ( preg_match( "/action=/", $query ) == 0 || preg_match( "/action=view/", $query ) == 1 ){ $indexRe = "/\/index\\" . $wgScriptExtension . "/"; if ( preg_match( $indexRe, $url ) ) $url = preg_replace( $indexRe, "/" . $wg_SBU2_skinNameFromUrl . $wgScriptExtension, $url ); else if ( preg_match( "/\/[a-z0-9]+\\" . $wgScriptExtension . "/", $url ) == 0 ){ $withoutSlash = substr( $url, 1 ); $url = "{$wgScriptPath}/{$wg_SBU2_skinNameFromUrl}{$wgScriptExtension}" . "?title={$withoutSlash}"; } } return true; } Unexpected non-MediaWiki exception encountered, of type "Error"
Error: Call to undefined function dl() in /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/DatabaseMysql.php:30
Stack trace:
#0 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/Database.php(341): DatabaseMysql->open()
#1 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/LoadBalancer.php(647): DatabaseBase->__construct()
#2 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/LoadBalancer.php(530): LoadBalancer->reallyOpenConnection()
#3 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/LoadBalancer.php(453): LoadBalancer->openConnection()
#4 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/GlobalFunctions.php(2973): LoadBalancer->getConnection()
#5 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(760): wfGetDB()
#6 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(321): LCStore_DB->get()
#7 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(350): LocalisationCache->isExpired()
#8 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(262): LocalisationCache->initLanguage()
#9 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(205): LocalisationCache->loadItem()
#10 /home/quarkcat/sw/www-php/quarknet-fellows-library/languages/Language.php(442): LocalisationCache->getItem()
#11 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/User.php(1052): Language->getDefaultUserOptionOverrides()
#12 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/User.php(1974): User::getDefaultOptions()
#13 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/StubObject.php(58): User->getOption()
#14 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/StubObject.php(182): StubObject->_call()
#15 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/parser/ParserOptions.php(150): StubUser->__call()
#16 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/parser/ParserOptions.php(109): ParserOptions->initialiseFromUser()
#17 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Article.php(4049): ParserOptions->__construct()
#18 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Article.php(745): Article->getParserOptions()
#19 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Wiki.php(493): Article->view()
#20 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Wiki.php(70): MediaWiki->performAction()
#21 /home/quarkcat/sw/www-php/quarknet-fellows-library/index.php(117): MediaWiki->performRequestForTitle()
#22 {main}

#0 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/Database.php(341): DatabaseMysql->open()
#1 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/LoadBalancer.php(647): DatabaseBase->__construct()
#2 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/LoadBalancer.php(530): LoadBalancer->reallyOpenConnection()
#3 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/db/LoadBalancer.php(453): LoadBalancer->openConnection()
#4 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/GlobalFunctions.php(2973): LoadBalancer->getConnection()
#5 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(760): wfGetDB()
#6 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(321): LCStore_DB->get()
#7 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(350): LocalisationCache->isExpired()
#8 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(262): LocalisationCache->initLanguage()
#9 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/LocalisationCache.php(205): LocalisationCache->loadItem()
#10 /home/quarkcat/sw/www-php/quarknet-fellows-library/languages/Language.php(442): LocalisationCache->getItem()
#11 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/User.php(1052): Language->getDefaultUserOptionOverrides()
#12 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/User.php(1974): User::getDefaultOptions()
#13 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/StubObject.php(58): User->getOption()
#14 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/StubObject.php(182): StubObject->_call()
#15 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/parser/ParserOptions.php(150): StubUser->__call()
#16 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/parser/ParserOptions.php(109): ParserOptions->initialiseFromUser()
#17 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Article.php(4049): ParserOptions->__construct()
#18 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Article.php(745): Article->getParserOptions()
#19 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Wiki.php(493): Article->view()
#20 /home/quarkcat/sw/www-php/quarknet-fellows-library/includes/Wiki.php(70): MediaWiki->performAction()
#21 /home/quarkcat/sw/www-php/quarknet-fellows-library/index.php(117): MediaWiki->performRequestForTitle()
#22 {main}