本文整理汇总了PHP中StubManager类的典型用法代码示例。如果您正苦于以下问题:PHP StubManager类的具体用法?PHP StubManager怎么用?PHP StubManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StubManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mg_gravatar
/**
* {{#gravatar: email_p1=John.Smith | email_p2=gmail.com [|optional parameters] }}
*/
public function mg_gravatar(&$parser)
{
$params = func_get_args();
$liste = StubManager::processArgList($params, true);
$output = $this->renderEntry($liste);
return array($output, 'noparse' => true, 'isHTML' => true);
}
示例2: mg_removeactions
/**
List of actions to remove from the current page.
*/
public function mg_removeactions(&$parser)
{
$params = StubManager::processArgList(func_get_args(), true);
if (isset($params)) {
foreach ($params as $actionToRemove) {
$this->actionsToRemove[] = $actionToRemove;
}
}
}
示例3: mg_jskitpoll
/**
* {{#jskitpoll(: [optional parameters] }}
*/
public function mg_jskitpoll(&$parser)
{
$params = func_get_args();
$liste = StubManager::processArgList($params, true);
$output = $this->renderEntry($liste);
$output .= <<<EOT
\t<script src="http://js-kit.com/polls.js"></script>
EOT;
return array($output, 'noparse' => true, 'isHTML' => true);
}
示例4: mg_quimble_poll
/**
* {{#quimble_poll: index=poll_index }}
*/
public function mg_quimble_poll(&$parser)
{
$params = func_get_args();
$liste = StubManager::processArgList($params, true);
$code = $this->formatPoll($liste, $index, $output);
if ($code !== true) {
return $code;
}
return array($output, 'noparse' => true, 'isHTML' => true);
}
示例5: mg_gcode
/**
{{#gcode: project=PROJECT NAME|file=FILENAME }}
*/
public function mg_gcode(&$parser)
{
$args = func_get_args();
$argv = StubManager::processArgList($args, true);
$project = @$argv['project'];
$file = @$argv['file'];
$result = $this->validateParameters($project, $file);
// don't bother going forward if we already have an error message
if (!empty($result)) {
return $result;
}
$code = $this->getCode($project, $file, $result);
// don't bother going forward if we already have an error message
if (!empty($result)) {
return $result;
}
return $code;
}
示例6: mg_jskitcomments
/**
* {{#jskitnavigator: [optional parameters] }}
*/
public function mg_jskitcomments(&$parser)
{
$params = func_get_args();
$liste = StubManager::processArgList($params, true);
// check for ''noscript'' parameter
$noscript = false;
if (isset($liste['noscript'])) {
$r = strtolower($liste['noscript']);
if ($r == '1' || $r == 'true') {
$noscript = true;
}
}
$output = $this->renderEntry($liste);
if (!$noscript) {
if (!$this->scriptIncluded) {
$this->scriptIncluded = true;
$output .= $this->getScript();
}
}
return array($output, 'noparse' => true, 'isHTML' => true);
}
示例7: mg_jskitrating
/**
* {{#jskitrating: [optional parameters] }}
*/
public function mg_jskitrating(&$parser)
{
$params = func_get_args();
$liste = StubManager::processArgList($params, true);
// check for ''noscript'' parameter
$noscript = false;
if (isset($liste['noscript'])) {
$r = strtolower($liste['noscript']);
if ($r == '1' || $r == 'true') {
$noscript = true;
}
}
$output = $this->renderEntry($liste);
if (!$noscript) {
if (!$this->scriptIncluded) {
$this->scriptIncluded = true;
$output .= <<<EOT
\t<script src="http://js-kit.com/ratings.js"></script>
EOT;
}
}
return array($output, 'noparse' => true, 'isHTML' => true);
}
示例8: array
<?php
/**
* @author Jean-Lou Dupont
* @package JSKitNavigator
* @version @@package-version@@
* @Id $Id$
*/
//<source lang=php>
if (!class_exists('StubManager')) {
echo '[[Extension:JSKitNavigator]] <b>requires</b> [[Extension:StubManager]] version >= 1.1.0' . "\n";
} else {
$wgExtensionCredits['other'][] = array('name' => 'JSKitNavigator', 'version' => '@@package-version@@', 'author' => 'Jean-Lou Dupont', 'url' => 'http://www.mediawiki.org/wiki/Extension:JSKitNavigator', 'description' => "Provides integration with JSKit Navigator tool.");
StubManager::createStub2(array('class' => 'JSKitNavigator', 'classfilename' => dirname(__FILE__) . '/JSKitNavigator.body.php', 'mgs' => array('jskitnavigator')));
}
//</source>
示例9: array
<?php
/**
* @author Jean-Lou Dupont
* @package SecureTransclusion
* @version @@package-version@@
* @Id $Id$
*/
//<source lang=php>
if (!class_exists('StubManager')) {
echo '[[Extension:SecureTransclusion]] <b>requires</b> [[Extension:StubManager]]' . "\n";
} else {
$wgExtensionCredits['other'][] = array('name' => 'SecureTransclusion', 'version' => '@@package-version@@', 'author' => 'Jean-Lou Dupont', 'url' => 'http://www.mediawiki.org/wiki/Extension:SecureTransclusion', 'description' => "Provides secure interwiki transclusion.");
StubManager::createStub2(array('class' => 'SecureTransclusion', 'classfilename' => dirname(__FILE__) . '/SecureTransclusion.body.php', 'mgs' => array('strans')));
}
//</source>
示例10: SVN
|name = AutoRedirect_stub
|status = beta
|type = parser
|author = [[user:jldupont|Jean-Lou Dupont]]
|image =
|version = See SVN ($Id$)
|update =
|mediawiki = tested on 1.10 but probably works with a earlier versions
|download = [http://bizzwiki.googlecode.com/svn/trunk/BizzWiki/extensions/XYZ/ SVN]
|readme =
|changelog =
|description =
|parameters =
|rights =
|example =
}}
<!--@@
== File Status ==
This section is only valid when viewing the page in a BizzWiki environment.
<code>(($#extractmtime|@@mtime@@$)) (($#extractfile|@@file@@$))</code>
Status: (($#comparemtime|<b>File system copy is newer - [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=reload}} Reload] </b>|Up to date$))
@@-->
== Notes ==
See details about this extension on [[Extension:AutoRedirect]].
== Code ==
<!--</wikitext>--><source lang=php>*/
StubManager::createStub2(array('class' => 'AutoRedirect', 'classfilename' => dirname(__FILE__) . '/AutoRedirect.php', 'mgs' => array('autoredirect')));
//</source>
示例11: MWException
case 10:
return $obj->$method( $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9] );
case 11:
return $obj->$method( $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10] );
case 12:
return $obj->$method( $args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8], $args[9], $args[10], $args[11] );
}
throw new MWException( __CLASS__.": too many arguments to method called in ".__METHOD__ );
*/
return call_user_func_array(array($obj, $method), $args);
}
}
// end class Stub
// Perform auto-discovery of [[Extension:ExtensionManager]]
// --------------------------------------------------------
StubManager::$edir = realpath(dirname(dirname(__FILE__)));
if (file_exists(StubManager::$edir . '/ExtensionManager/ExtensionManager.php')) {
include StubManager::$edir . '/ExtensionManager/ExtensionManager.php';
}
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// ExtHelper Class
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/**
* Some helper functions for extensions
*/
class ExtHelper
{
/**
* Retrieves the specified list of parameters from the list.
* Uses the ''l'' parameter from the reference list.
*/
示例12: array
<?php
/**
* @author Jean-Lou Dupont
* @package ManageNamespaces
* @version @@package-version@@
* @Id $Id$
*/
// <source lang=php>
if (class_exists('StubManager')) {
$wgExtensionCredits['other'][] = array('name' => 'ManageNamespaces', 'version' => '@@package-version@@', 'author' => 'Jean-Lou Dupont', 'url' => 'http://www.mediawiki.org/wiki/Extension:ManageNamespaces', 'description' => "Provides a special page to add/remove namespaces. ");
StubManager::createStub2(array('class' => 'ManageNamespaces', 'classfilename' => dirname(__FILE__) . '/ManageNamespaces.body.php', 'i18nfilename' => dirname(__FILE__) . '/ManageNamespaces.i18n.php', 'logging' => true, 'hooks' => array('ParserAfterTidy'), 'nss' => array(NS_MEDIAWIKI), 'mgs' => array('mns')));
} else {
echo "Extension:ManageNamespaces <b>requires</b> Extension:StubManager\n";
}
global $wgCanonicalNamespaceNames;
global $wgExtraNamespaces;
global $wgNamespacesWithSubpages;
global $bwManagedNamespaces;
global $bwManagedNamespacesDefines;
// Now include the managed namespaces in question
include dirname(__FILE__) . '/ManageNamespaces.namespaces.php';
// Is the Namespace class defined yet?
if (!class_exists('Namespace') && !empty($bwManagedNamespaces)) {
require $IP . '/includes/Namespace.php';
}
// Go through all the managed namespaces
if (!empty($bwManagedNamespaces)) {
foreach ($bwManagedNamespaces as $index => $name) {
// add the managed namespaces to the primary tables
$wgCanonicalNamespaceNames[$index] = $name;
示例13: array
<?php
/**
* @author Jean-Lou Dupont
* @package ParserExt
* @subpackage SkinTools
* @version @@package-version@@
* @Id $Id$
*/
//<source lang=php>
global $wgExtensionCredits;
$wgExtensionCredits['other'][] = array('name' => 'SkinTools', 'version' => '1.1.0', 'author' => 'Jean-Lou Dupont', 'description' => 'Provides skin level functions', 'url' => 'http://mediawiki.org/wiki/Extension:SkinTools');
StubManager::createStub2(array('class' => 'SkinTools', 'classfilename' => dirname(__FILE__) . '/SkinTools.body.php', 'hooks' => array('SkinTemplateTabs'), 'mgs' => array('clearactions', 'removeactions', 'addaction')));
//</source>
示例14: array
<?php
/**
* @author Jean-Lou Dupont
* @package PageSidebar
* @version $Id$
*/
//<source lang=php>
if (!class_exists('StubManager')) {
echo '[[Extension:PageSidebar]] <b>requires</b> [[Extension:StubManager]]' . "\n";
} else {
global $wgExtensionCredits;
$wgExtensionCredits['other'][] = array('name' => 'PageSidebar', 'version' => '@@package-version@@', 'author' => 'Jean-Lou Dupont', 'url' => 'http://www.mediawiki.org/wiki/Extension:PageSidebar', 'description' => "Provides per-page arbitrary wikitext for the sidebar.");
StubManager::createStub2(array('class' => 'PageSidebar', 'classfilename' => dirname(__FILE__) . '/PageSidebar.body.php', 'hooks' => array('SkinTemplateOutputPageBeforeExec', 'OutputPageParserOutput', 'PageSidebar'), 'tags' => array('pagesidebar')));
}
// </source>
示例15: require
* Download & Install [[Extension:PageFunctions]] extension
* Download & Install [[Extension:ParserPhase2]] extension
* Dowload all this extension's files and place in the desired directory
* Apply the following changes to 'LocalSettings.php' after the statements of [[Extension:StubManager]]:
<source lang=php>
require('extensions/ScriptingTools/ScriptingTools_stub.php');
</source>
== HISTORY ==
== See Also ==
This extension is part of the [[Extension:BizzWiki|BizzWiki Platform]].
== Code ==
<!--</wikitext>--><source lang=php>*/
$wgExtensionCredits[ScriptingTools::thisType][] = array('name' => ScriptingTools::thisName, 'version' => StubManager::getRevisionId('$Id$'), 'author' => 'Jean-Lou Dupont', 'description' => 'Provides an interface between MediaWiki scripting tools', 'url' => 'http://mediawiki.org/wiki/Extension:ScriptingTools');
class ScriptingTools
{
const thisName = 'ScriptingTools';
const thisType = 'other';
static $magicWord = '__jsminandstore__';
static $patterns = array('/<javascript(?:.*)\\>(.*)(?:\\<.?javascript>)/siU', '/<js(?:.*)\\>(.*)(?:\\<.?js>)/siU');
const open_js = '<script type= "text/javascript">/*<![CDATA[*/';
const close_js = '/*]]>*/</script>';
// relative directory from MediaWiki installation.
static $base = 'BizzWiki/scripts/';
public function __construct()
{
// take on global setting, if present.
global $bwScriptsDirectory;
if (isset($bwScriptsDirectory)) {