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