本文整理汇总了PHP中Piwik\API\Request::renameModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::renameModule方法的具体用法?PHP Request::renameModule怎么用?PHP Request::renameModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\API\Request
的用法示例。
在下文中一共展示了Request::renameModule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareDispatch
protected function prepareDispatch($module, $action, $parameters)
{
if (is_null($module)) {
$module = Common::getRequestVar('module', self::DEFAULT_MODULE, 'string');
}
if (is_null($action)) {
$action = Common::getRequestVar('action', false);
}
if (SettingsPiwik::isPiwikInstalled() && ($module !== 'API' || $action && $action !== 'index')) {
Session::start();
}
if (is_null($parameters)) {
$parameters = array();
}
if (!ctype_alnum($module)) {
throw new Exception("Invalid module name '{$module}'");
}
$module = Request::renameModule($module);
if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated($module)) {
throw new PluginDeactivatedException($module);
}
return array($module, $action, $parameters);
}
示例2: getPluginsInfo
protected function getPluginsInfo($themesOnly = false)
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
$plugins = $pluginManager->returnLoadedPluginsInfo();
foreach ($plugins as $pluginName => &$plugin) {
$plugin['isCorePlugin'] = $pluginManager->isPluginBundledWithCore($pluginName);
if (!isset($plugin['info'])) {
$suffix = Piwik::translate('CorePluginsAdmin_PluginNotWorkingAlternative');
// If the plugin has been renamed, we do not show message to ask user to update plugin
if ($pluginName != Request::renameModule($pluginName)) {
$suffix = "You may uninstall the plugin or manually delete the files in piwik/plugins/{$pluginName}/";
}
$description = '<strong><em>' . Piwik::translate('CorePluginsAdmin_PluginNotCompatibleWith', array($pluginName, self::getPiwikVersion())) . '</strong><br/>' . $suffix . '</em>';
$plugin['info'] = array('description' => $description, 'version' => Piwik::translate('General_Unknown'), 'theme' => false);
}
}
$pluginsFiltered = $this->keepPluginsOrThemes($themesOnly, $plugins);
return $pluginsFiltered;
}