id
int32
0
241k
repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
209,000
matomo-org/matomo
core/Plugin/Manager.php
Manager.loadCorePluginsDuringTracker
public function loadCorePluginsDuringTracker() { $pluginsToLoad = $this->pluginList->getActivatedPlugins(); $pluginsToLoad = array_diff($pluginsToLoad, $this->getTrackerPluginsNotToLoad()); $this->loadPlugins($pluginsToLoad); }
php
public function loadCorePluginsDuringTracker() { $pluginsToLoad = $this->pluginList->getActivatedPlugins(); $pluginsToLoad = array_diff($pluginsToLoad, $this->getTrackerPluginsNotToLoad()); $this->loadPlugins($pluginsToLoad); }
[ "public", "function", "loadCorePluginsDuringTracker", "(", ")", "{", "$", "pluginsToLoad", "=", "$", "this", "->", "pluginList", "->", "getActivatedPlugins", "(", ")", ";", "$", "pluginsToLoad", "=", "array_diff", "(", "$", "pluginsToLoad", ",", "$", "this", "...
Called during Tracker
[ "Called", "during", "Tracker" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L122-L127
209,001
matomo-org/matomo
core/Plugin/Manager.php
Manager.updatePluginsConfig
private function updatePluginsConfig($pluginsToLoad) { $pluginsToLoad = $this->pluginList->sortPluginsAndRespectDependencies($pluginsToLoad); $section = PiwikConfig::getInstance()->Plugins; $section['Plugins'] = $pluginsToLoad; PiwikConfig::getInstance()->Plugins = $section; }
php
private function updatePluginsConfig($pluginsToLoad) { $pluginsToLoad = $this->pluginList->sortPluginsAndRespectDependencies($pluginsToLoad); $section = PiwikConfig::getInstance()->Plugins; $section['Plugins'] = $pluginsToLoad; PiwikConfig::getInstance()->Plugins = $section; }
[ "private", "function", "updatePluginsConfig", "(", "$", "pluginsToLoad", ")", "{", "$", "pluginsToLoad", "=", "$", "this", "->", "pluginList", "->", "sortPluginsAndRespectDependencies", "(", "$", "pluginsToLoad", ")", ";", "$", "section", "=", "PiwikConfig", "::",...
Update Plugins config @param array $pluginsToLoad Plugins
[ "Update", "Plugins", "config" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L215-L221
209,002
matomo-org/matomo
core/Plugin/Manager.php
Manager.updatePluginsInstalledConfig
private function updatePluginsInstalledConfig($plugins) { $section = PiwikConfig::getInstance()->PluginsInstalled; $section['PluginsInstalled'] = $plugins; PiwikConfig::getInstance()->PluginsInstalled = $section; }
php
private function updatePluginsInstalledConfig($plugins) { $section = PiwikConfig::getInstance()->PluginsInstalled; $section['PluginsInstalled'] = $plugins; PiwikConfig::getInstance()->PluginsInstalled = $section; }
[ "private", "function", "updatePluginsInstalledConfig", "(", "$", "plugins", ")", "{", "$", "section", "=", "PiwikConfig", "::", "getInstance", "(", ")", "->", "PluginsInstalled", ";", "$", "section", "[", "'PluginsInstalled'", "]", "=", "$", "plugins", ";", "P...
Update PluginsInstalled config @param array $plugins Plugins
[ "Update", "PluginsInstalled", "config" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L228-L233
209,003
matomo-org/matomo
core/Plugin/Manager.php
Manager.isPluginActivated
public function isPluginActivated($name) { return in_array($name, $this->pluginsToLoad) || ($this->doLoadAlwaysActivatedPlugins && $this->isPluginAlwaysActivated($name)); }
php
public function isPluginActivated($name) { return in_array($name, $this->pluginsToLoad) || ($this->doLoadAlwaysActivatedPlugins && $this->isPluginAlwaysActivated($name)); }
[ "public", "function", "isPluginActivated", "(", "$", "name", ")", "{", "return", "in_array", "(", "$", "name", ",", "$", "this", "->", "pluginsToLoad", ")", "||", "(", "$", "this", "->", "doLoadAlwaysActivatedPlugins", "&&", "$", "this", "->", "isPluginAlway...
Returns `true` if a plugin has been activated. @param string $name Name of plugin, eg, `'Actions'`. @return bool @api
[ "Returns", "true", "if", "a", "plugin", "has", "been", "activated", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L270-L274
209,004
matomo-org/matomo
core/Plugin/Manager.php
Manager.getPluginDirectory
public static function getPluginDirectory($pluginName) { if (isset(self::$pluginsToPathCache[$pluginName])) { return self::$pluginsToPathCache[$pluginName]; } $corePluginsDir = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName; if (is_dir($corePluginsDir)) { // ...
php
public static function getPluginDirectory($pluginName) { if (isset(self::$pluginsToPathCache[$pluginName])) { return self::$pluginsToPathCache[$pluginName]; } $corePluginsDir = PIWIK_INCLUDE_PATH . '/plugins/' . $pluginName; if (is_dir($corePluginsDir)) { // ...
[ "public", "static", "function", "getPluginDirectory", "(", "$", "pluginName", ")", "{", "if", "(", "isset", "(", "self", "::", "$", "pluginsToPathCache", "[", "$", "pluginName", "]", ")", ")", "{", "return", "self", "::", "$", "pluginsToPathCache", "[", "$...
Gets the path to a specific plugin. If the plugin does not exist in any plugins folder, the default plugins folder will be assumed. @param $pluginName @return mixed|string @api
[ "Gets", "the", "path", "to", "a", "specific", "plugin", ".", "If", "the", "plugin", "does", "not", "exist", "in", "any", "plugins", "folder", "the", "default", "plugins", "folder", "will", "be", "assumed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L443-L466
209,005
matomo-org/matomo
core/Plugin/Manager.php
Manager.findComponents
public function findComponents($componentName, $expectedSubclass) { $plugins = $this->getPluginsLoadedAndActivated(); $components = array(); foreach ($plugins as $plugin) { $component = $plugin->findComponent($componentName, $expectedSubclass); if (!empty($compon...
php
public function findComponents($componentName, $expectedSubclass) { $plugins = $this->getPluginsLoadedAndActivated(); $components = array(); foreach ($plugins as $plugin) { $component = $plugin->findComponent($componentName, $expectedSubclass); if (!empty($compon...
[ "public", "function", "findComponents", "(", "$", "componentName", ",", "$", "expectedSubclass", ")", "{", "$", "plugins", "=", "$", "this", "->", "getPluginsLoadedAndActivated", "(", ")", ";", "$", "components", "=", "array", "(", ")", ";", "foreach", "(", ...
Tries to find the given components such as a Menu or Tasks implemented by plugins. This method won't cache the found components. If you need to find the same component multiple times you might want to cache the result to save a tiny bit of time. @param string $componentName The name of the component you want to lo...
[ "Tries", "to", "find", "the", "given", "components", "such", "as", "a", "Menu", "or", "Tasks", "implemented", "by", "plugins", ".", "This", "method", "won", "t", "cache", "the", "found", "components", ".", "If", "you", "need", "to", "find", "the", "same"...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L520-L534
209,006
matomo-org/matomo
core/Plugin/Manager.php
Manager.installLoadedPlugins
public function installLoadedPlugins() { Log::debug("Loaded plugins: " . implode(", ", array_keys($this->getLoadedPlugins()))); foreach ($this->getLoadedPlugins() as $plugin) { $this->installPluginIfNecessary($plugin); } }
php
public function installLoadedPlugins() { Log::debug("Loaded plugins: " . implode(", ", array_keys($this->getLoadedPlugins()))); foreach ($this->getLoadedPlugins() as $plugin) { $this->installPluginIfNecessary($plugin); } }
[ "public", "function", "installLoadedPlugins", "(", ")", "{", "Log", "::", "debug", "(", "\"Loaded plugins: \"", ".", "implode", "(", "\", \"", ",", "array_keys", "(", "$", "this", "->", "getLoadedPlugins", "(", ")", ")", ")", ")", ";", "foreach", "(", "$",...
Install loaded plugins @throws @return array Error messages of plugin install fails
[ "Install", "loaded", "plugins" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L620-L627
209,007
matomo-org/matomo
core/Plugin/Manager.php
Manager.getThemeEnabled
public function getThemeEnabled() { $plugins = $this->getLoadedPlugins(); $theme = false; foreach ($plugins as $plugin) { /* @var $plugin Plugin */ if ($plugin->isTheme() && $this->isPluginActivated($plugin->getPluginName()) ) { ...
php
public function getThemeEnabled() { $plugins = $this->getLoadedPlugins(); $theme = false; foreach ($plugins as $plugin) { /* @var $plugin Plugin */ if ($plugin->isTheme() && $this->isPluginActivated($plugin->getPluginName()) ) { ...
[ "public", "function", "getThemeEnabled", "(", ")", "{", "$", "plugins", "=", "$", "this", "->", "getLoadedPlugins", "(", ")", ";", "$", "theme", "=", "false", ";", "foreach", "(", "$", "plugins", "as", "$", "plugin", ")", "{", "/* @var $plugin Plugin */", ...
Returns the currently enabled theme. If no theme is enabled, the **Morpheus** plugin is returned (this is the base and default theme). @return Plugin @api
[ "Returns", "the", "currently", "enabled", "theme", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L689-L706
209,008
matomo-org/matomo
core/Plugin/Manager.php
Manager.loadAllPluginsAndGetTheirInfo
public function loadAllPluginsAndGetTheirInfo() { /** @var Translator $translator */ $translator = StaticContainer::get('Piwik\Translation\Translator'); $plugins = array(); $listPlugins = array_merge( $this->readPluginsDirectory(), $this->pluginList->getActi...
php
public function loadAllPluginsAndGetTheirInfo() { /** @var Translator $translator */ $translator = StaticContainer::get('Piwik\Translation\Translator'); $plugins = array(); $listPlugins = array_merge( $this->readPluginsDirectory(), $this->pluginList->getActi...
[ "public", "function", "loadAllPluginsAndGetTheirInfo", "(", ")", "{", "/** @var Translator $translator */", "$", "translator", "=", "StaticContainer", "::", "get", "(", "'Piwik\\Translation\\Translator'", ")", ";", "$", "plugins", "=", "array", "(", ")", ";", "$", "...
Returns info regarding all plugins. Loads plugins that can be loaded. @return array An array that maps plugin names with arrays of plugin information. Plugin information consists of the following entries: - **activated**: Whether the plugin is activated. - **alwaysActivated**: Whether the plugin should always be acti...
[ "Returns", "info", "regarding", "all", "plugins", ".", "Loads", "plugins", "that", "can", "be", "loaded", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L756-L811
209,009
matomo-org/matomo
core/Plugin/Manager.php
Manager.isPluginBundledWithCore
public function isPluginBundledWithCore($name) { return $this->isPluginEnabledByDefault($name) || in_array($name, $this->pluginList->getCorePluginsDisabledByDefault()) || $name == self::DEFAULT_THEME; }
php
public function isPluginBundledWithCore($name) { return $this->isPluginEnabledByDefault($name) || in_array($name, $this->pluginList->getCorePluginsDisabledByDefault()) || $name == self::DEFAULT_THEME; }
[ "public", "function", "isPluginBundledWithCore", "(", "$", "name", ")", "{", "return", "$", "this", "->", "isPluginEnabledByDefault", "(", "$", "name", ")", "||", "in_array", "(", "$", "name", ",", "$", "this", "->", "pluginList", "->", "getCorePluginsDisabled...
Returns `true` if the plugin is bundled with core or `false` if it is third party. @param string $name The name of the plugin, eg, `'Actions'`. @return bool
[ "Returns", "true", "if", "the", "plugin", "is", "bundled", "with", "core", "or", "false", "if", "it", "is", "third", "party", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L824-L829
209,010
matomo-org/matomo
core/Plugin/Manager.php
Manager.loadPlugins
public function loadPlugins(array $pluginsToLoad) { $this->resetTransientCache(); $this->pluginsToLoad = $this->makePluginsToLoad($pluginsToLoad); $this->reloadActivatedPlugins(); }
php
public function loadPlugins(array $pluginsToLoad) { $this->resetTransientCache(); $this->pluginsToLoad = $this->makePluginsToLoad($pluginsToLoad); $this->reloadActivatedPlugins(); }
[ "public", "function", "loadPlugins", "(", "array", "$", "pluginsToLoad", ")", "{", "$", "this", "->", "resetTransientCache", "(", ")", ";", "$", "this", "->", "pluginsToLoad", "=", "$", "this", "->", "makePluginsToLoad", "(", "$", "pluginsToLoad", ")", ";", ...
Load AND activates the specified plugins. It will also overwrite all previously loaded plugins, so it acts as a setter. @param array $pluginsToLoad Array of plugins to load.
[ "Load", "AND", "activates", "the", "specified", "plugins", ".", "It", "will", "also", "overwrite", "all", "previously", "loaded", "plugins", "so", "it", "acts", "as", "a", "setter", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L859-L864
209,011
matomo-org/matomo
core/Plugin/Manager.php
Manager.getPluginsLoadedAndActivated
public function getPluginsLoadedAndActivated() { if (is_null($this->pluginsLoadedAndActivated)) { $enabled = $this->getActivatedPlugins(); if (empty($enabled)) { return array(); } $plugins = $this->getLoadedPlugins(); $enabled = a...
php
public function getPluginsLoadedAndActivated() { if (is_null($this->pluginsLoadedAndActivated)) { $enabled = $this->getActivatedPlugins(); if (empty($enabled)) { return array(); } $plugins = $this->getLoadedPlugins(); $enabled = a...
[ "public", "function", "getPluginsLoadedAndActivated", "(", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "pluginsLoadedAndActivated", ")", ")", "{", "$", "enabled", "=", "$", "this", "->", "getActivatedPlugins", "(", ")", ";", "if", "(", "empty", ...
Returns an array of plugins that are currently loaded and activated, mapping loaded plugin names with their plugin objects, eg, array( 'UserCountry' => Plugin $pluginObject, 'UserLanguage' => Plugin $pluginObject, ); @return Plugin[]
[ "Returns", "an", "array", "of", "plugins", "that", "are", "currently", "loaded", "and", "activated", "mapping", "loaded", "plugin", "names", "with", "their", "plugin", "objects", "eg" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L947-L964
209,012
matomo-org/matomo
core/Plugin/Manager.php
Manager.getLoadedPlugin
public function getLoadedPlugin($name) { if (!isset($this->loadedPlugins[$name]) || is_null($this->loadedPlugins[$name])) { throw new \Exception("The plugin '$name' has not been loaded."); } return $this->loadedPlugins[$name]; }
php
public function getLoadedPlugin($name) { if (!isset($this->loadedPlugins[$name]) || is_null($this->loadedPlugins[$name])) { throw new \Exception("The plugin '$name' has not been loaded."); } return $this->loadedPlugins[$name]; }
[ "public", "function", "getLoadedPlugin", "(", "$", "name", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "loadedPlugins", "[", "$", "name", "]", ")", "||", "is_null", "(", "$", "this", "->", "loadedPlugins", "[", "$", "name", "]", ")", ...
Returns a Plugin object by name. @param string $name The name of the plugin, eg, `'Actions'`. @throws \Exception If the plugin has not been loaded. @return Plugin
[ "Returns", "a", "Plugin", "object", "by", "name", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L995-L1001
209,013
matomo-org/matomo
core/Plugin/Manager.php
Manager.reloadActivatedPlugins
private function reloadActivatedPlugins() { $pluginsToPostPendingEventsTo = array(); foreach ($this->pluginsToLoad as $pluginName) { $pluginsToPostPendingEventsTo = $this->reloadActivatedPlugin($pluginName, $pluginsToPostPendingEventsTo); } // post pending events after a...
php
private function reloadActivatedPlugins() { $pluginsToPostPendingEventsTo = array(); foreach ($this->pluginsToLoad as $pluginName) { $pluginsToPostPendingEventsTo = $this->reloadActivatedPlugin($pluginName, $pluginsToPostPendingEventsTo); } // post pending events after a...
[ "private", "function", "reloadActivatedPlugins", "(", ")", "{", "$", "pluginsToPostPendingEventsTo", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "pluginsToLoad", "as", "$", "pluginName", ")", "{", "$", "pluginsToPostPendingEventsTo", "=", "$"...
Load the plugins classes installed. Register the observers for every plugin.
[ "Load", "the", "plugins", "classes", "installed", ".", "Register", "the", "observers", "for", "every", "plugin", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L1007-L1018
209,014
matomo-org/matomo
core/Plugin/Manager.php
Manager.unloadPlugins
public function unloadPlugins() { $this->resetTransientCache(); $pluginsLoaded = $this->getLoadedPlugins(); foreach ($pluginsLoaded as $plugin) { $this->unloadPlugin($plugin); } }
php
public function unloadPlugins() { $this->resetTransientCache(); $pluginsLoaded = $this->getLoadedPlugins(); foreach ($pluginsLoaded as $plugin) { $this->unloadPlugin($plugin); } }
[ "public", "function", "unloadPlugins", "(", ")", "{", "$", "this", "->", "resetTransientCache", "(", ")", ";", "$", "pluginsLoaded", "=", "$", "this", "->", "getLoadedPlugins", "(", ")", ";", "foreach", "(", "$", "pluginsLoaded", "as", "$", "plugin", ")", ...
Unload all loaded plugins
[ "Unload", "all", "loaded", "plugins" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L1227-L1235
209,015
matomo-org/matomo
core/Plugin/Manager.php
Manager.executePluginInstall
private function executePluginInstall(Plugin $plugin) { try { $plugin->install(); } catch (\Exception $e) { throw new \Piwik\Plugin\PluginException($plugin->getPluginName(), $e->getMessage()); } }
php
private function executePluginInstall(Plugin $plugin) { try { $plugin->install(); } catch (\Exception $e) { throw new \Piwik\Plugin\PluginException($plugin->getPluginName(), $e->getMessage()); } }
[ "private", "function", "executePluginInstall", "(", "Plugin", "$", "plugin", ")", "{", "try", "{", "$", "plugin", "->", "install", "(", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", "throw", "new", "\\", "Piwik", "\\", "Plugin", ...
Install a specific plugin @param Plugin $plugin @throws \Piwik\Plugin\PluginException if installation fails
[ "Install", "a", "specific", "plugin" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L1243-L1250
209,016
matomo-org/matomo
core/Plugin/Manager.php
Manager.addLoadedPlugin
public function addLoadedPlugin($pluginName, Plugin $newPlugin) { $this->resetTransientCache(); $this->loadedPlugins[$pluginName] = $newPlugin; }
php
public function addLoadedPlugin($pluginName, Plugin $newPlugin) { $this->resetTransientCache(); $this->loadedPlugins[$pluginName] = $newPlugin; }
[ "public", "function", "addLoadedPlugin", "(", "$", "pluginName", ",", "Plugin", "$", "newPlugin", ")", "{", "$", "this", "->", "resetTransientCache", "(", ")", ";", "$", "this", "->", "loadedPlugins", "[", "$", "pluginName", "]", "=", "$", "newPlugin", ";"...
Add a plugin in the loaded plugins array @param string $pluginName plugin name without prefix (eg. 'UserCountry') @param Plugin $newPlugin @internal
[ "Add", "a", "plugin", "in", "the", "loaded", "plugins", "array" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L1259-L1264
209,017
matomo-org/matomo
core/Plugin/Manager.php
Manager.getMissingPlugins
public function getMissingPlugins() { $missingPlugins = array(); $plugins = $this->pluginList->getActivatedPlugins(); foreach ($plugins as $pluginName) { // if a plugin is listed in the config, but is not loaded, it does not exist in the folder if (!$this->isPluginL...
php
public function getMissingPlugins() { $missingPlugins = array(); $plugins = $this->pluginList->getActivatedPlugins(); foreach ($plugins as $pluginName) { // if a plugin is listed in the config, but is not loaded, it does not exist in the folder if (!$this->isPluginL...
[ "public", "function", "getMissingPlugins", "(", ")", "{", "$", "missingPlugins", "=", "array", "(", ")", ";", "$", "plugins", "=", "$", "this", "->", "pluginList", "->", "getActivatedPlugins", "(", ")", ";", "foreach", "(", "$", "plugins", "as", "$", "pl...
Returns names of plugins that should be loaded, but cannot be since their files cannot be found. @return array @api
[ "Returns", "names", "of", "plugins", "that", "should", "be", "loaded", "but", "cannot", "be", "since", "their", "files", "cannot", "be", "found", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L1285-L1300
209,018
matomo-org/matomo
core/Plugin/Manager.php
Manager.installPluginIfNecessary
private function installPluginIfNecessary(Plugin $plugin) { $pluginName = $plugin->getPluginName(); $saveConfig = false; // is the plugin already installed or is it the first time we activate it? $pluginsInstalled = $this->getInstalledPluginsName(); if (!$this->isPluginInst...
php
private function installPluginIfNecessary(Plugin $plugin) { $pluginName = $plugin->getPluginName(); $saveConfig = false; // is the plugin already installed or is it the first time we activate it? $pluginsInstalled = $this->getInstalledPluginsName(); if (!$this->isPluginInst...
[ "private", "function", "installPluginIfNecessary", "(", "Plugin", "$", "plugin", ")", "{", "$", "pluginName", "=", "$", "plugin", "->", "getPluginName", "(", ")", ";", "$", "saveConfig", "=", "false", ";", "// is the plugin already installed or is it the first time we...
Install a plugin, if necessary @param Plugin $plugin
[ "Install", "a", "plugin", "if", "necessary" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L1307-L1337
209,019
matomo-org/matomo
plugins/CoreHome/Columns/Metrics/EvolutionMetric.php
EvolutionMetric.getPastRowFromCurrent
public function getPastRowFromCurrent(Row $row) { $pastData = $this->getPastDataTable(); if (empty($pastData)) { return null; } $label = $row->getColumn('label'); return $label ? $pastData->getRowFromLabel($label) : $pastData->getFirstRow(); }
php
public function getPastRowFromCurrent(Row $row) { $pastData = $this->getPastDataTable(); if (empty($pastData)) { return null; } $label = $row->getColumn('label'); return $label ? $pastData->getRowFromLabel($label) : $pastData->getFirstRow(); }
[ "public", "function", "getPastRowFromCurrent", "(", "Row", "$", "row", ")", "{", "$", "pastData", "=", "$", "this", "->", "getPastDataTable", "(", ")", ";", "if", "(", "empty", "(", "$", "pastData", ")", ")", "{", "return", "null", ";", "}", "$", "la...
public for Insights use.
[ "public", "for", "Insights", "use", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Columns/Metrics/EvolutionMetric.php#L144-L153
209,020
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.isValidReportForSite
public function isValidReportForSite($idSite, $apiMethodUniqueId) { $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId); return !empty($report); }
php
public function isValidReportForSite($idSite, $apiMethodUniqueId) { $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId); return !empty($report); }
[ "public", "function", "isValidReportForSite", "(", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", "{", "$", "report", "=", "$", "this", "->", "getReportMetadataByUniqueId", "(", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", ";", "return", "!", "empty"...
Verfies whether the given report exists for the given site. @param int $idSite @param string $apiMethodUniqueId For example 'MultiSites_getAll' @return bool
[ "Verfies", "whether", "the", "given", "report", "exists", "for", "the", "given", "site", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L102-L107
209,021
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.isValidMetricForReport
public function isValidMetricForReport($metric, $idSite, $apiMethodUniqueId) { $translation = $this->translateMetric($metric, $idSite, $apiMethodUniqueId); return !empty($translation); }
php
public function isValidMetricForReport($metric, $idSite, $apiMethodUniqueId) { $translation = $this->translateMetric($metric, $idSite, $apiMethodUniqueId); return !empty($translation); }
[ "public", "function", "isValidMetricForReport", "(", "$", "metric", ",", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", "{", "$", "translation", "=", "$", "this", "->", "translateMetric", "(", "$", "metric", ",", "$", "idSite", ",", "$", "apiMethodUnique...
Verfies whether the given metric belongs to the given report. @param int $idSite @param string $metric For example 'nb_visits' @param string $apiMethodUniqueId For example 'MultiSites_getAll' @return bool
[ "Verfies", "whether", "the", "given", "metric", "belongs", "to", "the", "given", "report", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L118-L123
209,022
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.translateMetric
public function translateMetric($metric, $idSite, $apiMethodUniqueId) { $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId); if (empty($report)) { return; } $properties = array('metrics', 'processedMetrics', 'processedMetricsGoal'); foreac...
php
public function translateMetric($metric, $idSite, $apiMethodUniqueId) { $report = $this->getReportMetadataByUniqueId($idSite, $apiMethodUniqueId); if (empty($report)) { return; } $properties = array('metrics', 'processedMetrics', 'processedMetricsGoal'); foreac...
[ "public", "function", "translateMetric", "(", "$", "metric", ",", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", "{", "$", "report", "=", "$", "this", "->", "getReportMetadataByUniqueId", "(", "$", "idSite", ",", "$", "apiMethodUniqueId", ")", ";", "if",...
Translates the given metric in case the report exists and in case the metric acutally belongs to the report. @param string $metric For example 'nb_visits' @param int $idSite @param string $apiMethodUniqueId For example 'MultiSites_getAll' @return null|string
[ "Translates", "the", "given", "metric", "in", "case", "the", "report", "exists", "and", "in", "case", "the", "metric", "acutally", "belongs", "to", "the", "report", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L145-L160
209,023
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.removeEmptyColumns
private function removeEmptyColumns(&$columns, &$reportMetadata, $dataTable) { $emptyColumns = $dataTable->getMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME); if (!is_array($emptyColumns)) { return; } $columnsToRemove = $this->getColumnsToRemove(); $columnsToKe...
php
private function removeEmptyColumns(&$columns, &$reportMetadata, $dataTable) { $emptyColumns = $dataTable->getMetadata(DataTable::EMPTY_COLUMNS_METADATA_NAME); if (!is_array($emptyColumns)) { return; } $columnsToRemove = $this->getColumnsToRemove(); $columnsToKe...
[ "private", "function", "removeEmptyColumns", "(", "&", "$", "columns", ",", "&", "$", "reportMetadata", ",", "$", "dataTable", ")", "{", "$", "emptyColumns", "=", "$", "dataTable", "->", "getMetadata", "(", "DataTable", "::", "EMPTY_COLUMNS_METADATA_NAME", ")", ...
Removes metrics from the list of columns and the report meta data if they are marked empty in the data table meta data.
[ "Removes", "metrics", "from", "the", "list", "of", "columns", "and", "the", "report", "meta", "data", "if", "they", "are", "marked", "empty", "in", "the", "data", "table", "meta", "data", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L510-L530
209,024
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.hideShowMetrics
private function hideShowMetrics($columns, $emptyColumns = array()) { if (!is_array($columns)) { return $columns; } // remove columns if hideColumns query parameters exist $columnsToRemove = $this->getColumnsToRemove(); // remove columns if showColumns query par...
php
private function hideShowMetrics($columns, $emptyColumns = array()) { if (!is_array($columns)) { return $columns; } // remove columns if hideColumns query parameters exist $columnsToRemove = $this->getColumnsToRemove(); // remove columns if showColumns query par...
[ "private", "function", "hideShowMetrics", "(", "$", "columns", ",", "$", "emptyColumns", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "columns", ")", ")", "{", "return", "$", "columns", ";", "}", "// remove columns if hideColumns...
Removes column names from an array based on the values in the hideColumns, showColumns query parameters. This is a hack that provides the ColumnDelete filter functionality in processed reports. @param array $columns List of metrics shown in a processed report. @param array $emptyColumns Empty columns from the data tab...
[ "Removes", "column", "names", "from", "an", "array", "based", "on", "the", "values", "in", "the", "hideColumns", "showColumns", "query", "parameters", ".", "This", "is", "a", "hack", "that", "provides", "the", "ColumnDelete", "filter", "functionality", "in", "...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L541-L554
209,025
matomo-org/matomo
plugins/API/ProcessedReport.php
ProcessedReport.getPrettyValue
public static function getPrettyValue(Formatter $formatter, $idSite, $columnName, $value) { if (!is_numeric($value)) { return $value; } // Display time in human readable if (strpos($columnName, 'time_generation') !== false) { return $formatter->getPrettyTimeFromSeconds($val...
php
public static function getPrettyValue(Formatter $formatter, $idSite, $columnName, $value) { if (!is_numeric($value)) { return $value; } // Display time in human readable if (strpos($columnName, 'time_generation') !== false) { return $formatter->getPrettyTimeFromSeconds($val...
[ "public", "static", "function", "getPrettyValue", "(", "Formatter", "$", "formatter", ",", "$", "idSite", ",", "$", "columnName", ",", "$", "value", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", ...
Prettifies a metric value based on the column name. @param int $idSite The ID of the site the metric is for (used if the column value is an amount of money). @param string $columnName The metric name. @param mixed $value The metric value. @param bool $isHtml If true, replaces all spaces with `' '`. @return string
[ "Prettifies", "a", "metric", "value", "based", "on", "the", "column", "name", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/ProcessedReport.php#L827-L855
209,026
matomo-org/matomo
libs/Zend/Validate/Ip.php
Zend_Validate_Ip._validateIPv4
protected function _validateIPv4($value) { $ip2long = ip2long($value); if($ip2long === false) { return false; } return $value == long2ip($ip2long); }
php
protected function _validateIPv4($value) { $ip2long = ip2long($value); if($ip2long === false) { return false; } return $value == long2ip($ip2long); }
[ "protected", "function", "_validateIPv4", "(", "$", "value", ")", "{", "$", "ip2long", "=", "ip2long", "(", "$", "value", ")", ";", "if", "(", "$", "ip2long", "===", "false", ")", "{", "return", "false", ";", "}", "return", "$", "value", "==", "long2...
Validates an IPv4 address @param string $value
[ "Validates", "an", "IPv4", "address" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Ip.php#L145-L152
209,027
matomo-org/matomo
libs/Zend/Validate/Ip.php
Zend_Validate_Ip._validateIPv6
protected function _validateIPv6($value) { if (strlen($value) < 3) { return $value == '::'; } if (strpos($value, '.')) { $lastcolon = strrpos($value, ':'); if (!($lastcolon && $this->_validateIPv4(substr($value, $lastcolon + 1)))) { return fal...
php
protected function _validateIPv6($value) { if (strlen($value) < 3) { return $value == '::'; } if (strpos($value, '.')) { $lastcolon = strrpos($value, ':'); if (!($lastcolon && $this->_validateIPv4(substr($value, $lastcolon + 1)))) { return fal...
[ "protected", "function", "_validateIPv6", "(", "$", "value", ")", "{", "if", "(", "strlen", "(", "$", "value", ")", "<", "3", ")", "{", "return", "$", "value", "==", "'::'", ";", "}", "if", "(", "strpos", "(", "$", "value", ",", "'.'", ")", ")", ...
Validates an IPv6 address @param string $value Value to check against @return boolean True when $value is a valid ipv6 address False otherwise
[ "Validates", "an", "IPv6", "address" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Ip.php#L161-L190
209,028
matomo-org/matomo
core/Unzip.php
Unzip.factory
public static function factory($name, $filename) { switch ($name) { case 'ZipArchive': if (class_exists('ZipArchive', false)) { return new ZipArchive($filename); } break; case 'tar.gz': return new Ta...
php
public static function factory($name, $filename) { switch ($name) { case 'ZipArchive': if (class_exists('ZipArchive', false)) { return new ZipArchive($filename); } break; case 'tar.gz': return new Ta...
[ "public", "static", "function", "factory", "(", "$", "name", ",", "$", "filename", ")", "{", "switch", "(", "$", "name", ")", "{", "case", "'ZipArchive'", ":", "if", "(", "class_exists", "(", "'ZipArchive'", ",", "false", ")", ")", "{", "return", "new"...
Factory method to create an unarchiver @param string $name Name of unarchiver @param string $filename Name of .zip archive @return \Piwik\Decompress\DecompressInterface
[ "Factory", "method", "to", "create", "an", "unarchiver" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Unzip.php#L28-L55
209,029
matomo-org/matomo
plugins/Login/Auth.php
Auth.setPassword
public function setPassword($password) { if (empty($password)) { $this->hashedPassword = null; } else { $this->hashedPassword = UsersManager::getPasswordHash($password); } }
php
public function setPassword($password) { if (empty($password)) { $this->hashedPassword = null; } else { $this->hashedPassword = UsersManager::getPasswordHash($password); } }
[ "public", "function", "setPassword", "(", "$", "password", ")", "{", "if", "(", "empty", "(", "$", "password", ")", ")", "{", "$", "this", "->", "hashedPassword", "=", "null", ";", "}", "else", "{", "$", "this", "->", "hashedPassword", "=", "UsersManag...
Sets the password to authenticate with. @param string $password
[ "Sets", "the", "password", "to", "authenticate", "with", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Auth.php#L169-L176
209,030
matomo-org/matomo
plugins/Login/Auth.php
Auth.setPasswordHash
public function setPasswordHash($passwordHash) { if ($passwordHash === null) { $this->hashedPassword = null; return; } // check that the password hash is valid (sanity check) UsersManager::checkPasswordHash($passwordHash, Piwik::translate('Login_ExceptionPass...
php
public function setPasswordHash($passwordHash) { if ($passwordHash === null) { $this->hashedPassword = null; return; } // check that the password hash is valid (sanity check) UsersManager::checkPasswordHash($passwordHash, Piwik::translate('Login_ExceptionPass...
[ "public", "function", "setPasswordHash", "(", "$", "passwordHash", ")", "{", "if", "(", "$", "passwordHash", "===", "null", ")", "{", "$", "this", "->", "hashedPassword", "=", "null", ";", "return", ";", "}", "// check that the password hash is valid (sanity check...
Sets the password hash to use when authentication. @param string $passwordHash The password hash.
[ "Sets", "the", "password", "hash", "to", "use", "when", "authentication", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/Auth.php#L183-L194
209,031
matomo-org/matomo
core/Plugin/API.php
API.getInstance
public static function getInstance() { $class = get_called_class(); if (!isset(self::$instances[$class])) { $container = StaticContainer::getContainer(); $refl = new \ReflectionClass($class); if (!$refl->getConstructor() || $refl->getConstructor()->isPublic()) ...
php
public static function getInstance() { $class = get_called_class(); if (!isset(self::$instances[$class])) { $container = StaticContainer::getContainer(); $refl = new \ReflectionClass($class); if (!$refl->getConstructor() || $refl->getConstructor()->isPublic()) ...
[ "public", "static", "function", "getInstance", "(", ")", "{", "$", "class", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "isset", "(", "self", "::", "$", "instances", "[", "$", "class", "]", ")", ")", "{", "$", "container", "=", "StaticCon...
Returns the singleton instance for the derived class. If the singleton instance has not been created, this method will create it. @return static
[ "Returns", "the", "singleton", "instance", "for", "the", "derived", "class", ".", "If", "the", "singleton", "instance", "has", "not", "been", "created", "this", "method", "will", "create", "it", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/API.php#L53-L75
209,032
matomo-org/matomo
libs/Zend/Mail/Storage/Maildir.php
Zend_Mail_Storage_Maildir._getFileData
protected function _getFileData($id, $field = null) { if (!isset($this->_files[$id - 1])) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('id does not exist'); ...
php
protected function _getFileData($id, $field = null) { if (!isset($this->_files[$id - 1])) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception('id does not exist'); ...
[ "protected", "function", "_getFileData", "(", "$", "id", ",", "$", "field", "=", "null", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "_files", "[", "$", "id", "-", "1", "]", ")", ")", "{", "/**\n * @see Zend_Mail_Storage_Except...
Get one or all fields from file structure. Also checks if message is valid @param int $id message number @param string|null $field wanted field @return string|array wanted field or all fields as array @throws Zend_Mail_Storage_Exception
[ "Get", "one", "or", "all", "fields", "from", "file", "structure", ".", "Also", "checks", "if", "message", "is", "valid" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Maildir.php#L119-L142
209,033
matomo-org/matomo
libs/Zend/Mail/Storage/Maildir.php
Zend_Mail_Storage_Maildir._isMaildir
protected function _isMaildir($dirname) { if (file_exists($dirname . '/new') && !is_dir($dirname . '/new')) { return false; } if (file_exists($dirname . '/tmp') && !is_dir($dirname . '/tmp')) { return false; } return is_dir($dirname . '/cur'); }
php
protected function _isMaildir($dirname) { if (file_exists($dirname . '/new') && !is_dir($dirname . '/new')) { return false; } if (file_exists($dirname . '/tmp') && !is_dir($dirname . '/tmp')) { return false; } return is_dir($dirname . '/cur'); }
[ "protected", "function", "_isMaildir", "(", "$", "dirname", ")", "{", "if", "(", "file_exists", "(", "$", "dirname", ".", "'/new'", ")", "&&", "!", "is_dir", "(", "$", "dirname", ".", "'/new'", ")", ")", "{", "return", "false", ";", "}", "if", "(", ...
check if a given dir is a valid maildir @param string $dirname name of dir @return bool dir is valid maildir
[ "check", "if", "a", "given", "dir", "is", "a", "valid", "maildir" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Maildir.php#L296-L305
209,034
matomo-org/matomo
libs/Zend/Mail/Storage/Maildir.php
Zend_Mail_Storage_Maildir._openMaildir
protected function _openMaildir($dirname) { if ($this->_files) { $this->close(); } $dh = @opendir($dirname . '/cur/'); if (!$dh) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php...
php
protected function _openMaildir($dirname) { if ($this->_files) { $this->close(); } $dh = @opendir($dirname . '/cur/'); if (!$dh) { /** * @see Zend_Mail_Storage_Exception */ // require_once 'Zend/Mail/Storage/Exception.php...
[ "protected", "function", "_openMaildir", "(", "$", "dirname", ")", "{", "if", "(", "$", "this", "->", "_files", ")", "{", "$", "this", "->", "close", "(", ")", ";", "}", "$", "dh", "=", "@", "opendir", "(", "$", "dirname", ".", "'/cur/'", ")", ";...
open given dir as current maildir @param string $dirname name of maildir @return null @throws Zend_Mail_Storage_Exception
[ "open", "given", "dir", "as", "current", "maildir" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Maildir.php#L314-L342
209,035
matomo-org/matomo
libs/Zend/Mail/Storage/Maildir.php
Zend_Mail_Storage_Maildir._getMaildirFiles
protected function _getMaildirFiles($dh, $dirname, $default_flags = array()) { while (($entry = readdir($dh)) !== false) { if ($entry[0] == '.' || !is_file($dirname . $entry)) { continue; } @list($uniq, $info) = explode(':', $entry, 2); @list(...
php
protected function _getMaildirFiles($dh, $dirname, $default_flags = array()) { while (($entry = readdir($dh)) !== false) { if ($entry[0] == '.' || !is_file($dirname . $entry)) { continue; } @list($uniq, $info) = explode(':', $entry, 2); @list(...
[ "protected", "function", "_getMaildirFiles", "(", "$", "dh", ",", "$", "dirname", ",", "$", "default_flags", "=", "array", "(", ")", ")", "{", "while", "(", "(", "$", "entry", "=", "readdir", "(", "$", "dh", ")", ")", "!==", "false", ")", "{", "if"...
find all files in opened dir handle and add to maildir files @param resource $dh dir handle used for search @param string $dirname dirname of dir in $dh @param array $default_flags default flags for given dir @return null
[ "find", "all", "files", "in", "opened", "dir", "handle", "and", "add", "to", "maildir", "files" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Storage/Maildir.php#L352-L388
209,036
matomo-org/matomo
core/CronArchive/SharedSiteIds.php
SharedSiteIds.runExclusive
private function runExclusive($closure) { $process = new Process('archive.sharedsiteids'); while ($process->isRunning() && $process->getSecondsSinceCreation() < 5) { // wait max 5 seconds, such an operation should not take longer usleep(25 * 1000); } $proces...
php
private function runExclusive($closure) { $process = new Process('archive.sharedsiteids'); while ($process->isRunning() && $process->getSecondsSinceCreation() < 5) { // wait max 5 seconds, such an operation should not take longer usleep(25 * 1000); } $proces...
[ "private", "function", "runExclusive", "(", "$", "closure", ")", "{", "$", "process", "=", "new", "Process", "(", "'archive.sharedsiteids'", ")", ";", "while", "(", "$", "process", "->", "isRunning", "(", ")", "&&", "$", "process", "->", "getSecondsSinceCrea...
If there are multiple archiver running on the same node it makes sure only one of them performs an action and it will wait until another one has finished. Any closure you pass here should be very fast as other processes wait for this closure to finish otherwise. Currently only used for making multiple archivers at the ...
[ "If", "there", "are", "multiple", "archiver", "running", "on", "the", "same", "node", "it", "makes", "sure", "only", "one", "of", "them", "performs", "an", "action", "and", "it", "will", "wait", "until", "another", "one", "has", "finished", ".", "Any", "...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive/SharedSiteIds.php#L129-L150
209,037
matomo-org/matomo
core/CronArchive/SharedSiteIds.php
SharedSiteIds.getNextSiteId
public function getNextSiteId() { if ($this->done) { // we make sure we don't check again whether there are more sites to be archived as the list of // sharedSiteIds may have been reset by now. return null; } $self = $this; $this->currentSiteId =...
php
public function getNextSiteId() { if ($this->done) { // we make sure we don't check again whether there are more sites to be archived as the list of // sharedSiteIds may have been reset by now. return null; } $self = $this; $this->currentSiteId =...
[ "public", "function", "getNextSiteId", "(", ")", "{", "if", "(", "$", "this", "->", "done", ")", "{", "// we make sure we don't check again whether there are more sites to be archived as the list of", "// sharedSiteIds may have been reset by now.", "return", "null", ";", "}", ...
Get the next site id that needs to be processed or null if all site ids where processed. @return int|null
[ "Get", "the", "next", "site", "id", "that", "needs", "to", "be", "processed", "or", "null", "if", "all", "site", "ids", "where", "processed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/CronArchive/SharedSiteIds.php#L157-L196
209,038
matomo-org/matomo
core/Session/SessionInitializer.php
SessionInitializer.initSession
public function initSession(AuthInterface $auth) { $this->regenerateSessionId(); $authResult = $this->doAuthenticateSession($auth); if (!$authResult->wasAuthenticationSuccessful()) { Piwik::postEvent('Login.authenticate.failed', array($auth->getLogin())); $this->p...
php
public function initSession(AuthInterface $auth) { $this->regenerateSessionId(); $authResult = $this->doAuthenticateSession($auth); if (!$authResult->wasAuthenticationSuccessful()) { Piwik::postEvent('Login.authenticate.failed', array($auth->getLogin())); $this->p...
[ "public", "function", "initSession", "(", "AuthInterface", "$", "auth", ")", "{", "$", "this", "->", "regenerateSessionId", "(", ")", ";", "$", "authResult", "=", "$", "this", "->", "doAuthenticateSession", "(", "$", "auth", ")", ";", "if", "(", "!", "$"...
Authenticates the user and, if successful, initializes an authenticated session. @param \Piwik\Auth $auth The Auth implementation to use. @throws Exception If authentication fails or the user is not allowed to login for some reason.
[ "Authenticates", "the", "user", "and", "if", "successful", "initializes", "an", "authenticated", "session", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Session/SessionInitializer.php#L28-L45
209,039
matomo-org/matomo
libs/Zend/Validate/CreditCard.php
Zend_Validate_CreditCard.addType
public function addType($type) { if (is_string($type)) { $type = array($type); } foreach($type as $typ) { if (defined('self::' . strtoupper($typ)) && !in_array($typ, $this->_type)) { $this->_type[] = $typ; } if (($typ == self:...
php
public function addType($type) { if (is_string($type)) { $type = array($type); } foreach($type as $typ) { if (defined('self::' . strtoupper($typ)) && !in_array($typ, $this->_type)) { $this->_type[] = $typ; } if (($typ == self:...
[ "public", "function", "addType", "(", "$", "type", ")", "{", "if", "(", "is_string", "(", "$", "type", ")", ")", "{", "$", "type", "=", "array", "(", "$", "type", ")", ";", "}", "foreach", "(", "$", "type", "as", "$", "typ", ")", "{", "if", "...
Adds a CCI to be accepted by validation @param string|array $type Type to allow for validation @return Zend_Validate_CreditCard Provides a fluid interface
[ "Adds", "a", "CCI", "to", "be", "accepted", "by", "validation" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/CreditCard.php#L193-L210
209,040
matomo-org/matomo
plugins/ExamplePlugin/Updates/0.0.2.php
Updates_0_0_2.getMigrations
public function getMigrations(Updater $updater) { // many different migrations are available to be used via $this->migration factory $migration1 = $this->migration->db->changeColumnType('log_visit', 'example', 'BOOLEAN NOT NULL'); // you can also define custom SQL migrations. If you need to ...
php
public function getMigrations(Updater $updater) { // many different migrations are available to be used via $this->migration factory $migration1 = $this->migration->db->changeColumnType('log_visit', 'example', 'BOOLEAN NOT NULL'); // you can also define custom SQL migrations. If you need to ...
[ "public", "function", "getMigrations", "(", "Updater", "$", "updater", ")", "{", "// many different migrations are available to be used via $this->migration factory", "$", "migration1", "=", "$", "this", "->", "migration", "->", "db", "->", "changeColumnType", "(", "'log_...
Return database migrations to be executed in this update. Database migrations should be defined here, instead of in `doUpdate()`, since this method is used in the `core:update` command when displaying the queries an update will run. If you execute migrations directly in `doUpdate()`, they won't be displayed to the use...
[ "Return", "database", "migrations", "to", "be", "executed", "in", "this", "update", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExamplePlugin/Updates/0.0.2.php#L43-L54
209,041
matomo-org/matomo
core/Updates/2.14.2.php
Updates_2_14_2.getMigrations
public function getMigrations(Updater $updater) { $visitMigrations = $this->getMigrationsThatRemoveOptionEntriesOfNotActuallyInstalledColumns(VisitDimension::INSTALLER_PREFIX, 'log_visit'); $actionMigrations = $this->getMigrationsThatRemoveOptionEntriesOfNotActuallyInstalledColumns(ActionDimension::...
php
public function getMigrations(Updater $updater) { $visitMigrations = $this->getMigrationsThatRemoveOptionEntriesOfNotActuallyInstalledColumns(VisitDimension::INSTALLER_PREFIX, 'log_visit'); $actionMigrations = $this->getMigrationsThatRemoveOptionEntriesOfNotActuallyInstalledColumns(ActionDimension::...
[ "public", "function", "getMigrations", "(", "Updater", "$", "updater", ")", "{", "$", "visitMigrations", "=", "$", "this", "->", "getMigrationsThatRemoveOptionEntriesOfNotActuallyInstalledColumns", "(", "VisitDimension", "::", "INSTALLER_PREFIX", ",", "'log_visit'", ")", ...
Removes option entries for columns that are marked as installed but are actually no longer installed due to a bug in previous versions where the option entries were not correctly removed. @param Updater $updater @return array
[ "Removes", "option", "entries", "for", "columns", "that", "are", "marked", "as", "installed", "but", "are", "actually", "no", "longer", "installed", "due", "to", "a", "bug", "in", "previous", "versions", "where", "the", "option", "entries", "were", "not", "c...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/2.14.2.php#L45-L66
209,042
matomo-org/matomo
plugins/UserId/Archiver.php
Archiver.aggregateUsers
protected function aggregateUsers() { $userIdFieldName = self::USER_ID_FIELD; $visitorIdFieldName = self::VISITOR_ID_FIELD; /** @var \Zend_Db_Statement $query */ $query = $this->getLogAggregator()->queryVisitsByDimension( array(self::USER_ID_FIELD), "log_visi...
php
protected function aggregateUsers() { $userIdFieldName = self::USER_ID_FIELD; $visitorIdFieldName = self::VISITOR_ID_FIELD; /** @var \Zend_Db_Statement $query */ $query = $this->getLogAggregator()->queryVisitsByDimension( array(self::USER_ID_FIELD), "log_visi...
[ "protected", "function", "aggregateUsers", "(", ")", "{", "$", "userIdFieldName", "=", "self", "::", "USER_ID_FIELD", ";", "$", "visitorIdFieldName", "=", "self", "::", "VISITOR_ID_FIELD", ";", "/** @var \\Zend_Db_Statement $query */", "$", "query", "=", "$", "this"...
Used to aggregate daily data per user ID
[ "Used", "to", "aggregate", "daily", "data", "per", "user", "ID" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserId/Archiver.php#L75-L97
209,043
matomo-org/matomo
plugins/UserId/Archiver.php
Archiver.insertDayReports
protected function insertDayReports() { /** @var DataTable $dataTable */ $dataTable = $this->arrays->asDataTable(); $this->setVisitorIds($dataTable); $report = $dataTable->getSerialized($this->maximumRowsInDataTableLevelZero, null, Metrics::INDEX_NB_VISITS); $this->getProcess...
php
protected function insertDayReports() { /** @var DataTable $dataTable */ $dataTable = $this->arrays->asDataTable(); $this->setVisitorIds($dataTable); $report = $dataTable->getSerialized($this->maximumRowsInDataTableLevelZero, null, Metrics::INDEX_NB_VISITS); $this->getProcess...
[ "protected", "function", "insertDayReports", "(", ")", "{", "/** @var DataTable $dataTable */", "$", "dataTable", "=", "$", "this", "->", "arrays", "->", "asDataTable", "(", ")", ";", "$", "this", "->", "setVisitorIds", "(", "$", "dataTable", ")", ";", "$", ...
Insert aggregated daily data serialized @throws \Exception
[ "Insert", "aggregated", "daily", "data", "serialized" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserId/Archiver.php#L104-L111
209,044
matomo-org/matomo
plugins/UserId/Archiver.php
Archiver.rememberVisitorId
private function rememberVisitorId($row) { if (!empty($row[self::USER_ID_FIELD]) && !empty($row[self::VISITOR_ID_FIELD])) { $this->visitorIdsUserIdsMap[$row[self::USER_ID_FIELD]] = $row[self::VISITOR_ID_FIELD]; } }
php
private function rememberVisitorId($row) { if (!empty($row[self::USER_ID_FIELD]) && !empty($row[self::VISITOR_ID_FIELD])) { $this->visitorIdsUserIdsMap[$row[self::USER_ID_FIELD]] = $row[self::VISITOR_ID_FIELD]; } }
[ "private", "function", "rememberVisitorId", "(", "$", "row", ")", "{", "if", "(", "!", "empty", "(", "$", "row", "[", "self", "::", "USER_ID_FIELD", "]", ")", "&&", "!", "empty", "(", "$", "row", "[", "self", "::", "VISITOR_ID_FIELD", "]", ")", ")", ...
Remember visitor ID per user. We use it to fill metadata before actual inserting rows to DB. @param array $row
[ "Remember", "visitor", "ID", "per", "user", ".", "We", "use", "it", "to", "fill", "metadata", "before", "actual", "inserting", "rows", "to", "DB", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserId/Archiver.php#L118-L123
209,045
matomo-org/matomo
plugins/UserId/Archiver.php
Archiver.setVisitorIds
private function setVisitorIds(DataTable $dataTable) { foreach ($dataTable->getRows() as $row) { $userId = $row->getColumn('label'); if (isset($this->visitorIdsUserIdsMap[$userId])) { $row->setMetadata(self::VISITOR_ID_FIELD, $this->visitorIdsUserIdsMap[$userId]); ...
php
private function setVisitorIds(DataTable $dataTable) { foreach ($dataTable->getRows() as $row) { $userId = $row->getColumn('label'); if (isset($this->visitorIdsUserIdsMap[$userId])) { $row->setMetadata(self::VISITOR_ID_FIELD, $this->visitorIdsUserIdsMap[$userId]); ...
[ "private", "function", "setVisitorIds", "(", "DataTable", "$", "dataTable", ")", "{", "foreach", "(", "$", "dataTable", "->", "getRows", "(", ")", "as", "$", "row", ")", "{", "$", "userId", "=", "$", "row", "->", "getColumn", "(", "'label'", ")", ";", ...
Fill visitor ID as metadata before actual inserting rows to DB. @param DataTable $dataTable
[ "Fill", "visitor", "ID", "as", "metadata", "before", "actual", "inserting", "rows", "to", "DB", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserId/Archiver.php#L130-L138
209,046
matomo-org/matomo
plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php
EncodedEntities.filter
public function filter($translations) { foreach ($translations as $pluginName => $pluginTranslations) { foreach ($pluginTranslations as $key => $translation) { if (isset($this->baseTranslations[$pluginName][$key]) && $this->baseTranslations[$pluginName][$key]...
php
public function filter($translations) { foreach ($translations as $pluginName => $pluginTranslations) { foreach ($pluginTranslations as $key => $translation) { if (isset($this->baseTranslations[$pluginName][$key]) && $this->baseTranslations[$pluginName][$key]...
[ "public", "function", "filter", "(", "$", "translations", ")", "{", "foreach", "(", "$", "translations", "as", "$", "pluginName", "=>", "$", "pluginTranslations", ")", "{", "foreach", "(", "$", "pluginTranslations", "as", "$", "key", "=>", "$", "translation"...
Decodes all encoded entities in the given translations @param array $translations @return array filtered translations
[ "Decodes", "all", "encoded", "entities", "in", "the", "given", "translations" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php#L35-L57
209,047
matomo-org/matomo
plugins/Dashboard/API.php
API.createNewDashboardForUser
public function createNewDashboardForUser($login, $dashboardName = '', $addDefaultWidgets = true) { Piwik::checkUserHasSuperUserAccessOrIsTheUser($login); $layout = '{}'; if ($addDefaultWidgets) { $layout = $this->dashboard->getDefaultLayout(); } return $this->...
php
public function createNewDashboardForUser($login, $dashboardName = '', $addDefaultWidgets = true) { Piwik::checkUserHasSuperUserAccessOrIsTheUser($login); $layout = '{}'; if ($addDefaultWidgets) { $layout = $this->dashboard->getDefaultLayout(); } return $this->...
[ "public", "function", "createNewDashboardForUser", "(", "$", "login", ",", "$", "dashboardName", "=", "''", ",", "$", "addDefaultWidgets", "=", "true", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccessOrIsTheUser", "(", "$", "login", ")", ";", "$", "layout",...
Creates a new dashboard for the given login Note: Only a super user is able to create dashboards for other users @param string $login login of the user that dashboard should be created for @param string $dashboardName name of the new dashboard @param bool $addDefaultWidgets whether to add the current default widget ...
[ "Creates", "a", "new", "dashboard", "for", "the", "given", "login" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L68-L79
209,048
matomo-org/matomo
plugins/Dashboard/API.php
API.removeDashboard
public function removeDashboard($idDashboard, $login='') { $login = $login ? $login : Piwik::getCurrentUserLogin(); Piwik::checkUserHasSuperUserAccessOrIsTheUser($login); $this->model->deleteDashboardForUser($idDashboard, $login); }
php
public function removeDashboard($idDashboard, $login='') { $login = $login ? $login : Piwik::getCurrentUserLogin(); Piwik::checkUserHasSuperUserAccessOrIsTheUser($login); $this->model->deleteDashboardForUser($idDashboard, $login); }
[ "public", "function", "removeDashboard", "(", "$", "idDashboard", ",", "$", "login", "=", "''", ")", "{", "$", "login", "=", "$", "login", "?", "$", "login", ":", "Piwik", "::", "getCurrentUserLogin", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAcc...
Removes a dashboard according to given dashboard id and login Note: Only a super user is able to remove dashboards for other users Also note: It is allowed to delete the first dashboard for a user, BUT that will cause buggy behavior if a new dashboard is not immediately added. Deleting the first dashboard (with ID = ...
[ "Removes", "a", "dashboard", "according", "to", "given", "dashboard", "id", "and", "login" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L94-L101
209,049
matomo-org/matomo
plugins/Dashboard/API.php
API.copyDashboardToUser
public function copyDashboardToUser($idDashboard, $copyToUser, $dashboardName = '') { Piwik::checkUserHasSomeAdminAccess(); // get users only returns users of sites the current user has at least admin access to $users = Request::processRequest('UsersManager.getUsers'); $userFound = ...
php
public function copyDashboardToUser($idDashboard, $copyToUser, $dashboardName = '') { Piwik::checkUserHasSomeAdminAccess(); // get users only returns users of sites the current user has at least admin access to $users = Request::processRequest('UsersManager.getUsers'); $userFound = ...
[ "public", "function", "copyDashboardToUser", "(", "$", "idDashboard", ",", "$", "copyToUser", ",", "$", "dashboardName", "=", "''", ")", "{", "Piwik", "::", "checkUserHasSomeAdminAccess", "(", ")", ";", "// get users only returns users of sites the current user has at lea...
Copy a dashboard of current user to another user Note: current user needs super user access @param int $idDashboard Id of the dashboard that should be copied @param string $copyToUser User the dashboard should be copied to @param string $dashboardName Name of the new dashboard (defaults to 'Dashboard of {user}') @ret...
[ "Copy", "a", "dashboard", "of", "current", "user", "to", "another", "user" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L114-L140
209,050
matomo-org/matomo
plugins/Dashboard/API.php
API.resetDashboardLayout
public function resetDashboardLayout($idDashboard, $login='') { $login = $login ? $login : Piwik::getCurrentUserLogin(); Piwik::checkUserHasSuperUserAccessOrIsTheUser($login); $layout = $this->dashboard->getDefaultLayout(); $this->model->updateLayoutForUser($login, $idDashboard, $...
php
public function resetDashboardLayout($idDashboard, $login='') { $login = $login ? $login : Piwik::getCurrentUserLogin(); Piwik::checkUserHasSuperUserAccessOrIsTheUser($login); $layout = $this->dashboard->getDefaultLayout(); $this->model->updateLayoutForUser($login, $idDashboard, $...
[ "public", "function", "resetDashboardLayout", "(", "$", "idDashboard", ",", "$", "login", "=", "''", ")", "{", "$", "login", "=", "$", "login", "?", "$", "login", ":", "Piwik", "::", "getCurrentUserLogin", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUs...
Resets a dashboard to the default widget configuration Note: Only a super user is able to reset dashboards for other users @param int $idDashboard dashboard id @param string $login user the dashboard belongs
[ "Resets", "a", "dashboard", "to", "the", "default", "widget", "configuration" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L151-L160
209,051
matomo-org/matomo
plugins/Dashboard/API.php
API.getDefaultDashboard
private function getDefaultDashboard() { $defaultLayout = $this->dashboard->getDefaultLayout(); $defaultLayout = $this->dashboard->decodeLayout($defaultLayout); $defaultDashboard = array('name' => Piwik::translate('Dashboard_Dashboard'), 'layout' => $defaultLayout, 'iddashboard' => 1); ...
php
private function getDefaultDashboard() { $defaultLayout = $this->dashboard->getDefaultLayout(); $defaultLayout = $this->dashboard->decodeLayout($defaultLayout); $defaultDashboard = array('name' => Piwik::translate('Dashboard_Dashboard'), 'layout' => $defaultLayout, 'iddashboard' => 1); ...
[ "private", "function", "getDefaultDashboard", "(", ")", "{", "$", "defaultLayout", "=", "$", "this", "->", "dashboard", "->", "getDefaultLayout", "(", ")", ";", "$", "defaultLayout", "=", "$", "this", "->", "dashboard", "->", "decodeLayout", "(", "$", "defau...
Get the default dashboard. @return \array[]
[ "Get", "the", "default", "dashboard", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L166-L175
209,052
matomo-org/matomo
plugins/Dashboard/API.php
API.getUserDashboards
private function getUserDashboards($userLogin) { $userDashboards = $this->dashboard->getAllDashboards($userLogin); $dashboards = array(); foreach ($userDashboards as $userDashboard) { $widgets = $this->getVisibleWidgetsWithinDashboard($userDashboard); $dashboards[] ...
php
private function getUserDashboards($userLogin) { $userDashboards = $this->dashboard->getAllDashboards($userLogin); $dashboards = array(); foreach ($userDashboards as $userDashboard) { $widgets = $this->getVisibleWidgetsWithinDashboard($userDashboard); $dashboards[] ...
[ "private", "function", "getUserDashboards", "(", "$", "userLogin", ")", "{", "$", "userDashboards", "=", "$", "this", "->", "dashboard", "->", "getAllDashboards", "(", "$", "userLogin", ")", ";", "$", "dashboards", "=", "array", "(", ")", ";", "foreach", "...
Get all dashboards which a user has created. @param string $userLogin login of the user @return \array[]
[ "Get", "all", "dashboards", "which", "a", "user", "has", "created", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/API.php#L183-L195
209,053
matomo-org/matomo
plugins/API/RowEvolution.php
RowEvolution.getSingleRowEvolution
private function getSingleRowEvolution($idSite, $dataTable, $metadata, $apiModule, $apiAction, $label, $labelUseAbsoluteUrl = true) { $metricNames = array_keys($metadata['metrics']); $logo = $actualLabel = false; $urlFound = false; foreach ($dataTable->getDataTables() as $subTable) ...
php
private function getSingleRowEvolution($idSite, $dataTable, $metadata, $apiModule, $apiAction, $label, $labelUseAbsoluteUrl = true) { $metricNames = array_keys($metadata['metrics']); $logo = $actualLabel = false; $urlFound = false; foreach ($dataTable->getDataTables() as $subTable) ...
[ "private", "function", "getSingleRowEvolution", "(", "$", "idSite", ",", "$", "dataTable", ",", "$", "metadata", ",", "$", "apiModule", ",", "$", "apiAction", ",", "$", "label", ",", "$", "labelUseAbsoluteUrl", "=", "true", ")", "{", "$", "metricNames", "=...
Get row evolution for a single label @param DataTable\Map $dataTable @param array $metadata @param string $apiModule @param string $apiAction @param string $label @param bool $labelUseAbsoluteUrl @return array containing report data, metadata, label, logo
[ "Get", "row", "evolution", "for", "a", "single", "label" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/RowEvolution.php#L141-L192
209,054
matomo-org/matomo
plugins/API/RowEvolution.php
RowEvolution.cleanOriginalLabel
private function cleanOriginalLabel($label) { $label = str_replace(LabelFilter::SEPARATOR_RECURSIVE_LABEL, ' - ', $label); $label = SafeDecodeLabel::decodeLabelSafe($label); return $label; }
php
private function cleanOriginalLabel($label) { $label = str_replace(LabelFilter::SEPARATOR_RECURSIVE_LABEL, ' - ', $label); $label = SafeDecodeLabel::decodeLabelSafe($label); return $label; }
[ "private", "function", "cleanOriginalLabel", "(", "$", "label", ")", "{", "$", "label", "=", "str_replace", "(", "LabelFilter", "::", "SEPARATOR_RECURSIVE_LABEL", ",", "' - '", ",", "$", "label", ")", ";", "$", "label", "=", "SafeDecodeLabel", "::", "decodeLab...
Returns a prettier, more comprehensible version of a row evolution label for display.
[ "Returns", "a", "prettier", "more", "comprehensible", "version", "of", "a", "row", "evolution", "label", "for", "display", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/API/RowEvolution.php#L535-L540
209,055
matomo-org/matomo
plugins/MobileMessaging/SMSProvider.php
SMSProvider.findAvailableSmsProviders
public static function findAvailableSmsProviders() { /** @var SMSProvider[] $smsProviders */ $smsProviders = Plugin\Manager::getInstance()->findMultipleComponents('SMSProvider', 'Piwik\Plugins\MobileMessaging\SMSProvider'); $providers = array(); foreach ($smsProviders as $provider)...
php
public static function findAvailableSmsProviders() { /** @var SMSProvider[] $smsProviders */ $smsProviders = Plugin\Manager::getInstance()->findMultipleComponents('SMSProvider', 'Piwik\Plugins\MobileMessaging\SMSProvider'); $providers = array(); foreach ($smsProviders as $provider)...
[ "public", "static", "function", "findAvailableSmsProviders", "(", ")", "{", "/** @var SMSProvider[] $smsProviders */", "$", "smsProviders", "=", "Plugin", "\\", "Manager", "::", "getInstance", "(", ")", "->", "findMultipleComponents", "(", "'SMSProvider'", ",", "'Piwik\...
Returns all available SMS Providers @return SMSProvider[] @ignore
[ "Returns", "all", "available", "SMS", "Providers" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/SMSProvider.php#L135-L151
209,056
matomo-org/matomo
plugins/MobileMessaging/SMSProvider.php
SMSProvider.containsUCS2Characters
public static function containsUCS2Characters($string) { $GSMCharsetAsString = implode(array_keys(GSMCharset::$GSMCharset)); foreach (self::mb_str_split($string) as $char) { if (mb_strpos($GSMCharsetAsString, $char) === false) { return true; } } ...
php
public static function containsUCS2Characters($string) { $GSMCharsetAsString = implode(array_keys(GSMCharset::$GSMCharset)); foreach (self::mb_str_split($string) as $char) { if (mb_strpos($GSMCharsetAsString, $char) === false) { return true; } } ...
[ "public", "static", "function", "containsUCS2Characters", "(", "$", "string", ")", "{", "$", "GSMCharsetAsString", "=", "implode", "(", "array_keys", "(", "GSMCharset", "::", "$", "GSMCharset", ")", ")", ";", "foreach", "(", "self", "::", "mb_str_split", "(", ...
Assert whether a given String contains UCS2 characters @param string $string @return bool true if $string contains UCS2 characters @ignore
[ "Assert", "whether", "a", "given", "String", "contains", "UCS2", "characters" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/SMSProvider.php#L160-L171
209,057
matomo-org/matomo
core/Archive/Chunk.php
Chunk.moveArchiveBlobsIntoChunks
public function moveArchiveBlobsIntoChunks($recordName, $blobs) { $chunks = array(); foreach ($blobs as $tableId => $blob) { $name = $this->getRecordNameForTableId($recordName, $tableId); if (!array_key_exists($name, $chunks)) { $chunks[$name] = array(); ...
php
public function moveArchiveBlobsIntoChunks($recordName, $blobs) { $chunks = array(); foreach ($blobs as $tableId => $blob) { $name = $this->getRecordNameForTableId($recordName, $tableId); if (!array_key_exists($name, $chunks)) { $chunks[$name] = array(); ...
[ "public", "function", "moveArchiveBlobsIntoChunks", "(", "$", "recordName", ",", "$", "blobs", ")", "{", "$", "chunks", "=", "array", "(", ")", ";", "foreach", "(", "$", "blobs", "as", "$", "tableId", "=>", "$", "blob", ")", "{", "$", "name", "=", "$...
Moves the given blobs into chunks and assigns a proper record name containing the chunk number. @param string $recordName The original archive record name, eg 'Actions_ActionsUrl' @param array $blobs An array containg a mapping of tableIds to blobs. Eg array(0 => 'blob', 1 => 'subtableBlob', ...) @return array ...
[ "Moves", "the", "given", "blobs", "into", "chunks", "and", "assigns", "a", "proper", "record", "name", "containing", "the", "chunk", "number", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/Chunk.php#L51-L66
209,058
matomo-org/matomo
core/Archive/Chunk.php
Chunk.isRecordNameAChunk
public function isRecordNameAChunk($recordName) { $posAppendix = $this->getEndPosOfChunkAppendix($recordName); if (false === $posAppendix) { return false; } // will contain "0_99" of "chunk_0_99" $blobId = substr($recordName, $posAppendix); return $this...
php
public function isRecordNameAChunk($recordName) { $posAppendix = $this->getEndPosOfChunkAppendix($recordName); if (false === $posAppendix) { return false; } // will contain "0_99" of "chunk_0_99" $blobId = substr($recordName, $posAppendix); return $this...
[ "public", "function", "isRecordNameAChunk", "(", "$", "recordName", ")", "{", "$", "posAppendix", "=", "$", "this", "->", "getEndPosOfChunkAppendix", "(", "$", "recordName", ")", ";", "if", "(", "false", "===", "$", "posAppendix", ")", "{", "return", "false"...
Detects whether a recordName like 'Actions_ActionUrls_chunk_0_99' or 'Actions_ActionUrls' belongs to a chunk or not. To be a valid recordName that belongs to a chunk it must end with '_chunk_NUMERIC_NUMERIC'. @param string $recordName @return bool
[ "Detects", "whether", "a", "recordName", "like", "Actions_ActionUrls_chunk_0_99", "or", "Actions_ActionUrls", "belongs", "to", "a", "chunk", "or", "not", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/Chunk.php#L77-L89
209,059
matomo-org/matomo
core/Archive/Chunk.php
Chunk.getRecordNameWithoutChunkAppendix
public function getRecordNameWithoutChunkAppendix($recordName) { if (!$this->isRecordNameAChunk($recordName)) { return $recordName; } $posAppendix = $this->getStartPosOfChunkAppendix($recordName); if (false === $posAppendix) { return $recordName; } ...
php
public function getRecordNameWithoutChunkAppendix($recordName) { if (!$this->isRecordNameAChunk($recordName)) { return $recordName; } $posAppendix = $this->getStartPosOfChunkAppendix($recordName); if (false === $posAppendix) { return $recordName; } ...
[ "public", "function", "getRecordNameWithoutChunkAppendix", "(", "$", "recordName", ")", "{", "if", "(", "!", "$", "this", "->", "isRecordNameAChunk", "(", "$", "recordName", ")", ")", "{", "return", "$", "recordName", ";", "}", "$", "posAppendix", "=", "$", ...
When having a record like 'Actions_ActionUrls_chunk_0_99" it will return the raw recordName 'Actions_ActionUrls'. @param string $recordName @return string
[ "When", "having", "a", "record", "like", "Actions_ActionUrls_chunk_0_99", "it", "will", "return", "the", "raw", "recordName", "Actions_ActionUrls", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/Chunk.php#L104-L117
209,060
matomo-org/matomo
plugins/Marketplace/Api/Service.php
Service.download
public function download($url, $destinationPath = null, $timeout = null) { $method = Http::getTransportMethod(); if (!isset($timeout)) { $timeout = static::HTTP_REQUEST_TIMEOUT; } $post = null; if ($this->accessToken) { $post = array('access_token' =...
php
public function download($url, $destinationPath = null, $timeout = null) { $method = Http::getTransportMethod(); if (!isset($timeout)) { $timeout = static::HTTP_REQUEST_TIMEOUT; } $post = null; if ($this->accessToken) { $post = array('access_token' =...
[ "public", "function", "download", "(", "$", "url", ",", "$", "destinationPath", "=", "null", ",", "$", "timeout", "=", "null", ")", "{", "$", "method", "=", "Http", "::", "getTransportMethod", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "timeou...
Downloads data from the given URL via a POST request. If a destination path is given, the downloaded data will be stored in the given path and returned otherwise. Make sure to call {@link authenticate()} to download paid plugins. @param string $url An absolute URL to the marketplace including domain. @param null|stri...
[ "Downloads", "data", "from", "the", "given", "URL", "via", "a", "POST", "request", ".", "If", "a", "destination", "path", "is", "given", "the", "downloaded", "data", "will", "be", "stored", "in", "the", "given", "path", "and", "returned", "otherwise", "." ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Marketplace/Api/Service.php#L86-L114
209,061
matomo-org/matomo
plugins/Marketplace/Api/Service.php
Service.fetch
public function fetch($action, $params) { $endpoint = sprintf('%s/api/%s/', $this->domain, $this->version); $query = Http::buildQuery($params); $url = sprintf('%s%s?%s', $endpoint, $action, $query); $response = $this->download($url); $result = json_decode($response, true...
php
public function fetch($action, $params) { $endpoint = sprintf('%s/api/%s/', $this->domain, $this->version); $query = Http::buildQuery($params); $url = sprintf('%s%s?%s', $endpoint, $action, $query); $response = $this->download($url); $result = json_decode($response, true...
[ "public", "function", "fetch", "(", "$", "action", ",", "$", "params", ")", "{", "$", "endpoint", "=", "sprintf", "(", "'%s/api/%s/'", ",", "$", "this", "->", "domain", ",", "$", "this", "->", "version", ")", ";", "$", "query", "=", "Http", "::", "...
Executes the given API action on the Marketplace using the given params and returns the result. Make sure to call {@link authenticate()} to download paid plugins. @param string $action eg 'plugins', 'plugins/$pluginName/info', ... @param array $params eg array('sort' => 'alpha') @return mixed @throws Service\Excep...
[ "Executes", "the", "given", "API", "action", "on", "the", "Marketplace", "using", "the", "given", "params", "and", "returns", "the", "result", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Marketplace/Api/Service.php#L126-L147
209,062
matomo-org/matomo
core/API/DataTableManipulator/ReportTotalsCalculator.php
ReportTotalsCalculator.manipulateSubtableRequest
protected function manipulateSubtableRequest($request) { $request['totals'] = 0; $request['expanded'] = 0; $request['filter_limit'] = -1; $request['filter_offset'] = 0; $request['filter_sort_column'] = ''; $parametersToRemove = array('flat'); if...
php
protected function manipulateSubtableRequest($request) { $request['totals'] = 0; $request['expanded'] = 0; $request['filter_limit'] = -1; $request['filter_offset'] = 0; $request['filter_sort_column'] = ''; $parametersToRemove = array('flat'); if...
[ "protected", "function", "manipulateSubtableRequest", "(", "$", "request", ")", "{", "$", "request", "[", "'totals'", "]", "=", "0", ";", "$", "request", "[", "'expanded'", "]", "=", "0", ";", "$", "request", "[", "'filter_limit'", "]", "=", "-", "1", ...
Make sure to get all rows of the first level table. @param array $request @return array
[ "Make", "sure", "to", "get", "all", "rows", "of", "the", "first", "level", "table", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DataTableManipulator/ReportTotalsCalculator.php#L209-L229
209,063
matomo-org/matomo
core/Settings/Storage/Backend/PluginSettingsTable.php
PluginSettingsTable.removeAllUserSettingsForUser
public static function removeAllUserSettingsForUser($userLogin) { if (empty($userLogin)) { throw new Exception('No userLogin specified. Cannot remove all settings for this user'); } try { $table = Common::prefixTable('plugin_setting'); Db::get()->query(sp...
php
public static function removeAllUserSettingsForUser($userLogin) { if (empty($userLogin)) { throw new Exception('No userLogin specified. Cannot remove all settings for this user'); } try { $table = Common::prefixTable('plugin_setting'); Db::get()->query(sp...
[ "public", "static", "function", "removeAllUserSettingsForUser", "(", "$", "userLogin", ")", "{", "if", "(", "empty", "(", "$", "userLogin", ")", ")", "{", "throw", "new", "Exception", "(", "'No userLogin specified. Cannot remove all settings for this user'", ")", ";",...
Unsets all settings for a user. The settings will be removed from the database. Used when a user is deleted. @internal @param string $userLogin @throws \Exception If the `$userLogin` is empty. Otherwise we would delete most plugin settings
[ "Unsets", "all", "settings", "for", "a", "user", ".", "The", "settings", "will", "be", "removed", "from", "the", "database", ".", "Used", "when", "a", "user", "is", "deleted", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Storage/Backend/PluginSettingsTable.php#L172-L187
209,064
matomo-org/matomo
core/Settings/Storage/Backend/PluginSettingsTable.php
PluginSettingsTable.removeAllSettingsForPlugin
public static function removeAllSettingsForPlugin($pluginName) { try { $table = Common::prefixTable('plugin_setting'); Db::get()->query(sprintf('DELETE FROM %s WHERE plugin_name = ?', $table), array($pluginName)); } catch (Exception $e) { if ($e->getCode() != 42) ...
php
public static function removeAllSettingsForPlugin($pluginName) { try { $table = Common::prefixTable('plugin_setting'); Db::get()->query(sprintf('DELETE FROM %s WHERE plugin_name = ?', $table), array($pluginName)); } catch (Exception $e) { if ($e->getCode() != 42) ...
[ "public", "static", "function", "removeAllSettingsForPlugin", "(", "$", "pluginName", ")", "{", "try", "{", "$", "table", "=", "Common", "::", "prefixTable", "(", "'plugin_setting'", ")", ";", "Db", "::", "get", "(", ")", "->", "query", "(", "sprintf", "("...
Unsets all settings for a plugin. The settings will be removed from the database. Used when a plugin is uninstalled. @internal @param string $pluginName @throws \Exception If the `$userLogin` is empty.
[ "Unsets", "all", "settings", "for", "a", "plugin", ".", "The", "settings", "will", "be", "removed", "from", "the", "database", ".", "Used", "when", "a", "plugin", "is", "uninstalled", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Storage/Backend/PluginSettingsTable.php#L197-L208
209,065
matomo-org/matomo
core/ViewDataTable/Config.php
Config.loadDocumentation
private function loadDocumentation() { $this->metrics_documentation = array(); $idSite = Common::getRequestVar('idSite', 0, 'int'); if ($idSite < 1) { return; } $apiParameters = array(); $entityNames = StaticContainer::get('entities.idNames'); f...
php
private function loadDocumentation() { $this->metrics_documentation = array(); $idSite = Common::getRequestVar('idSite', 0, 'int'); if ($idSite < 1) { return; } $apiParameters = array(); $entityNames = StaticContainer::get('entities.idNames'); f...
[ "private", "function", "loadDocumentation", "(", ")", "{", "$", "this", "->", "metrics_documentation", "=", "array", "(", ")", ";", "$", "idSite", "=", "Common", "::", "getRequestVar", "(", "'idSite'", ",", "0", ",", "'int'", ")", ";", "if", "(", "$", ...
Load documentation from the API
[ "Load", "documentation", "from", "the", "API" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Config.php#L578-L612
209,066
matomo-org/matomo
core/ViewDataTable/Config.php
Config.addTranslations
public function addTranslations($translations) { foreach ($translations as $key => $translation) { $this->addTranslation($key, $translation); } }
php
public function addTranslations($translations) { foreach ($translations as $key => $translation) { $this->addTranslation($key, $translation); } }
[ "public", "function", "addTranslations", "(", "$", "translations", ")", "{", "foreach", "(", "$", "translations", "as", "$", "key", "=>", "$", "translation", ")", "{", "$", "this", "->", "addTranslation", "(", "$", "key", ",", "$", "translation", ")", ";...
Associates multiple translations with metrics. See {@link $translations} and {@link addTranslation()}. @param array $translations An array of column name => text mappings, eg, ``` array( 'nb_visits' => 'Visits', 'goal_1_nb_conversions' => "Conversions for 'My Goal'" ) ```
[ "Associates", "multiple", "translations", "with", "metrics", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ViewDataTable/Config.php#L802-L807
209,067
matomo-org/matomo
plugins/DBStats/API.php
API.getGeneralInformation
public function getGeneralInformation() { Piwik::checkUserHasSuperUserAccess(); // calculate total size $totalSpaceUsed = 0; foreach ($this->metadataProvider->getAllTablesStatus() as $status) { $totalSpaceUsed += $status['Data_length'] + $status['Index_length']; }...
php
public function getGeneralInformation() { Piwik::checkUserHasSuperUserAccess(); // calculate total size $totalSpaceUsed = 0; foreach ($this->metadataProvider->getAllTablesStatus() as $status) { $totalSpaceUsed += $status['Data_length'] + $status['Index_length']; }...
[ "public", "function", "getGeneralInformation", "(", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "// calculate total size", "$", "totalSpaceUsed", "=", "0", ";", "foreach", "(", "$", "this", "->", "metadataProvider", "->", "getAllTablesStat...
Gets some general information about this Matomo installation, including the count of websites tracked, the count of users and the total space used by the database. @return array Contains the website count, user count and total space used by the database.
[ "Gets", "some", "general", "information", "about", "this", "Matomo", "installation", "including", "the", "count", "of", "websites", "tracked", "the", "count", "of", "users", "and", "the", "total", "space", "used", "by", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/API.php#L39-L55
209,068
matomo-org/matomo
plugins/DBStats/API.php
API.getDatabaseUsageSummary
public function getDatabaseUsageSummary() { Piwik::checkUserHasSuperUserAccess(); $emptyRow = array('data_size' => 0, 'index_size' => 0, 'row_count' => 0); $rows = array( 'tracker_data' => $emptyRow, 'metric_data' => $emptyRow, 'report_data' => $emptyRo...
php
public function getDatabaseUsageSummary() { Piwik::checkUserHasSuperUserAccess(); $emptyRow = array('data_size' => 0, 'index_size' => 0, 'row_count' => 0); $rows = array( 'tracker_data' => $emptyRow, 'metric_data' => $emptyRow, 'report_data' => $emptyRo...
[ "public", "function", "getDatabaseUsageSummary", "(", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "emptyRow", "=", "array", "(", "'data_size'", "=>", "0", ",", "'index_size'", "=>", "0", ",", "'row_count'", "=>", "0", ")", ";"...
Returns a datatable summarizing how data is distributed among Matomo tables. This function will group tracker tables, numeric archive tables, blob archive tables and other tables together so only four rows are shown. @return DataTable A datatable with three columns: 'data_size', 'index_size', 'row_count'.
[ "Returns", "a", "datatable", "summarizing", "how", "data", "is", "distributed", "among", "Matomo", "tables", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/API.php#L76-L105
209,069
matomo-org/matomo
plugins/DBStats/API.php
API.getMetricDataSummaryByYear
public function getMetricDataSummaryByYear() { Piwik::checkUserHasSuperUserAccess(); $dataTable = $this->getMetricDataSummary(); $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\API::getArchiveTableYear')); return $dataTable; }
php
public function getMetricDataSummaryByYear() { Piwik::checkUserHasSuperUserAccess(); $dataTable = $this->getMetricDataSummary(); $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\API::getArchiveTableYear')); return $dataTable; }
[ "public", "function", "getMetricDataSummaryByYear", "(", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "dataTable", "=", "$", "this", "->", "getMetricDataSummary", "(", ")", ";", "$", "dataTable", "->", "filter", "(", "'GroupBy'", ...
Returns a datatable describing how much space is taken up by each numeric archive table, grouped by year. @return DataTable A datatable with three columns: 'data_size', 'index_size', 'row_count'.
[ "Returns", "a", "datatable", "describing", "how", "much", "space", "is", "taken", "up", "by", "each", "numeric", "archive", "table", "grouped", "by", "year", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/API.php#L136-L145
209,070
matomo-org/matomo
plugins/DBStats/API.php
API.getReportDataSummaryByYear
public function getReportDataSummaryByYear() { Piwik::checkUserHasSuperUserAccess(); $dataTable = $this->getReportDataSummary(); $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\API::getArchiveTableYear')); return $dataTable; }
php
public function getReportDataSummaryByYear() { Piwik::checkUserHasSuperUserAccess(); $dataTable = $this->getReportDataSummary(); $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\API::getArchiveTableYear')); return $dataTable; }
[ "public", "function", "getReportDataSummaryByYear", "(", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "dataTable", "=", "$", "this", "->", "getReportDataSummary", "(", ")", ";", "$", "dataTable", "->", "filter", "(", "'GroupBy'", ...
Returns a datatable describing how much space is taken up by each blob archive table, grouped by year. @return DataTable A datatable with three columns: 'data_size', 'index_size', 'row_count'.
[ "Returns", "a", "datatable", "describing", "how", "much", "space", "is", "taken", "up", "by", "each", "blob", "archive", "table", "grouped", "by", "year", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/API.php#L165-L174
209,071
matomo-org/matomo
plugins/DBStats/API.php
API.getTablesSummary
private function getTablesSummary($statuses) { $dataTable = new DataTable(); foreach ($statuses as $status) { $dataTable->addRowFromSimpleArray(array( 'label' => $status['Name'], 'd...
php
private function getTablesSummary($statuses) { $dataTable = new DataTable(); foreach ($statuses as $status) { $dataTable->addRowFromSimpleArray(array( 'label' => $status['Name'], 'd...
[ "private", "function", "getTablesSummary", "(", "$", "statuses", ")", "{", "$", "dataTable", "=", "new", "DataTable", "(", ")", ";", "foreach", "(", "$", "statuses", "as", "$", "status", ")", "{", "$", "dataTable", "->", "addRowFromSimpleArray", "(", "arra...
Returns a datatable representation of a set of table statuses. @param array $statuses The table statuses to summarize. @return DataTable
[ "Returns", "a", "datatable", "representation", "of", "a", "set", "of", "table", "statuses", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/API.php#L228-L240
209,072
matomo-org/matomo
core/Cookie.php
Cookie.loadContentFromCookie
protected function loadContentFromCookie() { $cookieStr = $this->extractSignedContent($_COOKIE[$this->name]); if ($cookieStr === false) { return; } $values = explode(self::VALUE_SEPARATOR, $cookieStr); foreach ($values as $nameValue) { $equalPos = st...
php
protected function loadContentFromCookie() { $cookieStr = $this->extractSignedContent($_COOKIE[$this->name]); if ($cookieStr === false) { return; } $values = explode(self::VALUE_SEPARATOR, $cookieStr); foreach ($values as $nameValue) { $equalPos = st...
[ "protected", "function", "loadContentFromCookie", "(", ")", "{", "$", "cookieStr", "=", "$", "this", "->", "extractSignedContent", "(", "$", "_COOKIE", "[", "$", "this", "->", "name", "]", ")", ";", "if", "(", "$", "cookieStr", "===", "false", ")", "{", ...
Load the cookie content into a php array. Parses the cookie string to extract the different variables. Unserialize the array when necessary. Decode the non numeric values that were base64 encoded.
[ "Load", "the", "cookie", "content", "into", "a", "php", "array", ".", "Parses", "the", "cookie", "string", "to", "extract", "the", "different", "variables", ".", "Unserialize", "the", "array", "when", "necessary", ".", "Decode", "the", "non", "numeric", "val...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Cookie.php#L222-L252
209,073
matomo-org/matomo
core/Cookie.php
Cookie.set
public function set($name, $value) { $name = self::escapeValue($name); // Delete value if $value === null if (is_null($value)) { if ($this->keyStore === false) { unset($this->value[$name]); return; } unset($this->value[$thi...
php
public function set($name, $value) { $name = self::escapeValue($name); // Delete value if $value === null if (is_null($value)) { if ($this->keyStore === false) { unset($this->value[$name]); return; } unset($this->value[$thi...
[ "public", "function", "set", "(", "$", "name", ",", "$", "value", ")", "{", "$", "name", "=", "self", "::", "escapeValue", "(", "$", "name", ")", ";", "// Delete value if $value === null", "if", "(", "is_null", "(", "$", "value", ")", ")", "{", "if", ...
Registers a new name => value association in the cookie. Registering new values is optimal if the value is a numeric value. If the value is a string, it will be saved as a base64 encoded string. If the value is an array, it will be saved as a serialized and base64 encoded string which is not very good in terms of byte...
[ "Registers", "a", "new", "name", "=", ">", "value", "association", "in", "the", "cookie", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Cookie.php#L326-L346
209,074
matomo-org/matomo
core/Plugin/Visualization.php
Visualization.postDataTableLoadedFromAPI
private function postDataTableLoadedFromAPI() { $columns = $this->dataTable->getColumns(); $hasNbVisits = in_array('nb_visits', $columns); $hasNbUniqVisitors = in_array('nb_uniq_visitors', $columns); // default columns_to_display to label, nb_uniq_visitors/nb_visits if those c...
php
private function postDataTableLoadedFromAPI() { $columns = $this->dataTable->getColumns(); $hasNbVisits = in_array('nb_visits', $columns); $hasNbUniqVisitors = in_array('nb_uniq_visitors', $columns); // default columns_to_display to label, nb_uniq_visitors/nb_visits if those c...
[ "private", "function", "postDataTableLoadedFromAPI", "(", ")", "{", "$", "columns", "=", "$", "this", "->", "dataTable", "->", "getColumns", "(", ")", ";", "$", "hasNbVisits", "=", "in_array", "(", "'nb_visits'", ",", "$", "columns", ")", ";", "$", "hasNbU...
Hook called after the dataTable has been loaded from the API Can be used to add, delete or modify the data freshly loaded @return bool
[ "Hook", "called", "after", "the", "dataTable", "has", "been", "loaded", "from", "the", "API", "Can", "be", "used", "to", "add", "delete", "or", "modify", "the", "data", "freshly", "loaded" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Visualization.php#L378-L413
209,075
matomo-org/matomo
core/Plugin/Visualization.php
Visualization.makePrettyArchivedOnText
private function makePrettyArchivedOnText() { $dateText = $this->metadata[DataTable::ARCHIVED_DATE_METADATA_NAME]; $date = Date::factory($dateText); $today = mktime(0, 0, 0); if ($date->getTimestamp() > $today) { $elapsedSeconds = time() - $date->getTimestamp(); ...
php
private function makePrettyArchivedOnText() { $dateText = $this->metadata[DataTable::ARCHIVED_DATE_METADATA_NAME]; $date = Date::factory($dateText); $today = mktime(0, 0, 0); if ($date->getTimestamp() > $today) { $elapsedSeconds = time() - $date->getTimestamp(); ...
[ "private", "function", "makePrettyArchivedOnText", "(", ")", "{", "$", "dateText", "=", "$", "this", "->", "metadata", "[", "DataTable", "::", "ARCHIVED_DATE_METADATA_NAME", "]", ";", "$", "date", "=", "Date", "::", "factory", "(", "$", "dateText", ")", ";",...
Returns prettified and translated text that describes when a report was last updated. @return string
[ "Returns", "prettified", "and", "translated", "text", "that", "describes", "when", "a", "report", "was", "last", "updated", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Visualization.php#L502-L519
209,076
matomo-org/matomo
core/Plugin/Visualization.php
Visualization.getClientSidePropertiesToSet
private function getClientSidePropertiesToSet() { $result = array(); foreach ($this->config->clientSideProperties as $name) { if (property_exists($this->requestConfig, $name)) { $result[$name] = $this->getIntIfValueIsBool($this->requestConfig->$name); } elsei...
php
private function getClientSidePropertiesToSet() { $result = array(); foreach ($this->config->clientSideProperties as $name) { if (property_exists($this->requestConfig, $name)) { $result[$name] = $this->getIntIfValueIsBool($this->requestConfig->$name); } elsei...
[ "private", "function", "getClientSidePropertiesToSet", "(", ")", "{", "$", "result", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "config", "->", "clientSideProperties", "as", "$", "name", ")", "{", "if", "(", "property_exists", "(", "$"...
Returns array of properties that should be visible to client side JavaScript. The data will be available in the data-props HTML attribute of the .dataTable div. @return array Maps property names w/ property values.
[ "Returns", "array", "of", "properties", "that", "should", "be", "visible", "to", "client", "side", "JavaScript", ".", "The", "data", "will", "be", "available", "in", "the", "data", "-", "props", "HTML", "attribute", "of", "the", ".", "dataTable", "div", "....
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Visualization.php#L546-L559
209,077
matomo-org/matomo
core/LogDeleter.php
LogDeleter.deleteVisits
public function deleteVisits($visitIds) { $numDeletedVisits = 0; foreach ($this->logTablesProvider->getAllLogTables() as $logTable) { if ($logTable->getColumnToJoinOnIdVisit()) { $numVisits = $this->rawLogDao->deleteFromLogTable($logTable->getName(), $visitIds); ...
php
public function deleteVisits($visitIds) { $numDeletedVisits = 0; foreach ($this->logTablesProvider->getAllLogTables() as $logTable) { if ($logTable->getColumnToJoinOnIdVisit()) { $numVisits = $this->rawLogDao->deleteFromLogTable($logTable->getName(), $visitIds); ...
[ "public", "function", "deleteVisits", "(", "$", "visitIds", ")", "{", "$", "numDeletedVisits", "=", "0", ";", "foreach", "(", "$", "this", "->", "logTablesProvider", "->", "getAllLogTables", "(", ")", "as", "$", "logTable", ")", "{", "if", "(", "$", "log...
Deletes visits by ID. This method cascades, so conversions, conversion items and visit actions for the visits are also deleted. @param int[] $visitIds @return int The number of deleted visits.
[ "Deletes", "visits", "by", "ID", ".", "This", "method", "cascades", "so", "conversions", "conversion", "items", "and", "visit", "actions", "for", "the", "visits", "are", "also", "deleted", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/LogDeleter.php#L43-L57
209,078
matomo-org/matomo
libs/HTML/QuickForm2/Element/Select.php
HTML_QuickForm2_Element_Select_OptionContainer.addOptgroup
public function addOptgroup($label, $attributes = null) { $optgroup = new HTML_QuickForm2_Element_Select_Optgroup( $this->values, $this->possibleValues, $label, $attributes ); $this->options[] = $optgroup; return...
php
public function addOptgroup($label, $attributes = null) { $optgroup = new HTML_QuickForm2_Element_Select_Optgroup( $this->values, $this->possibleValues, $label, $attributes ); $this->options[] = $optgroup; return...
[ "public", "function", "addOptgroup", "(", "$", "label", ",", "$", "attributes", "=", "null", ")", "{", "$", "optgroup", "=", "new", "HTML_QuickForm2_Element_Select_Optgroup", "(", "$", "this", "->", "values", ",", "$", "this", "->", "possibleValues", ",", "$...
Adds a new optgroup @param string 'label' attribute for optgroup tag @param mixed Additional attributes for <optgroup> tag (either as a string or as an associative array) @return HTML_QuickForm2_Element_Select_Optgroup
[ "Adds", "a", "new", "optgroup" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element/Select.php#L142-L150
209,079
matomo-org/matomo
libs/HTML/QuickForm2/Element/Select.php
HTML_QuickForm2_Element_Select.loadOptionsFromArray
protected function loadOptionsFromArray( HTML_QuickForm2_Element_Select_OptionContainer $container, $options ) { foreach ($options as $key => $value) { if (is_array($value)) { $optgroup = $container->addOptgroup($key); $this->loadOptionsFromArray($optg...
php
protected function loadOptionsFromArray( HTML_QuickForm2_Element_Select_OptionContainer $container, $options ) { foreach ($options as $key => $value) { if (is_array($value)) { $optgroup = $container->addOptgroup($key); $this->loadOptionsFromArray($optg...
[ "protected", "function", "loadOptionsFromArray", "(", "HTML_QuickForm2_Element_Select_OptionContainer", "$", "container", ",", "$", "options", ")", "{", "foreach", "(", "$", "options", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_array", "(", ...
Adds options from given array into given container @param HTML_QuickForm2_Element_Select_OptionContainer options will be added to this container @param array options array
[ "Adds", "options", "from", "given", "array", "into", "given", "container" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element/Select.php#L514-L526
209,080
matomo-org/matomo
libs/Zend/Validate/Isbn.php
Zend_Validate_Isbn._detectFormat
protected function _detectFormat() { // prepare separator and pattern list $sep = quotemeta($this->_separator); $patterns = array(); $lengths = array(); // check for ISBN-10 if ($this->_type == self::ISBN10 || $this->_type == self::AUTO) { if (empty...
php
protected function _detectFormat() { // prepare separator and pattern list $sep = quotemeta($this->_separator); $patterns = array(); $lengths = array(); // check for ISBN-10 if ($this->_type == self::ISBN10 || $this->_type == self::AUTO) { if (empty...
[ "protected", "function", "_detectFormat", "(", ")", "{", "// prepare separator and pattern list", "$", "sep", "=", "quotemeta", "(", "$", "this", "->", "_separator", ")", ";", "$", "patterns", "=", "array", "(", ")", ";", "$", "lengths", "=", "array", "(", ...
Detect input format. @return string
[ "Detect", "input", "format", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Isbn.php#L102-L145
209,081
matomo-org/matomo
core/Period/Factory.php
Factory.makePeriodFromQueryParams
public static function makePeriodFromQueryParams($timezone, $period, $date) { if (empty($timezone)) { $timezone = 'UTC'; } if ($period == 'range') { self::checkPeriodIsEnabled('range'); $oPeriod = new Range('range', $date, $timezone, Date::factory('today'...
php
public static function makePeriodFromQueryParams($timezone, $period, $date) { if (empty($timezone)) { $timezone = 'UTC'; } if ($period == 'range') { self::checkPeriodIsEnabled('range'); $oPeriod = new Range('range', $date, $timezone, Date::factory('today'...
[ "public", "static", "function", "makePeriodFromQueryParams", "(", "$", "timezone", ",", "$", "period", ",", "$", "date", ")", "{", "if", "(", "empty", "(", "$", "timezone", ")", ")", "{", "$", "timezone", "=", "'UTC'", ";", "}", "if", "(", "$", "peri...
Creates a Period instance using a period, date and timezone. @param string $timezone The timezone of the date. Only used if `$date` is `'now'`, `'today'`, `'yesterday'` or `'yesterdaySameTime'`. @param string $period The period string: `"day"`, `"week"`, `"month"`, `"year"`, `"range"`. @param string $date The date or ...
[ "Creates", "a", "Period", "instance", "using", "a", "period", "date", "and", "timezone", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Period/Factory.php#L143-L164
209,082
matomo-org/matomo
libs/Zend/Db/Statement/Mysqli.php
Zend_Db_Statement_Mysqli.close
public function close() { if ($this->_stmt) { $r = $this->_stmt->close(); $this->_stmt = null; return $r; } return false; }
php
public function close() { if ($this->_stmt) { $r = $this->_stmt->close(); $this->_stmt = null; return $r; } return false; }
[ "public", "function", "close", "(", ")", "{", "if", "(", "$", "this", "->", "_stmt", ")", "{", "$", "r", "=", "$", "this", "->", "_stmt", "->", "close", "(", ")", ";", "$", "this", "->", "_stmt", "=", "null", ";", "return", "$", "r", ";", "}"...
Closes the cursor and the statement. @return bool
[ "Closes", "the", "cursor", "and", "the", "statement", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Mysqli.php#L102-L110
209,083
matomo-org/matomo
plugins/Diagnostics/ConfigReader.php
ConfigReader.addConfigValuesFromSystemSettings
public function addConfigValuesFromSystemSettings($configValues, $systemSettings) { foreach ($systemSettings as $pluginSetting) { $pluginName = $pluginSetting->getPluginName(); if (empty($pluginName)) { continue; } if (!array_key_exists($plug...
php
public function addConfigValuesFromSystemSettings($configValues, $systemSettings) { foreach ($systemSettings as $pluginSetting) { $pluginName = $pluginSetting->getPluginName(); if (empty($pluginName)) { continue; } if (!array_key_exists($plug...
[ "public", "function", "addConfigValuesFromSystemSettings", "(", "$", "configValues", ",", "$", "systemSettings", ")", "{", "foreach", "(", "$", "systemSettings", "as", "$", "pluginSetting", ")", "{", "$", "pluginName", "=", "$", "pluginSetting", "->", "getPluginNa...
Adds config values that can be used to overwrite a plugin system setting and adds a description + default value for already existing configured config values that overwrite a plugin system setting. @param array $configValues @param \Piwik\Settings\Plugin\SystemSettings[] $systemSettings @return array
[ "Adds", "config", "values", "that", "can", "be", "used", "to", "overwrite", "a", "plugin", "system", "setting", "and", "adds", "a", "description", "+", "default", "value", "for", "already", "existing", "configured", "config", "values", "that", "overwrite", "a"...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Diagnostics/ConfigReader.php#L142-L204
209,084
matomo-org/matomo
core/Updates/2.10.0-b5.php
Updates_2_10_0_b5.getAllArchiveBlobTables
public static function getAllArchiveBlobTables() { if (empty(self::$archiveBlobTables)) { $archiveTables = ArchiveTableCreator::getTablesArchivesInstalled(); self::$archiveBlobTables = array_filter($archiveTables, function ($name) { return ArchiveTableCreator::getTyp...
php
public static function getAllArchiveBlobTables() { if (empty(self::$archiveBlobTables)) { $archiveTables = ArchiveTableCreator::getTablesArchivesInstalled(); self::$archiveBlobTables = array_filter($archiveTables, function ($name) { return ArchiveTableCreator::getTyp...
[ "public", "static", "function", "getAllArchiveBlobTables", "(", ")", "{", "if", "(", "empty", "(", "self", "::", "$", "archiveBlobTables", ")", ")", "{", "$", "archiveTables", "=", "ArchiveTableCreator", "::", "getTablesArchivesInstalled", "(", ")", ";", "self",...
Returns all available archive blob tables @return array
[ "Returns", "all", "available", "archive", "blob", "tables" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/2.10.0-b5.php#L135-L149
209,085
matomo-org/matomo
core/Updates/2.10.0-b5.php
Updates_2_10_0_b5.getFirstDayOfArchivedDeviceDetectorData
public static function getFirstDayOfArchivedDeviceDetectorData() { static $deviceDetectionBlobAvailableDate; if (empty($deviceDetectionBlobAvailableDate)) { $archiveBlobTables = self::getAllArchiveBlobTables(); $deviceDetectionBlobAvailableDate = null; foreach (...
php
public static function getFirstDayOfArchivedDeviceDetectorData() { static $deviceDetectionBlobAvailableDate; if (empty($deviceDetectionBlobAvailableDate)) { $archiveBlobTables = self::getAllArchiveBlobTables(); $deviceDetectionBlobAvailableDate = null; foreach (...
[ "public", "static", "function", "getFirstDayOfArchivedDeviceDetectorData", "(", ")", "{", "static", "$", "deviceDetectionBlobAvailableDate", ";", "if", "(", "empty", "(", "$", "deviceDetectionBlobAvailableDate", ")", ")", "{", "$", "archiveBlobTables", "=", "self", ":...
Find the first day on which DevicesDetection archives were generated @return int Timestamp
[ "Find", "the", "first", "day", "on", "which", "DevicesDetection", "archives", "were", "generated" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/2.10.0-b5.php#L156-L178
209,086
matomo-org/matomo
core/Updates/2.10.0-b5.php
Updates_2_10_0_b5.updateBrowserArchives
public static function updateBrowserArchives($table) { // rename old UserSettings archives where no DeviceDetection archives exists Db::exec(sprintf("UPDATE IGNORE %s SET name='DevicesDetection_browserVersions' WHERE name = 'UserSettings_browser'", $table)); /* * check dates of rem...
php
public static function updateBrowserArchives($table) { // rename old UserSettings archives where no DeviceDetection archives exists Db::exec(sprintf("UPDATE IGNORE %s SET name='DevicesDetection_browserVersions' WHERE name = 'UserSettings_browser'", $table)); /* * check dates of rem...
[ "public", "static", "function", "updateBrowserArchives", "(", "$", "table", ")", "{", "// rename old UserSettings archives where no DeviceDetection archives exists", "Db", "::", "exec", "(", "sprintf", "(", "\"UPDATE IGNORE %s SET name='DevicesDetection_browserVersions' WHERE name = ...
Updates all browser archives to new structure @param string $table @throws \Exception
[ "Updates", "all", "browser", "archives", "to", "new", "structure" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/2.10.0-b5.php#L185-L203
209,087
matomo-org/matomo
libs/Zend/Cache/Backend/Static.php
Zend_Cache_Backend_Static.setOption
public function setOption($name, $value) { if ($name == 'tag_cache') { $this->setInnerCache($value); } else { parent::setOption($name, $value); } return $this; }
php
public function setOption($name, $value) { if ($name == 'tag_cache') { $this->setInnerCache($value); } else { parent::setOption($name, $value); } return $this; }
[ "public", "function", "setOption", "(", "$", "name", ",", "$", "value", ")", "{", "if", "(", "$", "name", "==", "'tag_cache'", ")", "{", "$", "this", "->", "setInnerCache", "(", "$", "value", ")", ";", "}", "else", "{", "parent", "::", "setOption", ...
Interceptor child method to handle the case where an Inner Cache object is being set since it's not supported by the standard backend interface @param string $name @param mixed $value @return Zend_Cache_Backend_Static
[ "Interceptor", "child", "method", "to", "handle", "the", "case", "where", "an", "Inner", "Cache", "object", "is", "being", "set", "since", "it", "s", "not", "supported", "by", "the", "standard", "backend", "interface" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L83-L91
209,088
matomo-org/matomo
libs/Zend/Cache/Backend/Static.php
Zend_Cache_Backend_Static.getOption
public function getOption($name) { if ($name == 'tag_cache') { return $this->getInnerCache(); } else { if (in_array($name, $this->_options)) { return $this->_options[$name]; } if ($name == 'lifetime') { return parent::ge...
php
public function getOption($name) { if ($name == 'tag_cache') { return $this->getInnerCache(); } else { if (in_array($name, $this->_options)) { return $this->_options[$name]; } if ($name == 'lifetime') { return parent::ge...
[ "public", "function", "getOption", "(", "$", "name", ")", "{", "if", "(", "$", "name", "==", "'tag_cache'", ")", "{", "return", "$", "this", "->", "getInnerCache", "(", ")", ";", "}", "else", "{", "if", "(", "in_array", "(", "$", "name", ",", "$", ...
Retrieve any option via interception of the parent's statically held options including the local option for a tag cache. @param string $name @return mixed
[ "Retrieve", "any", "option", "via", "interception", "of", "the", "parent", "s", "statically", "held", "options", "including", "the", "local", "option", "for", "a", "tag", "cache", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L100-L113
209,089
matomo-org/matomo
libs/Zend/Cache/Backend/Static.php
Zend_Cache_Backend_Static._createDirectoriesFor
protected function _createDirectoriesFor($path) { if (!is_dir($path)) { $oldUmask = umask(0); if ( !@mkdir($path, $this->_octdec($this->_options['cache_directory_umask']), true)) { $lastErr = error_get_last(); umask($oldUmask); Zend_Cac...
php
protected function _createDirectoriesFor($path) { if (!is_dir($path)) { $oldUmask = umask(0); if ( !@mkdir($path, $this->_octdec($this->_options['cache_directory_umask']), true)) { $lastErr = error_get_last(); umask($oldUmask); Zend_Cac...
[ "protected", "function", "_createDirectoriesFor", "(", "$", "path", ")", "{", "if", "(", "!", "is_dir", "(", "$", "path", ")", ")", "{", "$", "oldUmask", "=", "umask", "(", "0", ")", ";", "if", "(", "!", "@", "mkdir", "(", "$", "path", ",", "$", ...
Recursively create the directories needed to write the static file
[ "Recursively", "create", "the", "directories", "needed", "to", "write", "the", "static", "file" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L262-L273
209,090
matomo-org/matomo
libs/Zend/Cache/Backend/Static.php
Zend_Cache_Backend_Static._verifyPath
protected function _verifyPath($path) { $path = realpath($path); $base = realpath($this->_options['public_dir']); return strncmp($path, $base, strlen($base)) !== 0; }
php
protected function _verifyPath($path) { $path = realpath($path); $base = realpath($this->_options['public_dir']); return strncmp($path, $base, strlen($base)) !== 0; }
[ "protected", "function", "_verifyPath", "(", "$", "path", ")", "{", "$", "path", "=", "realpath", "(", "$", "path", ")", ";", "$", "base", "=", "realpath", "(", "$", "this", "->", "_options", "[", "'public_dir'", "]", ")", ";", "return", "strncmp", "...
Verify path exists and is non-empty @param string $path @return bool
[ "Verify", "path", "exists", "and", "is", "non", "-", "empty" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/Static.php#L491-L496
209,091
matomo-org/matomo
plugins/Intl/DateTimeFormatProvider.php
DateTimeFormatProvider.getRangeFormatPattern
public function getRangeFormatPattern($short=false, $maxDifference='Y') { return $this->translator->translate( sprintf( 'Intl_Format_Interval_%s_%s', $short ? 'Short' : 'Long', $maxDifference )); }
php
public function getRangeFormatPattern($short=false, $maxDifference='Y') { return $this->translator->translate( sprintf( 'Intl_Format_Interval_%s_%s', $short ? 'Short' : 'Long', $maxDifference )); }
[ "public", "function", "getRangeFormatPattern", "(", "$", "short", "=", "false", ",", "$", "maxDifference", "=", "'Y'", ")", "{", "return", "$", "this", "->", "translator", "->", "translate", "(", "sprintf", "(", "'Intl_Format_Interval_%s_%s'", ",", "$", "short...
Returns interval format pattern for the given format type @param bool $short whether to return short or long format pattern @param string $maxDifference maximal difference in interval dates (Y, M or D) @return string
[ "Returns", "interval", "format", "pattern", "for", "the", "given", "format", "type" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Intl/DateTimeFormatProvider.php#L97-L105
209,092
matomo-org/matomo
libs/Zend/Cache/Core.php
Zend_Cache_Core.setConfig
public function setConfig(Zend_Config $config) { $options = $config->toArray(); while (list($name, $value) = each($options)) { $this->setOption($name, $value); } return $this; }
php
public function setConfig(Zend_Config $config) { $options = $config->toArray(); while (list($name, $value) = each($options)) { $this->setOption($name, $value); } return $this; }
[ "public", "function", "setConfig", "(", "Zend_Config", "$", "config", ")", "{", "$", "options", "=", "$", "config", "->", "toArray", "(", ")", ";", "while", "(", "list", "(", "$", "name", ",", "$", "value", ")", "=", "each", "(", "$", "options", ")...
Set options using an instance of type Zend_Config @param Zend_Config $config @return Zend_Cache_Core
[ "Set", "options", "using", "an", "instance", "of", "type", "Zend_Config" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L158-L165
209,093
matomo-org/matomo
libs/Zend/Cache/Core.php
Zend_Cache_Core.save
public function save($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 8) { if (!$this->_options['caching']) { return true; } if ($id === null) { $id = $this->_lastId; } else { $id = $this->_id($id); } self:...
php
public function save($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 8) { if (!$this->_options['caching']) { return true; } if ($id === null) { $id = $this->_lastId; } else { $id = $this->_id($id); } self:...
[ "public", "function", "save", "(", "$", "data", ",", "$", "id", "=", "null", ",", "$", "tags", "=", "array", "(", ")", ",", "$", "specificLifetime", "=", "false", ",", "$", "priority", "=", "8", ")", "{", "if", "(", "!", "$", "this", "->", "_op...
Save some data in a cache @param mixed $data Data to put in cache (can be another type than string if automatic_serialization is on) @param string $id Cache id (if not set, the last cache id will be used) @param array $tags Cache tags @param int $specificLifetime If != false, set a ...
[ "Save", "some", "data", "in", "a", "cache" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L347-L412
209,094
matomo-org/matomo
libs/Zend/Cache/Core.php
Zend_Cache_Core.remove
public function remove($id) { if (!$this->_options['caching']) { return true; } $id = $this->_id($id); // cache id may need prefix self::_validateIdOrTag($id); $this->_log("Zend_Cache_Core: remove item '{$id}'", 7); return $this->_backend->remove($id); ...
php
public function remove($id) { if (!$this->_options['caching']) { return true; } $id = $this->_id($id); // cache id may need prefix self::_validateIdOrTag($id); $this->_log("Zend_Cache_Core: remove item '{$id}'", 7); return $this->_backend->remove($id); ...
[ "public", "function", "remove", "(", "$", "id", ")", "{", "if", "(", "!", "$", "this", "->", "_options", "[", "'caching'", "]", ")", "{", "return", "true", ";", "}", "$", "id", "=", "$", "this", "->", "_id", "(", "$", "id", ")", ";", "// cache ...
Remove a cache @param string $id Cache id to remove @return boolean True if ok
[ "Remove", "a", "cache" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L420-L430
209,095
matomo-org/matomo
libs/Zend/Cache/Core.php
Zend_Cache_Core.clean
public function clean($mode = 'all', $tags = array()) { if (!$this->_options['caching']) { return true; } if (!in_array($mode, array(Zend_Cache::CLEANING_MODE_ALL, Zend_Cache::CLEANING_MODE_OLD, Zend_Cache::CLE...
php
public function clean($mode = 'all', $tags = array()) { if (!$this->_options['caching']) { return true; } if (!in_array($mode, array(Zend_Cache::CLEANING_MODE_ALL, Zend_Cache::CLEANING_MODE_OLD, Zend_Cache::CLE...
[ "public", "function", "clean", "(", "$", "mode", "=", "'all'", ",", "$", "tags", "=", "array", "(", ")", ")", "{", "if", "(", "!", "$", "this", "->", "_options", "[", "'caching'", "]", ")", "{", "return", "true", ";", "}", "if", "(", "!", "in_a...
Clean cache entries Available modes are : 'all' (default) => remove all cache entries ($tags is not used) 'old' => remove too old cache entries ($tags is not used) 'matchingTag' => remove cache entries matching all given tags ($tags can be an array of strings or a single string) 'notMatchingTag' => remo...
[ "Clean", "cache", "entries" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L450-L465
209,096
matomo-org/matomo
libs/Zend/Cache/Core.php
Zend_Cache_Core._id
protected function _id($id) { if (($id !== null) && isset($this->_options['cache_id_prefix'])) { return $this->_options['cache_id_prefix'] . $id; // return with prefix } return $id; // no prefix, just return the $id passed }
php
protected function _id($id) { if (($id !== null) && isset($this->_options['cache_id_prefix'])) { return $this->_options['cache_id_prefix'] . $id; // return with prefix } return $id; // no prefix, just return the $id passed }
[ "protected", "function", "_id", "(", "$", "id", ")", "{", "if", "(", "(", "$", "id", "!==", "null", ")", "&&", "isset", "(", "$", "this", "->", "_options", "[", "'cache_id_prefix'", "]", ")", ")", "{", "return", "$", "this", "->", "_options", "[", ...
Make and return a cache id Checks 'cache_id_prefix' and returns new id with prefix or simply the id if null @param string $id Cache id @return string Cache id (with or without prefix)
[ "Make", "and", "return", "a", "cache", "id" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Core.php#L756-L762
209,097
matomo-org/matomo
core/DataTable/Filter/SafeDecodeLabel.php
SafeDecodeLabel.decodeLabelSafe
public static function decodeLabelSafe($value) { if (empty($value)) { return $value; } $raw = urldecode($value); $value = htmlspecialchars_decode($raw, ENT_QUOTES); // ENT_IGNORE so that if utf8 string has some errors, we simply discard invalid code unit sequence...
php
public static function decodeLabelSafe($value) { if (empty($value)) { return $value; } $raw = urldecode($value); $value = htmlspecialchars_decode($raw, ENT_QUOTES); // ENT_IGNORE so that if utf8 string has some errors, we simply discard invalid code unit sequence...
[ "public", "static", "function", "decodeLabelSafe", "(", "$", "value", ")", "{", "if", "(", "empty", "(", "$", "value", ")", ")", "{", "return", "$", "value", ";", "}", "$", "raw", "=", "urldecode", "(", "$", "value", ")", ";", "$", "value", "=", ...
Decodes the given value @param string $value @return mixed|string
[ "Decodes", "the", "given", "value" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/SafeDecodeLabel.php#L37-L53
209,098
matomo-org/matomo
core/DataTable/Filter/SafeDecodeLabel.php
SafeDecodeLabel.filter
public function filter($table) { foreach ($table->getRows() as $row) { $value = $row->getColumn($this->columnToDecode); if ($value !== false) { $value = self::decodeLabelSafe($value); $row->setColumn($this->columnToDecode, $value); $th...
php
public function filter($table) { foreach ($table->getRows() as $row) { $value = $row->getColumn($this->columnToDecode); if ($value !== false) { $value = self::decodeLabelSafe($value); $row->setColumn($this->columnToDecode, $value); $th...
[ "public", "function", "filter", "(", "$", "table", ")", "{", "foreach", "(", "$", "table", "->", "getRows", "(", ")", "as", "$", "row", ")", "{", "$", "value", "=", "$", "row", "->", "getColumn", "(", "$", "this", "->", "columnToDecode", ")", ";", ...
Decodes all columns of the given data table @param DataTable $table
[ "Decodes", "all", "columns", "of", "the", "given", "data", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/SafeDecodeLabel.php#L60-L71
209,099
matomo-org/matomo
plugins/CoreAdminHome/Model/DuplicateActionRemover.php
DuplicateActionRemover.getDuplicateIdActions
public function getDuplicateIdActions() { $sql = "SELECT name, COUNT(*) AS count, GROUP_CONCAT(idaction ORDER BY idaction ASC SEPARATOR ',') as idactions FROM " . Common::prefixTable('log_action') . " GROUP BY name, hash, type HAVING count > 1"; $result = array(); ...
php
public function getDuplicateIdActions() { $sql = "SELECT name, COUNT(*) AS count, GROUP_CONCAT(idaction ORDER BY idaction ASC SEPARATOR ',') as idactions FROM " . Common::prefixTable('log_action') . " GROUP BY name, hash, type HAVING count > 1"; $result = array(); ...
[ "public", "function", "getDuplicateIdActions", "(", ")", "{", "$", "sql", "=", "\"SELECT name, COUNT(*) AS count, GROUP_CONCAT(idaction ORDER BY idaction ASC SEPARATOR ',') as idactions\n FROM \"", ".", "Common", "::", "prefixTable", "(", "'log_action'", ")", ".", ...
Returns list of all duplicate actions in the log_action table by name and the lowest action ID. The duplicate actions are returned with each action. @return array Contains the following elements: * **name**: The action's name. * **idaction**: The action's ID. * **duplicateIdActions**: An array of duplicate action IDs...
[ "Returns", "list", "of", "all", "duplicate", "actions", "in", "the", "log_action", "table", "by", "name", "and", "the", "lowest", "action", "ID", ".", "The", "duplicate", "actions", "are", "returned", "with", "each", "action", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Model/DuplicateActionRemover.php#L75-L92