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,900 | matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.formatPercentEvolution | public function formatPercentEvolution($value)
{
$isPositiveEvolution = !empty($value) && ($value > 0 || $value[0] == '+');
$formatted = self::formatPercent($value);
if ($isPositiveEvolution) {
// $this->symbols has already been initialized from formatPercent().
$la... | php | public function formatPercentEvolution($value)
{
$isPositiveEvolution = !empty($value) && ($value > 0 || $value[0] == '+');
$formatted = self::formatPercent($value);
if ($isPositiveEvolution) {
// $this->symbols has already been initialized from formatPercent().
$la... | [
"public",
"function",
"formatPercentEvolution",
"(",
"$",
"value",
")",
"{",
"$",
"isPositiveEvolution",
"=",
"!",
"empty",
"(",
"$",
"value",
")",
"&&",
"(",
"$",
"value",
">",
"0",
"||",
"$",
"value",
"[",
"0",
"]",
"==",
"'+'",
")",
";",
"$",
"f... | Formats given number as percent value, but keep the leading + sign if found
@param $value
@return string | [
"Formats",
"given",
"number",
"as",
"percent",
"value",
"but",
"keep",
"the",
"leading",
"+",
"sign",
"if",
"found"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L106-L118 |
209,901 | matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.getPattern | protected function getPattern($value, $translationId)
{
$language = $this->translator->getCurrentLanguage();
if (!isset($this->patterns[$language][$translationId])) {
$this->patterns[$language][$translationId] = $this->parsePattern($this->translator->translate($translationId));
... | php | protected function getPattern($value, $translationId)
{
$language = $this->translator->getCurrentLanguage();
if (!isset($this->patterns[$language][$translationId])) {
$this->patterns[$language][$translationId] = $this->parsePattern($this->translator->translate($translationId));
... | [
"protected",
"function",
"getPattern",
"(",
"$",
"value",
",",
"$",
"translationId",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"translator",
"->",
"getCurrentLanguage",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"patterns",
... | Returns the relevant pattern for the given number.
@param string $value
@param string $translationId
@return string | [
"Returns",
"the",
"relevant",
"pattern",
"for",
"the",
"given",
"number",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L154-L166 |
209,902 | matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.parsePattern | protected function parsePattern($pattern)
{
$patterns = explode(';', $pattern);
if (!isset($patterns[1])) {
// No explicit negative pattern was provided, construct it.
$patterns[1] = '-' . $patterns[0];
}
return $patterns;
} | php | protected function parsePattern($pattern)
{
$patterns = explode(';', $pattern);
if (!isset($patterns[1])) {
// No explicit negative pattern was provided, construct it.
$patterns[1] = '-' . $patterns[0];
}
return $patterns;
} | [
"protected",
"function",
"parsePattern",
"(",
"$",
"pattern",
")",
"{",
"$",
"patterns",
"=",
"explode",
"(",
"';'",
",",
"$",
"pattern",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"patterns",
"[",
"1",
"]",
")",
")",
"{",
"// No explicit negative pa... | Parses the given pattern and returns patterns for positive and negative numbers
@param string $pattern
@return array | [
"Parses",
"the",
"given",
"pattern",
"and",
"returns",
"patterns",
"for",
"positive",
"and",
"negative",
"numbers"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L174-L182 |
209,903 | matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.formatNumberWithPattern | protected function formatNumberWithPattern($pattern, $value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
if (!is_numeric($value)) {
return $value;
}
$usesGrouping = (strpos($pattern, ',') !== false);
// if pattern has number groups, parse them.
if ($use... | php | protected function formatNumberWithPattern($pattern, $value, $maximumFractionDigits=0, $minimumFractionDigits=0)
{
if (!is_numeric($value)) {
return $value;
}
$usesGrouping = (strpos($pattern, ',') !== false);
// if pattern has number groups, parse them.
if ($use... | [
"protected",
"function",
"formatNumberWithPattern",
"(",
"$",
"pattern",
",",
"$",
"value",
",",
"$",
"maximumFractionDigits",
"=",
"0",
",",
"$",
"minimumFractionDigits",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
... | Formats the given number with the given pattern
@param string $pattern
@param string|int|float $value
@param int $maximumFractionDigits
@param int $minimumFractionDigits
@return mixed|string | [
"Formats",
"the",
"given",
"number",
"with",
"the",
"given",
"pattern"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L193-L255 |
209,904 | matomo-org/matomo | core/NumberFormatter.php | NumberFormatter.replaceSymbols | protected function replaceSymbols($value)
{
$language = $this->translator->getCurrentLanguage();
if (!isset($this->symbols[$language])) {
$this->symbols[$language] = array(
'.' => $this->translator->translate('Intl_NumberSymbolDecimal'),
',' => $this->tra... | php | protected function replaceSymbols($value)
{
$language = $this->translator->getCurrentLanguage();
if (!isset($this->symbols[$language])) {
$this->symbols[$language] = array(
'.' => $this->translator->translate('Intl_NumberSymbolDecimal'),
',' => $this->tra... | [
"protected",
"function",
"replaceSymbols",
"(",
"$",
"value",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"translator",
"->",
"getCurrentLanguage",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"symbols",
"[",
"$",
"language",
... | Replaces number symbols with their localized equivalents.
@param string $value The value being formatted.
@return string
@see http://cldr.unicode.org/translation/number-symbols | [
"Replaces",
"number",
"symbols",
"with",
"their",
"localized",
"equivalents",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L267-L282 |
209,905 | matomo-org/matomo | plugins/ExampleTracker/Columns/ExampleConversionDimension.php | ExampleConversionDimension.onEcommerceOrderConversion | public function onEcommerceOrderConversion(Request $request, Visitor $visitor, $action, GoalManager $goalManager)
{
if ($visitor->isVisitorKnown()) {
return 1;
}
return 0;
} | php | public function onEcommerceOrderConversion(Request $request, Visitor $visitor, $action, GoalManager $goalManager)
{
if ($visitor->isVisitorKnown()) {
return 1;
}
return 0;
} | [
"public",
"function",
"onEcommerceOrderConversion",
"(",
"Request",
"$",
"request",
",",
"Visitor",
"$",
"visitor",
",",
"$",
"action",
",",
"GoalManager",
"$",
"goalManager",
")",
"{",
"if",
"(",
"$",
"visitor",
"->",
"isVisitorKnown",
"(",
")",
")",
"{",
... | This event is triggered when an ecommerce order is converted. In this example we would store a "0" in case it
was the visitors first action or "1" otherwise.
Return boolean false if you do not want to change the value in some cases. If you do not want to perform any
action on an ecommerce order at all it is recommended... | [
"This",
"event",
"is",
"triggered",
"when",
"an",
"ecommerce",
"order",
"is",
"converted",
".",
"In",
"this",
"example",
"we",
"would",
"store",
"a",
"0",
"in",
"case",
"it",
"was",
"the",
"visitors",
"first",
"action",
"or",
"1",
"otherwise",
".",
"Retu... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExampleTracker/Columns/ExampleConversionDimension.php#L81-L88 |
209,906 | matomo-org/matomo | plugins/ExampleTracker/Columns/ExampleConversionDimension.php | ExampleConversionDimension.onEcommerceCartUpdateConversion | public function onEcommerceCartUpdateConversion(Request $request, Visitor $visitor, $action, GoalManager $goalManager)
{
return Common::getRequestVar('myCustomParam', $default = false, 'int', $request->getParams());
} | php | public function onEcommerceCartUpdateConversion(Request $request, Visitor $visitor, $action, GoalManager $goalManager)
{
return Common::getRequestVar('myCustomParam', $default = false, 'int', $request->getParams());
} | [
"public",
"function",
"onEcommerceCartUpdateConversion",
"(",
"Request",
"$",
"request",
",",
"Visitor",
"$",
"visitor",
",",
"$",
"action",
",",
"GoalManager",
"$",
"goalManager",
")",
"{",
"return",
"Common",
"::",
"getRequestVar",
"(",
"'myCustomParam'",
",",
... | This event is triggered when an ecommerce cart update is converted. In this example we would store a
the value of the tracking url parameter "myCustomParam" in the "example_conversion_dimension" column.
Return boolean false if you do not want to change the value in some cases. If you do not want to perform any
action o... | [
"This",
"event",
"is",
"triggered",
"when",
"an",
"ecommerce",
"cart",
"update",
"is",
"converted",
".",
"In",
"this",
"example",
"we",
"would",
"store",
"a",
"the",
"value",
"of",
"the",
"tracking",
"url",
"parameter",
"myCustomParam",
"in",
"the",
"example... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExampleTracker/Columns/ExampleConversionDimension.php#L103-L106 |
209,907 | matomo-org/matomo | plugins/ExampleTracker/Columns/ExampleConversionDimension.php | ExampleConversionDimension.onGoalConversion | public function onGoalConversion(Request $request, Visitor $visitor, $action, GoalManager $goalManager)
{
$goalId = $goalManager->getGoalColumn('idgoal');
if ($visitor->isVisitorKnown()) {
return $goalId;
}
return false;
} | php | public function onGoalConversion(Request $request, Visitor $visitor, $action, GoalManager $goalManager)
{
$goalId = $goalManager->getGoalColumn('idgoal');
if ($visitor->isVisitorKnown()) {
return $goalId;
}
return false;
} | [
"public",
"function",
"onGoalConversion",
"(",
"Request",
"$",
"request",
",",
"Visitor",
"$",
"visitor",
",",
"$",
"action",
",",
"GoalManager",
"$",
"goalManager",
")",
"{",
"$",
"goalId",
"=",
"$",
"goalManager",
"->",
"getGoalColumn",
"(",
"'idgoal'",
")... | This event is triggered when an any custom goal is converted. In this example we would store a the id of the
goal in the 'example_conversion_dimension' column if the visitor is known and nothing otherwise.
Return boolean false if you do not want to change the value in some cases. If you do not want to perform any
actio... | [
"This",
"event",
"is",
"triggered",
"when",
"an",
"any",
"custom",
"goal",
"is",
"converted",
".",
"In",
"this",
"example",
"we",
"would",
"store",
"a",
"the",
"id",
"of",
"the",
"goal",
"in",
"the",
"example_conversion_dimension",
"column",
"if",
"the",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExampleTracker/Columns/ExampleConversionDimension.php#L121-L130 |
209,908 | matomo-org/matomo | core/ReportRenderer.php | ReportRenderer.processTableFormat | protected static function processTableFormat($reportMetadata, $report, $reportColumns)
{
$finalReport = $report;
if (empty($reportMetadata['dimension'])) {
$simpleReportMetrics = $report->getFirstRow();
if ($simpleReportMetrics) {
$finalReport = new Simple();
... | php | protected static function processTableFormat($reportMetadata, $report, $reportColumns)
{
$finalReport = $report;
if (empty($reportMetadata['dimension'])) {
$simpleReportMetrics = $report->getFirstRow();
if ($simpleReportMetrics) {
$finalReport = new Simple();
... | [
"protected",
"static",
"function",
"processTableFormat",
"(",
"$",
"reportMetadata",
",",
"$",
"report",
",",
"$",
"reportColumns",
")",
"{",
"$",
"finalReport",
"=",
"$",
"report",
";",
"if",
"(",
"empty",
"(",
"$",
"reportMetadata",
"[",
"'dimension'",
"]"... | Convert a dimension-less report to a multi-row two-column data table
@static
@param $reportMetadata array
@param $report DataTable
@param $reportColumns array
@return array DataTable $report & array $columns | [
"Convert",
"a",
"dimension",
"-",
"less",
"report",
"to",
"a",
"multi",
"-",
"row",
"two",
"-",
"column",
"data",
"table"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ReportRenderer.php#L222-L247 |
209,909 | matomo-org/matomo | core/DataTable/Filter/RangeCheck.php | RangeCheck.filter | public function filter($table)
{
foreach ($table->getRows() as $row) {
$value = $row->getColumn($this->columnToFilter);
if ($value === false) {
$value = $row->getMetadata($this->columnToFilter);
if ($value !== false) {
if ($value <... | php | public function filter($table)
{
foreach ($table->getRows() as $row) {
$value = $row->getColumn($this->columnToFilter);
if ($value === false) {
$value = $row->getMetadata($this->columnToFilter);
if ($value !== false) {
if ($value <... | [
"public",
"function",
"filter",
"(",
"$",
"table",
")",
"{",
"foreach",
"(",
"$",
"table",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"value",
"=",
"$",
"row",
"->",
"getColumn",
"(",
"$",
"this",
"->",
"columnToFilter",
")",
";",
... | Executes the filter an adjusts all columns to fit the defined range
@param DataTable $table | [
"Executes",
"the",
"filter",
"an",
"adjusts",
"all",
"columns",
"to",
"fit",
"the",
"defined",
"range"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/RangeCheck.php#L46-L71 |
209,910 | matomo-org/matomo | core/Config.php | Config.reload | protected function reload($pathLocal = null, $pathGlobal = null, $pathCommon = null)
{
$this->settings->reload($pathGlobal, $pathLocal, $pathCommon);
} | php | protected function reload($pathLocal = null, $pathGlobal = null, $pathCommon = null)
{
$this->settings->reload($pathGlobal, $pathLocal, $pathCommon);
} | [
"protected",
"function",
"reload",
"(",
"$",
"pathLocal",
"=",
"null",
",",
"$",
"pathGlobal",
"=",
"null",
",",
"$",
"pathCommon",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"settings",
"->",
"reload",
"(",
"$",
"pathGlobal",
",",
"$",
"pathLocal",
","... | Reloads config data from disk.
@throws \Exception if the global config file is not found and this is a tracker request, or
if the local config file is not found and this is NOT a tracker request. | [
"Reloads",
"config",
"data",
"from",
"disk",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config.php#L315-L318 |
209,911 | matomo-org/matomo | core/Config.php | Config.writeConfig | protected function writeConfig($clear = true)
{
$output = $this->dumpConfig();
if ($output !== null
&& $output !== false
) {
$localPath = $this->getLocalPath();
if ($this->doNotWriteConfigInTests) {
// simulate whether it would be successf... | php | protected function writeConfig($clear = true)
{
$output = $this->dumpConfig();
if ($output !== null
&& $output !== false
) {
$localPath = $this->getLocalPath();
if ($this->doNotWriteConfigInTests) {
// simulate whether it would be successf... | [
"protected",
"function",
"writeConfig",
"(",
"$",
"clear",
"=",
"true",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"dumpConfig",
"(",
")",
";",
"if",
"(",
"$",
"output",
"!==",
"null",
"&&",
"$",
"output",
"!==",
"false",
")",
"{",
"$",
"loca... | Write user configuration file
@param array $configLocal
@param array $configGlobal
@param array $configCommon
@param array $configCache
@param string $pathLocal
@param bool $clear
@throws \Exception if config file not writable | [
"Write",
"user",
"configuration",
"file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config.php#L415-L445 |
209,912 | matomo-org/matomo | core/Config.php | Config.setSetting | public static function setSetting($sectionName, $name, $value)
{
$section = self::getInstance()->$sectionName;
$section[$name] = $value;
self::getInstance()->$sectionName = $section;
} | php | public static function setSetting($sectionName, $name, $value)
{
$section = self::getInstance()->$sectionName;
$section[$name] = $value;
self::getInstance()->$sectionName = $section;
} | [
"public",
"static",
"function",
"setSetting",
"(",
"$",
"sectionName",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"section",
"=",
"self",
"::",
"getInstance",
"(",
")",
"->",
"$",
"sectionName",
";",
"$",
"section",
"[",
"$",
"name",
"]",
"=... | Convenience method for setting settings in a single section. Will set them in a new array first
to be compatible with certain PHP versions.
@param string $sectionName Section name.
@param string $name The setting name.
@param mixed $value The setting value to set. | [
"Convenience",
"method",
"for",
"setting",
"settings",
"in",
"a",
"single",
"section",
".",
"Will",
"set",
"them",
"in",
"a",
"new",
"array",
"first",
"to",
"be",
"compatible",
"with",
"certain",
"PHP",
"versions",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Config.php#L475-L480 |
209,913 | matomo-org/matomo | libs/Zend/Cache/Frontend/Page.php | Zend_Cache_Frontend_Page._setContentTypeMemorization | protected function _setContentTypeMemorization($value)
{
$found = null;
foreach ($this->_specificOptions['memorize_headers'] as $key => $value) {
if (strtolower($value) == 'content-type') {
$found = $key;
}
}
if ($value) {
if (!$fou... | php | protected function _setContentTypeMemorization($value)
{
$found = null;
foreach ($this->_specificOptions['memorize_headers'] as $key => $value) {
if (strtolower($value) == 'content-type') {
$found = $key;
}
}
if ($value) {
if (!$fou... | [
"protected",
"function",
"_setContentTypeMemorization",
"(",
"$",
"value",
")",
"{",
"$",
"found",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"_specificOptions",
"[",
"'memorize_headers'",
"]",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if"... | Set the deprecated contentTypeMemorization option
@param boolean $value value
@return void
@deprecated | [
"Set",
"the",
"deprecated",
"contentTypeMemorization",
"option"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Page.php#L186-L203 |
209,914 | matomo-org/matomo | libs/Zend/Cache/Frontend/Page.php | Zend_Cache_Frontend_Page._makePartialId | protected function _makePartialId($arrayName, $bool1, $bool2)
{
switch ($arrayName) {
case 'Get':
$var = $_GET;
break;
case 'Post':
$var = $_POST;
break;
case 'Session':
if (isset($_SESSION)) {
$var = $_SESSI... | php | protected function _makePartialId($arrayName, $bool1, $bool2)
{
switch ($arrayName) {
case 'Get':
$var = $_GET;
break;
case 'Post':
$var = $_POST;
break;
case 'Session':
if (isset($_SESSION)) {
$var = $_SESSI... | [
"protected",
"function",
"_makePartialId",
"(",
"$",
"arrayName",
",",
"$",
"bool1",
",",
"$",
"bool2",
")",
"{",
"switch",
"(",
"$",
"arrayName",
")",
"{",
"case",
"'Get'",
":",
"$",
"var",
"=",
"$",
"_GET",
";",
"break",
";",
"case",
"'Post'",
":",... | Make a partial id depending on options
@param string $arrayName Superglobal array name
@param bool $bool1 If true, cache is still on even if there are some variables in the superglobal array
@param bool $bool2 If true, we have to use the content of the superglobal array to make a partial id
@return mixe... | [
"Make",
"a",
"partial",
"id",
"depending",
"on",
"options"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Page.php#L363-L402 |
209,915 | matomo-org/matomo | core/API/ResponseBuilder.php | ResponseBuilder.getResponse | public function getResponse($value = null, $apiModule = false, $apiMethod = false)
{
$this->apiModule = $apiModule;
$this->apiMethod = $apiMethod;
$this->sendHeaderIfEnabled();
// when null or void is returned from the api call, we handle it as a successful operation
if (!i... | php | public function getResponse($value = null, $apiModule = false, $apiMethod = false)
{
$this->apiModule = $apiModule;
$this->apiMethod = $apiMethod;
$this->sendHeaderIfEnabled();
// when null or void is returned from the api call, we handle it as a successful operation
if (!i... | [
"public",
"function",
"getResponse",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"apiModule",
"=",
"false",
",",
"$",
"apiMethod",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"apiModule",
"=",
"$",
"apiModule",
";",
"$",
"this",
"->",
"apiMethod",
"=",
... | This method processes the data resulting from the API call.
- If the data resulted from the API call is a DataTable then
- we apply the standard filters if the parameters have been found
in the URL. For example to offset,limit the Table you can add the following parameters to any API
call that returns a DataTable: fil... | [
"This",
"method",
"processes",
"the",
"data",
"resulting",
"from",
"the",
"API",
"call",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/ResponseBuilder.php#L83-L124 |
209,916 | matomo-org/matomo | libs/Zend/Db/Adapter/Mysqli.php | Zend_Db_Adapter_Mysqli._connect | protected function _connect()
{
if ($this->_connection) {
return;
}
if (!extension_loaded('mysqli')) {
/**
* @see Zend_Db_Adapter_Mysqli_Exception
*/
// require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
throw new Z... | php | protected function _connect()
{
if ($this->_connection) {
return;
}
if (!extension_loaded('mysqli')) {
/**
* @see Zend_Db_Adapter_Mysqli_Exception
*/
// require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
throw new Z... | [
"protected",
"function",
"_connect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_connection",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"extension_loaded",
"(",
"'mysqli'",
")",
")",
"{",
"/**\n * @see Zend_Db_Adapter_Mysqli_Exception\n ... | Creates a connection to the database.
@return void
@throws Zend_Db_Adapter_Mysqli_Exception | [
"Creates",
"a",
"connection",
"to",
"the",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Mysqli.php#L280-L375 |
209,917 | matomo-org/matomo | libs/Zend/Db/Adapter/Mysqli.php | Zend_Db_Adapter_Mysqli.prepare | public function prepare($sql)
{
$this->_connect();
if ($this->_stmt) {
$this->_stmt->close();
}
$stmtClass = $this->_defaultStmtClass;
if (!class_exists($stmtClass)) {
// require_once 'Zend/Loader.php';
Zend_Loader::loadClass($stmtClass);
... | php | public function prepare($sql)
{
$this->_connect();
if ($this->_stmt) {
$this->_stmt->close();
}
$stmtClass = $this->_defaultStmtClass;
if (!class_exists($stmtClass)) {
// require_once 'Zend/Loader.php';
Zend_Loader::loadClass($stmtClass);
... | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_stmt",
")",
"{",
"$",
"this",
"->",
"_stmt",
"->",
"close",
"(",
")",
";",
"}",
"$",
"stmtClass",
"=",
"$"... | Prepare a statement and return a PDOStatement-like object.
@param string $sql SQL query
@return Zend_Db_Statement_Mysqli | [
"Prepare",
"a",
"statement",
"and",
"return",
"a",
"PDOStatement",
"-",
"like",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Mysqli.php#L406-L424 |
209,918 | matomo-org/matomo | libs/Zend/Db/Adapter/Mysqli.php | Zend_Db_Adapter_Mysqli._rollBack | protected function _rollBack()
{
$this->_connect();
$this->_connection->rollback();
$this->_connection->autocommit(true);
} | php | protected function _rollBack()
{
$this->_connect();
$this->_connection->rollback();
$this->_connection->autocommit(true);
} | [
"protected",
"function",
"_rollBack",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"this",
"->",
"_connection",
"->",
"rollback",
"(",
")",
";",
"$",
"this",
"->",
"_connection",
"->",
"autocommit",
"(",
"true",
")",
";",
"}"
] | Roll-back a transaction.
@return void | [
"Roll",
"-",
"back",
"a",
"transaction",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Mysqli.php#L477-L482 |
209,919 | matomo-org/matomo | core/Translation/Translator.php | Translator.translate | public function translate($translationId, $args = array(), $language = null)
{
$args = is_array($args) ? $args : array($args);
if (strpos($translationId, "_") !== false) {
list($plugin, $key) = explode("_", $translationId, 2);
$language = is_string($language) ? $language : $... | php | public function translate($translationId, $args = array(), $language = null)
{
$args = is_array($args) ? $args : array($args);
if (strpos($translationId, "_") !== false) {
list($plugin, $key) = explode("_", $translationId, 2);
$language = is_string($language) ? $language : $... | [
"public",
"function",
"translate",
"(",
"$",
"translationId",
",",
"$",
"args",
"=",
"array",
"(",
")",
",",
"$",
"language",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"is_array",
"(",
"$",
"args",
")",
"?",
"$",
"args",
":",
"array",
"(",
"$",
"a... | Returns an internationalized string using a translation ID. If a translation
cannot be found for the ID, the ID is returned.
@param string $translationId Translation ID, eg, `General_Date`.
@param array|string|int $args `sprintf` arguments to be applied to the internationalized
string.
@param string|null $language Opt... | [
"Returns",
"an",
"internationalized",
"string",
"using",
"a",
"translation",
"ID",
".",
"If",
"a",
"translation",
"cannot",
"be",
"found",
"for",
"the",
"ID",
"the",
"ID",
"is",
"returned",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Translator.php#L75-L90 |
209,920 | matomo-org/matomo | core/Translation/Translator.php | Translator.getJavascriptTranslations | public function getJavascriptTranslations()
{
$clientSideTranslations = array();
foreach ($this->getClientSideTranslationKeys() as $id) {
list($plugin, $key) = explode('_', $id, 2);
$clientSideTranslations[$id] = $this->getTranslation($id, $this->currentLanguage, $plugin, $ke... | php | public function getJavascriptTranslations()
{
$clientSideTranslations = array();
foreach ($this->getClientSideTranslationKeys() as $id) {
list($plugin, $key) = explode('_', $id, 2);
$clientSideTranslations[$id] = $this->getTranslation($id, $this->currentLanguage, $plugin, $ke... | [
"public",
"function",
"getJavascriptTranslations",
"(",
")",
"{",
"$",
"clientSideTranslations",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getClientSideTranslationKeys",
"(",
")",
"as",
"$",
"id",
")",
"{",
"list",
"(",
"$",
"plugin",
... | Generate javascript translations array | [
"Generate",
"javascript",
"translations",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Translator.php#L127-L139 |
209,921 | matomo-org/matomo | core/Translation/Translator.php | Translator.addDirectory | public function addDirectory($directory)
{
if (isset($this->directories[$directory])) {
return;
}
// index by name to avoid duplicates
$this->directories[$directory] = $directory;
// clear currently loaded translations to force reloading them
$this->trans... | php | public function addDirectory($directory)
{
if (isset($this->directories[$directory])) {
return;
}
// index by name to avoid duplicates
$this->directories[$directory] = $directory;
// clear currently loaded translations to force reloading them
$this->trans... | [
"public",
"function",
"addDirectory",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"directories",
"[",
"$",
"directory",
"]",
")",
")",
"{",
"return",
";",
"}",
"// index by name to avoid duplicates",
"$",
"this",
"->",
"dir... | Add a directory containing translations.
@param string $directory | [
"Add",
"a",
"directory",
"containing",
"translations",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Translator.php#L179-L189 |
209,922 | matomo-org/matomo | core/Translation/Translator.php | Translator.reset | public function reset()
{
$this->currentLanguage = $this->getDefaultLanguage();
$this->directories = array(PIWIK_INCLUDE_PATH . '/lang');
$this->translations = array();
} | php | public function reset()
{
$this->currentLanguage = $this->getDefaultLanguage();
$this->directories = array(PIWIK_INCLUDE_PATH . '/lang');
$this->translations = array();
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"currentLanguage",
"=",
"$",
"this",
"->",
"getDefaultLanguage",
"(",
")",
";",
"$",
"this",
"->",
"directories",
"=",
"array",
"(",
"PIWIK_INCLUDE_PATH",
".",
"'/lang'",
")",
";",
"$",
"th... | Should be used by tests only, and this method should eventually be removed. | [
"Should",
"be",
"used",
"by",
"tests",
"only",
"and",
"this",
"method",
"should",
"eventually",
"be",
"removed",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Translator.php#L194-L199 |
209,923 | matomo-org/matomo | core/Translation/Translator.php | Translator.getAllTranslations | public function getAllTranslations()
{
$this->loadTranslations($this->currentLanguage);
if (!isset($this->translations[$this->currentLanguage])) {
return array();
}
return $this->translations[$this->currentLanguage];
} | php | public function getAllTranslations()
{
$this->loadTranslations($this->currentLanguage);
if (!isset($this->translations[$this->currentLanguage])) {
return array();
}
return $this->translations[$this->currentLanguage];
} | [
"public",
"function",
"getAllTranslations",
"(",
")",
"{",
"$",
"this",
"->",
"loadTranslations",
"(",
"$",
"this",
"->",
"currentLanguage",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"translations",
"[",
"$",
"this",
"->",
"currentLanguage... | Returns all the translation messages loaded.
@return array | [
"Returns",
"all",
"the",
"translation",
"messages",
"loaded",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Translator.php#L222-L231 |
209,924 | matomo-org/matomo | libs/Zend/Cache/Frontend/Class.php | Zend_Cache_Frontend_Class.setCachedEntity | public function setCachedEntity($cachedEntity)
{
if (!is_string($cachedEntity) && !is_object($cachedEntity)) {
Zend_Cache::throwException('cached_entity must be an object or a class name');
}
$this->_cachedEntity = $cachedEntity;
$this->_specificOptions['cached_entity'] =... | php | public function setCachedEntity($cachedEntity)
{
if (!is_string($cachedEntity) && !is_object($cachedEntity)) {
Zend_Cache::throwException('cached_entity must be an object or a class name');
}
$this->_cachedEntity = $cachedEntity;
$this->_specificOptions['cached_entity'] =... | [
"public",
"function",
"setCachedEntity",
"(",
"$",
"cachedEntity",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"cachedEntity",
")",
"&&",
"!",
"is_object",
"(",
"$",
"cachedEntity",
")",
")",
"{",
"Zend_Cache",
"::",
"throwException",
"(",
"'cached_enti... | Specific method to set the cachedEntity
if set to a class name, we will cache an abstract class and will use only static calls
if set to an object, we will cache this object methods
@param mixed $cachedEntity | [
"Specific",
"method",
"to",
"set",
"the",
"cachedEntity"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/Class.php#L168-L181 |
209,925 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.save | public function save($idSite)
{
$this->checkIdSiteIsLoaded($idSite);
$optionName = self::getAnnotationCollectionOptionName($idSite);
Option::set($optionName, serialize($this->annotations[$idSite]));
} | php | public function save($idSite)
{
$this->checkIdSiteIsLoaded($idSite);
$optionName = self::getAnnotationCollectionOptionName($idSite);
Option::set($optionName, serialize($this->annotations[$idSite]));
} | [
"public",
"function",
"save",
"(",
"$",
"idSite",
")",
"{",
"$",
"this",
"->",
"checkIdSiteIsLoaded",
"(",
"$",
"idSite",
")",
";",
"$",
"optionName",
"=",
"self",
"::",
"getAnnotationCollectionOptionName",
"(",
"$",
"idSite",
")",
";",
"Option",
"::",
"se... | Persists the annotations list for a site, overwriting whatever exists.
@param int $idSite The ID of the site to save annotations for.
@throws Exception if $idSite is not an ID that was supplied upon construction. | [
"Persists",
"the",
"annotations",
"list",
"for",
"a",
"site",
"overwriting",
"whatever",
"exists",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L105-L111 |
209,926 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.update | public function update($idSite, $idNote, $date = null, $note = null, $starred = null)
{
$this->checkIdSiteIsLoaded($idSite);
$this->checkNoteExists($idSite, $idNote);
$annotation =& $this->annotations[$idSite][$idNote];
if ($date !== null) {
$annotation['date'] = Date::f... | php | public function update($idSite, $idNote, $date = null, $note = null, $starred = null)
{
$this->checkIdSiteIsLoaded($idSite);
$this->checkNoteExists($idSite, $idNote);
$annotation =& $this->annotations[$idSite][$idNote];
if ($date !== null) {
$annotation['date'] = Date::f... | [
"public",
"function",
"update",
"(",
"$",
"idSite",
",",
"$",
"idNote",
",",
"$",
"date",
"=",
"null",
",",
"$",
"note",
"=",
"null",
",",
"$",
"starred",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"checkIdSiteIsLoaded",
"(",
"$",
"idSite",
")",
";"... | Modifies an annotation in this instance's collection of annotations.
Note: This method does not perist the change in the DB. The save method must
be called for that.
@param int $idSite The ID of the site whose annotation will be updated.
@param int $idNote The ID of the note.
@param string|null $date The new date of ... | [
"Modifies",
"an",
"annotation",
"in",
"this",
"instance",
"s",
"collection",
"of",
"annotations",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L130-L145 |
209,927 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.remove | public function remove($idSite, $idNote)
{
$this->checkIdSiteIsLoaded($idSite);
$this->checkNoteExists($idSite, $idNote);
unset($this->annotations[$idSite][$idNote]);
} | php | public function remove($idSite, $idNote)
{
$this->checkIdSiteIsLoaded($idSite);
$this->checkNoteExists($idSite, $idNote);
unset($this->annotations[$idSite][$idNote]);
} | [
"public",
"function",
"remove",
"(",
"$",
"idSite",
",",
"$",
"idNote",
")",
"{",
"$",
"this",
"->",
"checkIdSiteIsLoaded",
"(",
"$",
"idSite",
")",
";",
"$",
"this",
"->",
"checkNoteExists",
"(",
"$",
"idSite",
",",
"$",
"idNote",
")",
";",
"unset",
... | Removes a note from a site's collection of annotations.
Note: This method does not perist the change in the DB. The save method must
be called for that.
@param int $idSite The ID of the site whose annotation will be updated.
@param int $idNote The ID of the note.
@throws Exception if $idSite is not an ID that was sup... | [
"Removes",
"a",
"note",
"from",
"a",
"site",
"s",
"collection",
"of",
"annotations",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L158-L164 |
209,928 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.get | public function get($idSite, $idNote)
{
$this->checkIdSiteIsLoaded($idSite);
$this->checkNoteExists($idSite, $idNote);
$annotation = $this->annotations[$idSite][$idNote];
$this->augmentAnnotationData($idSite, $idNote, $annotation);
return $annotation;
} | php | public function get($idSite, $idNote)
{
$this->checkIdSiteIsLoaded($idSite);
$this->checkNoteExists($idSite, $idNote);
$annotation = $this->annotations[$idSite][$idNote];
$this->augmentAnnotationData($idSite, $idNote, $annotation);
return $annotation;
} | [
"public",
"function",
"get",
"(",
"$",
"idSite",
",",
"$",
"idNote",
")",
"{",
"$",
"this",
"->",
"checkIdSiteIsLoaded",
"(",
"$",
"idSite",
")",
";",
"$",
"this",
"->",
"checkNoteExists",
"(",
"$",
"idSite",
",",
"$",
"idNote",
")",
";",
"$",
"annot... | Retrieves an annotation by ID.
This function returns an array with the following elements:
- idNote: The ID of the annotation.
- date: The date of the annotation.
- note: The text of the annotation.
- starred: 1 or 0, whether the annotation is stared;
- user: (unless current user is anonymous) The user that created th... | [
"Retrieves",
"an",
"annotation",
"by",
"ID",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L198-L206 |
209,929 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.search | public function search($startDate, $endDate, $idSite = false)
{
if ($idSite) {
$idSites = Site::getIdSitesFromIdSitesString($idSite);
} else {
$idSites = array_keys($this->annotations);
}
// collect annotations that are within the right date range & belong to... | php | public function search($startDate, $endDate, $idSite = false)
{
if ($idSite) {
$idSites = Site::getIdSitesFromIdSitesString($idSite);
} else {
$idSites = array_keys($this->annotations);
}
// collect annotations that are within the right date range & belong to... | [
"public",
"function",
"search",
"(",
"$",
"startDate",
",",
"$",
"endDate",
",",
"$",
"idSite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"idSite",
")",
"{",
"$",
"idSites",
"=",
"Site",
"::",
"getIdSitesFromIdSitesString",
"(",
"$",
"idSite",
")",
";",
... | Returns all annotations within a specific date range. The result is
an array that maps site IDs with arrays of annotations within the range.
Note: The date range is inclusive.
@see self::get for info on what attributes stored within annotations.
@param Date|bool $startDate The start of the date range.
@param Date|bo... | [
"Returns",
"all",
"annotations",
"within",
"a",
"specific",
"date",
"range",
".",
"The",
"result",
"is",
"an",
"array",
"that",
"maps",
"site",
"IDs",
"with",
"arrays",
"of",
"annotations",
"within",
"the",
"range",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L234-L270 |
209,930 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.count | public function count($idSite, $startDate, $endDate)
{
$this->checkIdSiteIsLoaded($idSite);
// search includes end date, and count should not, so subtract one from the timestamp
$annotations = $this->search($startDate, Date::factory($endDate->getTimestamp() - 1));
// count the anno... | php | public function count($idSite, $startDate, $endDate)
{
$this->checkIdSiteIsLoaded($idSite);
// search includes end date, and count should not, so subtract one from the timestamp
$annotations = $this->search($startDate, Date::factory($endDate->getTimestamp() - 1));
// count the anno... | [
"public",
"function",
"count",
"(",
"$",
"idSite",
",",
"$",
"startDate",
",",
"$",
"endDate",
")",
"{",
"$",
"this",
"->",
"checkIdSiteIsLoaded",
"(",
"$",
"idSite",
")",
";",
"// search includes end date, and count should not, so subtract one from the timestamp",
"$... | Counts annotations & starred annotations within a date range and returns
the counts. The date range includes the start date, but not the end date.
@param int $idSite The ID of the site to count annotations for.
@param string|false $startDate The start date of the range or false if no
range check is desired.
@param str... | [
"Counts",
"annotations",
"&",
"starred",
"annotations",
"within",
"a",
"date",
"range",
"and",
"returns",
"the",
"counts",
".",
"The",
"date",
"range",
"includes",
"the",
"start",
"date",
"but",
"not",
"the",
"end",
"date",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L283-L302 |
209,931 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.makeAnnotation | private function makeAnnotation($date, $note, $starred = 0)
{
return array('date' => $date,
'note' => $note,
'starred' => (int)$starred,
'user' => Piwik::getCurrentUserLogin());
} | php | private function makeAnnotation($date, $note, $starred = 0)
{
return array('date' => $date,
'note' => $note,
'starred' => (int)$starred,
'user' => Piwik::getCurrentUserLogin());
} | [
"private",
"function",
"makeAnnotation",
"(",
"$",
"date",
",",
"$",
"note",
",",
"$",
"starred",
"=",
"0",
")",
"{",
"return",
"array",
"(",
"'date'",
"=>",
"$",
"date",
",",
"'note'",
"=>",
"$",
"note",
",",
"'starred'",
"=>",
"(",
"int",
")",
"$... | Utility function. Creates a new annotation.
@param string $date
@param string $note
@param int $starred
@return array | [
"Utility",
"function",
".",
"Creates",
"a",
"new",
"annotation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L312-L318 |
209,932 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.getAnnotationsForSite | private function getAnnotationsForSite()
{
$result = array();
foreach ($this->idSites as $id) {
$optionName = self::getAnnotationCollectionOptionName($id);
$serialized = Option::get($optionName);
if ($serialized !== false) {
$result[$id] = Common:... | php | private function getAnnotationsForSite()
{
$result = array();
foreach ($this->idSites as $id) {
$optionName = self::getAnnotationCollectionOptionName($id);
$serialized = Option::get($optionName);
if ($serialized !== false) {
$result[$id] = Common:... | [
"private",
"function",
"getAnnotationsForSite",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"idSites",
"as",
"$",
"id",
")",
"{",
"$",
"optionName",
"=",
"self",
"::",
"getAnnotationCollectionOptionName",
"... | Retrieves annotations from the database for the sites supplied to the
constructor.
@return array Lists of annotations mapped by site ID. | [
"Retrieves",
"annotations",
"from",
"the",
"database",
"for",
"the",
"sites",
"supplied",
"to",
"the",
"constructor",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L326-L344 |
209,933 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.canUserModifyOrDelete | public static function canUserModifyOrDelete($idSite, $annotation)
{
// user can save if user is admin or if has view access, is not anonymous & is user who wrote note
$canEdit = Piwik::isUserHasWriteAccess($idSite)
|| (!Piwik::isUserIsAnonymous()
&& Piwik::getCurrentUser... | php | public static function canUserModifyOrDelete($idSite, $annotation)
{
// user can save if user is admin or if has view access, is not anonymous & is user who wrote note
$canEdit = Piwik::isUserHasWriteAccess($idSite)
|| (!Piwik::isUserIsAnonymous()
&& Piwik::getCurrentUser... | [
"public",
"static",
"function",
"canUserModifyOrDelete",
"(",
"$",
"idSite",
",",
"$",
"annotation",
")",
"{",
"// user can save if user is admin or if has view access, is not anonymous & is user who wrote note",
"$",
"canEdit",
"=",
"Piwik",
"::",
"isUserHasWriteAccess",
"(",
... | Returns true if the current user can modify or delete a specific annotation.
A user can modify/delete a note if the user has write access for the site OR
the user has view access, is not the anonymous user and is the user that
created the note in question.
@param int $idSite The site ID the annotation belongs to.
@pa... | [
"Returns",
"true",
"if",
"the",
"current",
"user",
"can",
"modify",
"or",
"delete",
"a",
"specific",
"annotation",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L389-L396 |
209,934 | matomo-org/matomo | plugins/Annotations/AnnotationList.php | AnnotationList.augmentAnnotationData | private function augmentAnnotationData($idSite, $idNote, &$annotation)
{
$annotation['idNote'] = $idNote;
$annotation['canEditOrDelete'] = self::canUserModifyOrDelete($idSite, $annotation);
// we don't supply user info if the current user is anonymous
if (Piwik::isUserIsAnonymous())... | php | private function augmentAnnotationData($idSite, $idNote, &$annotation)
{
$annotation['idNote'] = $idNote;
$annotation['canEditOrDelete'] = self::canUserModifyOrDelete($idSite, $annotation);
// we don't supply user info if the current user is anonymous
if (Piwik::isUserIsAnonymous())... | [
"private",
"function",
"augmentAnnotationData",
"(",
"$",
"idSite",
",",
"$",
"idNote",
",",
"&",
"$",
"annotation",
")",
"{",
"$",
"annotation",
"[",
"'idNote'",
"]",
"=",
"$",
"idNote",
";",
"$",
"annotation",
"[",
"'canEditOrDelete'",
"]",
"=",
"self",
... | Adds extra data to an annotation, including the annotation's ID and whether
the current user can edit or delete it.
Also, if the current user is anonymous, the user attribute is removed.
@param int $idSite
@param int $idNote
@param array $annotation | [
"Adds",
"extra",
"data",
"to",
"an",
"annotation",
"including",
"the",
"annotation",
"s",
"ID",
"and",
"whether",
"the",
"current",
"user",
"can",
"edit",
"or",
"delete",
"it",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Annotations/AnnotationList.php#L408-L417 |
209,935 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.areSMSAPICredentialProvided | public function areSMSAPICredentialProvided()
{
Piwik::checkUserHasSomeViewAccess();
$credential = $this->getSMSAPICredential();
return isset($credential[MobileMessaging::API_KEY_OPTION]);
} | php | public function areSMSAPICredentialProvided()
{
Piwik::checkUserHasSomeViewAccess();
$credential = $this->getSMSAPICredential();
return isset($credential[MobileMessaging::API_KEY_OPTION]);
} | [
"public",
"function",
"areSMSAPICredentialProvided",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeViewAccess",
"(",
")",
";",
"$",
"credential",
"=",
"$",
"this",
"->",
"getSMSAPICredential",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"credential",
"[",
"Mo... | determine if SMS API credential are available for the current user
@return bool true if SMS API credential are available for the current user | [
"determine",
"if",
"SMS",
"API",
"credential",
"are",
"available",
"for",
"the",
"current",
"user"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L33-L39 |
209,936 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.setSMSAPICredential | public function setSMSAPICredential($provider, $credentials = array())
{
$this->checkCredentialManagementRights();
$smsProviderInstance = SMSProvider::factory($provider);
$smsProviderInstance->verifyCredential($credentials);
$settings = $this->getCredentialManagerSettings();
... | php | public function setSMSAPICredential($provider, $credentials = array())
{
$this->checkCredentialManagementRights();
$smsProviderInstance = SMSProvider::factory($provider);
$smsProviderInstance->verifyCredential($credentials);
$settings = $this->getCredentialManagerSettings();
... | [
"public",
"function",
"setSMSAPICredential",
"(",
"$",
"provider",
",",
"$",
"credentials",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"checkCredentialManagementRights",
"(",
")",
";",
"$",
"smsProviderInstance",
"=",
"SMSProvider",
"::",
"factory",
... | set the SMS API credential
@param string $provider SMS API provider
@param array $credentials array with data like API Key or username
@return bool true if SMS API credential were validated and saved, false otherwise | [
"set",
"the",
"SMS",
"API",
"credential"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L82-L97 |
209,937 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.addPhoneNumber | public function addPhoneNumber($phoneNumber)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumber = self::sanitizePhoneNumber($phoneNumber);
$verificationCode = "";
for ($i = 0; $i < self::VERIFICATION_CODE_LENGTH; $i++) {
$verificationCode .= mt_rand(0, 9);
}
... | php | public function addPhoneNumber($phoneNumber)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumber = self::sanitizePhoneNumber($phoneNumber);
$verificationCode = "";
for ($i = 0; $i < self::VERIFICATION_CODE_LENGTH; $i++) {
$verificationCode .= mt_rand(0, 9);
}
... | [
"public",
"function",
"addPhoneNumber",
"(",
"$",
"phoneNumber",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"phoneNumber",
"=",
"self",
"::",
"sanitizePhoneNumber",
"(",
"$",
"phoneNumber",
")",
";",
"$",
"verificationCode",
"=",
"... | add phone number
@param string $phoneNumber
@return bool true | [
"add",
"phone",
"number"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L106-L135 |
209,938 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.sendSMS | public function sendSMS($content, $phoneNumber, $from)
{
Piwik::checkUserIsNotAnonymous();
$credential = $this->getSMSAPICredential();
$SMSProvider = SMSProvider::factory($credential[MobileMessaging::PROVIDER_OPTION]);
$SMSProvider->sendSMS(
$credential[MobileMessaging::... | php | public function sendSMS($content, $phoneNumber, $from)
{
Piwik::checkUserIsNotAnonymous();
$credential = $this->getSMSAPICredential();
$SMSProvider = SMSProvider::factory($credential[MobileMessaging::PROVIDER_OPTION]);
$SMSProvider->sendSMS(
$credential[MobileMessaging::... | [
"public",
"function",
"sendSMS",
"(",
"$",
"content",
",",
"$",
"phoneNumber",
",",
"$",
"from",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"credential",
"=",
"$",
"this",
"->",
"getSMSAPICredential",
"(",
")",
";",
"$",
"SMS... | send a SMS
@param string $content
@param string $phoneNumber
@param string $from
@return bool true
@ignore | [
"send",
"a",
"SMS"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L158-L174 |
209,939 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.getCreditLeft | public function getCreditLeft()
{
$this->checkCredentialManagementRights();
$credential = $this->getSMSAPICredential();
$SMSProvider = SMSProvider::factory($credential[MobileMessaging::PROVIDER_OPTION]);
return $SMSProvider->getCreditLeft(
$credential[MobileMessaging::AP... | php | public function getCreditLeft()
{
$this->checkCredentialManagementRights();
$credential = $this->getSMSAPICredential();
$SMSProvider = SMSProvider::factory($credential[MobileMessaging::PROVIDER_OPTION]);
return $SMSProvider->getCreditLeft(
$credential[MobileMessaging::AP... | [
"public",
"function",
"getCreditLeft",
"(",
")",
"{",
"$",
"this",
"->",
"checkCredentialManagementRights",
"(",
")",
";",
"$",
"credential",
"=",
"$",
"this",
"->",
"getSMSAPICredential",
"(",
")",
";",
"$",
"SMSProvider",
"=",
"SMSProvider",
"::",
"factory",... | get remaining credit
@return string remaining credit | [
"get",
"remaining",
"credit"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L181-L190 |
209,940 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.removePhoneNumber | public function removePhoneNumber($phoneNumber)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
unset($phoneNumbers[$phoneNumber]);
$this->savePhoneNumbers($phoneNumbers);
/**
* Triggered after a phone number has been deleted. Thi... | php | public function removePhoneNumber($phoneNumber)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
unset($phoneNumbers[$phoneNumber]);
$this->savePhoneNumbers($phoneNumbers);
/**
* Triggered after a phone number has been deleted. Thi... | [
"public",
"function",
"removePhoneNumber",
"(",
"$",
"phoneNumber",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"phoneNumbers",
"=",
"$",
"this",
"->",
"retrievePhoneNumbers",
"(",
")",
";",
"unset",
"(",
"$",
"phoneNumbers",
"[",
... | remove phone number
@param string $phoneNumber
@return bool true | [
"remove",
"phone",
"number"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L199-L224 |
209,941 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.validatePhoneNumber | public function validatePhoneNumber($phoneNumber, $verificationCode)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
if (isset($phoneNumbers[$phoneNumber])) {
if ($verificationCode == $phoneNumbers[$phoneNumber]) {
$phoneNumbe... | php | public function validatePhoneNumber($phoneNumber, $verificationCode)
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
if (isset($phoneNumbers[$phoneNumber])) {
if ($verificationCode == $phoneNumbers[$phoneNumber]) {
$phoneNumbe... | [
"public",
"function",
"validatePhoneNumber",
"(",
"$",
"phoneNumber",
",",
"$",
"verificationCode",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"phoneNumbers",
"=",
"$",
"this",
"->",
"retrievePhoneNumbers",
"(",
")",
";",
"if",
"("... | validate phone number
@param string $phoneNumber
@param string $verificationCode
@return bool true if validation code is correct, false otherwise | [
"validate",
"phone",
"number"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L276-L292 |
209,942 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.getPhoneNumbers | public function getPhoneNumbers()
{
Piwik::checkUserIsNotAnonymous();
$rawPhoneNumbers = $this->retrievePhoneNumbers();
$phoneNumbers = array();
foreach ($rawPhoneNumbers as $phoneNumber => $verificationCode) {
$phoneNumbers[$phoneNumber] = self::isActivated($verificati... | php | public function getPhoneNumbers()
{
Piwik::checkUserIsNotAnonymous();
$rawPhoneNumbers = $this->retrievePhoneNumbers();
$phoneNumbers = array();
foreach ($rawPhoneNumbers as $phoneNumber => $verificationCode) {
$phoneNumbers[$phoneNumber] = self::isActivated($verificati... | [
"public",
"function",
"getPhoneNumbers",
"(",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"rawPhoneNumbers",
"=",
"$",
"this",
"->",
"retrievePhoneNumbers",
"(",
")",
";",
"$",
"phoneNumbers",
"=",
"array",
"(",
")",
";",
"foreach... | get phone number list
@return array $phoneNumber => $isValidated
@ignore | [
"get",
"phone",
"number",
"list"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L300-L312 |
209,943 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.getActivatedPhoneNumbers | public function getActivatedPhoneNumbers()
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
$activatedPhoneNumbers = array();
foreach ($phoneNumbers as $phoneNumber => $verificationCode) {
if (self::isActivated($verificationCode)) {
... | php | public function getActivatedPhoneNumbers()
{
Piwik::checkUserIsNotAnonymous();
$phoneNumbers = $this->retrievePhoneNumbers();
$activatedPhoneNumbers = array();
foreach ($phoneNumbers as $phoneNumber => $verificationCode) {
if (self::isActivated($verificationCode)) {
... | [
"public",
"function",
"getActivatedPhoneNumbers",
"(",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"phoneNumbers",
"=",
"$",
"this",
"->",
"retrievePhoneNumbers",
"(",
")",
";",
"$",
"activatedPhoneNumbers",
"=",
"array",
"(",
")",
... | get activated phone number list
@return array $phoneNumber
@ignore | [
"get",
"activated",
"phone",
"number",
"list"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L320-L334 |
209,944 | matomo-org/matomo | plugins/MobileMessaging/API.php | API.deleteSMSAPICredential | public function deleteSMSAPICredential()
{
$this->checkCredentialManagementRights();
$settings = $this->getCredentialManagerSettings();
$settings[MobileMessaging::API_KEY_OPTION] = null;
$this->setCredentialManagerSettings($settings);
return true;
} | php | public function deleteSMSAPICredential()
{
$this->checkCredentialManagementRights();
$settings = $this->getCredentialManagerSettings();
$settings[MobileMessaging::API_KEY_OPTION] = null;
$this->setCredentialManagerSettings($settings);
return true;
} | [
"public",
"function",
"deleteSMSAPICredential",
"(",
")",
"{",
"$",
"this",
"->",
"checkCredentialManagementRights",
"(",
")",
";",
"$",
"settings",
"=",
"$",
"this",
"->",
"getCredentialManagerSettings",
"(",
")",
";",
"$",
"settings",
"[",
"MobileMessaging",
"... | delete the SMS API credential
@return bool true | [
"delete",
"the",
"SMS",
"API",
"credential"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MobileMessaging/API.php#L346-L357 |
209,945 | matomo-org/matomo | libs/HTML/QuickForm2/Rule/Each.php | HTML_QuickForm2_Rule_Each.validateOwner | protected function validateOwner()
{
$rule = clone $this->getConfig();
foreach ($this->owner->getRecursiveIterator(RecursiveIteratorIterator::LEAVES_ONLY) as $child) {
$rule->setOwner($child);
if (!$rule->validateOwner()) {
return false;
}
... | php | protected function validateOwner()
{
$rule = clone $this->getConfig();
foreach ($this->owner->getRecursiveIterator(RecursiveIteratorIterator::LEAVES_ONLY) as $child) {
$rule->setOwner($child);
if (!$rule->validateOwner()) {
return false;
}
... | [
"protected",
"function",
"validateOwner",
"(",
")",
"{",
"$",
"rule",
"=",
"clone",
"$",
"this",
"->",
"getConfig",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"owner",
"->",
"getRecursiveIterator",
"(",
"RecursiveIteratorIterator",
"::",
"LEAVES_ONLY",
... | Validates the owner's children using the template Rule
@return bool Whether all children are valid according to a template Rule | [
"Validates",
"the",
"owner",
"s",
"children",
"using",
"the",
"template",
"Rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Each.php#L81-L91 |
209,946 | matomo-org/matomo | libs/HTML/QuickForm2/Rule/Each.php | HTML_QuickForm2_Rule_Each.setConfig | public function setConfig($config)
{
if (!$config instanceof HTML_QuickForm2_Rule) {
throw new HTML_QuickForm2_InvalidArgumentException(
'Each Rule requires a template Rule to validate with, ' .
preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
... | php | public function setConfig($config)
{
if (!$config instanceof HTML_QuickForm2_Rule) {
throw new HTML_QuickForm2_InvalidArgumentException(
'Each Rule requires a template Rule to validate with, ' .
preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
... | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"$",
"config",
"instanceof",
"HTML_QuickForm2_Rule",
")",
"{",
"throw",
"new",
"HTML_QuickForm2_InvalidArgumentException",
"(",
"'Each Rule requires a template Rule to validate with, '",
".",... | Sets the template Rule to use for actual validation
We do not allow using Required rules here, they are able to validate
containers themselves without the help of Each rule.
@param HTML_QuickForm2_Rule Template Rule
@return HTML_QuickForm2_Rule
@throws HTML_QuickForm2_InvalidArgumentException if $config is ... | [
"Sets",
"the",
"template",
"Rule",
"to",
"use",
"for",
"actual",
"validation"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/Each.php#L104-L117 |
209,947 | matomo-org/matomo | core/Tracker/Request.php | Request.isTimestampValid | protected function isTimestampValid($time, $now = null)
{
if (empty($now)) {
$now = $this->getCurrentTimestamp();
}
return $time <= $now
&& $time > $now - 20 * 365 * 86400;
} | php | protected function isTimestampValid($time, $now = null)
{
if (empty($now)) {
$now = $this->getCurrentTimestamp();
}
return $time <= $now
&& $time > $now - 20 * 365 * 86400;
} | [
"protected",
"function",
"isTimestampValid",
"(",
"$",
"time",
",",
"$",
"now",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"now",
")",
")",
"{",
"$",
"now",
"=",
"$",
"this",
"->",
"getCurrentTimestamp",
"(",
")",
";",
"}",
"return",
"$",... | Returns true if the timestamp is valid ie. timestamp is sometime in the last 10 years and is not in the future.
@param $time int Timestamp to test
@param $now int Current timestamp
@return bool | [
"Returns",
"true",
"if",
"the",
"timestamp",
"is",
"valid",
"ie",
".",
"timestamp",
"is",
"sometime",
"in",
"the",
"last",
"10",
"years",
"and",
"is",
"not",
"in",
"the",
"future",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Request.php#L515-L523 |
209,948 | matomo-org/matomo | core/Tracker/Request.php | Request.setThirdPartyCookie | public function setThirdPartyCookie($idVisitor)
{
if (!$this->shouldUseThirdPartyCookie()) {
return;
}
$cookie = $this->makeThirdPartyCookieUID();
$idVisitor = bin2hex($idVisitor);
$cookie->set(0, $idVisitor);
$cookie->save();
Common::printDebug(... | php | public function setThirdPartyCookie($idVisitor)
{
if (!$this->shouldUseThirdPartyCookie()) {
return;
}
$cookie = $this->makeThirdPartyCookieUID();
$idVisitor = bin2hex($idVisitor);
$cookie->set(0, $idVisitor);
$cookie->save();
Common::printDebug(... | [
"public",
"function",
"setThirdPartyCookie",
"(",
"$",
"idVisitor",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"shouldUseThirdPartyCookie",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"cookie",
"=",
"$",
"this",
"->",
"makeThirdPartyCookieUID",
"(",
")"... | Update the cookie information. | [
"Update",
"the",
"cookie",
"information",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Request.php#L667-L679 |
209,949 | matomo-org/matomo | core/Tracker/Request.php | Request.getVisitorIdForThirdPartyCookie | public function getVisitorIdForThirdPartyCookie()
{
$found = false;
// For 3rd party cookies, priority is on re-using the existing 3rd party cookie value
if (!$found) {
$useThirdPartyCookie = $this->shouldUseThirdPartyCookie();
if ($useThirdPartyCookie) {
... | php | public function getVisitorIdForThirdPartyCookie()
{
$found = false;
// For 3rd party cookies, priority is on re-using the existing 3rd party cookie value
if (!$found) {
$useThirdPartyCookie = $this->shouldUseThirdPartyCookie();
if ($useThirdPartyCookie) {
... | [
"public",
"function",
"getVisitorIdForThirdPartyCookie",
"(",
")",
"{",
"$",
"found",
"=",
"false",
";",
"// For 3rd party cookies, priority is on re-using the existing 3rd party cookie value",
"if",
"(",
"!",
"$",
"found",
")",
"{",
"$",
"useThirdPartyCookie",
"=",
"$",
... | When creating a third party cookie, we want to ensure that the original value set in this 3rd party cookie
sticks and is not overwritten later. | [
"When",
"creating",
"a",
"third",
"party",
"cookie",
"we",
"want",
"to",
"ensure",
"that",
"the",
"original",
"value",
"set",
"in",
"this",
"3rd",
"party",
"cookie",
"sticks",
"and",
"is",
"not",
"overwritten",
"later",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Request.php#L780-L806 |
209,950 | matomo-org/matomo | core/Tracker/Request.php | Request.getMetadata | public function getMetadata($pluginName, $key)
{
return isset($this->requestMetadata[$pluginName][$key]) ? $this->requestMetadata[$pluginName][$key] : null;
} | php | public function getMetadata($pluginName, $key)
{
return isset($this->requestMetadata[$pluginName][$key]) ? $this->requestMetadata[$pluginName][$key] : null;
} | [
"public",
"function",
"getMetadata",
"(",
"$",
"pluginName",
",",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"requestMetadata",
"[",
"$",
"pluginName",
"]",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"requestMetadata",
"["... | Get a request metadata value. Returns `null` if none exists.
@param string $pluginName eg, `'Actions'`, `'Goals'`, `'YourPlugin'`
@param string $key
@return mixed | [
"Get",
"a",
"request",
"metadata",
"value",
".",
"Returns",
"null",
"if",
"none",
"exists",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Request.php#L917-L920 |
209,951 | matomo-org/matomo | libs/Zend/Db/Adapter/Sqlsrv.php | Zend_Db_Adapter_Sqlsrv._checkRequiredOptions | protected function _checkRequiredOptions(array $config)
{
// we need at least a dbname
if (! array_key_exists('dbname', $config)) {
/** @see Zend_Db_Adapter_Exception */
// require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception("Configur... | php | protected function _checkRequiredOptions(array $config)
{
// we need at least a dbname
if (! array_key_exists('dbname', $config)) {
/** @see Zend_Db_Adapter_Exception */
// require_once 'Zend/Db/Adapter/Exception.php';
throw new Zend_Db_Adapter_Exception("Configur... | [
"protected",
"function",
"_checkRequiredOptions",
"(",
"array",
"$",
"config",
")",
"{",
"// we need at least a dbname",
"if",
"(",
"!",
"array_key_exists",
"(",
"'dbname'",
",",
"$",
"config",
")",
")",
"{",
"/** @see Zend_Db_Adapter_Exception */",
"// require_once 'Ze... | Check for config options that are mandatory.
Throw exceptions if any are missing.
@param array $config
@throws Zend_Db_Adapter_Exception | [
"Check",
"for",
"config",
"options",
"that",
"are",
"mandatory",
".",
"Throw",
"exceptions",
"if",
"any",
"are",
"missing",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Sqlsrv.php#L179-L205 |
209,952 | matomo-org/matomo | libs/Zend/Db/Adapter/Sqlsrv.php | Zend_Db_Adapter_Sqlsrv.setTransactionIsolationLevel | public function setTransactionIsolationLevel($level = null)
{
$this->_connect();
$sql = null;
// Default transaction level in sql server
if ($level === null)
{
$level = SQLSRV_TXN_READ_COMMITTED;
}
switch ($level) {
case SQLSRV_TXN_RE... | php | public function setTransactionIsolationLevel($level = null)
{
$this->_connect();
$sql = null;
// Default transaction level in sql server
if ($level === null)
{
$level = SQLSRV_TXN_READ_COMMITTED;
}
switch ($level) {
case SQLSRV_TXN_RE... | [
"public",
"function",
"setTransactionIsolationLevel",
"(",
"$",
"level",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"sql",
"=",
"null",
";",
"// Default transaction level in sql server",
"if",
"(",
"$",
"level",
"===",
"null",
... | Set the transaction isoltion level.
@param integer|null $level A fetch mode from SQLSRV_TXN_*.
@return true
@throws Zend_Db_Adapter_Sqlsrv_Exception | [
"Set",
"the",
"transaction",
"isoltion",
"level",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Sqlsrv.php#L214-L252 |
209,953 | matomo-org/matomo | libs/Zend/Cache/Frontend/File.php | Zend_Cache_Frontend_File.setMasterFiles | public function setMasterFiles(array $masterFiles)
{
$this->_specificOptions['master_file'] = null; // to keep a compatibility
$this->_specificOptions['master_files'] = null;
$this->_masterFile_mtimes = array();
clearstatcache();
$i = 0;
foreach ($masterFiles as $ma... | php | public function setMasterFiles(array $masterFiles)
{
$this->_specificOptions['master_file'] = null; // to keep a compatibility
$this->_specificOptions['master_files'] = null;
$this->_masterFile_mtimes = array();
clearstatcache();
$i = 0;
foreach ($masterFiles as $ma... | [
"public",
"function",
"setMasterFiles",
"(",
"array",
"$",
"masterFiles",
")",
"{",
"$",
"this",
"->",
"_specificOptions",
"[",
"'master_file'",
"]",
"=",
"null",
";",
"// to keep a compatibility",
"$",
"this",
"->",
"_specificOptions",
"[",
"'master_files'",
"]",... | Change the master_files option
@param array $masterFiles the complete paths and name of the master files | [
"Change",
"the",
"master_files",
"option"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Frontend/File.php#L104-L131 |
209,954 | matomo-org/matomo | core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php | ColumnCallbackAddColumnQuotient.formatValue | protected function formatValue($value, $divisor)
{
$quotient = 0;
if ($divisor > 0 && $value > 0) {
$quotient = round($value / $divisor, $this->quotientPrecision);
}
return $quotient;
} | php | protected function formatValue($value, $divisor)
{
$quotient = 0;
if ($divisor > 0 && $value > 0) {
$quotient = round($value / $divisor, $this->quotientPrecision);
}
return $quotient;
} | [
"protected",
"function",
"formatValue",
"(",
"$",
"value",
",",
"$",
"divisor",
")",
"{",
"$",
"quotient",
"=",
"0",
";",
"if",
"(",
"$",
"divisor",
">",
"0",
"&&",
"$",
"value",
">",
"0",
")",
"{",
"$",
"quotient",
"=",
"round",
"(",
"$",
"value... | Formats the given value
@param number $value
@param number $divisor
@return float|int | [
"Formats",
"the",
"given",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php#L106-L114 |
209,955 | matomo-org/matomo | core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php | ColumnCallbackAddColumnQuotient.getDivisor | protected function getDivisor($row)
{
if (!is_null($this->totalValueUsedAsDivisor)) {
return $this->totalValueUsedAsDivisor;
} elseif ($this->getDivisorFromSummaryRow) {
$summaryRow = $this->table->getRowFromId(DataTable::ID_SUMMARY_ROW);
return $summaryRow->getCo... | php | protected function getDivisor($row)
{
if (!is_null($this->totalValueUsedAsDivisor)) {
return $this->totalValueUsedAsDivisor;
} elseif ($this->getDivisorFromSummaryRow) {
$summaryRow = $this->table->getRowFromId(DataTable::ID_SUMMARY_ROW);
return $summaryRow->getCo... | [
"protected",
"function",
"getDivisor",
"(",
"$",
"row",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"totalValueUsedAsDivisor",
")",
")",
"{",
"return",
"$",
"this",
"->",
"totalValueUsedAsDivisor",
";",
"}",
"elseif",
"(",
"$",
"this",
"... | Returns the divisor to use when calculating the new column value. Can
be overridden by descendent classes to customize behavior.
@param Row $row The row being modified.
@return int|float | [
"Returns",
"the",
"divisor",
"to",
"use",
"when",
"calculating",
"the",
"new",
"column",
"value",
".",
"Can",
"be",
"overridden",
"by",
"descendent",
"classes",
"to",
"customize",
"behavior",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/ColumnCallbackAddColumnQuotient.php#L135-L145 |
209,956 | matomo-org/matomo | core/Intl/Data/Provider/RegionDataProvider.php | RegionDataProvider.getCountryList | public function getCountryList($includeInternalCodes = false)
{
if ($this->countryList === null) {
$this->countryList = require __DIR__ . '/../Resources/countries.php';
}
if ($this->countryExtraList === null) {
$this->countryExtraList = require __DIR__ . '/../Resource... | php | public function getCountryList($includeInternalCodes = false)
{
if ($this->countryList === null) {
$this->countryList = require __DIR__ . '/../Resources/countries.php';
}
if ($this->countryExtraList === null) {
$this->countryExtraList = require __DIR__ . '/../Resource... | [
"public",
"function",
"getCountryList",
"(",
"$",
"includeInternalCodes",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"countryList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"countryList",
"=",
"require",
"__DIR__",
".",
"'/../Resources/countries.... | Returns the list of valid country codes.
@param bool $includeInternalCodes
@return string[] Array of 2 letter country ISO codes => 3 letter continent code
@api | [
"Returns",
"the",
"list",
"of",
"valid",
"country",
"codes",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Intl/Data/Provider/RegionDataProvider.php#L42-L56 |
209,957 | matomo-org/matomo | core/Db/Adapter/Pdo/Pgsql.php | Pgsql.checkServerVersion | public function checkServerVersion()
{
$databaseVersion = $this->getServerVersion();
$requiredVersion = Config::getInstance()->General['minimum_pgsql_version'];
if (version_compare($databaseVersion, $requiredVersion) === -1) {
throw new Exception(Piwik::translate('General_Except... | php | public function checkServerVersion()
{
$databaseVersion = $this->getServerVersion();
$requiredVersion = Config::getInstance()->General['minimum_pgsql_version'];
if (version_compare($databaseVersion, $requiredVersion) === -1) {
throw new Exception(Piwik::translate('General_Except... | [
"public",
"function",
"checkServerVersion",
"(",
")",
"{",
"$",
"databaseVersion",
"=",
"$",
"this",
"->",
"getServerVersion",
"(",
")",
";",
"$",
"requiredVersion",
"=",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'minimum_pgsql_version'",
... | Check PostgreSQL version
@throws Exception | [
"Check",
"PostgreSQL",
"version"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Pdo/Pgsql.php#L46-L54 |
209,958 | matomo-org/matomo | plugins/PrivacyManager/LogDataPurger.php | LogDataPurger.getDeleteIdVisitOffset | private function getDeleteIdVisitOffset($deleteLogsOlderThan)
{
$logVisit = Common::prefixTable("log_visit");
// get max idvisit
$maxIdVisit = Db::fetchOne("SELECT MAX(idvisit) FROM $logVisit");
if (empty($maxIdVisit)) {
return false;
}
// select highest... | php | private function getDeleteIdVisitOffset($deleteLogsOlderThan)
{
$logVisit = Common::prefixTable("log_visit");
// get max idvisit
$maxIdVisit = Db::fetchOne("SELECT MAX(idvisit) FROM $logVisit");
if (empty($maxIdVisit)) {
return false;
}
// select highest... | [
"private",
"function",
"getDeleteIdVisitOffset",
"(",
"$",
"deleteLogsOlderThan",
")",
"{",
"$",
"logVisit",
"=",
"Common",
"::",
"prefixTable",
"(",
"\"log_visit\"",
")",
";",
"// get max idvisit",
"$",
"maxIdVisit",
"=",
"Db",
"::",
"fetchOne",
"(",
"\"SELECT MA... | get highest idVisit to delete rows from
@return string | [
"get",
"highest",
"idVisit",
"to",
"delete",
"rows",
"from"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/LogDataPurger.php#L142-L163 |
209,959 | matomo-org/matomo | plugins/PrivacyManager/LogDataPurger.php | LogDataPurger.getDeleteTableLogTables | public static function getDeleteTableLogTables()
{
$provider = StaticContainer::get('Piwik\Plugin\LogTablesProvider');
$result = array();
foreach ($provider->getAllLogTables() as $logTable) {
if ($logTable->getColumnToJoinOnIdVisit()) {
$result[] = Common::prefi... | php | public static function getDeleteTableLogTables()
{
$provider = StaticContainer::get('Piwik\Plugin\LogTablesProvider');
$result = array();
foreach ($provider->getAllLogTables() as $logTable) {
if ($logTable->getColumnToJoinOnIdVisit()) {
$result[] = Common::prefi... | [
"public",
"static",
"function",
"getDeleteTableLogTables",
"(",
")",
"{",
"$",
"provider",
"=",
"StaticContainer",
"::",
"get",
"(",
"'Piwik\\Plugin\\LogTablesProvider'",
")",
";",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"provider",
"-... | let's hardcode, since these are not dynamically created tables | [
"let",
"s",
"hardcode",
"since",
"these",
"are",
"not",
"dynamically",
"created",
"tables"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/LogDataPurger.php#L172-L189 |
209,960 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.hasReportBeenPurged | public static function hasReportBeenPurged($dataTable)
{
$strPeriod = Common::getRequestVar('period', false);
$strDate = Common::getRequestVar('date', false);
if (false !== $strPeriod
&& false !== $strDate
&& (is_null($dataTable)
|| (!empty($dataTab... | php | public static function hasReportBeenPurged($dataTable)
{
$strPeriod = Common::getRequestVar('period', false);
$strDate = Common::getRequestVar('date', false);
if (false !== $strPeriod
&& false !== $strDate
&& (is_null($dataTable)
|| (!empty($dataTab... | [
"public",
"static",
"function",
"hasReportBeenPurged",
"(",
"$",
"dataTable",
")",
"{",
"$",
"strPeriod",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'period'",
",",
"false",
")",
";",
"$",
"strDate",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'date'",
",",... | Returns true if it is likely that the data for this report has been purged and if the
user should be told about that.
In order for this function to return true, the following must also be true:
- The data table for this report must either be empty or not have been fetched.
- The period of this report is not a multiple... | [
"Returns",
"true",
"if",
"it",
"is",
"likely",
"that",
"the",
"data",
"for",
"this",
"report",
"has",
"been",
"purged",
"and",
"if",
"the",
"user",
"should",
"be",
"told",
"about",
"that",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L103-L128 |
209,961 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.installationFormInit | public function installationFormInit(FormDefaultSettings $form)
{
$form->addElement('checkbox', 'do_not_track', null,
array(
'content' => '<div class="form-help">' . Piwik::translate('PrivacyManager_DoNotTrack_EnabledMoreInfo') . '</div> ' . Piwik::translate('PrivacyM... | php | public function installationFormInit(FormDefaultSettings $form)
{
$form->addElement('checkbox', 'do_not_track', null,
array(
'content' => '<div class="form-help">' . Piwik::translate('PrivacyManager_DoNotTrack_EnabledMoreInfo') . '</div> ' . Piwik::translate('PrivacyM... | [
"public",
"function",
"installationFormInit",
"(",
"FormDefaultSettings",
"$",
"form",
")",
"{",
"$",
"form",
"->",
"addElement",
"(",
"'checkbox'",
",",
"'do_not_track'",
",",
"null",
",",
"array",
"(",
"'content'",
"=>",
"'<div class=\"form-help\">'",
".",
"Piwi... | Customize the Installation "default settings" form.
@param FormDefaultSettings $form | [
"Customize",
"the",
"Installation",
"default",
"settings",
"form",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L237-L253 |
209,962 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.installationFormSubmit | public function installationFormSubmit(FormDefaultSettings $form)
{
$doNotTrack = (bool) $form->getSubmitValue('do_not_track');
$dntChecker = new DoNotTrackHeaderChecker();
if ($doNotTrack) {
$dntChecker->activate();
} else {
$dntChecker->deactivate();
... | php | public function installationFormSubmit(FormDefaultSettings $form)
{
$doNotTrack = (bool) $form->getSubmitValue('do_not_track');
$dntChecker = new DoNotTrackHeaderChecker();
if ($doNotTrack) {
$dntChecker->activate();
} else {
$dntChecker->deactivate();
... | [
"public",
"function",
"installationFormSubmit",
"(",
"FormDefaultSettings",
"$",
"form",
")",
"{",
"$",
"doNotTrack",
"=",
"(",
"bool",
")",
"$",
"form",
"->",
"getSubmitValue",
"(",
"'do_not_track'",
")",
";",
"$",
"dntChecker",
"=",
"new",
"DoNotTrackHeaderChe... | Process the submit on the Installation "default settings" form.
@param FormDefaultSettings $form | [
"Process",
"the",
"submit",
"on",
"the",
"Installation",
"default",
"settings",
"form",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L260-L276 |
209,963 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.getPurgeDataSettings | public static function getPurgeDataSettings()
{
$settings = array();
// load settings from ini config
$config = PiwikConfig::getInstance();
foreach (self::$purgeDataOptions as $configKey => $configSection) {
$values = $config->$configSection;
$settings[$confi... | php | public static function getPurgeDataSettings()
{
$settings = array();
// load settings from ini config
$config = PiwikConfig::getInstance();
foreach (self::$purgeDataOptions as $configKey => $configSection) {
$values = $config->$configSection;
$settings[$confi... | [
"public",
"static",
"function",
"getPurgeDataSettings",
"(",
")",
"{",
"$",
"settings",
"=",
"array",
"(",
")",
";",
"// load settings from ini config",
"$",
"config",
"=",
"PiwikConfig",
"::",
"getInstance",
"(",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
... | Returns the settings for the data purging feature.
@return array | [
"Returns",
"the",
"settings",
"for",
"the",
"data",
"purging",
"feature",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L283-L307 |
209,964 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.savePurgeDataSettings | public static function savePurgeDataSettings($settings)
{
foreach (self::$purgeDataOptions as $configName => $configSection) {
if (isset($settings[$configName])) {
Option::set($configName, $settings[$configName]);
}
}
} | php | public static function savePurgeDataSettings($settings)
{
foreach (self::$purgeDataOptions as $configName => $configSection) {
if (isset($settings[$configName])) {
Option::set($configName, $settings[$configName]);
}
}
} | [
"public",
"static",
"function",
"savePurgeDataSettings",
"(",
"$",
"settings",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"purgeDataOptions",
"as",
"$",
"configName",
"=>",
"$",
"configSection",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"settings",
"[",
"$... | Saves the supplied data purging settings.
@param array $settings The settings to save. | [
"Saves",
"the",
"supplied",
"data",
"purging",
"settings",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L314-L321 |
209,965 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.deleteLogData | public function deleteLogData()
{
$settings = self::getPurgeDataSettings();
// Make sure, data deletion is enabled
if ($settings['delete_logs_enable'] == 0) {
return false;
}
// make sure purging should run at this time
if (!$this->shouldPurgeData($setti... | php | public function deleteLogData()
{
$settings = self::getPurgeDataSettings();
// Make sure, data deletion is enabled
if ($settings['delete_logs_enable'] == 0) {
return false;
}
// make sure purging should run at this time
if (!$this->shouldPurgeData($setti... | [
"public",
"function",
"deleteLogData",
"(",
")",
"{",
"$",
"settings",
"=",
"self",
"::",
"getPurgeDataSettings",
"(",
")",
";",
"// Make sure, data deletion is enabled",
"if",
"(",
"$",
"settings",
"[",
"'delete_logs_enable'",
"]",
"==",
"0",
")",
"{",
"return"... | Deletes old raw data based on the options set in the Deletelogs config
section. This is a scheduled task and will only execute every N days. The number
of days is determined by the delete_logs_schedule_lowest_interval config option.
If delete_logs_enable is set to 1, old data in the log_visit, log_conversion,
log_conv... | [
"Deletes",
"old",
"raw",
"data",
"based",
"on",
"the",
"options",
"set",
"in",
"the",
"Deletelogs",
"config",
"section",
".",
"This",
"is",
"a",
"scheduled",
"task",
"and",
"will",
"only",
"execute",
"every",
"N",
"days",
".",
"The",
"number",
"of",
"day... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L376-L409 |
209,966 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.getPurgeEstimate | public static function getPurgeEstimate($settings = null)
{
if (is_null($settings)) {
$settings = self::getPurgeDataSettings();
}
$result = array();
if ($settings['delete_logs_enable']) {
/** @var LogDataPurger $logDataPurger */
$logDataPurger = ... | php | public static function getPurgeEstimate($settings = null)
{
if (is_null($settings)) {
$settings = self::getPurgeDataSettings();
}
$result = array();
if ($settings['delete_logs_enable']) {
/** @var LogDataPurger $logDataPurger */
$logDataPurger = ... | [
"public",
"static",
"function",
"getPurgeEstimate",
"(",
"$",
"settings",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"settings",
")",
")",
"{",
"$",
"settings",
"=",
"self",
"::",
"getPurgeDataSettings",
"(",
")",
";",
"}",
"$",
"result",
"... | Returns an array describing what data would be purged if both raw data & report
purging is invoked.
The returned array maps table names with the number of rows that will be deleted.
If the table name is mapped with -1, the table will be dropped.
@param array $settings The config options to use in the estimate. If nul... | [
"Returns",
"an",
"array",
"describing",
"what",
"data",
"would",
"be",
"purged",
"if",
"both",
"raw",
"data",
"&",
"report",
"purging",
"is",
"invoked",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L422-L442 |
209,967 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.getAllMetricsToKeep | public static function getAllMetricsToKeep()
{
$metricsToKeep = self::getMetricsToKeep();
// convert goal metric names to correct archive names
if (Common::isGoalPluginEnabled()) {
$goalMetricsToKeep = self::getGoalMetricsToKeep();
$maxGoalId = self::getMaxGoalId();... | php | public static function getAllMetricsToKeep()
{
$metricsToKeep = self::getMetricsToKeep();
// convert goal metric names to correct archive names
if (Common::isGoalPluginEnabled()) {
$goalMetricsToKeep = self::getGoalMetricsToKeep();
$maxGoalId = self::getMaxGoalId();... | [
"public",
"static",
"function",
"getAllMetricsToKeep",
"(",
")",
"{",
"$",
"metricsToKeep",
"=",
"self",
"::",
"getMetricsToKeep",
"(",
")",
";",
"// convert goal metric names to correct archive names",
"if",
"(",
"Common",
"::",
"isGoalPluginEnabled",
"(",
")",
")",
... | Returns the names of metrics that should be kept when purging as they appear in
archive tables. | [
"Returns",
"the",
"names",
"of",
"metrics",
"that",
"should",
"be",
"kept",
"when",
"purging",
"as",
"they",
"appear",
"in",
"archive",
"tables",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L535-L560 |
209,968 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.shouldPurgeData | private function shouldPurgeData($settings, $lastRanOption, $setting)
{
// Log deletion may not run until it is once rescheduled (initial run). This is the
// only way to guarantee the calculated next scheduled deletion time.
$initialDelete = Option::get(self::OPTION_LAST_DELETE_PIWIK_LOGS_I... | php | private function shouldPurgeData($settings, $lastRanOption, $setting)
{
// Log deletion may not run until it is once rescheduled (initial run). This is the
// only way to guarantee the calculated next scheduled deletion time.
$initialDelete = Option::get(self::OPTION_LAST_DELETE_PIWIK_LOGS_I... | [
"private",
"function",
"shouldPurgeData",
"(",
"$",
"settings",
",",
"$",
"lastRanOption",
",",
"$",
"setting",
")",
"{",
"// Log deletion may not run until it is once rescheduled (initial run). This is the",
"// only way to guarantee the calculated next scheduled deletion time.",
"$... | Returns true if one of the purge data tasks should run now, false if it shouldn't. | [
"Returns",
"true",
"if",
"one",
"of",
"the",
"purge",
"data",
"tasks",
"should",
"run",
"now",
"false",
"if",
"it",
"shouldn",
"t",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L565-L589 |
209,969 | matomo-org/matomo | plugins/PrivacyManager/PrivacyManager.php | PrivacyManager.getUserIdSalt | public static function getUserIdSalt()
{
$salt = Option::get(self::OPTION_USERID_SALT);
if (empty($salt)) {
$salt = Common::getRandomString($len = 40, $alphabet = "abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPRSTUVWXYZ0123456789_-$");
Option::set(self::OPTION_USERID_SALT, $salt, ... | php | public static function getUserIdSalt()
{
$salt = Option::get(self::OPTION_USERID_SALT);
if (empty($salt)) {
$salt = Common::getRandomString($len = 40, $alphabet = "abcdefghijklmnoprstuvwxyzABCDEFGHIJKLMNOPRSTUVWXYZ0123456789_-$");
Option::set(self::OPTION_USERID_SALT, $salt, ... | [
"public",
"static",
"function",
"getUserIdSalt",
"(",
")",
"{",
"$",
"salt",
"=",
"Option",
"::",
"get",
"(",
"self",
"::",
"OPTION_USERID_SALT",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"salt",
")",
")",
"{",
"$",
"salt",
"=",
"Common",
"::",
"getRan... | Returns a unique salt used for pseudonimisation of user id only
@return string | [
"Returns",
"a",
"unique",
"salt",
"used",
"for",
"pseudonimisation",
"of",
"user",
"id",
"only"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/PrivacyManager.php#L606-L614 |
209,970 | matomo-org/matomo | plugins/VisitTime/API.php | API.getByDayOfWeek | public function getByDayOfWeek($idSite, $period, $date, $segment = false)
{
Piwik::checkUserHasViewAccess($idSite);
// metrics to query
$metrics = Metrics::getVisitsMetricNames();
unset($metrics[Metrics::INDEX_MAX_ACTIONS]);
// disabled for multiple dates
if (Perio... | php | public function getByDayOfWeek($idSite, $period, $date, $segment = false)
{
Piwik::checkUserHasViewAccess($idSite);
// metrics to query
$metrics = Metrics::getVisitsMetricNames();
unset($metrics[Metrics::INDEX_MAX_ACTIONS]);
// disabled for multiple dates
if (Perio... | [
"public",
"function",
"getByDayOfWeek",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"Piwik",
"::",
"checkUserHasViewAccess",
"(",
"$",
"idSite",
")",
";",
"// metrics to query",
"$",
"metrics",
"="... | Returns datatable describing the number of visits for each day of the week.
@param string $idSite The site ID. Cannot refer to multiple sites.
@param string $period The period type: day, week, year, range...
@param string $date The start date of the period. Cannot refer to multiple dates.
@param bool|string $segment T... | [
"Returns",
"datatable",
"describing",
"the",
"number",
"of",
"visits",
"for",
"each",
"day",
"of",
"the",
"week",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/VisitTime/API.php#L79-L133 |
209,971 | matomo-org/matomo | plugins/VisitorInterest/Archiver.php | Archiver.getSecondsGap | protected static function getSecondsGap()
{
$secondsGap = array();
foreach (self::$timeGap as $gap) {
if (count($gap) == 3 && $gap[2] == 's') // if the units are already in seconds, just assign them
{
$secondsGap[] = array($gap[0], $gap[1]);
} else... | php | protected static function getSecondsGap()
{
$secondsGap = array();
foreach (self::$timeGap as $gap) {
if (count($gap) == 3 && $gap[2] == 's') // if the units are already in seconds, just assign them
{
$secondsGap[] = array($gap[0], $gap[1]);
} else... | [
"protected",
"static",
"function",
"getSecondsGap",
"(",
")",
"{",
"$",
"secondsGap",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"self",
"::",
"$",
"timeGap",
"as",
"$",
"gap",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"gap",
")",
"==",
"3",
"&&",
... | Transforms and returns the set of ranges used to calculate the 'visits by total time'
report from ranges in minutes to equivalent ranges in seconds. | [
"Transforms",
"and",
"returns",
"the",
"set",
"of",
"ranges",
"used",
"to",
"calculate",
"the",
"visits",
"by",
"total",
"time",
"report",
"from",
"ranges",
"in",
"minutes",
"to",
"equivalent",
"ranges",
"in",
"seconds",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/VisitorInterest/Archiver.php#L146-L160 |
209,972 | matomo-org/matomo | core/Profiler.php | Profiler.getMemoryUsage | public static function getMemoryUsage()
{
$memory = false;
if (function_exists('xdebug_memory_usage')) {
$memory = xdebug_memory_usage();
} elseif (function_exists('memory_get_usage')) {
$memory = memory_get_usage();
}
if ($memory === false) {
... | php | public static function getMemoryUsage()
{
$memory = false;
if (function_exists('xdebug_memory_usage')) {
$memory = xdebug_memory_usage();
} elseif (function_exists('memory_get_usage')) {
$memory = memory_get_usage();
}
if ($memory === false) {
... | [
"public",
"static",
"function",
"getMemoryUsage",
"(",
")",
"{",
"$",
"memory",
"=",
"false",
";",
"if",
"(",
"function_exists",
"(",
"'xdebug_memory_usage'",
")",
")",
"{",
"$",
"memory",
"=",
"xdebug_memory_usage",
"(",
")",
";",
"}",
"elseif",
"(",
"fun... | Returns memory usage
@return string | [
"Returns",
"memory",
"usage"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Profiler.php#L39-L52 |
209,973 | matomo-org/matomo | core/Profiler.php | Profiler.displayDbProfileReport | public static function displayDbProfileReport()
{
$profiler = Db::get()->getProfiler();
if (!$profiler->getEnabled()) {
// To display the profiler you should enable enable_sql_profiler on your config/config.ini.php file
return;
}
$infoIndexedByQuery = array(... | php | public static function displayDbProfileReport()
{
$profiler = Db::get()->getProfiler();
if (!$profiler->getEnabled()) {
// To display the profiler you should enable enable_sql_profiler on your config/config.ini.php file
return;
}
$infoIndexedByQuery = array(... | [
"public",
"static",
"function",
"displayDbProfileReport",
"(",
")",
"{",
"$",
"profiler",
"=",
"Db",
"::",
"get",
"(",
")",
"->",
"getProfiler",
"(",
")",
";",
"if",
"(",
"!",
"$",
"profiler",
"->",
"getEnabled",
"(",
")",
")",
"{",
"// To display the pr... | Outputs SQL Profiling reports from Zend
@throws \Exception | [
"Outputs",
"SQL",
"Profiling",
"reports",
"from",
"Zend"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Profiler.php#L59-L99 |
209,974 | matomo-org/matomo | core/Profiler.php | Profiler.displayDbTrackerProfile | public static function displayDbTrackerProfile($db = null)
{
if (is_null($db)) {
$db = Tracker::getDatabase();
}
$tableName = Common::prefixTable('log_profiling');
$all = $db->fetchAll('SELECT * FROM ' . $tableName);
if ($all === false) {
return;
... | php | public static function displayDbTrackerProfile($db = null)
{
if (is_null($db)) {
$db = Tracker::getDatabase();
}
$tableName = Common::prefixTable('log_profiling');
$all = $db->fetchAll('SELECT * FROM ' . $tableName);
if ($all === false) {
return;
... | [
"public",
"static",
"function",
"displayDbTrackerProfile",
"(",
"$",
"db",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"db",
")",
")",
"{",
"$",
"db",
"=",
"Tracker",
"::",
"getDatabase",
"(",
")",
";",
"}",
"$",
"tableName",
"=",
"Common"... | Print profiling report for the tracker
@param \Piwik\Db $db Tracker database object (or null) | [
"Print",
"profiling",
"report",
"for",
"the",
"tracker"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Profiler.php#L116-L137 |
209,975 | matomo-org/matomo | core/Profiler.php | Profiler.printQueryCount | public static function printQueryCount()
{
$totalTime = self::getDbElapsedSecs();
$queryCount = Profiler::getQueryCount();
if ($queryCount > 0) {
Log::debug(sprintf("Total queries = %d (total sql time = %.2fs)", $queryCount, $totalTime));
}
} | php | public static function printQueryCount()
{
$totalTime = self::getDbElapsedSecs();
$queryCount = Profiler::getQueryCount();
if ($queryCount > 0) {
Log::debug(sprintf("Total queries = %d (total sql time = %.2fs)", $queryCount, $totalTime));
}
} | [
"public",
"static",
"function",
"printQueryCount",
"(",
")",
"{",
"$",
"totalTime",
"=",
"self",
"::",
"getDbElapsedSecs",
"(",
")",
";",
"$",
"queryCount",
"=",
"Profiler",
"::",
"getQueryCount",
"(",
")",
";",
"if",
"(",
"$",
"queryCount",
">",
"0",
")... | Print number of queries and elapsed time | [
"Print",
"number",
"of",
"queries",
"and",
"elapsed",
"time"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Profiler.php#L142-L149 |
209,976 | matomo-org/matomo | core/Profiler.php | Profiler.getSqlProfilingQueryBreakdownOutput | private static function getSqlProfilingQueryBreakdownOutput($infoIndexedByQuery)
{
$output = '<hr /><strong>Breakdown by query</strong><br/>';
foreach ($infoIndexedByQuery as $query => $queryInfo) {
$timeMs = round($queryInfo['sumTimeMs'], 1);
$count = $queryInfo['count'];
... | php | private static function getSqlProfilingQueryBreakdownOutput($infoIndexedByQuery)
{
$output = '<hr /><strong>Breakdown by query</strong><br/>';
foreach ($infoIndexedByQuery as $query => $queryInfo) {
$timeMs = round($queryInfo['sumTimeMs'], 1);
$count = $queryInfo['count'];
... | [
"private",
"static",
"function",
"getSqlProfilingQueryBreakdownOutput",
"(",
"$",
"infoIndexedByQuery",
")",
"{",
"$",
"output",
"=",
"'<hr /><strong>Breakdown by query</strong><br/>'",
";",
"foreach",
"(",
"$",
"infoIndexedByQuery",
"as",
"$",
"query",
"=>",
"$",
"quer... | Log a breakdown by query
@param array $infoIndexedByQuery | [
"Log",
"a",
"breakdown",
"by",
"query"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Profiler.php#L178-L193 |
209,977 | matomo-org/matomo | libs/Zend/Validate/Regex.php | Zend_Validate_Regex.setPattern | public function setPattern($pattern)
{
$this->_pattern = (string) $pattern;
$status = @preg_match($this->_pattern, "Test");
if (false === $status) {
// require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception("Internal error while using t... | php | public function setPattern($pattern)
{
$this->_pattern = (string) $pattern;
$status = @preg_match($this->_pattern, "Test");
if (false === $status) {
// require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception("Internal error while using t... | [
"public",
"function",
"setPattern",
"(",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"_pattern",
"=",
"(",
"string",
")",
"$",
"pattern",
";",
"$",
"status",
"=",
"@",
"preg_match",
"(",
"$",
"this",
"->",
"_pattern",
",",
"\"Test\"",
")",
";",
"if"... | Sets the pattern option
@param string $pattern
@throws Zend_Validate_Exception if there is a fatal error in pattern matching
@return Zend_Validate_Regex Provides a fluent interface | [
"Sets",
"the",
"pattern",
"option"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/Regex.php#L104-L115 |
209,978 | matomo-org/matomo | plugins/Marketplace/UpdateCommunication.php | UpdateCommunication.canBeEnabled | public static function canBeEnabled()
{
$isEnabled = (bool) Config::getInstance()->General['enable_update_communication'];
if($isEnabled === true && Marketplace::isMarketplaceEnabled() === true && SettingsPiwik::isInternetEnabled() === true){
return true;
}
retur... | php | public static function canBeEnabled()
{
$isEnabled = (bool) Config::getInstance()->General['enable_update_communication'];
if($isEnabled === true && Marketplace::isMarketplaceEnabled() === true && SettingsPiwik::isInternetEnabled() === true){
return true;
}
retur... | [
"public",
"static",
"function",
"canBeEnabled",
"(",
")",
"{",
"$",
"isEnabled",
"=",
"(",
"bool",
")",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'enable_update_communication'",
"]",
";",
"if",
"(",
"$",
"isEnabled",
"===",
"true",
"&... | Checks whether a plugin update notification can be enabled or not. It cannot be enabled if for instance the
Marketplace is disabled or if update notifications are disabled in general.
@return bool | [
"Checks",
"whether",
"a",
"plugin",
"update",
"notification",
"can",
"be",
"enabled",
"or",
"not",
".",
"It",
"cannot",
"be",
"enabled",
"if",
"for",
"instance",
"the",
"Marketplace",
"is",
"disabled",
"or",
"if",
"update",
"notifications",
"are",
"disabled",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Marketplace/UpdateCommunication.php#L57-L65 |
209,979 | matomo-org/matomo | plugins/Marketplace/UpdateCommunication.php | UpdateCommunication.sendNotificationIfUpdatesAvailable | public function sendNotificationIfUpdatesAvailable()
{
$pluginsHavingUpdate = $this->getPluginsHavingUpdate();
if (empty($pluginsHavingUpdate)) {
return;
}
$pluginsToBeNotified = array();
foreach ($pluginsHavingUpdate as $plugin) {
if ($this->hasNot... | php | public function sendNotificationIfUpdatesAvailable()
{
$pluginsHavingUpdate = $this->getPluginsHavingUpdate();
if (empty($pluginsHavingUpdate)) {
return;
}
$pluginsToBeNotified = array();
foreach ($pluginsHavingUpdate as $plugin) {
if ($this->hasNot... | [
"public",
"function",
"sendNotificationIfUpdatesAvailable",
"(",
")",
"{",
"$",
"pluginsHavingUpdate",
"=",
"$",
"this",
"->",
"getPluginsHavingUpdate",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"pluginsHavingUpdate",
")",
")",
"{",
"return",
";",
"}",
"$",... | Sends an email to all super users if there is an update available for any plugins from the Marketplace.
For each update we send an email only once.
@return bool | [
"Sends",
"an",
"email",
"to",
"all",
"super",
"users",
"if",
"there",
"is",
"an",
"update",
"available",
"for",
"any",
"plugins",
"from",
"the",
"Marketplace",
".",
"For",
"each",
"update",
"we",
"send",
"an",
"email",
"only",
"once",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Marketplace/UpdateCommunication.php#L73-L96 |
209,980 | matomo-org/matomo | libs/Zend/Mail/Protocol/Pop3.php | Zend_Mail_Protocol_Pop3.request | public function request($request, $multiline = false)
{
$this->sendRequest($request);
return $this->readResponse($multiline);
} | php | public function request($request, $multiline = false)
{
$this->sendRequest($request);
return $this->readResponse($multiline);
} | [
"public",
"function",
"request",
"(",
"$",
"request",
",",
"$",
"multiline",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"request",
")",
";",
"return",
"$",
"this",
"->",
"readResponse",
"(",
"$",
"multiline",
")",
";",
"}"
] | Send request and get resposne
@see sendRequest(), readResponse()
@param string $request request
@param bool $multiline multiline response?
@return string result from readResponse()
@throws Zend_Mail_Protocol_Exception | [
"Send",
"request",
"and",
"get",
"resposne"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Pop3.php#L219-L223 |
209,981 | matomo-org/matomo | libs/Zend/Mail/Protocol/Pop3.php | Zend_Mail_Protocol_Pop3.status | public function status(&$messages, &$octets)
{
$messages = 0;
$octets = 0;
$result = $this->request('STAT');
list($messages, $octets) = explode(' ', $result);
} | php | public function status(&$messages, &$octets)
{
$messages = 0;
$octets = 0;
$result = $this->request('STAT');
list($messages, $octets) = explode(' ', $result);
} | [
"public",
"function",
"status",
"(",
"&",
"$",
"messages",
",",
"&",
"$",
"octets",
")",
"{",
"$",
"messages",
"=",
"0",
";",
"$",
"octets",
"=",
"0",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"'STAT'",
")",
";",
"list",
"(",
... | Make STAT call for message count and size sum
@param int $messages out parameter with count of messages
@param int $octets out parameter with size in octects of messages
@return void
@throws Zend_Mail_Protocol_Exception | [
"Make",
"STAT",
"call",
"for",
"message",
"count",
"and",
"size",
"sum"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Pop3.php#L294-L301 |
209,982 | matomo-org/matomo | libs/Zend/Mail/Protocol/Pop3.php | Zend_Mail_Protocol_Pop3.uniqueid | public function uniqueid($msgno = null)
{
if ($msgno !== null) {
$result = $this->request("UIDL $msgno");
list(, $result) = explode(' ', $result);
return $result;
}
$result = $this->request('UIDL', true);
$result = explode("\n", $result);
... | php | public function uniqueid($msgno = null)
{
if ($msgno !== null) {
$result = $this->request("UIDL $msgno");
list(, $result) = explode(' ', $result);
return $result;
}
$result = $this->request('UIDL', true);
$result = explode("\n", $result);
... | [
"public",
"function",
"uniqueid",
"(",
"$",
"msgno",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"msgno",
"!==",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"request",
"(",
"\"UIDL $msgno\"",
")",
";",
"list",
"(",
",",
"$",
"result",
")",
... | Make UIDL call for getting a uniqueid
@param int|null $msgno number of message, null for all
@return string|array uniqueid of message or list with array(num => uniqueid)
@throws Zend_Mail_Protocol_Exception | [
"Make",
"UIDL",
"call",
"for",
"getting",
"a",
"uniqueid"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Pop3.php#L340-L363 |
209,983 | matomo-org/matomo | libs/Zend/Mail/Protocol/Pop3.php | Zend_Mail_Protocol_Pop3.top | public function top($msgno, $lines = 0, $fallback = false)
{
if ($this->hasTop === false) {
if ($fallback) {
return $this->retrieve($msgno);
} else {
/**
* @see Zend_Mail_Protocol_Exception
*/
// requir... | php | public function top($msgno, $lines = 0, $fallback = false)
{
if ($this->hasTop === false) {
if ($fallback) {
return $this->retrieve($msgno);
} else {
/**
* @see Zend_Mail_Protocol_Exception
*/
// requir... | [
"public",
"function",
"top",
"(",
"$",
"msgno",
",",
"$",
"lines",
"=",
"0",
",",
"$",
"fallback",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasTop",
"===",
"false",
")",
"{",
"if",
"(",
"$",
"fallback",
")",
"{",
"return",
"$",
"t... | Make TOP call for getting headers and maybe some body lines
This method also sets hasTop - before it it's not known if top is supported
The fallback makes normale RETR call, which retrieves the whole message. Additional
lines are not removed.
@param int $msgno number of message
@param int $lines number of w... | [
"Make",
"TOP",
"call",
"for",
"getting",
"headers",
"and",
"maybe",
"some",
"body",
"lines",
"This",
"method",
"also",
"sets",
"hasTop",
"-",
"before",
"it",
"it",
"s",
"not",
"known",
"if",
"top",
"is",
"supported"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Pop3.php#L379-L408 |
209,984 | matomo-org/matomo | core/Tracker/Settings.php | Settings.getConfigHash | protected function getConfigHash(Request $request, $os, $browserName, $browserVersion, $plugin_Flash, $plugin_Java,
$plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF,
$plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $p... | php | protected function getConfigHash(Request $request, $os, $browserName, $browserVersion, $plugin_Flash, $plugin_Java,
$plugin_Director, $plugin_Quicktime, $plugin_RealPlayer, $plugin_PDF,
$plugin_WindowsMedia, $plugin_Gears, $plugin_Silverlight, $p... | [
"protected",
"function",
"getConfigHash",
"(",
"Request",
"$",
"request",
",",
"$",
"os",
",",
"$",
"browserName",
",",
"$",
"browserVersion",
",",
"$",
"plugin_Flash",
",",
"$",
"plugin_Java",
",",
"$",
"plugin_Director",
",",
"$",
"plugin_Quicktime",
",",
... | Returns a 64-bit hash that attemps to identify a user.
Maintaining some privacy by default, eg. prevents the merging of several Piwik serve together for matching across instances..
@param $os
@param $browserName
@param $browserVersion
@param $plugin_Flash
@param $plugin_Java
@param $plugin_Director
@param $plugin_Quic... | [
"Returns",
"a",
"64",
"-",
"bit",
"hash",
"that",
"attemps",
"to",
"identify",
"a",
"user",
".",
"Maintaining",
"some",
"privacy",
"by",
"default",
"eg",
".",
"prevents",
"the",
"merging",
"of",
"several",
"Piwik",
"serve",
"together",
"for",
"matching",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Settings.php#L100-L125 |
209,985 | matomo-org/matomo | libs/Zend/Cache.php | Zend_Cache._normalizeName | protected static function _normalizeName($name)
{
$name = ucfirst(strtolower($name));
$name = str_replace(array('-', '_', '.'), ' ', $name);
$name = ucwords($name);
$name = str_replace(' ', '', $name);
if (stripos($name, 'ZendServer') === 0) {
$name = 'ZendServer_... | php | protected static function _normalizeName($name)
{
$name = ucfirst(strtolower($name));
$name = str_replace(array('-', '_', '.'), ' ', $name);
$name = ucwords($name);
$name = str_replace(' ', '', $name);
if (stripos($name, 'ZendServer') === 0) {
$name = 'ZendServer_... | [
"protected",
"static",
"function",
"_normalizeName",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"name",
")",
")",
";",
"$",
"name",
"=",
"str_replace",
"(",
"array",
"(",
"'-'",
",",
"'_'",
",",
"'.'",
")",
... | Normalize frontend and backend names to allow multiple words TitleCased
@param string $name Name to normalize
@return string | [
"Normalize",
"frontend",
"and",
"backend",
"names",
"to",
"allow",
"multiple",
"words",
"TitleCased"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache.php#L218-L229 |
209,986 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.connect | public function connect($host, $port = null, $ssl = false)
{
if ($ssl == 'SSL') {
$host = 'ssl://' . $host;
}
if ($port === null) {
$port = $ssl === 'SSL' ? 993 : 143;
}
$errno = 0;
$errstr = '';
$this->_socket = @fsockopen($host, $... | php | public function connect($host, $port = null, $ssl = false)
{
if ($ssl == 'SSL') {
$host = 'ssl://' . $host;
}
if ($port === null) {
$port = $ssl === 'SSL' ? 993 : 143;
}
$errno = 0;
$errstr = '';
$this->_socket = @fsockopen($host, $... | [
"public",
"function",
"connect",
"(",
"$",
"host",
",",
"$",
"port",
"=",
"null",
",",
"$",
"ssl",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"ssl",
"==",
"'SSL'",
")",
"{",
"$",
"host",
"=",
"'ssl://'",
".",
"$",
"host",
";",
"}",
"if",
"(",
"$... | Open connection to IMAP server
@param string $host hostname or IP address of IMAP server
@param int|null $port of IMAP server, default is 143 (993 for ssl)
@param string|bool $ssl use 'SSL', 'TLS' or false
@return string welcome message
@throws Zend_Mail_Protocol_Exception | [
"Open",
"connection",
"to",
"IMAP",
"server"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L82-L123 |
209,987 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap._nextTaggedLine | protected function _nextTaggedLine(&$tag)
{
$line = $this->_nextLine();
// seperate tag from line
list($tag, $line) = explode(' ', $line, 2);
return $line;
} | php | protected function _nextTaggedLine(&$tag)
{
$line = $this->_nextLine();
// seperate tag from line
list($tag, $line) = explode(' ', $line, 2);
return $line;
} | [
"protected",
"function",
"_nextTaggedLine",
"(",
"&",
"$",
"tag",
")",
"{",
"$",
"line",
"=",
"$",
"this",
"->",
"_nextLine",
"(",
")",
";",
"// seperate tag from line",
"list",
"(",
"$",
"tag",
",",
"$",
"line",
")",
"=",
"explode",
"(",
"' '",
",",
... | get next line and split the tag. that's the normal case for a response line
@param string $tag tag of line is returned by reference
@return string next line
@throws Zend_Mail_Protocol_Exception | [
"get",
"next",
"line",
"and",
"split",
"the",
"tag",
".",
"that",
"s",
"the",
"normal",
"case",
"for",
"a",
"response",
"line"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L166-L174 |
209,988 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.sendRequest | public function sendRequest($command, $tokens = array(), &$tag = null)
{
if (!$tag) {
++$this->_tagCount;
$tag = 'TAG' . $this->_tagCount;
}
$line = $tag . ' ' . $command;
foreach ($tokens as $token) {
if (is_array($token)) {
if (... | php | public function sendRequest($command, $tokens = array(), &$tag = null)
{
if (!$tag) {
++$this->_tagCount;
$tag = 'TAG' . $this->_tagCount;
}
$line = $tag . ' ' . $command;
foreach ($tokens as $token) {
if (is_array($token)) {
if (... | [
"public",
"function",
"sendRequest",
"(",
"$",
"command",
",",
"$",
"tokens",
"=",
"array",
"(",
")",
",",
"&",
"$",
"tag",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"tag",
")",
"{",
"++",
"$",
"this",
"->",
"_tagCount",
";",
"$",
"tag",
"=",... | send a request
@param string $command your request command
@param array $tokens additional parameters to command, use escapeString() to prepare
@param string $tag provide a tag otherwise an autogenerated is returned
@return null
@throws Zend_Mail_Protocol_Exception | [
"send",
"a",
"request"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L336-L374 |
209,989 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.requestAndResponse | public function requestAndResponse($command, $tokens = array(), $dontParse = false)
{
$this->sendRequest($command, $tokens, $tag);
$response = $this->readResponse($tag, $dontParse);
return $response;
} | php | public function requestAndResponse($command, $tokens = array(), $dontParse = false)
{
$this->sendRequest($command, $tokens, $tag);
$response = $this->readResponse($tag, $dontParse);
return $response;
} | [
"public",
"function",
"requestAndResponse",
"(",
"$",
"command",
",",
"$",
"tokens",
"=",
"array",
"(",
")",
",",
"$",
"dontParse",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"command",
",",
"$",
"tokens",
",",
"$",
"tag",
")... | send a request and get response at once
@param string $command command as in sendRequest()
@param array $tokens parameters as in sendRequest()
@param bool $dontParse if true unparsed lines are returned instead of tokens
@return mixed response as in readResponse()
@throws Zend_Mail_Protocol_Exception | [
"send",
"a",
"request",
"and",
"get",
"response",
"at",
"once"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L385-L391 |
209,990 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.escapeString | public function escapeString($string)
{
if (func_num_args() < 2) {
if (strpos($string, "\n") !== false) {
return array('{' . strlen($string) . '}', $string);
} else {
return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
... | php | public function escapeString($string)
{
if (func_num_args() < 2) {
if (strpos($string, "\n") !== false) {
return array('{' . strlen($string) . '}', $string);
} else {
return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
... | [
"public",
"function",
"escapeString",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"<",
"2",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"string",
",",
"\"\\n\"",
")",
"!==",
"false",
")",
"{",
"return",
"array",
"(",
"'{'",
"."... | escape one or more literals i.e. for sendRequest
@param string|array $string the literal/-s
@return string|array escape literals, literals with newline ar returned
as array('{size}', 'string'); | [
"escape",
"one",
"or",
"more",
"literals",
"i",
".",
"e",
".",
"for",
"sendRequest"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L400-L414 |
209,991 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.login | public function login($user, $password)
{
return $this->requestAndResponse('LOGIN', $this->escapeString($user, $password), true);
} | php | public function login($user, $password)
{
return $this->requestAndResponse('LOGIN', $this->escapeString($user, $password), true);
} | [
"public",
"function",
"login",
"(",
"$",
"user",
",",
"$",
"password",
")",
"{",
"return",
"$",
"this",
"->",
"requestAndResponse",
"(",
"'LOGIN'",
",",
"$",
"this",
"->",
"escapeString",
"(",
"$",
"user",
",",
"$",
"password",
")",
",",
"true",
")",
... | Login to IMAP server.
@param string $user username
@param string $password password
@return bool success
@throws Zend_Mail_Protocol_Exception | [
"Login",
"to",
"IMAP",
"server",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L444-L447 |
209,992 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.capability | public function capability()
{
$response = $this->requestAndResponse('CAPABILITY');
if (!$response) {
return $response;
}
$capabilities = array();
foreach ($response as $line) {
$capabilities = array_merge($capabilities, $line);
}
ret... | php | public function capability()
{
$response = $this->requestAndResponse('CAPABILITY');
if (!$response) {
return $response;
}
$capabilities = array();
foreach ($response as $line) {
$capabilities = array_merge($capabilities, $line);
}
ret... | [
"public",
"function",
"capability",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"requestAndResponse",
"(",
"'CAPABILITY'",
")",
";",
"if",
"(",
"!",
"$",
"response",
")",
"{",
"return",
"$",
"response",
";",
"}",
"$",
"capabilities",
"=",
"... | Get capabilities from IMAP server
@return array list of capabilities
@throws Zend_Mail_Protocol_Exception | [
"Get",
"capabilities",
"from",
"IMAP",
"server"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L476-L489 |
209,993 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.examineOrSelect | public function examineOrSelect($command = 'EXAMINE', $box = 'INBOX')
{
$this->sendRequest($command, array($this->escapeString($box)), $tag);
$result = array();
while (!$this->readLine($tokens, $tag)) {
if ($tokens[0] == 'FLAGS') {
array_shift($tokens);
... | php | public function examineOrSelect($command = 'EXAMINE', $box = 'INBOX')
{
$this->sendRequest($command, array($this->escapeString($box)), $tag);
$result = array();
while (!$this->readLine($tokens, $tag)) {
if ($tokens[0] == 'FLAGS') {
array_shift($tokens);
... | [
"public",
"function",
"examineOrSelect",
"(",
"$",
"command",
"=",
"'EXAMINE'",
",",
"$",
"box",
"=",
"'INBOX'",
")",
"{",
"$",
"this",
"->",
"sendRequest",
"(",
"$",
"command",
",",
"array",
"(",
"$",
"this",
"->",
"escapeString",
"(",
"$",
"box",
")"... | Examine and select have the same response. The common code for both
is in this method
@param string $command can be 'EXAMINE' or 'SELECT' and this is used as command
@param string $box which folder to change to or examine
@return bool|array false if error, array with returned information
otherwise (flags, exists, re... | [
"Examine",
"and",
"select",
"have",
"the",
"same",
"response",
".",
"The",
"common",
"code",
"for",
"both",
"is",
"in",
"this",
"method"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L501-L529 |
209,994 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.fetch | public function fetch($items, $from, $to = null)
{
if (is_array($from)) {
$set = implode(',', $from);
} else if ($to === null) {
$set = (int)$from;
} else if ($to === INF) {
$set = (int)$from . ':*';
} else {
$set = (int)$from . ':' . (... | php | public function fetch($items, $from, $to = null)
{
if (is_array($from)) {
$set = implode(',', $from);
} else if ($to === null) {
$set = (int)$from;
} else if ($to === INF) {
$set = (int)$from . ':*';
} else {
$set = (int)$from . ':' . (... | [
"public",
"function",
"fetch",
"(",
"$",
"items",
",",
"$",
"from",
",",
"$",
"to",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"from",
")",
")",
"{",
"$",
"set",
"=",
"implode",
"(",
"','",
",",
"$",
"from",
")",
";",
"}",
"else"... | fetch one or more items of one or more messages
@param string|array $items items to fetch from message(s) as string (if only one item)
or array of strings
@param int $from message for items or start message if $to !== null
@param int|null $to if null only one message ($from) is fetched, else it's t... | [
"fetch",
"one",
"or",
"more",
"items",
"of",
"one",
"or",
"more",
"messages"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L569-L637 |
209,995 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.listMailbox | public function listMailbox($reference = '', $mailbox = '*')
{
$result = array();
$list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox));
if (!$list || $list === true) {
return $result;
}
foreach ($list as $item) {
if (co... | php | public function listMailbox($reference = '', $mailbox = '*')
{
$result = array();
$list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox));
if (!$list || $list === true) {
return $result;
}
foreach ($list as $item) {
if (co... | [
"public",
"function",
"listMailbox",
"(",
"$",
"reference",
"=",
"''",
",",
"$",
"mailbox",
"=",
"'*'",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"list",
"=",
"$",
"this",
"->",
"requestAndResponse",
"(",
"'LIST'",
",",
"$",
"this",
... | get mailbox list
this method can't be named after the IMAP command 'LIST', as list is a reserved keyword
@param string $reference mailbox reference for list
@param string $mailbox mailbox name match with wildcards
@return array mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' =>... | [
"get",
"mailbox",
"list"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L649-L665 |
209,996 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.append | public function append($folder, $message, $flags = null, $date = null)
{
$tokens = array();
$tokens[] = $this->escapeString($folder);
if ($flags !== null) {
$tokens[] = $this->escapeList($flags);
}
if ($date !== null) {
$tokens[] = $this->escapeString(... | php | public function append($folder, $message, $flags = null, $date = null)
{
$tokens = array();
$tokens[] = $this->escapeString($folder);
if ($flags !== null) {
$tokens[] = $this->escapeList($flags);
}
if ($date !== null) {
$tokens[] = $this->escapeString(... | [
"public",
"function",
"append",
"(",
"$",
"folder",
",",
"$",
"message",
",",
"$",
"flags",
"=",
"null",
",",
"$",
"date",
"=",
"null",
")",
"{",
"$",
"tokens",
"=",
"array",
"(",
")",
";",
"$",
"tokens",
"[",
"]",
"=",
"$",
"this",
"->",
"esca... | append a new message to given folder
@param string $folder name of target folder
@param string $message full message content
@param array $flags flags for new message
@param string $date date for new message
@return bool success
@throws Zend_Mail_Protocol_Exception | [
"append",
"a",
"new",
"message",
"to",
"given",
"folder"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L723-L736 |
209,997 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.copy | public function copy($folder, $from, $to = null)
{
$set = (int)$from;
if ($to != null) {
$set .= ':' . ($to == INF ? '*' : (int)$to);
}
return $this->requestAndResponse('COPY', array($set, $this->escapeString($folder)), true);
} | php | public function copy($folder, $from, $to = null)
{
$set = (int)$from;
if ($to != null) {
$set .= ':' . ($to == INF ? '*' : (int)$to);
}
return $this->requestAndResponse('COPY', array($set, $this->escapeString($folder)), true);
} | [
"public",
"function",
"copy",
"(",
"$",
"folder",
",",
"$",
"from",
",",
"$",
"to",
"=",
"null",
")",
"{",
"$",
"set",
"=",
"(",
"int",
")",
"$",
"from",
";",
"if",
"(",
"$",
"to",
"!=",
"null",
")",
"{",
"$",
"set",
".=",
"':'",
".",
"(",
... | copy message set from current folder to other folder
@param string $folder destination folder
@param int|null $to if null only one message ($from) is fetched, else it's the
last message, INF means last message avaible
@return bool success
@throws Zend_Mail_Protocol_Exception | [
"copy",
"message",
"set",
"from",
"current",
"folder",
"to",
"other",
"folder"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L747-L755 |
209,998 | matomo-org/matomo | libs/Zend/Mail/Protocol/Imap.php | Zend_Mail_Protocol_Imap.search | public function search(array $params)
{
$response = $this->requestAndResponse('SEARCH', $params);
if (!$response) {
return $response;
}
foreach ($response as $ids) {
if ($ids[0] == 'SEARCH') {
array_shift($ids);
return $ids;
... | php | public function search(array $params)
{
$response = $this->requestAndResponse('SEARCH', $params);
if (!$response) {
return $response;
}
foreach ($response as $ids) {
if ($ids[0] == 'SEARCH') {
array_shift($ids);
return $ids;
... | [
"public",
"function",
"search",
"(",
"array",
"$",
"params",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"requestAndResponse",
"(",
"'SEARCH'",
",",
"$",
"params",
")",
";",
"if",
"(",
"!",
"$",
"response",
")",
"{",
"return",
"$",
"response",
... | do a search request
This method is currently marked as internal as the API might change and is not
safe if you don't take precautions.
@internal
@return array message ids | [
"do",
"a",
"search",
"request"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Protocol/Imap.php#L822-L836 |
209,999 | matomo-org/matomo | core/Access.php | Access.reloadAccess | public function reloadAccess(Auth $auth = null)
{
$this->resetSites();
if (isset($auth)) {
$this->auth = $auth;
}
if ($this->hasSuperUserAccess()) {
$this->makeSureLoginNameIsSet();
return true;
}
$this->token_auth = null;
... | php | public function reloadAccess(Auth $auth = null)
{
$this->resetSites();
if (isset($auth)) {
$this->auth = $auth;
}
if ($this->hasSuperUserAccess()) {
$this->makeSureLoginNameIsSet();
return true;
}
$this->token_auth = null;
... | [
"public",
"function",
"reloadAccess",
"(",
"Auth",
"$",
"auth",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"resetSites",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"auth",
")",
")",
"{",
"$",
"this",
"->",
"auth",
"=",
"$",
"auth",
";",
"}",
"... | Loads the access levels for the current user.
Calls the authentication method to try to log the user in the system.
If the user credentials are not correct we don't load anything.
If the login/password is correct the user is either the SuperUser or a normal user.
We load the access levels for this user for all the web... | [
"Loads",
"the",
"access",
"levels",
"for",
"the",
"current",
"user",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Access.php#L135-L172 |
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.