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,500 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.getNamePlural | public function getNamePlural()
{
if (!empty($this->namePlural)) {
return Piwik::translate($this->namePlural);
}
return $this->getName();
} | php | public function getNamePlural()
{
if (!empty($this->namePlural)) {
return Piwik::translate($this->namePlural);
}
return $this->getName();
} | [
"public",
"function",
"getNamePlural",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"namePlural",
")",
")",
"{",
"return",
"Piwik",
"::",
"translate",
"(",
"$",
"this",
"->",
"namePlural",
")",
";",
"}",
"return",
"$",
"this",
"->"... | Returns a translated name in plural for this dimension.
@return string
@api since Piwik 3.2.0 | [
"Returns",
"a",
"translated",
"name",
"in",
"plural",
"for",
"this",
"dimension",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L358-L365 |
209,501 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.groupValue | public function groupValue($value, $idSite)
{
switch ($this->type) {
case Dimension::TYPE_URL:
return str_replace(array('http://', 'https://'), '', $value);
case Dimension::TYPE_BOOL:
return !empty($value) ? '1' : '0';
case Dimension::TYPE_... | php | public function groupValue($value, $idSite)
{
switch ($this->type) {
case Dimension::TYPE_URL:
return str_replace(array('http://', 'https://'), '', $value);
case Dimension::TYPE_BOOL:
return !empty($value) ? '1' : '0';
case Dimension::TYPE_... | [
"public",
"function",
"groupValue",
"(",
"$",
"value",
",",
"$",
"idSite",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"Dimension",
"::",
"TYPE_URL",
":",
"return",
"str_replace",
"(",
"array",
"(",
"'http://'",
",",
"'https://'... | A dimension should group values by using this method. Otherwise the same row may appear several times.
@param mixed $value
@param int $idSite
@return mixed
@api since Piwik 3.2.0 | [
"A",
"dimension",
"should",
"group",
"values",
"by",
"using",
"this",
"method",
".",
"Otherwise",
"the",
"same",
"row",
"may",
"appear",
"several",
"times",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L405-L416 |
209,502 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.formatValue | public function formatValue($value, $idSite, Formatter $formatter)
{
switch ($this->type) {
case Dimension::TYPE_BOOL:
if (empty($value)) {
return Piwik::translate('General_No');
}
return Piwik::translate('General_Yes');
... | php | public function formatValue($value, $idSite, Formatter $formatter)
{
switch ($this->type) {
case Dimension::TYPE_BOOL:
if (empty($value)) {
return Piwik::translate('General_No');
}
return Piwik::translate('General_Yes');
... | [
"public",
"function",
"formatValue",
"(",
"$",
"value",
",",
"$",
"idSite",
",",
"Formatter",
"$",
"formatter",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"Dimension",
"::",
"TYPE_BOOL",
":",
"if",
"(",
"empty",
"(",
"$",
"... | Formats the dimension value. By default, the dimension is formatted based on the set dimension type.
@param mixed $value
@param int $idSite
@param Formatter $formatter
@return mixed
@api since Piwik 3.2.0 | [
"Formats",
"the",
"dimension",
"value",
".",
"By",
"default",
"the",
"dimension",
"is",
"formatted",
"based",
"on",
"the",
"set",
"dimension",
"type",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L427-L459 |
209,503 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.configureMetrics | public function configureMetrics(MetricsList $metricsList, DimensionMetricFactory $dimensionMetricFactory)
{
if ($this->getMetricId() && $this->dbTableName && $this->columnName && $this->getNamePlural()) {
if (in_array($this->getType(), array(self::TYPE_DATETIME, self::TYPE_DATE, self::TYPE_TIME... | php | public function configureMetrics(MetricsList $metricsList, DimensionMetricFactory $dimensionMetricFactory)
{
if ($this->getMetricId() && $this->dbTableName && $this->columnName && $this->getNamePlural()) {
if (in_array($this->getType(), array(self::TYPE_DATETIME, self::TYPE_DATE, self::TYPE_TIME... | [
"public",
"function",
"configureMetrics",
"(",
"MetricsList",
"$",
"metricsList",
",",
"DimensionMetricFactory",
"$",
"dimensionMetricFactory",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getMetricId",
"(",
")",
"&&",
"$",
"this",
"->",
"dbTableName",
"&&",
"$",
... | Configures metrics for this dimension.
For certain dimension types, some metrics will be added automatically.
@param MetricsList $metricsList
@param DimensionMetricFactory $dimensionMetricFactory | [
"Configures",
"metrics",
"for",
"this",
"dimension",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L492-L512 |
209,504 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.hasImplementedEvent | public function hasImplementedEvent($method)
{
$method = new \ReflectionMethod($this, $method);
$declaringClass = $method->getDeclaringClass();
return 0 === strpos($declaringClass->name, 'Piwik\Plugins');
} | php | public function hasImplementedEvent($method)
{
$method = new \ReflectionMethod($this, $method);
$declaringClass = $method->getDeclaringClass();
return 0 === strpos($declaringClass->name, 'Piwik\Plugins');
} | [
"public",
"function",
"hasImplementedEvent",
"(",
"$",
"method",
")",
"{",
"$",
"method",
"=",
"new",
"\\",
"ReflectionMethod",
"(",
"$",
"this",
",",
"$",
"method",
")",
";",
"$",
"declaringClass",
"=",
"$",
"method",
"->",
"getDeclaringClass",
"(",
")",
... | Check whether a dimension has overwritten a specific method.
@param $method
@return bool
@ignore | [
"Check",
"whether",
"a",
"dimension",
"has",
"overwritten",
"a",
"specific",
"method",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L520-L526 |
209,505 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.getSqlSegment | public function getSqlSegment()
{
if (!empty($this->sqlSegment)) {
return $this->sqlSegment;
}
if ($this->dbTableName && $this->columnName) {
return $this->dbTableName . '.' . $this->columnName;
}
} | php | public function getSqlSegment()
{
if (!empty($this->sqlSegment)) {
return $this->sqlSegment;
}
if ($this->dbTableName && $this->columnName) {
return $this->dbTableName . '.' . $this->columnName;
}
} | [
"public",
"function",
"getSqlSegment",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"sqlSegment",
")",
")",
"{",
"return",
"$",
"this",
"->",
"sqlSegment",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"dbTableName",
"&&",
"$",
"this",
... | Returns a sql segment expression for this dimension.
@return string
@api since Piwik 3.2.0 | [
"Returns",
"a",
"sql",
"segment",
"expression",
"for",
"this",
"dimension",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L677-L686 |
209,506 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.getAllDimensions | public static function getAllDimensions()
{
$cacheId = CacheId::siteAware(CacheId::pluginAware('AllDimensions'));
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
... | php | public static function getAllDimensions()
{
$cacheId = CacheId::siteAware(CacheId::pluginAware('AllDimensions'));
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
... | [
"public",
"static",
"function",
"getAllDimensions",
"(",
")",
"{",
"$",
"cacheId",
"=",
"CacheId",
"::",
"siteAware",
"(",
"CacheId",
"::",
"pluginAware",
"(",
"'AllDimensions'",
")",
")",
";",
"$",
"cache",
"=",
"PiwikCache",
"::",
"getTransientCache",
"(",
... | Gets an instance of all available visit, action and conversion dimension.
@return Dimension[] | [
"Gets",
"an",
"instance",
"of",
"all",
"available",
"visit",
"action",
"and",
"conversion",
"dimension",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L748-L803 |
209,507 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.getModule | public function getModule()
{
$id = $this->getId();
if (empty($id)) {
throw new Exception("Invalid dimension ID: '$id'.");
}
$parts = explode('.', $id);
return reset($parts);
} | php | public function getModule()
{
$id = $this->getId();
if (empty($id)) {
throw new Exception("Invalid dimension ID: '$id'.");
}
$parts = explode('.', $id);
return reset($parts);
} | [
"public",
"function",
"getModule",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Invalid dimension ID: '$id'.\"",
")",
";",
"}",
"$",
... | Returns the name of the plugin that contains this Dimension.
@return string
@throws Exception if the Dimension is not located within a Plugin module.
@api | [
"Returns",
"the",
"name",
"of",
"the",
"plugin",
"that",
"contains",
"this",
"Dimension",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L840-L849 |
209,508 | matomo-org/matomo | core/Columns/Dimension.php | Dimension.getType | public function getType()
{
if (!empty($this->type)) {
return $this->type;
}
if ($this->getDbColumnJoin()) {
// best guess
return self::TYPE_TEXT;
}
if ($this->getEnumColumnValues()) {
// best guess
return self::TY... | php | public function getType()
{
if (!empty($this->type)) {
return $this->type;
}
if ($this->getDbColumnJoin()) {
// best guess
return self::TYPE_TEXT;
}
if ($this->getEnumColumnValues()) {
// best guess
return self::TY... | [
"public",
"function",
"getType",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"type",
")",
")",
"{",
"return",
"$",
"this",
"->",
"type",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"getDbColumnJoin",
"(",
")",
")",
"{",
"// best g... | Returns the type of the dimension which defines what kind of value this dimension stores.
@return string
@api since Piwik 3.2.0 | [
"Returns",
"the",
"type",
"of",
"the",
"dimension",
"which",
"defines",
"what",
"kind",
"of",
"value",
"this",
"dimension",
"stores",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/Dimension.php#L856-L895 |
209,509 | matomo-org/matomo | core/Scheduler/Scheduler.php | Scheduler.run | public function run()
{
$tasks = $this->loader->loadTasks();
$this->logger->debug('{count} scheduled tasks loaded', array('count' => count($tasks)));
// remove from timetable tasks that are not active anymore
$this->timetable->removeInactiveTasks($tasks);
$this->logger->in... | php | public function run()
{
$tasks = $this->loader->loadTasks();
$this->logger->debug('{count} scheduled tasks loaded', array('count' => count($tasks)));
// remove from timetable tasks that are not active anymore
$this->timetable->removeInactiveTasks($tasks);
$this->logger->in... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"tasks",
"=",
"$",
"this",
"->",
"loader",
"->",
"loadTasks",
"(",
")",
";",
"$",
"this",
"->",
"logger",
"->",
"debug",
"(",
"'{count} scheduled tasks loaded'",
",",
"array",
"(",
"'count'",
"=>",
"count"... | Executes tasks that are scheduled to run, then reschedules them.
@return array An array describing the results of scheduled task execution. Each element
in the array will have the following format:
```
array(
'task' => 'task name',
'output' => '... task output ...'
)
``` | [
"Executes",
"tasks",
"that",
"are",
"scheduled",
"to",
"run",
"then",
"reschedules",
"them",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Scheduler.php#L92-L146 |
209,510 | matomo-org/matomo | core/Scheduler/Scheduler.php | Scheduler.runTaskNow | public function runTaskNow($taskName)
{
$tasks = $this->loader->loadTasks();
foreach ($tasks as $task) {
if ($task->getName() === $taskName) {
return $this->executeTask($task);
}
}
throw new \InvalidArgumentException('Task ' . $taskName . ' n... | php | public function runTaskNow($taskName)
{
$tasks = $this->loader->loadTasks();
foreach ($tasks as $task) {
if ($task->getName() === $taskName) {
return $this->executeTask($task);
}
}
throw new \InvalidArgumentException('Task ' . $taskName . ' n... | [
"public",
"function",
"runTaskNow",
"(",
"$",
"taskName",
")",
"{",
"$",
"tasks",
"=",
"$",
"this",
"->",
"loader",
"->",
"loadTasks",
"(",
")",
";",
"foreach",
"(",
"$",
"tasks",
"as",
"$",
"task",
")",
"{",
"if",
"(",
"$",
"task",
"->",
"getName"... | Run a specific task now. Will ignore the schedule completely.
@param string $taskName
@return string Task output. | [
"Run",
"a",
"specific",
"task",
"now",
".",
"Will",
"ignore",
"the",
"schedule",
"completely",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Scheduler.php#L154-L165 |
209,511 | matomo-org/matomo | core/Scheduler/Scheduler.php | Scheduler.getTaskList | public function getTaskList()
{
$tasks = $this->loader->loadTasks();
return array_map(function (Task $task) {
return $task->getName();
}, $tasks);
} | php | public function getTaskList()
{
$tasks = $this->loader->loadTasks();
return array_map(function (Task $task) {
return $task->getName();
}, $tasks);
} | [
"public",
"function",
"getTaskList",
"(",
")",
"{",
"$",
"tasks",
"=",
"$",
"this",
"->",
"loader",
"->",
"loadTasks",
"(",
")",
";",
"return",
"array_map",
"(",
"function",
"(",
"Task",
"$",
"task",
")",
"{",
"return",
"$",
"task",
"->",
"getName",
... | Returns the list of the task names.
@return string[] | [
"Returns",
"the",
"list",
"of",
"the",
"task",
"names",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Scheduler.php#L230-L237 |
209,512 | matomo-org/matomo | core/Scheduler/Scheduler.php | Scheduler.executeTask | private function executeTask($task)
{
$this->logger->info("Scheduler: executing task {taskName}...", array(
'taskName' => $task->getName(),
));
$this->isRunningTask = true;
$timer = new Timer();
/**
* Triggered directly before a scheduled task is execu... | php | private function executeTask($task)
{
$this->logger->info("Scheduler: executing task {taskName}...", array(
'taskName' => $task->getName(),
));
$this->isRunningTask = true;
$timer = new Timer();
/**
* Triggered directly before a scheduled task is execu... | [
"private",
"function",
"executeTask",
"(",
"$",
"task",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"info",
"(",
"\"Scheduler: executing task {taskName}...\"",
",",
"array",
"(",
"'taskName'",
"=>",
"$",
"task",
"->",
"getName",
"(",
")",
",",
")",
")",
"... | Executes the given task
@param Task $task
@return string | [
"Executes",
"the",
"given",
"task"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Scheduler.php#L245-L287 |
209,513 | matomo-org/matomo | core/Application/Kernel/PluginList.php | PluginList.getPluginsBundledWithPiwik | public function getPluginsBundledWithPiwik()
{
$pathGlobal = $this->settings->getPathGlobal();
$section = $this->settings->getIniFileChain()->getFrom($pathGlobal, 'Plugins');
return $section['Plugins'];
} | php | public function getPluginsBundledWithPiwik()
{
$pathGlobal = $this->settings->getPathGlobal();
$section = $this->settings->getIniFileChain()->getFrom($pathGlobal, 'Plugins');
return $section['Plugins'];
} | [
"public",
"function",
"getPluginsBundledWithPiwik",
"(",
")",
"{",
"$",
"pathGlobal",
"=",
"$",
"this",
"->",
"settings",
"->",
"getPathGlobal",
"(",
")",
";",
"$",
"section",
"=",
"$",
"this",
"->",
"settings",
"->",
"getIniFileChain",
"(",
")",
"->",
"ge... | Returns the list of plugins that are bundled with Piwik.
@return string[] | [
"Returns",
"the",
"list",
"of",
"plugins",
"that",
"are",
"bundled",
"with",
"Piwik",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Application/Kernel/PluginList.php#L76-L82 |
209,514 | matomo-org/matomo | core/Application/Kernel/PluginList.php | PluginList.sortPlugins | public function sortPlugins(array $plugins)
{
$global = $this->getPluginsBundledWithPiwik();
if (empty($global)) {
return $plugins;
}
// we need to make sure a possibly disabled plugin will be still loaded before any 3rd party plugin
$global = array_merge($global... | php | public function sortPlugins(array $plugins)
{
$global = $this->getPluginsBundledWithPiwik();
if (empty($global)) {
return $plugins;
}
// we need to make sure a possibly disabled plugin will be still loaded before any 3rd party plugin
$global = array_merge($global... | [
"public",
"function",
"sortPlugins",
"(",
"array",
"$",
"plugins",
")",
"{",
"$",
"global",
"=",
"$",
"this",
"->",
"getPluginsBundledWithPiwik",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"global",
")",
")",
"{",
"return",
"$",
"plugins",
";",
"}",
... | Sorts an array of plugins in the order they should be loaded. We cannot use DI here as DI is not initialized
at this stage.
@params string[] $plugins
@return \string[] | [
"Sorts",
"an",
"array",
"of",
"plugins",
"in",
"the",
"order",
"they",
"should",
"be",
"loaded",
".",
"We",
"cannot",
"use",
"DI",
"here",
"as",
"DI",
"is",
"not",
"initialized",
"at",
"this",
"stage",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Application/Kernel/PluginList.php#L101-L124 |
209,515 | matomo-org/matomo | core/Application/Kernel/PluginList.php | PluginList.sortPluginsAndRespectDependencies | public function sortPluginsAndRespectDependencies(array $plugins, $pluginJsonCache = array())
{
$global = $this->getPluginsBundledWithPiwik();
if (empty($global)) {
return $plugins;
}
// we need to make sure a possibly disabled plugin will be still loaded before any 3rd... | php | public function sortPluginsAndRespectDependencies(array $plugins, $pluginJsonCache = array())
{
$global = $this->getPluginsBundledWithPiwik();
if (empty($global)) {
return $plugins;
}
// we need to make sure a possibly disabled plugin will be still loaded before any 3rd... | [
"public",
"function",
"sortPluginsAndRespectDependencies",
"(",
"array",
"$",
"plugins",
",",
"$",
"pluginJsonCache",
"=",
"array",
"(",
")",
")",
"{",
"$",
"global",
"=",
"$",
"this",
"->",
"getPluginsBundledWithPiwik",
"(",
")",
";",
"if",
"(",
"empty",
"(... | Sorts an array of plugins in the order they should be saved in config.ini.php. This basically influences
the order of the plugin config.php and which config will be loaded first. We want to make sure to require the
config or a required plugin first before loading the plugin that requires it.
We do not sort using this ... | [
"Sorts",
"an",
"array",
"of",
"plugins",
"in",
"the",
"order",
"they",
"should",
"be",
"saved",
"in",
"config",
".",
"ini",
".",
"php",
".",
"This",
"basically",
"influences",
"the",
"order",
"of",
"the",
"plugin",
"config",
".",
"php",
"and",
"which",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Application/Kernel/PluginList.php#L140-L169 |
209,516 | matomo-org/matomo | plugins/Annotations/Controller.php | Controller.getAnnotationManager | public function getAnnotationManager($fetch = false, $date = false, $period = false, $lastN = false)
{
$this->checkSitePermission();
if ($date === false) {
$date = Common::getRequestVar('date', false);
}
if ($period === false) {
$period = Common::getRequestV... | php | public function getAnnotationManager($fetch = false, $date = false, $period = false, $lastN = false)
{
$this->checkSitePermission();
if ($date === false) {
$date = Common::getRequestVar('date', false);
}
if ($period === false) {
$period = Common::getRequestV... | [
"public",
"function",
"getAnnotationManager",
"(",
"$",
"fetch",
"=",
"false",
",",
"$",
"date",
"=",
"false",
",",
"$",
"period",
"=",
"false",
",",
"$",
"lastN",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"checkSitePermission",
"(",
")",
";",
"if",
... | Controller action that returns HTML displaying annotations for a site and
specific date range.
Query Param Input:
- idSite: The ID of the site to get annotations for. Only one allowed.
- date: The date to get annotations for. If lastN is not supplied, this is the start date,
otherwise the start date in the last period... | [
"Controller",
"action",
"that",
"returns",
"HTML",
"displaying",
"annotations",
"for",
"a",
"site",
"and",
"specific",
"date",
"range",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/Controller.php#L44-L87 |
209,517 | matomo-org/matomo | plugins/Annotations/Controller.php | Controller.saveAnnotation | public function saveAnnotation()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
$view = new View('@Annotations/saveAnnotation');
// NOTE: permissions checked in API method
// save the annotation
$view->annotation = Reques... | php | public function saveAnnotation()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
$view = new View('@Annotations/saveAnnotation');
// NOTE: permissions checked in API method
// save the annotation
$view->annotation = Reques... | [
"public",
"function",
"saveAnnotation",
"(",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"\"REQUEST_METHOD\"",
"]",
"==",
"\"POST\"",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@Annotations/saveAnno... | Controller action that modifies an annotation and returns HTML displaying
the modified annotation.
Query Param Input:
- idSite: The ID of the site the annotation belongs to. Only one ID is allowed.
- idNote: The ID of the annotation.
- date: The new date value for the annotation. (optional)
- note: The new text for th... | [
"Controller",
"action",
"that",
"modifies",
"an",
"annotation",
"and",
"returns",
"HTML",
"displaying",
"the",
"modified",
"annotation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/Controller.php#L106-L119 |
209,518 | matomo-org/matomo | plugins/Annotations/Controller.php | Controller.addAnnotation | public function addAnnotation()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
// the date used is for the annotation manager HTML that gets echo'd. we
// use this date for the new annotation, unless it is a date range, in
// which ca... | php | public function addAnnotation()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
// the date used is for the annotation manager HTML that gets echo'd. we
// use this date for the new annotation, unless it is a date range, in
// which ca... | [
"public",
"function",
"addAnnotation",
"(",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"\"REQUEST_METHOD\"",
"]",
"==",
"\"POST\"",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"// the date used is for the annotation manager HTML that gets echo'd. we"... | Controller action that adds a new annotation for a site and returns new
annotation manager HTML for the site and date range.
Query Param Input:
- idSite: The ID of the site to add an annotation to.
- date: The date for the new annotation.
- note: The text of the annotation.
- starred: Either 1 or 0, whether the annota... | [
"Controller",
"action",
"that",
"adds",
"a",
"new",
"annotation",
"for",
"a",
"site",
"and",
"returns",
"new",
"annotation",
"manager",
"HTML",
"for",
"the",
"site",
"and",
"date",
"range",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/Controller.php#L140-L160 |
209,519 | matomo-org/matomo | plugins/Annotations/Controller.php | Controller.deleteAnnotation | public function deleteAnnotation()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
// delete annotation. NOTE: permissions checked in API method
Request::processRequest("Annotations.delete");
return $this->getAnnotationManager($fetch ... | php | public function deleteAnnotation()
{
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$this->checkTokenInUrl();
// delete annotation. NOTE: permissions checked in API method
Request::processRequest("Annotations.delete");
return $this->getAnnotationManager($fetch ... | [
"public",
"function",
"deleteAnnotation",
"(",
")",
"{",
"if",
"(",
"$",
"_SERVER",
"[",
"\"REQUEST_METHOD\"",
"]",
"==",
"\"POST\"",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"// delete annotation. NOTE: permissions checked in API method",
"Req... | Controller action that deletes an annotation and returns new annotation
manager HTML for the site & date range.
Query Param Input:
- idSite: The ID of the site this annotation belongs to.
- idNote: The ID of the annotation to delete.
- date: For rendering the annotation manager. @see self::getAnnotationManager
for m... | [
"Controller",
"action",
"that",
"deletes",
"an",
"annotation",
"and",
"returns",
"new",
"annotation",
"manager",
"HTML",
"for",
"the",
"site",
"&",
"date",
"range",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/Controller.php#L179-L189 |
209,520 | matomo-org/matomo | plugins/Annotations/Controller.php | Controller.getEvolutionIcons | public function getEvolutionIcons()
{
// get annotation the count
$annotationCounts = Request::processRequest(
"Annotations.getAnnotationCountForDates", array('getAnnotationText' => 1));
// create & render the view
$view = new View('@Annotations/getEvolutionIcons');
... | php | public function getEvolutionIcons()
{
// get annotation the count
$annotationCounts = Request::processRequest(
"Annotations.getAnnotationCountForDates", array('getAnnotationText' => 1));
// create & render the view
$view = new View('@Annotations/getEvolutionIcons');
... | [
"public",
"function",
"getEvolutionIcons",
"(",
")",
"{",
"// get annotation the count",
"$",
"annotationCounts",
"=",
"Request",
"::",
"processRequest",
"(",
"\"Annotations.getAnnotationCountForDates\"",
",",
"array",
"(",
"'getAnnotationText'",
"=>",
"1",
")",
")",
";... | Controller action that echo's HTML that displays marker icons for an
evolution graph's x-axis. The marker icons still need to be positioned
by the JavaScript.
Query Param Input:
- idSite: The ID of the site this annotation belongs to. Only one is allowed.
- date: The date to check for annotations. If lastN is not supp... | [
"Controller",
"action",
"that",
"echo",
"s",
"HTML",
"that",
"displays",
"marker",
"icons",
"for",
"an",
"evolution",
"graph",
"s",
"x",
"-",
"axis",
".",
"The",
"marker",
"icons",
"still",
"need",
"to",
"be",
"positioned",
"by",
"the",
"JavaScript",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/Controller.php#L209-L220 |
209,521 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.getAllSites | public function getAllSites()
{
$db = $this->getDb();
$sites = $db->fetchAll("SELECT * FROM " . $this->table . " ORDER BY idsite ASC");
return $sites;
} | php | public function getAllSites()
{
$db = $this->getDb();
$sites = $db->fetchAll("SELECT * FROM " . $this->table . " ORDER BY idsite ASC");
return $sites;
} | [
"public",
"function",
"getAllSites",
"(",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"sites",
"=",
"$",
"db",
"->",
"fetchAll",
"(",
"\"SELECT * FROM \"",
".",
"$",
"this",
"->",
"table",
".",
"\" ORDER BY idsite ASC\"",
... | Returns all websites
@return array The list of websites, indexed by idsite | [
"Returns",
"all",
"websites"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L75-L81 |
209,522 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.getSitesWithVisits | public function getSitesWithVisits($time, $now)
{
$sites = Db::fetchAll("
SELECT idsite FROM " . $this->table . " s
WHERE EXISTS (
SELECT 1
FROM " . Common::prefixTable('log_visit') . " v
WHERE v.idsite = s.idsite
AND vi... | php | public function getSitesWithVisits($time, $now)
{
$sites = Db::fetchAll("
SELECT idsite FROM " . $this->table . " s
WHERE EXISTS (
SELECT 1
FROM " . Common::prefixTable('log_visit') . " v
WHERE v.idsite = s.idsite
AND vi... | [
"public",
"function",
"getSitesWithVisits",
"(",
"$",
"time",
",",
"$",
"now",
")",
"{",
"$",
"sites",
"=",
"Db",
"::",
"fetchAll",
"(",
"\"\n SELECT idsite FROM \"",
".",
"$",
"this",
"->",
"table",
".",
"\" s\n WHERE EXISTS (\n ... | Returns the list of the website IDs that received some visits since the specified timestamp.
@param string $time
@param string $now
@return array The list of website IDs | [
"Returns",
"the",
"list",
"of",
"the",
"website",
"IDs",
"that",
"received",
"some",
"visits",
"since",
"the",
"specified",
"timestamp",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L90-L104 |
209,523 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.getSitesFromIds | public function getSitesFromIds($idSites, $limit = false)
{
if (count($idSites) === 0) {
return array();
}
if ($limit) {
$limit = "LIMIT " . (int)$limit;
} else {
$limit = '';
}
$idSites = array_map('intval', $idSites);
$... | php | public function getSitesFromIds($idSites, $limit = false)
{
if (count($idSites) === 0) {
return array();
}
if ($limit) {
$limit = "LIMIT " . (int)$limit;
} else {
$limit = '';
}
$idSites = array_map('intval', $idSites);
$... | [
"public",
"function",
"getSitesFromIds",
"(",
"$",
"idSites",
",",
"$",
"limit",
"=",
"false",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"idSites",
")",
"===",
"0",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"$",
"limit",
")",
"{",... | Returns the list of websites from the ID array in parameters.
@param array $idSites list of website ID
@param bool $limit
@return array | [
"Returns",
"the",
"list",
"of",
"websites",
"from",
"the",
"ID",
"array",
"in",
"parameters",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L201-L221 |
209,524 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.getSitesId | public function getSitesId()
{
$result = Db::fetchAll("SELECT idsite FROM " . Common::prefixTable('site'));
$idSites = array();
foreach ($result as $idSite) {
$idSites[] = $idSite['idsite'];
}
return $idSites;
} | php | public function getSitesId()
{
$result = Db::fetchAll("SELECT idsite FROM " . Common::prefixTable('site'));
$idSites = array();
foreach ($result as $idSite) {
$idSites[] = $idSite['idsite'];
}
return $idSites;
} | [
"public",
"function",
"getSitesId",
"(",
")",
"{",
"$",
"result",
"=",
"Db",
"::",
"fetchAll",
"(",
"\"SELECT idsite FROM \"",
".",
"Common",
"::",
"prefixTable",
"(",
"'site'",
")",
")",
";",
"$",
"idSites",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
... | Returns the list of all the website IDs registered.
Caller must check access.
@return array The list of website IDs | [
"Returns",
"the",
"list",
"of",
"all",
"the",
"website",
"IDs",
"registered",
".",
"Caller",
"must",
"check",
"access",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L245-L255 |
209,525 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.getUniqueSiteTimezones | public function getUniqueSiteTimezones()
{
$results = Db::fetchAll("SELECT distinct timezone FROM " . $this->table);
$timezones = array();
foreach ($results as $result) {
$timezones[] = $result['timezone'];
}
return $timezones;
} | php | public function getUniqueSiteTimezones()
{
$results = Db::fetchAll("SELECT distinct timezone FROM " . $this->table);
$timezones = array();
foreach ($results as $result) {
$timezones[] = $result['timezone'];
}
return $timezones;
} | [
"public",
"function",
"getUniqueSiteTimezones",
"(",
")",
"{",
"$",
"results",
"=",
"Db",
"::",
"fetchAll",
"(",
"\"SELECT distinct timezone FROM \"",
".",
"$",
"this",
"->",
"table",
")",
";",
"$",
"timezones",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
... | Returns the list of unique timezones from all configured sites.
@return array ( string ) | [
"Returns",
"the",
"list",
"of",
"unique",
"timezones",
"from",
"all",
"configured",
"sites",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L326-L336 |
209,526 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.insertSiteUrl | public function insertSiteUrl($idSite, $url)
{
$db = $this->getDb();
$db->insert(Common::prefixTable("site_url"), array(
'idsite' => (int) $idSite,
'url' => $url
)
);
} | php | public function insertSiteUrl($idSite, $url)
{
$db = $this->getDb();
$db->insert(Common::prefixTable("site_url"), array(
'idsite' => (int) $idSite,
'url' => $url
)
);
} | [
"public",
"function",
"insertSiteUrl",
"(",
"$",
"idSite",
",",
"$",
"url",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"db",
"->",
"insert",
"(",
"Common",
"::",
"prefixTable",
"(",
"\"site_url\"",
")",
",",
"array",
... | Insert the list of alias URLs for the website.
The URLs must not exist already for this website! | [
"Insert",
"the",
"list",
"of",
"alias",
"URLs",
"for",
"the",
"website",
".",
"The",
"URLs",
"must",
"not",
"exist",
"already",
"for",
"this",
"website!"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L380-L388 |
209,527 | matomo-org/matomo | plugins/SitesManager/Model.php | Model.deleteSiteAliasUrls | public function deleteSiteAliasUrls($idsite)
{
$db = $this->getDb();
$db->query("DELETE FROM " . Common::prefixTable("site_url") . " WHERE idsite = ?", $idsite);
} | php | public function deleteSiteAliasUrls($idsite)
{
$db = $this->getDb();
$db->query("DELETE FROM " . Common::prefixTable("site_url") . " WHERE idsite = ?", $idsite);
} | [
"public",
"function",
"deleteSiteAliasUrls",
"(",
"$",
"idsite",
")",
"{",
"$",
"db",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
";",
"$",
"db",
"->",
"query",
"(",
"\"DELETE FROM \"",
".",
"Common",
"::",
"prefixTable",
"(",
"\"site_url\"",
")",
".",
... | Delete all the alias URLs for the given idSite. | [
"Delete",
"all",
"the",
"alias",
"URLs",
"for",
"the",
"given",
"idSite",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/Model.php#L436-L440 |
209,528 | matomo-org/matomo | libs/Zend/Mail/Protocol/Smtp.php | Zend_Mail_Protocol_Smtp._ehlo | protected function _ehlo($host)
{
// Support for older, less-compliant remote servers. Tries multiple attempts of EHLO or HELO.
try {
$this->_send('EHLO ' . $host);
$this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
} catch (Zend_Mail_Proto... | php | protected function _ehlo($host)
{
// Support for older, less-compliant remote servers. Tries multiple attempts of EHLO or HELO.
try {
$this->_send('EHLO ' . $host);
$this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
} catch (Zend_Mail_Proto... | [
"protected",
"function",
"_ehlo",
"(",
"$",
"host",
")",
"{",
"// Support for older, less-compliant remote servers. Tries multiple attempts of EHLO or HELO.",
"try",
"{",
"$",
"this",
"->",
"_send",
"(",
"'EHLO '",
".",
"$",
"host",
")",
";",
"$",
"this",
"->",
"_ex... | Send EHLO or HELO depending on capabilities of smtp host
@param string $host The client hostname or IP address (default: 127.0.0.1)
@throws Zend_Mail_Protocol_Exception
@return void | [
"Send",
"EHLO",
"or",
"HELO",
"depending",
"on",
"capabilities",
"of",
"smtp",
"host"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L228-L240 |
209,529 | matomo-org/matomo | libs/Zend/Mail/Protocol/Smtp.php | Zend_Mail_Protocol_Smtp.mail | public function mail($from)
{
if ($this->_sess !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('A valid session has not been started');
}
... | php | public function mail($from)
{
if ($this->_sess !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('A valid session has not been started');
}
... | [
"public",
"function",
"mail",
"(",
"$",
"from",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_sess",
"!==",
"true",
")",
"{",
"/**\n * @see Zend_Mail_Protocol_Exception\n */",
"// require_once 'Zend/Mail/Protocol/Exception.php';",
"throw",
"new",
"Zend... | Issues MAIL command
@param string $from Sender mailbox
@throws Zend_Mail_Protocol_Exception
@return void | [
"Issues",
"MAIL",
"command"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L250-L267 |
209,530 | matomo-org/matomo | libs/Zend/Mail/Protocol/Smtp.php | Zend_Mail_Protocol_Smtp.rcpt | public function rcpt($to)
{
if ($this->_mail !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No sender reverse path has been supplied');
}
... | php | public function rcpt($to)
{
if ($this->_mail !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No sender reverse path has been supplied');
}
... | [
"public",
"function",
"rcpt",
"(",
"$",
"to",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_mail",
"!==",
"true",
")",
"{",
"/**\n * @see Zend_Mail_Protocol_Exception\n */",
"// require_once 'Zend/Mail/Protocol/Exception.php';",
"throw",
"new",
"Zend_M... | Issues RCPT command
@param string $to Receiver(s) mailbox
@throws Zend_Mail_Protocol_Exception
@return void | [
"Issues",
"RCPT",
"command"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L277-L291 |
209,531 | matomo-org/matomo | libs/Zend/Mail/Protocol/Smtp.php | Zend_Mail_Protocol_Smtp.data | public function data($data)
{
// Ensure recipients have been set
if ($this->_rcpt !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No recipi... | php | public function data($data)
{
// Ensure recipients have been set
if ($this->_rcpt !== true) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No recipi... | [
"public",
"function",
"data",
"(",
"$",
"data",
")",
"{",
"// Ensure recipients have been set",
"if",
"(",
"$",
"this",
"->",
"_rcpt",
"!==",
"true",
")",
"{",
"/**\n * @see Zend_Mail_Protocol_Exception\n */",
"// require_once 'Zend/Mail/Protocol/Excep... | Issues DATA command
@param string $data
@throws Zend_Mail_Protocol_Exception
@return void | [
"Issues",
"DATA",
"command"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L301-L326 |
209,532 | matomo-org/matomo | libs/Zend/Mail/Protocol/Smtp.php | Zend_Mail_Protocol_Smtp.rset | public function rset()
{
$this->_send('RSET');
// MS ESMTP doesn't follow RFC, see [ZF-1377]
$this->_expect(array(250, 220));
$this->_mail = false;
$this->_rcpt = false;
$this->_data = false;
} | php | public function rset()
{
$this->_send('RSET');
// MS ESMTP doesn't follow RFC, see [ZF-1377]
$this->_expect(array(250, 220));
$this->_mail = false;
$this->_rcpt = false;
$this->_data = false;
} | [
"public",
"function",
"rset",
"(",
")",
"{",
"$",
"this",
"->",
"_send",
"(",
"'RSET'",
")",
";",
"// MS ESMTP doesn't follow RFC, see [ZF-1377]",
"$",
"this",
"->",
"_expect",
"(",
"array",
"(",
"250",
",",
"220",
")",
")",
";",
"$",
"this",
"->",
"_mai... | Issues the RSET command and validates answer
Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction.
@return void | [
"Issues",
"the",
"RSET",
"command",
"and",
"validates",
"answer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Smtp.php#L336-L345 |
209,533 | matomo-org/matomo | core/Plugin/ViewDataTable.php | ViewDataTable.getViewDataTableId | public static function getViewDataTableId()
{
$id = static::ID;
if (empty($id)) {
$message = sprintf('ViewDataTable %s does not define an ID. Set the ID constant to fix this issue', get_called_class());
throw new \Exception($message);
}
return $id;
} | php | public static function getViewDataTableId()
{
$id = static::ID;
if (empty($id)) {
$message = sprintf('ViewDataTable %s does not define an ID. Set the ID constant to fix this issue', get_called_class());
throw new \Exception($message);
}
return $id;
} | [
"public",
"static",
"function",
"getViewDataTableId",
"(",
")",
"{",
"$",
"id",
"=",
"static",
"::",
"ID",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'ViewDataTable %s does not define an ID. Set the ID constan... | Returns the viewDataTable ID for this DataTable visualization.
Derived classes should not override this method. They should instead declare a const ID field
with the viewDataTable ID.
@throws \Exception
@return string | [
"Returns",
"the",
"viewDataTable",
"ID",
"for",
"this",
"DataTable",
"visualization",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ViewDataTable.php#L373-L383 |
209,534 | matomo-org/matomo | core/Plugin/ViewDataTable.php | ViewDataTable.isRequestingSingleDataTable | public function isRequestingSingleDataTable()
{
$requestArray = $this->request->getRequestArray() + $_GET + $_POST;
$date = Common::getRequestVar('date', null, 'string', $requestArray);
$period = Common::getRequestVar('period', null, 'string', $requestArray);
$idSite = Common::getR... | php | public function isRequestingSingleDataTable()
{
$requestArray = $this->request->getRequestArray() + $_GET + $_POST;
$date = Common::getRequestVar('date', null, 'string', $requestArray);
$period = Common::getRequestVar('period', null, 'string', $requestArray);
$idSite = Common::getR... | [
"public",
"function",
"isRequestingSingleDataTable",
"(",
")",
"{",
"$",
"requestArray",
"=",
"$",
"this",
"->",
"request",
"->",
"getRequestArray",
"(",
")",
"+",
"$",
"_GET",
"+",
"$",
"_POST",
";",
"$",
"date",
"=",
"Common",
"::",
"getRequestVar",
"(",... | Returns `true` if this instance will request a single DataTable, `false` if requesting
more than one.
@return bool | [
"Returns",
"true",
"if",
"this",
"instance",
"will",
"request",
"a",
"single",
"DataTable",
"false",
"if",
"requesting",
"more",
"than",
"one",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ViewDataTable.php#L502-L517 |
209,535 | matomo-org/matomo | core/Config/IniFileChain.php | IniFileChain.& | public function &get($name)
{
if (!isset($this->mergedSettings[$name])) {
$this->mergedSettings[$name] = array();
}
$result =& $this->mergedSettings[$name];
return $result;
} | php | public function &get($name)
{
if (!isset($this->mergedSettings[$name])) {
$this->mergedSettings[$name] = array();
}
$result =& $this->mergedSettings[$name];
return $result;
} | [
"public",
"function",
"&",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"mergedSettings",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"mergedSettings",
"[",
"$",
"name",
"]",
"=",
"array",
"(",
... | Return setting section by reference.
@param string $name
@return mixed | [
"Return",
"setting",
"section",
"by",
"reference",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config/IniFileChain.php#L69-L77 |
209,536 | matomo-org/matomo | core/Config/IniFileChain.php | IniFileChain.dumpChanges | public function dumpChanges($header = '')
{
$userSettingsFile = $this->getUserSettingsFile();
$defaultSettings = $this->getMergedDefaultSettings();
$existingMutableSettings = $this->settingsChain[$userSettingsFile];
$dirty = false;
$configToWrite = array();
foreach... | php | public function dumpChanges($header = '')
{
$userSettingsFile = $this->getUserSettingsFile();
$defaultSettings = $this->getMergedDefaultSettings();
$existingMutableSettings = $this->settingsChain[$userSettingsFile];
$dirty = false;
$configToWrite = array();
foreach... | [
"public",
"function",
"dumpChanges",
"(",
"$",
"header",
"=",
"''",
")",
"{",
"$",
"userSettingsFile",
"=",
"$",
"this",
"->",
"getUserSettingsFile",
"(",
")",
";",
"$",
"defaultSettings",
"=",
"$",
"this",
"->",
"getMergedDefaultSettings",
"(",
")",
";",
... | Writes the difference of the in-memory setting values and the on-disk user settings file setting
values to a string in INI format, and returns it.
If a config section is identical to the default settings section (as computed by merging
all default setting files), it is not written to the user settings file.
@param st... | [
"Writes",
"the",
"difference",
"of",
"the",
"in",
"-",
"memory",
"setting",
"values",
"and",
"the",
"on",
"-",
"disk",
"user",
"settings",
"file",
"setting",
"values",
"to",
"a",
"string",
"in",
"INI",
"format",
"and",
"returns",
"it",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config/IniFileChain.php#L133-L198 |
209,537 | matomo-org/matomo | core/Config/IniFileChain.php | IniFileChain.reload | public function reload($defaultSettingsFiles = array(), $userSettingsFile = null)
{
if (!empty($defaultSettingsFiles)
|| !empty($userSettingsFile)
) {
$this->resetSettingsChain($defaultSettingsFiles, $userSettingsFile);
}
$reader = new IniReader();
fo... | php | public function reload($defaultSettingsFiles = array(), $userSettingsFile = null)
{
if (!empty($defaultSettingsFiles)
|| !empty($userSettingsFile)
) {
$this->resetSettingsChain($defaultSettingsFiles, $userSettingsFile);
}
$reader = new IniReader();
fo... | [
"public",
"function",
"reload",
"(",
"$",
"defaultSettingsFiles",
"=",
"array",
"(",
")",
",",
"$",
"userSettingsFile",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"defaultSettingsFiles",
")",
"||",
"!",
"empty",
"(",
"$",
"userSettingsFile",... | Reloads settings from disk. | [
"Reloads",
"settings",
"from",
"disk",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config/IniFileChain.php#L203-L229 |
209,538 | matomo-org/matomo | core/Config/IniFileChain.php | IniFileChain.encodeValues | protected function encodeValues(&$values)
{
if (is_array($values)) {
foreach ($values as &$value) {
$value = $this->encodeValues($value);
}
} elseif (is_float($values)) {
$values = Common::forceDotAsSeparatorForDecimalPoint($values);
} else... | php | protected function encodeValues(&$values)
{
if (is_array($values)) {
foreach ($values as &$value) {
$value = $this->encodeValues($value);
}
} elseif (is_float($values)) {
$values = Common::forceDotAsSeparatorForDecimalPoint($values);
} else... | [
"protected",
"function",
"encodeValues",
"(",
"&",
"$",
"values",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"&",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"encodeVal... | Encode HTML entities
@param mixed $values
@return mixed | [
"Encode",
"HTML",
"entities"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config/IniFileChain.php#L441-L454 |
209,539 | matomo-org/matomo | core/Config/IniFileChain.php | IniFileChain.decodeValues | protected function decodeValues(&$values)
{
if (is_array($values)) {
foreach ($values as &$value) {
$value = $this->decodeValues($value);
}
return $values;
} elseif (is_string($values)) {
return html_entity_decode($values, ENT_COMPAT, '... | php | protected function decodeValues(&$values)
{
if (is_array($values)) {
foreach ($values as &$value) {
$value = $this->decodeValues($value);
}
return $values;
} elseif (is_string($values)) {
return html_entity_decode($values, ENT_COMPAT, '... | [
"protected",
"function",
"decodeValues",
"(",
"&",
"$",
"values",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"&",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"decodeVal... | Decode HTML entities
@param mixed $values
@return mixed | [
"Decode",
"HTML",
"entities"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config/IniFileChain.php#L462-L473 |
209,540 | matomo-org/matomo | libs/Zend/Validate/Identical.php | Zend_Validate_Identical.setToken | public function setToken($token)
{
$this->_tokenString = (string) $token;
$this->_token = $token;
return $this;
} | php | public function setToken($token)
{
$this->_tokenString = (string) $token;
$this->_token = $token;
return $this;
} | [
"public",
"function",
"setToken",
"(",
"$",
"token",
")",
"{",
"$",
"this",
"->",
"_tokenString",
"=",
"(",
"string",
")",
"$",
"token",
";",
"$",
"this",
"->",
"_token",
"=",
"$",
"token",
";",
"return",
"$",
"this",
";",
"}"
] | Set token against which to compare
@param mixed $token
@return Zend_Validate_Identical | [
"Set",
"token",
"against",
"which",
"to",
"compare"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Identical.php#L103-L108 |
209,541 | matomo-org/matomo | libs/Zend/Mail/Protocol/Abstract.php | Zend_Mail_Protocol_Abstract._addLog | protected function _addLog($value)
{
if ($this->_maximumLog >= 0 && count($this->_log) >= $this->_maximumLog) {
array_shift($this->_log);
}
$this->_log[] = $value;
} | php | protected function _addLog($value)
{
if ($this->_maximumLog >= 0 && count($this->_log) >= $this->_maximumLog) {
array_shift($this->_log);
}
$this->_log[] = $value;
} | [
"protected",
"function",
"_addLog",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_maximumLog",
">=",
"0",
"&&",
"count",
"(",
"$",
"this",
"->",
"_log",
")",
">=",
"$",
"this",
"->",
"_maximumLog",
")",
"{",
"array_shift",
"(",
"$",
... | Add the transaction log
@param string new transaction
@return void | [
"Add",
"the",
"transaction",
"log"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Abstract.php#L243-L250 |
209,542 | matomo-org/matomo | libs/Zend/Mail/Protocol/Abstract.php | Zend_Mail_Protocol_Abstract._connect | protected function _connect($remote)
{
$errorNum = 0;
$errorStr = '';
// open connection
$this->_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);
if ($this->_socket === false) {
if ($errorNum == 0) {
$error... | php | protected function _connect($remote)
{
$errorNum = 0;
$errorStr = '';
// open connection
$this->_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);
if ($this->_socket === false) {
if ($errorNum == 0) {
$error... | [
"protected",
"function",
"_connect",
"(",
"$",
"remote",
")",
"{",
"$",
"errorNum",
"=",
"0",
";",
"$",
"errorStr",
"=",
"''",
";",
"// open connection",
"$",
"this",
"->",
"_socket",
"=",
"@",
"stream_socket_client",
"(",
"$",
"remote",
",",
"$",
"error... | Connect to the server using the supplied transport and target
An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'
@param string $remote Remote
@throws Zend_Mail_Protocol_Exception
@return boolean | [
"Connect",
"to",
"the",
"server",
"using",
"the",
"supplied",
"transport",
"and",
"target"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Abstract.php#L261-L289 |
209,543 | matomo-org/matomo | libs/Zend/Mail/Protocol/Abstract.php | Zend_Mail_Protocol_Abstract._send | protected function _send($request)
{
if (!is_resource($this->_socket)) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No connection has been established to ... | php | protected function _send($request)
{
if (!is_resource($this->_socket)) {
/**
* @see Zend_Mail_Protocol_Exception
*/
// require_once 'Zend/Mail/Protocol/Exception.php';
throw new Zend_Mail_Protocol_Exception('No connection has been established to ... | [
"protected",
"function",
"_send",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"_socket",
")",
")",
"{",
"/**\n * @see Zend_Mail_Protocol_Exception\n */",
"// require_once 'Zend/Mail/Protocol/Exception.php';",... | Send the given request followed by a LINEEND to the server.
@param string $request
@throws Zend_Mail_Protocol_Exception
@return integer|boolean Number of bytes written to remote host | [
"Send",
"the",
"given",
"request",
"followed",
"by",
"a",
"LINEEND",
"to",
"the",
"server",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Abstract.php#L312-L338 |
209,544 | matomo-org/matomo | plugins/Dashboard/Controller.php | Controller.index | public function index()
{
$view = $this->_getDashboardView('@Dashboard/index');
$view->dashboardSettingsControl = new DashboardManagerControl();
$view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
$view->dashboards = array();
if (!Piwik::isUserIsAnonymous()) {
... | php | public function index()
{
$view = $this->_getDashboardView('@Dashboard/index');
$view->dashboardSettingsControl = new DashboardManagerControl();
$view->hasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
$view->dashboards = array();
if (!Piwik::isUserIsAnonymous()) {
... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"_getDashboardView",
"(",
"'@Dashboard/index'",
")",
";",
"$",
"view",
"->",
"dashboardSettingsControl",
"=",
"new",
"DashboardManagerControl",
"(",
")",
";",
"$",
"view",
"->... | this is the exported widget | [
"this",
"is",
"the",
"exported",
"widget"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/Controller.php#L57-L69 |
209,545 | matomo-org/matomo | plugins/Dashboard/Controller.php | Controller.resetLayout | public function resetLayout()
{
$this->checkTokenInUrl();
if (Piwik::isUserIsAnonymous()) {
$session = new SessionNamespace("Dashboard");
$session->dashboardLayout = $this->dashboard->getDefaultLayout();
$session->setExpirationSeconds(1800);
} else {
... | php | public function resetLayout()
{
$this->checkTokenInUrl();
if (Piwik::isUserIsAnonymous()) {
$session = new SessionNamespace("Dashboard");
$session->dashboardLayout = $this->dashboard->getDefaultLayout();
$session->setExpirationSeconds(1800);
} else {
... | [
"public",
"function",
"resetLayout",
"(",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"if",
"(",
"Piwik",
"::",
"isUserIsAnonymous",
"(",
")",
")",
"{",
"$",
"session",
"=",
"new",
"SessionNamespace",
"(",
"\"Dashboard\"",
")",
";",
"$... | Resets the dashboard to the default widget configuration | [
"Resets",
"the",
"dashboard",
"to",
"the",
"default",
"widget",
"configuration"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/Controller.php#L88-L98 |
209,546 | matomo-org/matomo | plugins/Dashboard/Controller.php | Controller.getAllDashboards | public function getAllDashboards()
{
$this->checkTokenInUrl();
if (Piwik::isUserIsAnonymous()) {
Json::sendHeaderJSON();
return '[]';
}
$login = Piwik::getCurrentUserLogin();
$dashboards = $this->dashboard->getAllDashboards($login);
Jso... | php | public function getAllDashboards()
{
$this->checkTokenInUrl();
if (Piwik::isUserIsAnonymous()) {
Json::sendHeaderJSON();
return '[]';
}
$login = Piwik::getCurrentUserLogin();
$dashboards = $this->dashboard->getAllDashboards($login);
Jso... | [
"public",
"function",
"getAllDashboards",
"(",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"if",
"(",
"Piwik",
"::",
"isUserIsAnonymous",
"(",
")",
")",
"{",
"Json",
"::",
"sendHeaderJSON",
"(",
")",
";",
"return",
"'[]'",
";",
"}",
... | Outputs all available dashboards for the current user as a JSON string | [
"Outputs",
"all",
"available",
"dashboards",
"for",
"the",
"current",
"user",
"as",
"a",
"JSON",
"string"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/Controller.php#L108-L122 |
209,547 | matomo-org/matomo | plugins/Dashboard/Controller.php | Controller.saveLayout | public function saveLayout()
{
$this->checkTokenInUrl();
$layout = Common::unsanitizeInputValue(Common::getRequestVar('layout'));
$layout = strip_tags($layout);
$idDashboard = Common::getRequestVar('idDashboard', 1, 'int');
$name = Common::getRequestVar('nam... | php | public function saveLayout()
{
$this->checkTokenInUrl();
$layout = Common::unsanitizeInputValue(Common::getRequestVar('layout'));
$layout = strip_tags($layout);
$idDashboard = Common::getRequestVar('idDashboard', 1, 'int');
$name = Common::getRequestVar('nam... | [
"public",
"function",
"saveLayout",
"(",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"$",
"layout",
"=",
"Common",
"::",
"unsanitizeInputValue",
"(",
"Common",
"::",
"getRequestVar",
"(",
"'layout'",
")",
")",
";",
"$",
"layout",
"=",
... | Saves the layout for the current user
anonymous = in the session
authenticated user = in the DB | [
"Saves",
"the",
"layout",
"for",
"the",
"current",
"user",
"anonymous",
"=",
"in",
"the",
"session",
"authenticated",
"user",
"=",
"in",
"the",
"DB"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/Controller.php#L129-L148 |
209,548 | matomo-org/matomo | plugins/Dashboard/Controller.php | Controller.saveLayoutAsDefault | public function saveLayoutAsDefault()
{
$this->checkTokenInUrl();
if (Piwik::hasUserSuperUserAccess()) {
$layout = Common::unsanitizeInputValue(Common::getRequestVar('layout'));
$layout = strip_tags($layout);
$this->getModel()->createOrUpdateDashboard('', '1', $l... | php | public function saveLayoutAsDefault()
{
$this->checkTokenInUrl();
if (Piwik::hasUserSuperUserAccess()) {
$layout = Common::unsanitizeInputValue(Common::getRequestVar('layout'));
$layout = strip_tags($layout);
$this->getModel()->createOrUpdateDashboard('', '1', $l... | [
"public",
"function",
"saveLayoutAsDefault",
"(",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"if",
"(",
"Piwik",
"::",
"hasUserSuperUserAccess",
"(",
")",
")",
"{",
"$",
"layout",
"=",
"Common",
"::",
"unsanitizeInputValue",
"(",
"Common"... | Saves the layout as default | [
"Saves",
"the",
"layout",
"as",
"default"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/Controller.php#L153-L162 |
209,549 | matomo-org/matomo | core/DataTable/Manager.php | Manager.addTable | public function addTable($table)
{
$this->nextTableId++;
$this[$this->nextTableId] = $table;
return $this->nextTableId;
} | php | public function addTable($table)
{
$this->nextTableId++;
$this[$this->nextTableId] = $table;
return $this->nextTableId;
} | [
"public",
"function",
"addTable",
"(",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"nextTableId",
"++",
";",
"$",
"this",
"[",
"$",
"this",
"->",
"nextTableId",
"]",
"=",
"$",
"table",
";",
"return",
"$",
"this",
"->",
"nextTableId",
";",
"}"
] | Add a DataTable to the registry
@param DataTable $table
@return int Index of the table in the manager array | [
"Add",
"a",
"DataTable",
"to",
"the",
"registry"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Manager.php#L46-L51 |
209,550 | matomo-org/matomo | core/DataTable/Manager.php | Manager.deleteAll | public function deleteAll($deleteWhenIdTableGreaterThan = 0)
{
foreach ($this as $id => $table) {
if ($id > $deleteWhenIdTableGreaterThan) {
$this->deleteTable($id);
}
}
if ($deleteWhenIdTableGreaterThan == 0) {
$this->exchangeArray(array(... | php | public function deleteAll($deleteWhenIdTableGreaterThan = 0)
{
foreach ($this as $id => $table) {
if ($id > $deleteWhenIdTableGreaterThan) {
$this->deleteTable($id);
}
}
if ($deleteWhenIdTableGreaterThan == 0) {
$this->exchangeArray(array(... | [
"public",
"function",
"deleteAll",
"(",
"$",
"deleteWhenIdTableGreaterThan",
"=",
"0",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"id",
"=>",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"id",
">",
"$",
"deleteWhenIdTableGreaterThan",
")",
"{",
"$",
... | Delete all the registered DataTables from the manager | [
"Delete",
"all",
"the",
"registered",
"DataTables",
"from",
"the",
"manager"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Manager.php#L84-L96 |
209,551 | matomo-org/matomo | core/DataTable/Manager.php | Manager.dumpAllTables | public function dumpAllTables()
{
echo "<hr />Manager->dumpAllTables()<br />";
foreach ($this as $id => $table) {
if (!($table instanceof DataTable)) {
echo "Error table $id is not instance of datatable<br />";
var_export($table);
} else {
... | php | public function dumpAllTables()
{
echo "<hr />Manager->dumpAllTables()<br />";
foreach ($this as $id => $table) {
if (!($table instanceof DataTable)) {
echo "Error table $id is not instance of datatable<br />";
var_export($table);
} else {
... | [
"public",
"function",
"dumpAllTables",
"(",
")",
"{",
"echo",
"\"<hr />Manager->dumpAllTables()<br />\"",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"id",
"=>",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"table",
"instanceof",
"DataTable",
")",
")... | Debug only. Dumps all tables currently registered in the Manager | [
"Debug",
"only",
".",
"Dumps",
"all",
"tables",
"currently",
"registered",
"in",
"the",
"Manager"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Manager.php#L143-L158 |
209,552 | matomo-org/matomo | core/Metrics.php | Metrics.getUnit | public static function getUnit($column, $idSite)
{
$nameToUnit = array(
'_rate' => '%',
'revenue' => Site::getCurrencySymbolFor($idSite),
'_time_' => 's'
);
$unit = null;
/**
* Use this event to define units for custom metrics used in... | php | public static function getUnit($column, $idSite)
{
$nameToUnit = array(
'_rate' => '%',
'revenue' => Site::getCurrencySymbolFor($idSite),
'_time_' => 's'
);
$unit = null;
/**
* Use this event to define units for custom metrics used in... | [
"public",
"static",
"function",
"getUnit",
"(",
"$",
"column",
",",
"$",
"idSite",
")",
"{",
"$",
"nameToUnit",
"=",
"array",
"(",
"'_rate'",
"=>",
"'%'",
",",
"'revenue'",
"=>",
"Site",
"::",
"getCurrencySymbolFor",
"(",
"$",
"idSite",
")",
",",
"'_time... | Derive the unit name from a column name
@param $column
@param $idSite
@return string
@ignore | [
"Derive",
"the",
"unit",
"name",
"from",
"a",
"column",
"name"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics.php#L236-L266 |
209,553 | matomo-org/matomo | core/Development.php | Development.isEnabled | public static function isEnabled()
{
if (is_null(self::$isEnabled)) {
self::$isEnabled = (bool) Config::getInstance()->Development['enabled'];
}
return self::$isEnabled;
} | php | public static function isEnabled()
{
if (is_null(self::$isEnabled)) {
self::$isEnabled = (bool) Config::getInstance()->Development['enabled'];
}
return self::$isEnabled;
} | [
"public",
"static",
"function",
"isEnabled",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"isEnabled",
")",
")",
"{",
"self",
"::",
"$",
"isEnabled",
"=",
"(",
"bool",
")",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"Development",
... | Returns `true` if development mode is enabled and `false` otherwise.
@return bool | [
"Returns",
"true",
"if",
"development",
"mode",
"is",
"enabled",
"and",
"false",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Development.php#L33-L40 |
209,554 | matomo-org/matomo | plugins/ImageGraph/StaticGraph/PieGraph.php | PieGraph.truncateSmallValues | private function truncateSmallValues()
{
$metricColumns = array_keys($this->ordinateSeries);
$metricColumn = $metricColumns[0];
$ordinateValuesSum = 0;
foreach ($this->ordinateSeries[$metricColumn] as $ordinateValue) {
$ordinateValuesSum += $ordinateValue;
}
... | php | private function truncateSmallValues()
{
$metricColumns = array_keys($this->ordinateSeries);
$metricColumn = $metricColumns[0];
$ordinateValuesSum = 0;
foreach ($this->ordinateSeries[$metricColumn] as $ordinateValue) {
$ordinateValuesSum += $ordinateValue;
}
... | [
"private",
"function",
"truncateSmallValues",
"(",
")",
"{",
"$",
"metricColumns",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"ordinateSeries",
")",
";",
"$",
"metricColumn",
"=",
"$",
"metricColumns",
"[",
"0",
"]",
";",
"$",
"ordinateValuesSum",
"=",
"0",
... | this method logic is close to Piwik's core filter_truncate.
it uses a threshold to determine if an abscissa value should be drawn on the PIE
discarded abscissa values are summed in the 'other' abscissa value
if this process is not perform, CpChart will draw pie slices that are too small to see | [
"this",
"method",
"logic",
"is",
"close",
"to",
"Piwik",
"s",
"core",
"filter_truncate",
".",
"it",
"uses",
"a",
"threshold",
"to",
"determine",
"if",
"an",
"abscissa",
"value",
"should",
"be",
"drawn",
"on",
"the",
"PIE",
"discarded",
"abscissa",
"values",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ImageGraph/StaticGraph/PieGraph.php#L92-L125 |
209,555 | matomo-org/matomo | libs/HTML/QuickForm2/Element.php | HTML_QuickForm2_Element.getPersistentContent | protected function getPersistentContent()
{
if (!$this->persistent || null === ($value = $this->getValue())) {
return '';
}
return '<input type="hidden"' . self::getAttributesString(array(
'name' => $this->getName(),
'value' => $value,
'id' ... | php | protected function getPersistentContent()
{
if (!$this->persistent || null === ($value = $this->getValue())) {
return '';
}
return '<input type="hidden"' . self::getAttributesString(array(
'name' => $this->getName(),
'value' => $value,
'id' ... | [
"protected",
"function",
"getPersistentContent",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"persistent",
"||",
"null",
"===",
"(",
"$",
"value",
"=",
"$",
"this",
"->",
"getValue",
"(",
")",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
... | Generates hidden form field containing the element's value
This is used to pass the frozen element's value if 'persistent freeze'
feature is on
@return string | [
"Generates",
"hidden",
"form",
"field",
"containing",
"the",
"element",
"s",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element.php#L77-L87 |
209,556 | matomo-org/matomo | libs/HTML/QuickForm2/Element.php | HTML_QuickForm2_Element.render | public function render(HTML_QuickForm2_Renderer $renderer)
{
foreach ($this->rules as $rule) {
if ($rule[1] & HTML_QuickForm2_Rule::RUNAT_CLIENT) {
$renderer->getJavascriptBuilder()->addRule($rule[0]);
}
}
$renderer->renderElement($this);
retur... | php | public function render(HTML_QuickForm2_Renderer $renderer)
{
foreach ($this->rules as $rule) {
if ($rule[1] & HTML_QuickForm2_Rule::RUNAT_CLIENT) {
$renderer->getJavascriptBuilder()->addRule($rule[0]);
}
}
$renderer->renderElement($this);
retur... | [
"public",
"function",
"render",
"(",
"HTML_QuickForm2_Renderer",
"$",
"renderer",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"rule",
")",
"{",
"if",
"(",
"$",
"rule",
"[",
"1",
"]",
"&",
"HTML_QuickForm2_Rule",
"::",
"RUNAT_CLIENT",
... | Renders the element using the given renderer
@param HTML_QuickForm2_Renderer Renderer instance
@return HTML_QuickForm2_Renderer | [
"Renders",
"the",
"element",
"using",
"the",
"given",
"renderer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element.php#L112-L121 |
209,557 | matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.downloadFile | protected function downloadFile($dbType, $url)
{
$url = trim($url);
$ext = GeoIP2AutoUpdater::getGeoIPUrlExtension($url);
// NOTE: using the first item in $dbNames[$dbType] makes sure GeoLiteCity will be renamed to GeoIPCity
$zippedFilename = LocationProviderGeoIp2::$dbNames[$dbTyp... | php | protected function downloadFile($dbType, $url)
{
$url = trim($url);
$ext = GeoIP2AutoUpdater::getGeoIPUrlExtension($url);
// NOTE: using the first item in $dbNames[$dbType] makes sure GeoLiteCity will be renamed to GeoIPCity
$zippedFilename = LocationProviderGeoIp2::$dbNames[$dbTyp... | [
"protected",
"function",
"downloadFile",
"(",
"$",
"dbType",
",",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"trim",
"(",
"$",
"url",
")",
";",
"$",
"ext",
"=",
"GeoIP2AutoUpdater",
"::",
"getGeoIPUrlExtension",
"(",
"$",
"url",
")",
";",
"// NOTE: using the... | Downloads a GeoIP 2 database archive, extracts the .mmdb file and overwrites the existing
old database.
If something happens that causes the download to fail, no exception is thrown, but
an error is logged.
@param string $dbType
@param string $url URL to the database to download. The type of database is determined
fr... | [
"Downloads",
"a",
"GeoIP",
"2",
"database",
"archive",
"extracts",
"the",
".",
"mmdb",
"file",
"and",
"overwrites",
"the",
"existing",
"old",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L123-L159 |
209,558 | matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.getConfiguredUrls | public static function getConfiguredUrls()
{
$result = array();
foreach (self::$urlOptions as $key => $optionName) {
$result[$key] = Option::get($optionName);
}
return $result;
} | php | public static function getConfiguredUrls()
{
$result = array();
foreach (self::$urlOptions as $key => $optionName) {
$result[$key] = Option::get($optionName);
}
return $result;
} | [
"public",
"static",
"function",
"getConfiguredUrls",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"urlOptions",
"as",
"$",
"key",
"=>",
"$",
"optionName",
")",
"{",
"$",
"result",
"[",
"$",
"key",
"]",... | Retrieves the URLs used to update various GeoIP 2 database files.
@return array | [
"Retrieves",
"the",
"URLs",
"used",
"to",
"update",
"various",
"GeoIP",
"2",
"database",
"files",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L376-L383 |
209,559 | matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.getSchedulePeriod | public static function getSchedulePeriod()
{
$period = Option::get(self::SCHEDULE_PERIOD_OPTION_NAME);
if ($period === false) {
$period = self::SCHEDULE_PERIOD_MONTHLY;
}
return $period;
} | php | public static function getSchedulePeriod()
{
$period = Option::get(self::SCHEDULE_PERIOD_OPTION_NAME);
if ($period === false) {
$period = self::SCHEDULE_PERIOD_MONTHLY;
}
return $period;
} | [
"public",
"static",
"function",
"getSchedulePeriod",
"(",
")",
"{",
"$",
"period",
"=",
"Option",
"::",
"get",
"(",
"self",
"::",
"SCHEDULE_PERIOD_OPTION_NAME",
")",
";",
"if",
"(",
"$",
"period",
"===",
"false",
")",
"{",
"$",
"period",
"=",
"self",
"::... | Returns the configured update period, either 'week' or 'month'. Defaults to
'month'.
@return string | [
"Returns",
"the",
"configured",
"update",
"period",
"either",
"week",
"or",
"month",
".",
"Defaults",
"to",
"month",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L416-L423 |
209,560 | matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.getGeoIPUrlExtension | public static function getGeoIPUrlExtension($url)
{
// check for &suffix= query param that is special to MaxMind URLs
if (preg_match('/suffix=([^&]+)/', $url, $matches)) {
$ext = $matches[1];
} else {
// use basename of url
$filenameParts = explode('.', ba... | php | public static function getGeoIPUrlExtension($url)
{
// check for &suffix= query param that is special to MaxMind URLs
if (preg_match('/suffix=([^&]+)/', $url, $matches)) {
$ext = $matches[1];
} else {
// use basename of url
$filenameParts = explode('.', ba... | [
"public",
"static",
"function",
"getGeoIPUrlExtension",
"(",
"$",
"url",
")",
"{",
"// check for &suffix= query param that is special to MaxMind URLs",
"if",
"(",
"preg_match",
"(",
"'/suffix=([^&]+)/'",
",",
"$",
"url",
",",
"$",
"matches",
")",
")",
"{",
"$",
"ext... | Returns the extension of a URL used to update a GeoIP 2 database, if it can be found. | [
"Returns",
"the",
"extension",
"of",
"a",
"URL",
"used",
"to",
"update",
"a",
"GeoIP",
"2",
"database",
"if",
"it",
"can",
"be",
"found",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L452-L470 |
209,561 | matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.getOldAndNewPathsForBrokenDb | private function getOldAndNewPathsForBrokenDb($possibleDbNames)
{
$pathToDb = LocationProviderGeoIp2::getPathToGeoIpDatabase($possibleDbNames);
$newPath = false;
if ($pathToDb !== false) {
$newPath = $pathToDb . ".broken";
}
return array($pathToDb, $newPath);
... | php | private function getOldAndNewPathsForBrokenDb($possibleDbNames)
{
$pathToDb = LocationProviderGeoIp2::getPathToGeoIpDatabase($possibleDbNames);
$newPath = false;
if ($pathToDb !== false) {
$newPath = $pathToDb . ".broken";
}
return array($pathToDb, $newPath);
... | [
"private",
"function",
"getOldAndNewPathsForBrokenDb",
"(",
"$",
"possibleDbNames",
")",
"{",
"$",
"pathToDb",
"=",
"LocationProviderGeoIp2",
"::",
"getPathToGeoIpDatabase",
"(",
"$",
"possibleDbNames",
")",
";",
"$",
"newPath",
"=",
"false",
";",
"if",
"(",
"$",
... | Returns the path to a GeoIP 2 database and a path to rename it to if it's broken.
@param array $possibleDbNames The possible names of the database.
@return array Array with two elements, the path to the existing database, and
the path to rename it to if it is broken. The second will end
with something like .broken . | [
"Returns",
"the",
"path",
"to",
"a",
"GeoIP",
"2",
"database",
"and",
"a",
"path",
"to",
"rename",
"it",
"to",
"if",
"it",
"s",
"broken",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L550-L560 |
209,562 | matomo-org/matomo | plugins/GeoIp2/GeoIP2AutoUpdater.php | GeoIP2AutoUpdater.getLastRunTime | public static function getLastRunTime()
{
$timestamp = Option::get(self::LAST_RUN_TIME_OPTION_NAME);
return $timestamp === false ? false : Date::factory((int)$timestamp);
} | php | public static function getLastRunTime()
{
$timestamp = Option::get(self::LAST_RUN_TIME_OPTION_NAME);
return $timestamp === false ? false : Date::factory((int)$timestamp);
} | [
"public",
"static",
"function",
"getLastRunTime",
"(",
")",
"{",
"$",
"timestamp",
"=",
"Option",
"::",
"get",
"(",
"self",
"::",
"LAST_RUN_TIME_OPTION_NAME",
")",
";",
"return",
"$",
"timestamp",
"===",
"false",
"?",
"false",
":",
"Date",
"::",
"factory",
... | Returns the time the auto updater was last run.
@return Date|false | [
"Returns",
"the",
"time",
"the",
"auto",
"updater",
"was",
"last",
"run",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/GeoIp2/GeoIP2AutoUpdater.php#L567-L571 |
209,563 | matomo-org/matomo | core/Period/Month.php | Month.fillDayPeriods | private function fillDayPeriods($startDate, $endDate)
{
while (($startDate->isEarlier($endDate) || $startDate == $endDate)) {
$this->addSubperiod(new Day($startDate));
$startDate = $startDate->addDay(1);
}
} | php | private function fillDayPeriods($startDate, $endDate)
{
while (($startDate->isEarlier($endDate) || $startDate == $endDate)) {
$this->addSubperiod(new Day($startDate));
$startDate = $startDate->addDay(1);
}
} | [
"private",
"function",
"fillDayPeriods",
"(",
"$",
"startDate",
",",
"$",
"endDate",
")",
"{",
"while",
"(",
"(",
"$",
"startDate",
"->",
"isEarlier",
"(",
"$",
"endDate",
")",
"||",
"$",
"startDate",
"==",
"$",
"endDate",
")",
")",
"{",
"$",
"this",
... | Fills the periods from startDate to endDate with days
@param Date $startDate
@param Date $endDate | [
"Fills",
"the",
"periods",
"from",
"startDate",
"to",
"endDate",
"with",
"days"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Period/Month.php#L110-L116 |
209,564 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.& | public function &get($idSite, $period)
{
if (!isset($this->data[$idSite][$period])) {
$this->data[$idSite][$period] = $this->defaultRow;
}
return $this->data[$idSite][$period];
} | php | public function &get($idSite, $period)
{
if (!isset($this->data[$idSite][$period])) {
$this->data[$idSite][$period] = $this->defaultRow;
}
return $this->data[$idSite][$period];
} | [
"public",
"function",
"&",
"get",
"(",
"$",
"idSite",
",",
"$",
"period",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"idSite",
"]",
"[",
"$",
"period",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"$",... | Returns a reference to the data for a specific site & period. If there is
no data for the given site ID & period, it is set to the default row.
@param int $idSite
@param string $period eg, '2012-01-01,2012-01-31' | [
"Returns",
"a",
"reference",
"to",
"the",
"data",
"for",
"a",
"specific",
"site",
"&",
"period",
".",
"If",
"there",
"is",
"no",
"data",
"for",
"the",
"given",
"site",
"ID",
"&",
"period",
"it",
"is",
"set",
"to",
"the",
"default",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L132-L138 |
209,565 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.set | public function set($idSite, $period, $name, $value)
{
$row = & $this->get($idSite, $period);
$row[$name] = $value;
} | php | public function set($idSite, $period, $name, $value)
{
$row = & $this->get($idSite, $period);
$row[$name] = $value;
} | [
"public",
"function",
"set",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"row",
"=",
"&",
"$",
"this",
"->",
"get",
"(",
"$",
"idSite",
",",
"$",
"period",
")",
";",
"$",
"row",
"[",
"$",
"name"... | Set data for a specific site & period. If there is no data for the given site ID & period,
it is set to the default row.
@param int $idSite
@param string $period eg, '2012-01-01,2012-01-31'
@param string $name eg 'nb_visits'
@param string $value eg 5 | [
"Set",
"data",
"for",
"a",
"specific",
"site",
"&",
"period",
".",
"If",
"there",
"is",
"no",
"data",
"for",
"the",
"given",
"site",
"ID",
"&",
"period",
"it",
"is",
"set",
"to",
"the",
"default",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L149-L153 |
209,566 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.addMetadata | public function addMetadata($idSite, $period, $name, $value)
{
$row = & $this->get($idSite, $period);
$row[self::METADATA_CONTAINER_ROW_KEY][$name] = $value;
} | php | public function addMetadata($idSite, $period, $name, $value)
{
$row = & $this->get($idSite, $period);
$row[self::METADATA_CONTAINER_ROW_KEY][$name] = $value;
} | [
"public",
"function",
"addMetadata",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"row",
"=",
"&",
"$",
"this",
"->",
"get",
"(",
"$",
"idSite",
",",
"$",
"period",
")",
";",
"$",
"row",
"[",
"self... | Adds a new metadata to the data for specific site & period. If there is no
data for the given site ID & period, it is set to the default row.
Note: Site ID and period range string are two special types of metadata. Since
the data stored in this class is indexed by site & period, this metadata is not
stored in individu... | [
"Adds",
"a",
"new",
"metadata",
"to",
"the",
"data",
"for",
"specific",
"site",
"&",
"period",
".",
"If",
"there",
"is",
"no",
"data",
"for",
"the",
"given",
"site",
"ID",
"&",
"period",
"it",
"is",
"set",
"to",
"the",
"default",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L168-L172 |
209,567 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.getIndexedArray | public function getIndexedArray($resultIndices)
{
$indexKeys = array_keys($resultIndices);
$result = $this->createOrderedIndex($indexKeys);
foreach ($this->data as $idSite => $rowsByPeriod) {
foreach ($rowsByPeriod as $period => $row) {
// FIXME: This hack works ... | php | public function getIndexedArray($resultIndices)
{
$indexKeys = array_keys($resultIndices);
$result = $this->createOrderedIndex($indexKeys);
foreach ($this->data as $idSite => $rowsByPeriod) {
foreach ($rowsByPeriod as $period => $row) {
// FIXME: This hack works ... | [
"public",
"function",
"getIndexedArray",
"(",
"$",
"resultIndices",
")",
"{",
"$",
"indexKeys",
"=",
"array_keys",
"(",
"$",
"resultIndices",
")",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"createOrderedIndex",
"(",
"$",
"indexKeys",
")",
";",
"foreach",
... | Returns archive data as an array indexed by metadata.
@param array $resultIndices An array mapping metadata names to pretty labels
for them. Each archive data row will be indexed
by the metadata specified here.
Eg, array('site' => 'idSite', 'period' => 'Date')
@return array | [
"Returns",
"archive",
"data",
"as",
"an",
"array",
"indexed",
"by",
"metadata",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L184-L208 |
209,568 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.getDataTable | public function getDataTable($resultIndices)
{
$dataTableFactory = new DataTableFactory(
$this->dataNames, $this->dataType, $this->sitesId, $this->periods, $this->defaultRow);
$index = $this->getIndexedArray($resultIndices);
return $dataTableFactory->make($index, $resultIndices... | php | public function getDataTable($resultIndices)
{
$dataTableFactory = new DataTableFactory(
$this->dataNames, $this->dataType, $this->sitesId, $this->periods, $this->defaultRow);
$index = $this->getIndexedArray($resultIndices);
return $dataTableFactory->make($index, $resultIndices... | [
"public",
"function",
"getDataTable",
"(",
"$",
"resultIndices",
")",
"{",
"$",
"dataTableFactory",
"=",
"new",
"DataTableFactory",
"(",
"$",
"this",
"->",
"dataNames",
",",
"$",
"this",
"->",
"dataType",
",",
"$",
"this",
"->",
"sitesId",
",",
"$",
"this"... | Returns archive data as a DataTable indexed by metadata. Indexed data will
be represented by Map instances.
@param array $resultIndices An array mapping metadata names to pretty labels
for them. Each archive data row will be indexed
by the metadata specified here.
Eg, array('site' => 'idSite', 'period' => 'Date')
@re... | [
"Returns",
"archive",
"data",
"as",
"a",
"DataTable",
"indexed",
"by",
"metadata",
".",
"Indexed",
"data",
"will",
"be",
"represented",
"by",
"Map",
"instances",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L221-L229 |
209,569 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.getExpandedDataTable | public function getExpandedDataTable($resultIndices, $idSubTable = null, $depth = null, $addMetadataSubTableId = false)
{
if ($this->dataType != 'blob') {
throw new Exception("DataCollection: cannot call getExpandedDataTable with "
. "{$this->dataType} data types. Only works with... | php | public function getExpandedDataTable($resultIndices, $idSubTable = null, $depth = null, $addMetadataSubTableId = false)
{
if ($this->dataType != 'blob') {
throw new Exception("DataCollection: cannot call getExpandedDataTable with "
. "{$this->dataType} data types. Only works with... | [
"public",
"function",
"getExpandedDataTable",
"(",
"$",
"resultIndices",
",",
"$",
"idSubTable",
"=",
"null",
",",
"$",
"depth",
"=",
"null",
",",
"$",
"addMetadataSubTableId",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dataType",
"!=",
"'blob'... | Returns archive data as a DataTable indexed by metadata. Indexed data will
be represented by Map instances. Each DataTable will have
its subtable IDs set.
This function will only work if blob data was loaded and only one record
was loaded (not including subtables of the record).
@param array $resultIndices An array m... | [
"Returns",
"archive",
"data",
"as",
"a",
"DataTable",
"indexed",
"by",
"metadata",
".",
"Indexed",
"data",
"will",
"be",
"represented",
"by",
"Map",
"instances",
".",
"Each",
"DataTable",
"will",
"have",
"its",
"subtable",
"IDs",
"set",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L268-L288 |
209,570 | matomo-org/matomo | core/Archive/DataCollection.php | DataCollection.putRowInIndex | private function putRowInIndex(&$index, $metadataNamesToIndexBy, $row, $idSite, $period)
{
$currentLevel = & $index;
foreach ($metadataNamesToIndexBy as $metadataName) {
if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) {
$key = $idSite;
} els... | php | private function putRowInIndex(&$index, $metadataNamesToIndexBy, $row, $idSite, $period)
{
$currentLevel = & $index;
foreach ($metadataNamesToIndexBy as $metadataName) {
if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) {
$key = $idSite;
} els... | [
"private",
"function",
"putRowInIndex",
"(",
"&",
"$",
"index",
",",
"$",
"metadataNamesToIndexBy",
",",
"$",
"row",
",",
"$",
"idSite",
",",
"$",
"period",
")",
"{",
"$",
"currentLevel",
"=",
"&",
"$",
"index",
";",
"foreach",
"(",
"$",
"metadataNamesTo... | Puts an archive data row in an index. | [
"Puts",
"an",
"archive",
"data",
"row",
"in",
"an",
"index",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/DataCollection.php#L353-L374 |
209,571 | matomo-org/matomo | core/Notification/Manager.php | Manager.cancelAllNonPersistent | public static function cancelAllNonPersistent()
{
foreach (static::getAllNotifications() as $id => $notification) {
if (Notification::TYPE_PERSISTENT != $notification->type) {
static::removeNotification($id);
}
}
} | php | public static function cancelAllNonPersistent()
{
foreach (static::getAllNotifications() as $id => $notification) {
if (Notification::TYPE_PERSISTENT != $notification->type) {
static::removeNotification($id);
}
}
} | [
"public",
"static",
"function",
"cancelAllNonPersistent",
"(",
")",
"{",
"foreach",
"(",
"static",
"::",
"getAllNotifications",
"(",
")",
"as",
"$",
"id",
"=>",
"$",
"notification",
")",
"{",
"if",
"(",
"Notification",
"::",
"TYPE_PERSISTENT",
"!=",
"$",
"no... | Removes all temporary notifications.
Call this method after the notifications have been
displayed to make sure temporary notifications won't be displayed twice. | [
"Removes",
"all",
"temporary",
"notifications",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Notification/Manager.php#L67-L74 |
209,572 | matomo-org/matomo | core/Notification/Manager.php | Manager.getAllNotificationsToDisplay | public static function getAllNotificationsToDisplay()
{
$notifications = static::getAllNotifications();
uasort($notifications, function ($n1, $n2) {
/** @var Notification $n1 */ /** @var Notification $n2 */
if ($n1->getPriority() == $n2->getPriority()) {
retu... | php | public static function getAllNotificationsToDisplay()
{
$notifications = static::getAllNotifications();
uasort($notifications, function ($n1, $n2) {
/** @var Notification $n1 */ /** @var Notification $n2 */
if ($n1->getPriority() == $n2->getPriority()) {
retu... | [
"public",
"static",
"function",
"getAllNotificationsToDisplay",
"(",
")",
"{",
"$",
"notifications",
"=",
"static",
"::",
"getAllNotifications",
"(",
")",
";",
"uasort",
"(",
"$",
"notifications",
",",
"function",
"(",
"$",
"n1",
",",
"$",
"n2",
")",
"{",
... | Determine all notifications that needs to be displayed. They are sorted by priority. Highest priorities first.
@return \ArrayObject | [
"Determine",
"all",
"notifications",
"that",
"needs",
"to",
"be",
"displayed",
".",
"They",
"are",
"sorted",
"by",
"priority",
".",
"Highest",
"priorities",
"first",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Notification/Manager.php#L80-L94 |
209,573 | matomo-org/matomo | libs/HTML/QuickForm2/Element/Date.php | HTML_QuickForm2_Element_Date.setValue | public function setValue($value)
{
if (empty($value)) {
$value = array();
} elseif (is_scalar($value)) {
if (!is_numeric($value)) {
$value = strtotime($value);
}
// might be a unix epoch, then we fill all possible values
$ar... | php | public function setValue($value)
{
if (empty($value)) {
$value = array();
} elseif (is_scalar($value)) {
if (!is_numeric($value)) {
$value = strtotime($value);
}
// might be a unix epoch, then we fill all possible values
$ar... | [
"public",
"function",
"setValue",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array",
"(",
")",
";",
"}",
"elseif",
"(",
"is_scalar",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"!",
... | Tries to convert the given value to a usable date before setting the
element value
@param int|string|array A timestamp, a string compatible with strtotime()
or an array that fits the element names | [
"Tries",
"to",
"convert",
"the",
"given",
"value",
"to",
"a",
"usable",
"date",
"before",
"setting",
"the",
"element",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Element/Date.php#L272-L304 |
209,574 | matomo-org/matomo | core/API/DocumentationGenerator.php | DocumentationGenerator.getApiDocumentationAsString | public function getApiDocumentationAsString($outputExampleUrls = true)
{
list($toc, $str) = $this->generateDocumentation($outputExampleUrls, $prefixUrls = '', $displayTitlesAsAngularDirective = true);
return "<div piwik-content-block content-title='Quick access to APIs' id='topApiRef' name='topApiR... | php | public function getApiDocumentationAsString($outputExampleUrls = true)
{
list($toc, $str) = $this->generateDocumentation($outputExampleUrls, $prefixUrls = '', $displayTitlesAsAngularDirective = true);
return "<div piwik-content-block content-title='Quick access to APIs' id='topApiRef' name='topApiR... | [
"public",
"function",
"getApiDocumentationAsString",
"(",
"$",
"outputExampleUrls",
"=",
"true",
")",
"{",
"list",
"(",
"$",
"toc",
",",
"$",
"str",
")",
"=",
"$",
"this",
"->",
"generateDocumentation",
"(",
"$",
"outputExampleUrls",
",",
"$",
"prefixUrls",
... | Returns a HTML page containing help for all the successfully loaded APIs.
@param bool $outputExampleUrls
@return string | [
"Returns",
"a",
"HTML",
"page",
"containing",
"help",
"for",
"all",
"the",
"successfully",
"loaded",
"APIs",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DocumentationGenerator.php#L51-L58 |
209,575 | matomo-org/matomo | core/API/DocumentationGenerator.php | DocumentationGenerator.getApiDocumentationAsStringForDeveloperReference | public function getApiDocumentationAsStringForDeveloperReference($outputExampleUrls = true, $prefixUrls = '')
{
list($toc, $str) = $this->generateDocumentation($outputExampleUrls, $prefixUrls, $displayTitlesAsAngularDirective = false);
return "<h2 id='topApiRef' name='topApiRef'>Quick access to API... | php | public function getApiDocumentationAsStringForDeveloperReference($outputExampleUrls = true, $prefixUrls = '')
{
list($toc, $str) = $this->generateDocumentation($outputExampleUrls, $prefixUrls, $displayTitlesAsAngularDirective = false);
return "<h2 id='topApiRef' name='topApiRef'>Quick access to API... | [
"public",
"function",
"getApiDocumentationAsStringForDeveloperReference",
"(",
"$",
"outputExampleUrls",
"=",
"true",
",",
"$",
"prefixUrls",
"=",
"''",
")",
"{",
"list",
"(",
"$",
"toc",
",",
"$",
"str",
")",
"=",
"$",
"this",
"->",
"generateDocumentation",
"... | Used on developer.piwik.org
@param bool|true $outputExampleUrls
@param string $prefixUrls
@return string | [
"Used",
"on",
"developer",
".",
"piwik",
".",
"org"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/DocumentationGenerator.php#L67-L74 |
209,576 | matomo-org/matomo | core/Tracker/TrackerConfig.php | TrackerConfig.setConfigValue | public static function setConfigValue($name, $value)
{
$section = self::getConfig();
$section[$name] = $value;
Config::getInstance()->Tracker = $section;
} | php | public static function setConfigValue($name, $value)
{
$section = self::getConfig();
$section[$name] = $value;
Config::getInstance()->Tracker = $section;
} | [
"public",
"static",
"function",
"setConfigValue",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"section",
"=",
"self",
"::",
"getConfig",
"(",
")",
";",
"$",
"section",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"Config",
"::",
"getInstanc... | Update Tracker config
@param string $name Setting name
@param mixed $value Value | [
"Update",
"Tracker",
"config"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/TrackerConfig.php#L22-L27 |
209,577 | matomo-org/matomo | core/DataAccess/LogQueryBuilder/JoinGenerator.php | JoinGenerator.generate | public function generate()
{
/** @var LogTable[] $availableLogTables */
$availableLogTables = array();
$this->tables->sort();
foreach ($this->tables as $i => $table) {
if (is_array($table)) {
// join condition provided
$alias = isset($ta... | php | public function generate()
{
/** @var LogTable[] $availableLogTables */
$availableLogTables = array();
$this->tables->sort();
foreach ($this->tables as $i => $table) {
if (is_array($table)) {
// join condition provided
$alias = isset($ta... | [
"public",
"function",
"generate",
"(",
")",
"{",
"/** @var LogTable[] $availableLogTables */",
"$",
"availableLogTables",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"tables",
"->",
"sort",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"tables",
"as"... | Generate the join sql based on the needed tables
@throws Exception if tables can't be joined
@return array | [
"Generate",
"the",
"join",
"sql",
"based",
"on",
"the",
"needed",
"tables"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogQueryBuilder/JoinGenerator.php#L141-L199 |
209,578 | matomo-org/matomo | core/RankingQuery.php | RankingQuery.addLabelColumn | public function addLabelColumn($labelColumn)
{
if (is_array($labelColumn)) {
foreach ($labelColumn as $label) {
$this->addLabelColumn($label);
}
return;
}
$this->labelColumns[$labelColumn] = true;
} | php | public function addLabelColumn($labelColumn)
{
if (is_array($labelColumn)) {
foreach ($labelColumn as $label) {
$this->addLabelColumn($label);
}
return;
}
$this->labelColumns[$labelColumn] = true;
} | [
"public",
"function",
"addLabelColumn",
"(",
"$",
"labelColumn",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"labelColumn",
")",
")",
"{",
"foreach",
"(",
"$",
"labelColumn",
"as",
"$",
"label",
")",
"{",
"$",
"this",
"->",
"addLabelColumn",
"(",
"$",
"... | Add a label column.
Labels are the columns that are replaced with "Others" after the limit.
@param string|array $labelColumn | [
"Add",
"a",
"label",
"column",
".",
"Labels",
"are",
"the",
"columns",
"that",
"are",
"replaced",
"with",
"Others",
"after",
"the",
"limit",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/RankingQuery.php#L127-L136 |
209,579 | matomo-org/matomo | core/RankingQuery.php | RankingQuery.addColumn | public function addColumn($column, $aggregationFunction = false)
{
if (is_array($column)) {
foreach ($column as $c) {
$this->addColumn($c, $aggregationFunction);
}
return;
}
$this->additionalColumns[$column] = $aggregationFunction;
} | php | public function addColumn($column, $aggregationFunction = false)
{
if (is_array($column)) {
foreach ($column as $c) {
$this->addColumn($c, $aggregationFunction);
}
return;
}
$this->additionalColumns[$column] = $aggregationFunction;
} | [
"public",
"function",
"addColumn",
"(",
"$",
"column",
",",
"$",
"aggregationFunction",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"column",
")",
")",
"{",
"foreach",
"(",
"$",
"column",
"as",
"$",
"c",
")",
"{",
"$",
"this",
"->",
"a... | Add a column that has be added to the outer queries.
@param $column
@param string|bool $aggregationFunction If set, this function is used to aggregate the values of "Others",
eg, `'min'`, `'max'` or `'sum'`. | [
"Add",
"a",
"column",
"that",
"has",
"be",
"added",
"to",
"the",
"outer",
"queries",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/RankingQuery.php#L153-L162 |
209,580 | matomo-org/matomo | core/RankingQuery.php | RankingQuery.execute | public function execute($innerQuery, $bind = array())
{
$query = $this->generateRankingQuery($innerQuery);
$data = Db::fetchAll($query, $bind);
if ($this->columnToMarkExcludedRows !== false) {
// split the result into the regular result and the rows with special treatment
... | php | public function execute($innerQuery, $bind = array())
{
$query = $this->generateRankingQuery($innerQuery);
$data = Db::fetchAll($query, $bind);
if ($this->columnToMarkExcludedRows !== false) {
// split the result into the regular result and the rows with special treatment
... | [
"public",
"function",
"execute",
"(",
"$",
"innerQuery",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"generateRankingQuery",
"(",
"$",
"innerQuery",
")",
";",
"$",
"data",
"=",
"Db",
"::",
"fetchAll",
"("... | Executes the query.
The object has to be configured first using the other methods.
@param $innerQuery string The "payload" query that does the actual data aggregation. The ordering
has to be specified in this query. {@link RankingQuery} cannot apply ordering
itself.
@param $bind array Bindings for the inner q... | [
"Executes",
"the",
"query",
".",
"The",
"object",
"has",
"to",
"be",
"configured",
"first",
"using",
"the",
"other",
"methods",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/RankingQuery.php#L223-L254 |
209,581 | matomo-org/matomo | core/DataAccess/TableMetadata.php | TableMetadata.getColumns | public function getColumns($table)
{
$table = str_replace("`", "", $table);
$columns = Db::fetchAll("SHOW COLUMNS FROM `" . $table . "`");
$columnNames = array();
foreach ($columns as $column) {
$columnNames[] = $column['Field'];
}
return $columnNames;
... | php | public function getColumns($table)
{
$table = str_replace("`", "", $table);
$columns = Db::fetchAll("SHOW COLUMNS FROM `" . $table . "`");
$columnNames = array();
foreach ($columns as $column) {
$columnNames[] = $column['Field'];
}
return $columnNames;
... | [
"public",
"function",
"getColumns",
"(",
"$",
"table",
")",
"{",
"$",
"table",
"=",
"str_replace",
"(",
"\"`\"",
",",
"\"\"",
",",
"$",
"table",
")",
";",
"$",
"columns",
"=",
"Db",
"::",
"fetchAll",
"(",
"\"SHOW COLUMNS FROM `\"",
".",
"$",
"table",
"... | Returns the list of column names for a table.
@param string $table Prefixed table name.
@return string[] List of column names.. | [
"Returns",
"the",
"list",
"of",
"column",
"names",
"for",
"a",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/TableMetadata.php#L24-L36 |
209,582 | matomo-org/matomo | core/DataAccess/TableMetadata.php | TableMetadata.getIdActionColumnNames | public function getIdActionColumnNames($table)
{
$columns = $this->getColumns($table);
$columns = array_filter($columns, function ($columnName) {
return strpos($columnName, 'idaction') !== false;
});
return array_values($columns);
} | php | public function getIdActionColumnNames($table)
{
$columns = $this->getColumns($table);
$columns = array_filter($columns, function ($columnName) {
return strpos($columnName, 'idaction') !== false;
});
return array_values($columns);
} | [
"public",
"function",
"getIdActionColumnNames",
"(",
"$",
"table",
")",
"{",
"$",
"columns",
"=",
"$",
"this",
"->",
"getColumns",
"(",
"$",
"table",
")",
";",
"$",
"columns",
"=",
"array_filter",
"(",
"$",
"columns",
",",
"function",
"(",
"$",
"columnNa... | Returns the list of idaction columns in a table. A column is
assumed to be an idaction reference if it has `"idaction"` in its
name (eg, `"idaction_url"` or `"idaction_content_name"`.
@param string $table Prefixed table name.
@return string[] | [
"Returns",
"the",
"list",
"of",
"idaction",
"columns",
"in",
"a",
"table",
".",
"A",
"column",
"is",
"assumed",
"to",
"be",
"an",
"idaction",
"reference",
"if",
"it",
"has",
"idaction",
"in",
"its",
"name",
"(",
"eg",
"idaction_url",
"or",
"idaction_conten... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/TableMetadata.php#L46-L55 |
209,583 | matomo-org/matomo | core/Tracker/Model.php | Model.createNewIdAction | public function createNewIdAction($name, $type, $urlPrefix)
{
$newActionId = $this->insertNewAction($name, $type, $urlPrefix);
$realFirstActionId = $this->getIdActionMatchingNameAndType($name, $type);
// if the inserted action ID is not the same as the queried action ID, then that means we... | php | public function createNewIdAction($name, $type, $urlPrefix)
{
$newActionId = $this->insertNewAction($name, $type, $urlPrefix);
$realFirstActionId = $this->getIdActionMatchingNameAndType($name, $type);
// if the inserted action ID is not the same as the queried action ID, then that means we... | [
"public",
"function",
"createNewIdAction",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"urlPrefix",
")",
"{",
"$",
"newActionId",
"=",
"$",
"this",
"->",
"insertNewAction",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"urlPrefix",
")",
";",
"$",
"... | Inserts a new action into the log_action table. If there is an existing action that was inserted
due to another request pre-empting this one, the newly inserted action is deleted.
@param string $name
@param int $type
@param int $urlPrefix
@return int The ID of the action (can be for an existing action or new action). | [
"Inserts",
"a",
"new",
"action",
"into",
"the",
"log_action",
"table",
".",
"If",
"there",
"is",
"an",
"existing",
"action",
"that",
"was",
"inserted",
"due",
"to",
"another",
"request",
"pre",
"-",
"empting",
"this",
"one",
"the",
"newly",
"inserted",
"ac... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Model.php#L161-L174 |
209,584 | matomo-org/matomo | core/Tracker/Model.php | Model.getIdsAction | public function getIdsAction($actionsNameAndType)
{
$sql = "SELECT MIN(idaction) as idaction, type, name FROM " . Common::prefixTable('log_action')
. " WHERE";
$bind = array();
$i = 0;
foreach ($actionsNameAndType as $actionNameType) {
$name = $actionNameTyp... | php | public function getIdsAction($actionsNameAndType)
{
$sql = "SELECT MIN(idaction) as idaction, type, name FROM " . Common::prefixTable('log_action')
. " WHERE";
$bind = array();
$i = 0;
foreach ($actionsNameAndType as $actionNameType) {
$name = $actionNameTyp... | [
"public",
"function",
"getIdsAction",
"(",
"$",
"actionsNameAndType",
")",
"{",
"$",
"sql",
"=",
"\"SELECT MIN(idaction) as idaction, type, name FROM \"",
".",
"Common",
"::",
"prefixTable",
"(",
"'log_action'",
")",
".",
"\" WHERE\"",
";",
"$",
"bind",
"=",
"array"... | Returns the IDs for multiple actions based on name + type values.
@param array $actionsNameAndType Array like `array( array('name' => '...', 'type' => 1), ... )`
@return array|false Array of DB rows w/ columns: **idaction**, **type**, **name**. | [
"Returns",
"the",
"IDs",
"for",
"multiple",
"actions",
"based",
"on",
"name",
"+",
"type",
"values",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Model.php#L216-L252 |
209,585 | matomo-org/matomo | core/Tracker/Model.php | Model.isSiteEmpty | public function isSiteEmpty($siteId)
{
$sql = sprintf('SELECT idsite FROM %s WHERE idsite = ? limit 1', Common::prefixTable('log_visit'));
$result = \Piwik\Db::fetchOne($sql, array($siteId));
return $result == null;
} | php | public function isSiteEmpty($siteId)
{
$sql = sprintf('SELECT idsite FROM %s WHERE idsite = ? limit 1', Common::prefixTable('log_visit'));
$result = \Piwik\Db::fetchOne($sql, array($siteId));
return $result == null;
} | [
"public",
"function",
"isSiteEmpty",
"(",
"$",
"siteId",
")",
"{",
"$",
"sql",
"=",
"sprintf",
"(",
"'SELECT idsite FROM %s WHERE idsite = ? limit 1'",
",",
"Common",
"::",
"prefixTable",
"(",
"'log_visit'",
")",
")",
";",
"$",
"result",
"=",
"\\",
"Piwik",
"\... | Returns true if the site doesn't have raw data.
@param int $siteId
@return bool | [
"Returns",
"true",
"if",
"the",
"site",
"doesn",
"t",
"have",
"raw",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Model.php#L421-L428 |
209,586 | matomo-org/matomo | plugins/Installation/Controller.php | Controller.saveLanguage | public function saveLanguage()
{
if (DbHelper::isInstalled()) {
$this->checkTokenInUrl();
}
$language = $this->getParam('language');
LanguagesManager::setLanguageForSession($language);
Url::redirectToReferrer();
} | php | public function saveLanguage()
{
if (DbHelper::isInstalled()) {
$this->checkTokenInUrl();
}
$language = $this->getParam('language');
LanguagesManager::setLanguageForSession($language);
Url::redirectToReferrer();
} | [
"public",
"function",
"saveLanguage",
"(",
")",
"{",
"if",
"(",
"DbHelper",
"::",
"isInstalled",
"(",
")",
")",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"}",
"$",
"language",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'language'",
")",
... | Save language selection in session-store | [
"Save",
"language",
"selection",
"in",
"session",
"-",
"store"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L477-L485 |
209,587 | matomo-org/matomo | plugins/Installation/Controller.php | Controller.createConfigFile | private function createConfigFile($dbInfos)
{
$config = Config::getInstance();
// make sure DB sessions are used if the filesystem is NFS
if (count($headers = ProxyHeaders::getProxyClientHeaders()) > 0) {
$config->General['proxy_client_headers'] = $headers;
}
if ... | php | private function createConfigFile($dbInfos)
{
$config = Config::getInstance();
// make sure DB sessions are used if the filesystem is NFS
if (count($headers = ProxyHeaders::getProxyClientHeaders()) > 0) {
$config->General['proxy_client_headers'] = $headers;
}
if ... | [
"private",
"function",
"createConfigFile",
"(",
"$",
"dbInfos",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"getInstance",
"(",
")",
";",
"// make sure DB sessions are used if the filesystem is NFS",
"if",
"(",
"count",
"(",
"$",
"headers",
"=",
"ProxyHeaders",
... | Write configuration file from session-store | [
"Write",
"configuration",
"file",
"from",
"session",
"-",
"store"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L550-L586 |
209,588 | matomo-org/matomo | plugins/Installation/Controller.php | Controller.redirectToNextStep | private function redirectToNextStep($currentStep, $parameters = array())
{
$steps = array_keys($this->steps);
$nextStep = $steps[1 + array_search($currentStep, $steps)];
Piwik::redirectToModule('Installation', $nextStep, $parameters);
} | php | private function redirectToNextStep($currentStep, $parameters = array())
{
$steps = array_keys($this->steps);
$nextStep = $steps[1 + array_search($currentStep, $steps)];
Piwik::redirectToModule('Installation', $nextStep, $parameters);
} | [
"private",
"function",
"redirectToNextStep",
"(",
"$",
"currentStep",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"steps",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"steps",
")",
";",
"$",
"nextStep",
"=",
"$",
"steps",
"[",
"1",
... | Redirect to next step
@param string $currentStep Current step
@return void | [
"Redirect",
"to",
"next",
"step"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L629-L634 |
209,589 | matomo-org/matomo | plugins/Installation/Controller.php | Controller.extractHost | private function extractHost($url)
{
$urlParts = parse_url($url);
if (isset($urlParts['host']) && strlen($host = $urlParts['host'])) {
return $host;
}
return false;
} | php | private function extractHost($url)
{
$urlParts = parse_url($url);
if (isset($urlParts['host']) && strlen($host = $urlParts['host'])) {
return $host;
}
return false;
} | [
"private",
"function",
"extractHost",
"(",
"$",
"url",
")",
"{",
"$",
"urlParts",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"urlParts",
"[",
"'host'",
"]",
")",
"&&",
"strlen",
"(",
"$",
"host",
"=",
"$",
"urlParts"... | Extract host from URL
@param string $url URL
@return string|false | [
"Extract",
"host",
"from",
"URL"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L643-L651 |
209,590 | matomo-org/matomo | plugins/Installation/Controller.php | Controller.addTrustedHosts | private function addTrustedHosts($siteUrl)
{
$trustedHosts = array();
// extract host from the request header
if (($host = $this->extractHost('http://' . Url::getHost())) !== false) {
$trustedHosts[] = $host;
}
// extract host from first web site
if (($h... | php | private function addTrustedHosts($siteUrl)
{
$trustedHosts = array();
// extract host from the request header
if (($host = $this->extractHost('http://' . Url::getHost())) !== false) {
$trustedHosts[] = $host;
}
// extract host from first web site
if (($h... | [
"private",
"function",
"addTrustedHosts",
"(",
"$",
"siteUrl",
")",
"{",
"$",
"trustedHosts",
"=",
"array",
"(",
")",
";",
"// extract host from the request header",
"if",
"(",
"(",
"$",
"host",
"=",
"$",
"this",
"->",
"extractHost",
"(",
"'http://'",
".",
"... | Add trusted hosts | [
"Add",
"trusted",
"hosts"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L656-L679 |
209,591 | matomo-org/matomo | plugins/Installation/Controller.php | Controller.hasEnoughTablesToReuseDb | public function hasEnoughTablesToReuseDb($tablesInstalled)
{
if (empty($tablesInstalled) || !is_array($tablesInstalled)) {
return false;
}
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
$baseTablesInstalled = count($tablesInstalled) - count($ar... | php | public function hasEnoughTablesToReuseDb($tablesInstalled)
{
if (empty($tablesInstalled) || !is_array($tablesInstalled)) {
return false;
}
$archiveTables = ArchiveTableCreator::getTablesArchivesInstalled();
$baseTablesInstalled = count($tablesInstalled) - count($ar... | [
"public",
"function",
"hasEnoughTablesToReuseDb",
"(",
"$",
"tablesInstalled",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"tablesInstalled",
")",
"||",
"!",
"is_array",
"(",
"$",
"tablesInstalled",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"archiveTables... | should be private but there's a bug in php 5.3.6 | [
"should",
"be",
"private",
"but",
"there",
"s",
"a",
"bug",
"in",
"php",
"5",
".",
"3",
".",
"6"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/Controller.php#L692-L703 |
209,592 | matomo-org/matomo | core/Access/RolesProvider.php | RolesProvider.getAllRoleIds | public function getAllRoleIds()
{
$ids = array();
foreach ($this->getAllRoles() as $role) {
$ids[] = $role->getId();
}
return $ids;
} | php | public function getAllRoleIds()
{
$ids = array();
foreach ($this->getAllRoles() as $role) {
$ids[] = $role->getId();
}
return $ids;
} | [
"public",
"function",
"getAllRoleIds",
"(",
")",
"{",
"$",
"ids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAllRoles",
"(",
")",
"as",
"$",
"role",
")",
"{",
"$",
"ids",
"[",
"]",
"=",
"$",
"role",
"->",
"getId",
"(",
... | Returns the list of the existing Access level.
Useful when a given API method requests a given acccess Level.
We first check that the required access level exists.
@return array | [
"Returns",
"the",
"list",
"of",
"the",
"existing",
"Access",
"level",
".",
"Useful",
"when",
"a",
"given",
"API",
"method",
"requests",
"a",
"given",
"acccess",
"Level",
".",
"We",
"first",
"check",
"that",
"the",
"required",
"access",
"level",
"exists",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Access/RolesProvider.php#L38-L45 |
209,593 | matomo-org/matomo | plugins/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php | ConfigSettingManipulation.manipulate | public function manipulate(Config $config)
{
if ($this->isArrayAppend) {
$this->appendToArraySetting($config);
} else {
$this->setSingleConfigValue($config);
}
} | php | public function manipulate(Config $config)
{
if ($this->isArrayAppend) {
$this->appendToArraySetting($config);
} else {
$this->setSingleConfigValue($config);
}
} | [
"public",
"function",
"manipulate",
"(",
"Config",
"$",
"config",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isArrayAppend",
")",
"{",
"$",
"this",
"->",
"appendToArraySetting",
"(",
"$",
"config",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setSingl... | Performs the INI config manipulation.
@param Config $config
@throws \Exception if trying to append to a non-array setting value or if trying to set an
array value to a non-array setting | [
"Performs",
"the",
"INI",
"config",
"manipulation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Commands/SetConfig/ConfigSettingManipulation.php#L60-L67 |
209,594 | matomo-org/matomo | core/DataTable/Row.php | Row.export | public function export()
{
return array(
self::COLUMNS => $this->getArrayCopy(),
self::METADATA => $this->metadata,
self::DATATABLE_ASSOCIATED => $this->subtableId,
);
} | php | public function export()
{
return array(
self::COLUMNS => $this->getArrayCopy(),
self::METADATA => $this->metadata,
self::DATATABLE_ASSOCIATED => $this->subtableId,
);
} | [
"public",
"function",
"export",
"(",
")",
"{",
"return",
"array",
"(",
"self",
"::",
"COLUMNS",
"=>",
"$",
"this",
"->",
"getArrayCopy",
"(",
")",
",",
"self",
"::",
"METADATA",
"=>",
"$",
"this",
"->",
"metadata",
",",
"self",
"::",
"DATATABLE_ASSOCIATE... | Used when archiving to serialize the Row's properties.
@return array
@ignore | [
"Used",
"when",
"archiving",
"to",
"serialize",
"the",
"Row",
"s",
"properties",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L88-L95 |
209,595 | matomo-org/matomo | core/DataTable/Row.php | Row.getMetadata | public function getMetadata($name = null)
{
if (is_null($name)) {
return $this->metadata;
}
if (!isset($this->metadata[$name])) {
return false;
}
return $this->metadata[$name];
} | php | public function getMetadata($name = null)
{
if (is_null($name)) {
return $this->metadata;
}
if (!isset($this->metadata[$name])) {
return false;
}
return $this->metadata[$name];
} | [
"public",
"function",
"getMetadata",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"metadata",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"metadata",
"... | Returns the array of all metadata, or one requested metadata value.
@param string|null $name The name of the metadata to return or null to return all metadata.
@return mixed | [
"Returns",
"the",
"array",
"of",
"all",
"metadata",
"or",
"one",
"requested",
"metadata",
"value",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L197-L206 |
209,596 | matomo-org/matomo | core/DataTable/Row.php | Row.getSubtable | public function getSubtable()
{
if ($this->isSubtableLoaded) {
try {
return Manager::getInstance()->getTable($this->subtableId);
} catch (TableNotFoundException $e) {
// edge case
}
}
return false;
} | php | public function getSubtable()
{
if ($this->isSubtableLoaded) {
try {
return Manager::getInstance()->getTable($this->subtableId);
} catch (TableNotFoundException $e) {
// edge case
}
}
return false;
} | [
"public",
"function",
"getSubtable",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSubtableLoaded",
")",
"{",
"try",
"{",
"return",
"Manager",
"::",
"getInstance",
"(",
")",
"->",
"getTable",
"(",
"$",
"this",
"->",
"subtableId",
")",
";",
"}",
"catc... | Returns the associated subtable, if one exists. Returns `false` if none exists.
@return DataTable|bool | [
"Returns",
"the",
"associated",
"subtable",
"if",
"one",
"exists",
".",
"Returns",
"false",
"if",
"none",
"exists",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L252-L262 |
209,597 | matomo-org/matomo | core/DataTable/Row.php | Row.sumSubtable | public function sumSubtable(DataTable $subTable)
{
if ($this->isSubtableLoaded) {
$thisSubTable = $this->getSubtable();
} else {
$this->warnIfSubtableAlreadyExists();
$thisSubTable = new DataTable();
$this->setSubtable($thisSubTable);
}
... | php | public function sumSubtable(DataTable $subTable)
{
if ($this->isSubtableLoaded) {
$thisSubTable = $this->getSubtable();
} else {
$this->warnIfSubtableAlreadyExists();
$thisSubTable = new DataTable();
$this->setSubtable($thisSubTable);
}
... | [
"public",
"function",
"sumSubtable",
"(",
"DataTable",
"$",
"subTable",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSubtableLoaded",
")",
"{",
"$",
"thisSubTable",
"=",
"$",
"this",
"->",
"getSubtable",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->"... | Sums a DataTable to this row's subtable. If this row has no subtable a new
one is created.
See {@link Piwik\DataTable::addDataTable()} to learn how DataTables are summed.
@param DataTable $subTable Table to sum to this row's subtable. | [
"Sums",
"a",
"DataTable",
"to",
"this",
"row",
"s",
"subtable",
".",
"If",
"this",
"row",
"has",
"no",
"subtable",
"a",
"new",
"one",
"is",
"created",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L282-L295 |
209,598 | matomo-org/matomo | core/DataTable/Row.php | Row.setSubtable | public function setSubtable(DataTable $subTable)
{
$this->subtableId = $subTable->getId();
$this->isSubtableLoaded = true;
return $subTable;
} | php | public function setSubtable(DataTable $subTable)
{
$this->subtableId = $subTable->getId();
$this->isSubtableLoaded = true;
return $subTable;
} | [
"public",
"function",
"setSubtable",
"(",
"DataTable",
"$",
"subTable",
")",
"{",
"$",
"this",
"->",
"subtableId",
"=",
"$",
"subTable",
"->",
"getId",
"(",
")",
";",
"$",
"this",
"->",
"isSubtableLoaded",
"=",
"true",
";",
"return",
"$",
"subTable",
";"... | Attaches a subtable to this row, overwriting the existing subtable,
if any.
@param DataTable $subTable DataTable to associate to this row.
@return DataTable Returns `$subTable`. | [
"Attaches",
"a",
"subtable",
"to",
"this",
"row",
"overwriting",
"the",
"existing",
"subtable",
"if",
"any",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L304-L310 |
209,599 | matomo-org/matomo | core/DataTable/Row.php | Row.deleteMetadata | public function deleteMetadata($name = false)
{
if ($name === false) {
$this->metadata = array();
return true;
}
if (!isset($this->metadata[$name])) {
return false;
}
unset($this->metadata[$name]);
return true;
} | php | public function deleteMetadata($name = false)
{
if ($name === false) {
$this->metadata = array();
return true;
}
if (!isset($this->metadata[$name])) {
return false;
}
unset($this->metadata[$name]);
return true;
} | [
"public",
"function",
"deleteMetadata",
"(",
"$",
"name",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"name",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"metadata",
"=",
"array",
"(",
")",
";",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"isset",
"... | Deletes one metadata value or all metadata values.
@param bool|string $name Metadata name (omit to delete entire metadata).
@return bool `true` on success, `false` if the column didn't exist | [
"Deletes",
"one",
"metadata",
"value",
"or",
"all",
"metadata",
"values",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row.php#L371-L382 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.