Extension:StackFunctions/Install

From MediaWiki.org

Jump to: navigation, search
  • Ensure your PHP has multibyte functions enabled. If you do not have the possibility to do that, you might decide to do without multibyte support. In that case, just delete all occurences of "mb_" from StackFunctions.php.
  • Ensure your PHP is compiled with the mhash library which is needed to sign the serialized data with HMACs. If this is not possible to you, it is easy to patch the StackFunctions code to do without HMACs. However, this is strongly discouraged because anybody might upload serialzed PHP objects and use the __wakeup method to execute arbitrary PHP code on your server.
  • Unzip the distribution zipfile in the subdirectory extensions/StackFunctions of your mediawiki installation.
  • Add the following line to your LocalSettings.php:
require_once( "extensions/StackFunctions/StackFunctions.php" );
All parameters explained in the following must be set after this line.
  • Ensure $wgSecretKey is set in your LocalSettings.php (before the above require_once statement). If you want to use something else to sign serialized code, set ExtStackFunctions::$mAuthKey to some random sequence of characters.
ExtStackFunctions::$mEnableQuery = true;
  • It is recommanded to set up a distinct tablespace for prologs. To do that, copy something like this to your LocalSettings.php:
# extra namespace for StackFunctions Prologs
define('NS_PROLOG', 200);
define('NS_PROLOG_TALK', 201);

$wgExtraNamespaces = array(
  NS_PROLOG => "Prolog",
  NS_PROLOG_TALK => "Prolog_Talk" );

ExtStackFunctions::$mPrologNamespace = NS_PROLOG;
  • By default, StackFunctions use gzdeflate with maximum compression to compress serialized code. If you want to use different compression functions and/or parameters, you may copy something like this to your LocalSettings.php:
ExtStackFunctions::$mCompress = 'gzcompress';
ExtStackFunctions::$mCompressArg = 1;
ExtStackFunctions::$mDecompress = 'gzuncompress';