本文整理汇总了PHP中Piwik::deleteAllCacheOnUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::deleteAllCacheOnUpdate方法的具体用法?PHP Piwik::deleteAllCacheOnUpdate怎么用?PHP Piwik::deleteAllCacheOnUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::deleteAllCacheOnUpdate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: welcome
/**
* Installation Step 1: Welcome
*/
function welcome($message = false)
{
// Delete merged js/css files to force regenerations based on updated activated plugin list
Piwik::deleteAllCacheOnUpdate();
$view = new Piwik_Installation_View($this->pathView . 'welcome.tpl', $this->getInstallationSteps(), __FUNCTION__);
$view->newInstall = !file_exists(Piwik_Config::getLocalConfigPath());
$view->errorMessage = $message;
$this->skipThisStep(__FUNCTION__);
$view->showNextStep = $view->newInstall;
$this->session->currentStepDone = __FUNCTION__;
echo $view->render();
}
示例2: dispatch
function dispatch()
{
$module = Piwik_Common::getRequestVar('module', '', 'string');
$updater = new Piwik_Updater();
$updater->addComponentToCheck('core', Piwik_Version::VERSION);
$updates = $updater->getComponentsWithNewVersion();
if (!empty($updates)) {
Piwik::deleteAllCacheOnUpdate();
}
if (self::getComponentUpdates($updater) !== null && $module != 'CoreUpdater' && $module != 'Proxy') {
if (Piwik_FrontController::shouldRethrowException()) {
throw new Exception("Piwik and/or some plugins have been upgraded to a new version. Please run the update process first. See documentation: http://piwik.org/docs/update/");
} else {
Piwik::redirectToModule('CoreUpdater');
}
}
}
示例3: dispatch
function dispatch()
{
$module = Piwik_Common::getRequestVar('module', '', 'string');
$updater = new Piwik_Updater();
$updater->addComponentToCheck('core', Piwik_Version::VERSION);
$updates = $updater->getComponentsWithNewVersion();
if(!empty($updates))
{
Piwik::deleteAllCacheOnUpdate();
}
if(self::getComponentUpdates($updater) !== null
&& $module != 'CoreUpdater'
// Proxy module is used to redirect users to piwik.org, should still work when Piwik must be updated
&& $module != 'Proxy')
{
Piwik::redirectToModule('CoreUpdater');
}
}
示例4: activatePlugin
/**
* Activate the specified plugin and install (if needed)
*
* @param string $pluginName Name of plugin
* @throws Exception
*/
public function activatePlugin($pluginName)
{
$plugins = Piwik_Config::getInstance()->Plugins['Plugins'];
if (in_array($pluginName, $plugins)) {
throw new Exception("Plugin '{$pluginName}' already activated.");
}
$existingPlugins = $this->readPluginsDirectory();
if (array_search($pluginName, $existingPlugins) === false) {
Piwik::log("Unable to find the plugin '{$pluginName}' in activatePlugin.");
return;
}
$plugin = $this->loadPlugin($pluginName);
if ($plugin === null) {
return;
}
$this->installPluginIfNecessary($plugin);
$plugin->activate();
// we add the plugin to the list of activated plugins
if (!in_array($pluginName, $plugins)) {
$plugins[] = $pluginName;
} else {
// clean up if we find a dupe
$plugins = array_unique($plugins);
}
// the config file will automatically be saved with the new plugin
$this->updatePluginsConfig($plugins);
Piwik_Config::getInstance()->forceSave();
// Delete merged js/css files to force regenerations to include the activated plugin
Piwik::deleteAllCacheOnUpdate();
}
示例5: doExecuteUpdates
private function doExecuteUpdates($view, $updater, $componentsWithUpdateFile)
{
$this->loadAndExecuteUpdateFiles($updater, $componentsWithUpdateFile);
Piwik::deleteAllCacheOnUpdate();
$view->coreError = $this->coreError;
$view->warningMessages = $this->warningMessages;
$view->errorMessages = $this->errorMessages;
$view->deactivatedPlugins = $this->deactivatedPlugins;
echo $view->render();
}
示例6: activatePlugin
/**
* Activate the specified plugin and install (if needed)
*
* @param string $pluginName Name of plugin
*/
public function activatePlugin($pluginName)
{
$plugins = Zend_Registry::get('config')->Plugins->Plugins->toArray();
if(in_array($pluginName,$plugins))
{
throw new Exception("Plugin '$pluginName' already activated.");
}
$existingPlugins = $this->readPluginsDirectory();
if( array_search($pluginName,$existingPlugins) === false)
{
throw new Exception("Unable to find the plugin '$pluginName'.");
}
$plugin = $this->loadPlugin($pluginName);
$this->installPluginIfNecessary($plugin);
// we add the plugin to the list of activated plugins
$plugins[] = $pluginName;
// the config file will automatically be saved with the new plugin
Zend_Registry::get('config')->Plugins = $plugins;
// Delete merged js/css files to force regenerations to include the activated plugin
Piwik::deleteAllCacheOnUpdate();
}