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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
208,900 | matomo-org/matomo | plugins/CoreHome/DataTableRowAction/RowEvolution.php | RowEvolution.getSparkline | protected function getSparkline($metric)
{
// sparkline is always echoed, so we need to buffer the output
$view = $this->getRowEvolutionGraph($graphType = 'sparkline', $metrics = array($metric => $metric));
ob_start();
$view->render();
$spark = ob_get_contents();
ob_... | php | protected function getSparkline($metric)
{
// sparkline is always echoed, so we need to buffer the output
$view = $this->getRowEvolutionGraph($graphType = 'sparkline', $metrics = array($metric => $metric));
ob_start();
$view->render();
$spark = ob_get_contents();
ob_... | [
"protected",
"function",
"getSparkline",
"(",
"$",
"metric",
")",
"{",
"// sparkline is always echoed, so we need to buffer the output",
"$",
"view",
"=",
"$",
"this",
"->",
"getRowEvolutionGraph",
"(",
"$",
"graphType",
"=",
"'sparkline'",
",",
"$",
"metrics",
"=",
... | Get the img tag for a sparkline showing a single metric | [
"Get",
"the",
"img",
"tag",
"for",
"a",
"sparkline",
"showing",
"a",
"single",
"metric"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/DataTableRowAction/RowEvolution.php#L302-L318 |
208,901 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.isTokenValid | public function isTokenValid($token, $user, $keySuffix)
{
$now = time();
// token valid for 24 hrs (give or take, due to the coarse granularity in our strftime format string)
for ($i = 0; $i <= 24; $i++) {
$generatedToken = $this->generatePasswordResetToken($user, $keySuffix, $n... | php | public function isTokenValid($token, $user, $keySuffix)
{
$now = time();
// token valid for 24 hrs (give or take, due to the coarse granularity in our strftime format string)
for ($i = 0; $i <= 24; $i++) {
$generatedToken = $this->generatePasswordResetToken($user, $keySuffix, $n... | [
"public",
"function",
"isTokenValid",
"(",
"$",
"token",
",",
"$",
"user",
",",
"$",
"keySuffix",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"// token valid for 24 hrs (give or take, due to the coarse granularity in our strftime format string)",
"for",
"(",
"$"... | Returns true if a reset token is valid, false if otherwise. A reset token is valid if
it exists and has not expired.
@param string $token The reset token to check.
@param array $user The user information returned by the UsersManager API.
@param string $keySuffix The suffix used in generating a token.
@return bool true... | [
"Returns",
"true",
"if",
"a",
"reset",
"token",
"is",
"valid",
"false",
"if",
"otherwise",
".",
"A",
"reset",
"token",
"is",
"valid",
"if",
"it",
"exists",
"and",
"has",
"not",
"expired",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L246-L260 |
208,902 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.generatePasswordResetToken | public function generatePasswordResetToken($user, $keySuffix, $expiryTimestamp = null)
{
/*
* Piwik does not store the generated password reset token.
* This avoids a database schema change and SQL queries to store, retrieve, and purge (expired) tokens.
*/
if (!$expiryTime... | php | public function generatePasswordResetToken($user, $keySuffix, $expiryTimestamp = null)
{
/*
* Piwik does not store the generated password reset token.
* This avoids a database schema change and SQL queries to store, retrieve, and purge (expired) tokens.
*/
if (!$expiryTime... | [
"public",
"function",
"generatePasswordResetToken",
"(",
"$",
"user",
",",
"$",
"keySuffix",
",",
"$",
"expiryTimestamp",
"=",
"null",
")",
"{",
"/*\n * Piwik does not store the generated password reset token.\n * This avoids a database schema change and SQL queries t... | Generate a password reset token. Expires in 24 hours from the beginning of the current hour.
The reset token is generated using a user's email, login and the time when the token expires.
@param array $user The user information.
@param string $keySuffix The suffix used in generating a token.
@param int|null $expiryTi... | [
"Generate",
"a",
"password",
"reset",
"token",
".",
"Expires",
"in",
"24",
"hours",
"from",
"the",
"beginning",
"of",
"the",
"current",
"hour",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L273-L289 |
208,903 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.generateSecureHash | protected function generateSecureHash($hashIdentifier, $data)
{
// mitigate rainbow table attack
$halfDataLen = strlen($data) / 2;
$stringToHash = $hashIdentifier
. substr($data, 0, $halfDataLen)
. $this->getSalt()
. substr($... | php | protected function generateSecureHash($hashIdentifier, $data)
{
// mitigate rainbow table attack
$halfDataLen = strlen($data) / 2;
$stringToHash = $hashIdentifier
. substr($data, 0, $halfDataLen)
. $this->getSalt()
. substr($... | [
"protected",
"function",
"generateSecureHash",
"(",
"$",
"hashIdentifier",
",",
"$",
"data",
")",
"{",
"// mitigate rainbow table attack",
"$",
"halfDataLen",
"=",
"strlen",
"(",
"$",
"data",
")",
"/",
"2",
";",
"$",
"stringToHash",
"=",
"$",
"hashIdentifier",
... | Generates a hash using a hash "identifier" and some data to hash. The hash identifier is
a string that differentiates the hash in some way.
We can't get the identifier back from a hash but we can tell if a hash is the hash for
a specific identifier by computing a hash for the identifier and comparing with the
first ha... | [
"Generates",
"a",
"hash",
"using",
"a",
"hash",
"identifier",
"and",
"some",
"data",
"to",
"hash",
".",
"The",
"hash",
"identifier",
"is",
"a",
"string",
"that",
"differentiates",
"the",
"hash",
"in",
"some",
"way",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L305-L317 |
208,904 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.getUserInformation | protected function getUserInformation($loginOrMail)
{
$userModel = new Model();
$user = null;
if ($userModel->userExists($loginOrMail)) {
$user = $userModel->getUser($loginOrMail);
} else if ($userModel->userEmailExists($loginOrMail)) {
$user = $userModel->ge... | php | protected function getUserInformation($loginOrMail)
{
$userModel = new Model();
$user = null;
if ($userModel->userExists($loginOrMail)) {
$user = $userModel->getUser($loginOrMail);
} else if ($userModel->userEmailExists($loginOrMail)) {
$user = $userModel->ge... | [
"protected",
"function",
"getUserInformation",
"(",
"$",
"loginOrMail",
")",
"{",
"$",
"userModel",
"=",
"new",
"Model",
"(",
")",
";",
"$",
"user",
"=",
"null",
";",
"if",
"(",
"$",
"userModel",
"->",
"userExists",
"(",
"$",
"loginOrMail",
")",
")",
"... | Returns user information based on a login or email.
Derived classes can override this method to provide custom user querying logic.
@param string $loginMail user login or email address
@return array `array("login" => '...', "email" => '...', "password" => '...')` or null, if user not found. | [
"Returns",
"user",
"information",
"based",
"on",
"a",
"login",
"or",
"email",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L380-L391 |
208,905 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.checkPasswordHash | protected function checkPasswordHash($passwordHash)
{
$hashInfo = $this->passwordHelper->info($passwordHash);
if (!isset($hashInfo['algo']) || 0 >= $hashInfo['algo']) {
throw new Exception(Piwik::translate('Login_ExceptionPasswordMD5HashExpected'));
}
} | php | protected function checkPasswordHash($passwordHash)
{
$hashInfo = $this->passwordHelper->info($passwordHash);
if (!isset($hashInfo['algo']) || 0 >= $hashInfo['algo']) {
throw new Exception(Piwik::translate('Login_ExceptionPasswordMD5HashExpected'));
}
} | [
"protected",
"function",
"checkPasswordHash",
"(",
"$",
"passwordHash",
")",
"{",
"$",
"hashInfo",
"=",
"$",
"this",
"->",
"passwordHelper",
"->",
"info",
"(",
"$",
"passwordHash",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"hashInfo",
"[",
"'algo'",
"... | Checks the password hash that was retrieved from the Option table. Used as a sanity check
when finishing the reset password process. If a password is obviously malformed, changing
a user's password to it will keep the user from being able to login again.
Derived classes can override this method to provide fewer or mor... | [
"Checks",
"the",
"password",
"hash",
"that",
"was",
"retrieved",
"from",
"the",
"Option",
"table",
".",
"Used",
"as",
"a",
"sanity",
"check",
"when",
"finishing",
"the",
"reset",
"password",
"process",
".",
"If",
"a",
"password",
"is",
"obviously",
"malforme... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L403-L410 |
208,906 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.sendEmailConfirmationLink | private function sendEmailConfirmationLink($user, $keySuffix)
{
$login = $user['login'];
$email = $user['email'];
// construct a password reset token from user information
$resetToken = $this->generatePasswordResetToken($user, $keySuffix);
$confirmPasswordModule = $this->co... | php | private function sendEmailConfirmationLink($user, $keySuffix)
{
$login = $user['login'];
$email = $user['email'];
// construct a password reset token from user information
$resetToken = $this->generatePasswordResetToken($user, $keySuffix);
$confirmPasswordModule = $this->co... | [
"private",
"function",
"sendEmailConfirmationLink",
"(",
"$",
"user",
",",
"$",
"keySuffix",
")",
"{",
"$",
"login",
"=",
"$",
"user",
"[",
"'login'",
"]",
";",
"$",
"email",
"=",
"$",
"user",
"[",
"'email'",
"]",
";",
"// construct a password reset token fr... | Sends email confirmation link for a password reset request.
@param array $user User info for the requested password reset.
@param string $keySuffix The suffix used in generating a token. | [
"Sends",
"email",
"confirmation",
"link",
"for",
"a",
"password",
"reset",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L418-L452 |
208,907 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.savePasswordResetInfo | private function savePasswordResetInfo($login, $newPassword, $keySuffix)
{
$optionName = $this->getPasswordResetInfoOptionName($login);
$optionData = [
'hash' => $this->passwordHelper->hash(UsersManager::getPasswordHash($newPassword)),
'keySuffix' => $keySuffix,
];
... | php | private function savePasswordResetInfo($login, $newPassword, $keySuffix)
{
$optionName = $this->getPasswordResetInfoOptionName($login);
$optionData = [
'hash' => $this->passwordHelper->hash(UsersManager::getPasswordHash($newPassword)),
'keySuffix' => $keySuffix,
];
... | [
"private",
"function",
"savePasswordResetInfo",
"(",
"$",
"login",
",",
"$",
"newPassword",
",",
"$",
"keySuffix",
")",
"{",
"$",
"optionName",
"=",
"$",
"this",
"->",
"getPasswordResetInfoOptionName",
"(",
"$",
"login",
")",
";",
"$",
"optionData",
"=",
"["... | Stores password reset info for a specific login.
@param string $login The user login for whom a password change was requested.
@param string $newPassword The new password to set.
@param string $keySuffix The suffix used in generating a token. | [
"Stores",
"password",
"reset",
"info",
"for",
"a",
"specific",
"login",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L461-L471 |
208,908 | matomo-org/matomo | plugins/Login/PasswordResetter.php | PasswordResetter.getPasswordToResetTo | private function getPasswordToResetTo($login)
{
$optionName = self::getPasswordResetInfoOptionName($login);
$optionValue = Option::get($optionName);
$optionValue = json_decode($optionValue, $isAssoc = true);
return $optionValue;
} | php | private function getPasswordToResetTo($login)
{
$optionName = self::getPasswordResetInfoOptionName($login);
$optionValue = Option::get($optionName);
$optionValue = json_decode($optionValue, $isAssoc = true);
return $optionValue;
} | [
"private",
"function",
"getPasswordToResetTo",
"(",
"$",
"login",
")",
"{",
"$",
"optionName",
"=",
"self",
"::",
"getPasswordResetInfoOptionName",
"(",
"$",
"login",
")",
";",
"$",
"optionValue",
"=",
"Option",
"::",
"get",
"(",
"$",
"optionName",
")",
";",... | Gets password hash stored in password reset info.
@param string $login The user login to check for.
@return string|false The hashed password or false if no reset info exists. | [
"Gets",
"password",
"hash",
"stored",
"in",
"password",
"reset",
"info",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/PasswordResetter.php#L479-L485 |
208,909 | matomo-org/matomo | core/Plugin/Dimension/DimensionMetadataProvider.php | DimensionMetadataProvider.getActionReferenceColumnsByTable | public function getActionReferenceColumnsByTable()
{
$result = array(
'log_link_visit_action' => array('idaction_url',
'idaction_url_ref',
'idaction_name_ref'
),
'log_conversion' => array('idaction_url'),
'log_visit' ... | php | public function getActionReferenceColumnsByTable()
{
$result = array(
'log_link_visit_action' => array('idaction_url',
'idaction_url_ref',
'idaction_name_ref'
),
'log_conversion' => array('idaction_url'),
'log_visit' ... | [
"public",
"function",
"getActionReferenceColumnsByTable",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
"'log_link_visit_action'",
"=>",
"array",
"(",
"'idaction_url'",
",",
"'idaction_url_ref'",
",",
"'idaction_name_ref'",
")",
",",
"'log_conversion'",
"=>",
"arra... | Returns a list of idaction column names organized by table name. Uses dimension metadata
to find idaction columns dynamically.
Note: It is not currently possible to use the Piwik platform to add idaction columns to tables
other than log_link_visit_action (w/o doing something unsupported), so idaction columns in
other ... | [
"Returns",
"a",
"list",
"of",
"idaction",
"column",
"names",
"organized",
"by",
"table",
"name",
".",
"Uses",
"dimension",
"metadata",
"to",
"find",
"idaction",
"columns",
"dynamically",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Dimension/DimensionMetadataProvider.php#L41-L94 |
208,910 | matomo-org/matomo | plugins/ScheduledReports/API.php | API.addReport | public function addReport($idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false, $evolutionPeriodFor = 'prev',
$evolutionPeriodN = null)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasViewAccess($idSite);
... | php | public function addReport($idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false, $evolutionPeriodFor = 'prev',
$evolutionPeriodN = null)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasViewAccess($idSite);
... | [
"public",
"function",
"addReport",
"(",
"$",
"idSite",
",",
"$",
"description",
",",
"$",
"period",
",",
"$",
"hour",
",",
"$",
"reportType",
",",
"$",
"reportFormat",
",",
"$",
"reports",
",",
"$",
"parameters",
",",
"$",
"idSegment",
"=",
"false",
",... | Creates a new report and schedules it.
@param int $idSite
@param string $description Report description
@param string $period Schedule frequency: day, week or month
@param int $hour Hour (0-23) when the report should be sent
@param string $reportType 'email' or any other format provided via the ScheduledReports.getRep... | [
"Creates",
"a",
"new",
"report",
"and",
"schedules",
"it",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/API.php#L98-L133 |
208,911 | matomo-org/matomo | plugins/ScheduledReports/API.php | API.updateReport | public function updateReport($idReport, $idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false, $evolutionPeriodFor = 'prev',
$evolutionPeriodN = null)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasViewAc... | php | public function updateReport($idReport, $idSite, $description, $period, $hour, $reportType, $reportFormat, $reports, $parameters, $idSegment = false, $evolutionPeriodFor = 'prev',
$evolutionPeriodN = null)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasViewAc... | [
"public",
"function",
"updateReport",
"(",
"$",
"idReport",
",",
"$",
"idSite",
",",
"$",
"description",
",",
"$",
"period",
",",
"$",
"hour",
",",
"$",
"reportType",
",",
"$",
"reportFormat",
",",
"$",
"reports",
",",
"$",
"parameters",
",",
"$",
"idS... | Updates an existing report.
@see addReport() | [
"Updates",
"an",
"existing",
"report",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/API.php#L154-L189 |
208,912 | matomo-org/matomo | plugins/ScheduledReports/API.php | API.deleteReport | public function deleteReport($idReport)
{
$APIScheduledReports = $this->getReports($idSite = false, $periodSearch = false, $idReport);
$report = reset($APIScheduledReports);
Piwik::checkUserHasSuperUserAccessOrIsTheUser($report['login']);
$this->getModel()->updateReport($idReport, a... | php | public function deleteReport($idReport)
{
$APIScheduledReports = $this->getReports($idSite = false, $periodSearch = false, $idReport);
$report = reset($APIScheduledReports);
Piwik::checkUserHasSuperUserAccessOrIsTheUser($report['login']);
$this->getModel()->updateReport($idReport, a... | [
"public",
"function",
"deleteReport",
"(",
"$",
"idReport",
")",
"{",
"$",
"APIScheduledReports",
"=",
"$",
"this",
"->",
"getReports",
"(",
"$",
"idSite",
"=",
"false",
",",
"$",
"periodSearch",
"=",
"false",
",",
"$",
"idReport",
")",
";",
"$",
"report... | Deletes a specific report
@param int $idReport | [
"Deletes",
"a",
"specific",
"report"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/API.php#L196-L207 |
208,913 | matomo-org/matomo | plugins/ScheduledReports/API.php | API.getReports | public function getReports($idSite = false, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = false, $idSegment = false)
{
Piwik::checkUserHasSomeViewAccess();
$cacheKey = (int)$idSite . '.' . (string)$period . '.' . (int)$idReport . '.' . (int)$ifSuperUserReturnOnlySuper... | php | public function getReports($idSite = false, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = false, $idSegment = false)
{
Piwik::checkUserHasSomeViewAccess();
$cacheKey = (int)$idSite . '.' . (string)$period . '.' . (int)$idReport . '.' . (int)$ifSuperUserReturnOnlySuper... | [
"public",
"function",
"getReports",
"(",
"$",
"idSite",
"=",
"false",
",",
"$",
"period",
"=",
"false",
",",
"$",
"idReport",
"=",
"false",
",",
"$",
"ifSuperUserReturnOnlySuperUserReports",
"=",
"false",
",",
"$",
"idSegment",
"=",
"false",
")",
"{",
"Piw... | Returns the list of reports matching the passed parameters
@param bool|int $idSite If specified, will filter reports that belong to a specific idsite
@param bool|string $period If specified, will filter reports that are scheduled for this period (day,week,month)
@param bool|int $idReport If specified, will filter the ... | [
"Returns",
"the",
"list",
"of",
"reports",
"matching",
"the",
"passed",
"parameters"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/API.php#L220-L293 |
208,914 | matomo-org/matomo | core/Url.php | Url.getCurrentUrl | public static function getCurrentUrl()
{
return self::getCurrentScheme() . '://'
. self::getCurrentHost()
. self::getCurrentScriptName(false)
. self::getCurrentQueryString();
} | php | public static function getCurrentUrl()
{
return self::getCurrentScheme() . '://'
. self::getCurrentHost()
. self::getCurrentScriptName(false)
. self::getCurrentQueryString();
} | [
"public",
"static",
"function",
"getCurrentUrl",
"(",
")",
"{",
"return",
"self",
"::",
"getCurrentScheme",
"(",
")",
".",
"'://'",
".",
"self",
"::",
"getCurrentHost",
"(",
")",
".",
"self",
"::",
"getCurrentScriptName",
"(",
"false",
")",
".",
"self",
":... | Returns the current URL.
@return string eg, `"http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2"`
@api | [
"Returns",
"the",
"current",
"URL",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L59-L65 |
208,915 | matomo-org/matomo | core/Url.php | Url.getCurrentUrlWithoutQueryString | public static function getCurrentUrlWithoutQueryString($checkTrustedHost = true)
{
return self::getCurrentScheme() . '://'
. self::getCurrentHost($default = 'unknown', $checkTrustedHost)
. self::getCurrentScriptName(false);
} | php | public static function getCurrentUrlWithoutQueryString($checkTrustedHost = true)
{
return self::getCurrentScheme() . '://'
. self::getCurrentHost($default = 'unknown', $checkTrustedHost)
. self::getCurrentScriptName(false);
} | [
"public",
"static",
"function",
"getCurrentUrlWithoutQueryString",
"(",
"$",
"checkTrustedHost",
"=",
"true",
")",
"{",
"return",
"self",
"::",
"getCurrentScheme",
"(",
")",
".",
"'://'",
".",
"self",
"::",
"getCurrentHost",
"(",
"$",
"default",
"=",
"'unknown'"... | Returns the current URL without the query string.
@param bool $checkTrustedHost Whether to do trusted host check. Should ALWAYS be true,
except in {@link Piwik\Plugin\Controller}.
@return string eg, `"http://example.org/dir1/dir2/index.php"` if the current URL is
`"http://example.org/dir1/dir2/index.php?param1=value1&... | [
"Returns",
"the",
"current",
"URL",
"without",
"the",
"query",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L76-L81 |
208,916 | matomo-org/matomo | core/Url.php | Url.getCurrentScriptPath | public static function getCurrentScriptPath()
{
$queryString = self::getCurrentScriptName();
//add a fake letter case /test/test2/ returns /test which is not expected
$urlDir = dirname($queryString . 'x');
$urlDir = str_replace('\\', '/', $urlDir);
// if we are in a subpath ... | php | public static function getCurrentScriptPath()
{
$queryString = self::getCurrentScriptName();
//add a fake letter case /test/test2/ returns /test which is not expected
$urlDir = dirname($queryString . 'x');
$urlDir = str_replace('\\', '/', $urlDir);
// if we are in a subpath ... | [
"public",
"static",
"function",
"getCurrentScriptPath",
"(",
")",
"{",
"$",
"queryString",
"=",
"self",
"::",
"getCurrentScriptName",
"(",
")",
";",
"//add a fake letter case /test/test2/ returns /test which is not expected",
"$",
"urlDir",
"=",
"dirname",
"(",
"$",
"qu... | Returns the path to the script being executed. The script file name is not included.
@return string eg, `"/dir1/dir2/"` if the current URL is
`"http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2"`
@api | [
"Returns",
"the",
"path",
"to",
"the",
"script",
"being",
"executed",
".",
"The",
"script",
"file",
"name",
"is",
"not",
"included",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L105-L117 |
208,917 | matomo-org/matomo | core/Url.php | Url.getCurrentScriptName | public static function getCurrentScriptName($removePathInfo = true)
{
$url = '';
// insert extra path info if proxy_uri_header is set and enabled
if (isset(Config::getInstance()->General['proxy_uri_header'])
&& Config::getInstance()->General['proxy_uri_header'] == 1
... | php | public static function getCurrentScriptName($removePathInfo = true)
{
$url = '';
// insert extra path info if proxy_uri_header is set and enabled
if (isset(Config::getInstance()->General['proxy_uri_header'])
&& Config::getInstance()->General['proxy_uri_header'] == 1
... | [
"public",
"static",
"function",
"getCurrentScriptName",
"(",
"$",
"removePathInfo",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"''",
";",
"// insert extra path info if proxy_uri_header is set and enabled",
"if",
"(",
"isset",
"(",
"Config",
"::",
"getInstance",
"(",
")... | Returns the path to the script being executed. Includes the script file name.
@param bool $removePathInfo If true (default value) then the PATH_INFO will be stripped.
@return string eg, `"/dir1/dir2/index.php"` if the current URL is
`"http://example.org/dir1/dir2/index.php?param1=value1¶m2=value2"`
@api | [
"Returns",
"the",
"path",
"to",
"the",
"script",
"being",
"executed",
".",
"Includes",
"the",
"script",
"file",
"name",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L127-L177 |
208,918 | matomo-org/matomo | core/Url.php | Url.getQueryStringFromParameters | public static function getQueryStringFromParameters($parameters)
{
$query = '';
foreach ($parameters as $name => $value) {
if (is_null($value) || $value === false) {
continue;
}
if (is_array($value)) {
foreach ($value as $theValue) ... | php | public static function getQueryStringFromParameters($parameters)
{
$query = '';
foreach ($parameters as $name => $value) {
if (is_null($value) || $value === false) {
continue;
}
if (is_array($value)) {
foreach ($value as $theValue) ... | [
"public",
"static",
"function",
"getQueryStringFromParameters",
"(",
"$",
"parameters",
")",
"{",
"$",
"query",
"=",
"''",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
... | Converts an array of parameters name => value mappings to a query
string. Values must already be URL encoded before you call this function.
@param array $parameters eg. `array('param1' => 10, 'param2' => array(1,2))`
@return string eg. `"param1=10¶m2[]=1¶m2[]=2"`
@api | [
"Converts",
"an",
"array",
"of",
"parameters",
"name",
"=",
">",
"value",
"mappings",
"to",
"a",
"query",
"string",
".",
"Values",
"must",
"already",
"be",
"URL",
"encoded",
"before",
"you",
"call",
"this",
"function",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L427-L444 |
208,919 | matomo-org/matomo | core/Url.php | Url.redirectToReferrer | public static function redirectToReferrer()
{
$referrer = self::getReferrer();
if ($referrer !== false) {
self::redirectToUrl($referrer);
}
self::redirectToUrl(self::getCurrentUrlWithoutQueryString());
} | php | public static function redirectToReferrer()
{
$referrer = self::getReferrer();
if ($referrer !== false) {
self::redirectToUrl($referrer);
}
self::redirectToUrl(self::getCurrentUrlWithoutQueryString());
} | [
"public",
"static",
"function",
"redirectToReferrer",
"(",
")",
"{",
"$",
"referrer",
"=",
"self",
"::",
"getReferrer",
"(",
")",
";",
"if",
"(",
"$",
"referrer",
"!==",
"false",
")",
"{",
"self",
"::",
"redirectToUrl",
"(",
"$",
"referrer",
")",
";",
... | Redirects the user to the referrer. If no referrer exists, the user is redirected
to the current URL without query string.
@api | [
"Redirects",
"the",
"user",
"to",
"the",
"referrer",
".",
"If",
"no",
"referrer",
"exists",
"the",
"user",
"is",
"redirected",
"to",
"the",
"current",
"URL",
"without",
"query",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L457-L464 |
208,920 | matomo-org/matomo | core/Url.php | Url.redirectToHttps | public static function redirectToHttps()
{
if (ProxyHttp::isHttps()) {
return;
}
$url = self::getCurrentUrl();
$url = str_replace("http://", "https://", $url);
self::redirectToUrl($url);
} | php | public static function redirectToHttps()
{
if (ProxyHttp::isHttps()) {
return;
}
$url = self::getCurrentUrl();
$url = str_replace("http://", "https://", $url);
self::redirectToUrl($url);
} | [
"public",
"static",
"function",
"redirectToHttps",
"(",
")",
"{",
"if",
"(",
"ProxyHttp",
"::",
"isHttps",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"url",
"=",
"self",
"::",
"getCurrentUrl",
"(",
")",
";",
"$",
"url",
"=",
"str_replace",
"(",
"\"... | If the page is using HTTP, redirect to the same page over HTTPS | [
"If",
"the",
"page",
"is",
"using",
"HTTP",
"redirect",
"to",
"the",
"same",
"page",
"over",
"HTTPS"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L505-L513 |
208,921 | matomo-org/matomo | core/Url.php | Url.isLocalUrl | public static function isLocalUrl($url)
{
if (empty($url)) {
return true;
}
// handle host name mangling
$requestUri = isset($_SERVER['SCRIPT_URI']) ? $_SERVER['SCRIPT_URI'] : '';
$parseRequest = @parse_url($requestUri);
$hosts = array(self::getHost(), se... | php | public static function isLocalUrl($url)
{
if (empty($url)) {
return true;
}
// handle host name mangling
$requestUri = isset($_SERVER['SCRIPT_URI']) ? $_SERVER['SCRIPT_URI'] : '';
$parseRequest = @parse_url($requestUri);
$hosts = array(self::getHost(), se... | [
"public",
"static",
"function",
"isLocalUrl",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"url",
")",
")",
"{",
"return",
"true",
";",
"}",
"// handle host name mangling",
"$",
"requestUri",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'SCRIPT_U... | Returns `true` if the URL points to something on the same host, `false` if otherwise.
@param string $url
@return bool True if local; false otherwise.
@api | [
"Returns",
"true",
"if",
"the",
"URL",
"points",
"to",
"something",
"on",
"the",
"same",
"host",
"false",
"if",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L536-L561 |
208,922 | matomo-org/matomo | core/Url.php | Url.isLocalHost | public static function isLocalHost($host)
{
if (empty($host)) {
return false;
}
// remove port
$hostWithoutPort = explode(':', $host);
array_pop($hostWithoutPort);
$hostWithoutPort = implode(':', $hostWithoutPort);
$localHostnames = Url::getLocal... | php | public static function isLocalHost($host)
{
if (empty($host)) {
return false;
}
// remove port
$hostWithoutPort = explode(':', $host);
array_pop($hostWithoutPort);
$hostWithoutPort = implode(':', $hostWithoutPort);
$localHostnames = Url::getLocal... | [
"public",
"static",
"function",
"isLocalHost",
"(",
"$",
"host",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"host",
")",
")",
"{",
"return",
"false",
";",
"}",
"// remove port",
"$",
"hostWithoutPort",
"=",
"explode",
"(",
"':'",
",",
"$",
"host",
")",
... | Checks whether the given host is a local host like `127.0.0.1` or `localhost`.
@param string $host
@return bool | [
"Checks",
"whether",
"the",
"given",
"host",
"is",
"a",
"local",
"host",
"like",
"127",
".",
"0",
".",
"0",
".",
"1",
"or",
"localhost",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L569-L583 |
208,923 | matomo-org/matomo | core/Url.php | Url.getHostFromUrl | public static function getHostFromUrl($url)
{
$parsedUrl = parse_url($url);
if (empty($parsedUrl['host'])) {
return;
}
return Common::mb_strtolower($parsedUrl['host']);
} | php | public static function getHostFromUrl($url)
{
$parsedUrl = parse_url($url);
if (empty($parsedUrl['host'])) {
return;
}
return Common::mb_strtolower($parsedUrl['host']);
} | [
"public",
"static",
"function",
"getHostFromUrl",
"(",
"$",
"url",
")",
"{",
"$",
"parsedUrl",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"parsedUrl",
"[",
"'host'",
"]",
")",
")",
"{",
"return",
";",
"}",
"return",
... | Returns the host part of any valid URL.
@param string $url Any fully qualified URL
@return string|null The actual host in lower case or null if $url is not a valid fully qualified URL. | [
"Returns",
"the",
"host",
"part",
"of",
"any",
"valid",
"URL",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Url.php#L643-L652 |
208,924 | matomo-org/matomo | core/API/Request.php | Request.sanitizeRequest | private function sanitizeRequest()
{
// The label filter does not work with expanded=1 because the data table IDs have a different meaning
// depending on whether the table has been loaded yet. expanded=1 causes all tables to be loaded, which
// is why the label filter can't descend when a r... | php | private function sanitizeRequest()
{
// The label filter does not work with expanded=1 because the data table IDs have a different meaning
// depending on whether the table has been loaded yet. expanded=1 causes all tables to be loaded, which
// is why the label filter can't descend when a r... | [
"private",
"function",
"sanitizeRequest",
"(",
")",
"{",
"// The label filter does not work with expanded=1 because the data table IDs have a different meaning",
"// depending on whether the table has been loaded yet. expanded=1 causes all tables to be loaded, which",
"// is why the label filter can... | Make sure that the request contains no logical errors | [
"Make",
"sure",
"that",
"the",
"request",
"contains",
"no",
"logical",
"errors"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L180-L191 |
208,925 | matomo-org/matomo | core/API/Request.php | Request.process | public function process()
{
// read the format requested for the output data
$outputFormat = strtolower(Common::getRequestVar('format', 'xml', 'string', $this->request));
$disablePostProcessing = $this->shouldDisablePostProcessing();
// create the response
$response = new R... | php | public function process()
{
// read the format requested for the output data
$outputFormat = strtolower(Common::getRequestVar('format', 'xml', 'string', $this->request));
$disablePostProcessing = $this->shouldDisablePostProcessing();
// create the response
$response = new R... | [
"public",
"function",
"process",
"(",
")",
"{",
"// read the format requested for the output data",
"$",
"outputFormat",
"=",
"strtolower",
"(",
"Common",
"::",
"getRequestVar",
"(",
"'format'",
",",
"'xml'",
",",
"'string'",
",",
"$",
"this",
"->",
"request",
")"... | Dispatches the API request to the appropriate API method and returns the result
after post-processing.
Post-processing includes:
- flattening if **flat** is 0
- running generic filters unless **disable_generic_filters** is set to 1
- URL decoding label column values
- running queued filters unless **disable_queued_fi... | [
"Dispatches",
"the",
"API",
"request",
"to",
"the",
"appropriate",
"API",
"method",
"and",
"returns",
"the",
"result",
"after",
"post",
"-",
"processing",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L216-L289 |
208,926 | matomo-org/matomo | core/API/Request.php | Request.getMethodIfApiRequest | public static function getMethodIfApiRequest($request)
{
$module = Common::getRequestVar('module', '', 'string', $request);
$method = Common::getRequestVar('method', '', 'string', $request);
$isApi = $module === 'API' && !empty($method) && (count(explode('.', $method)) === 2);
retur... | php | public static function getMethodIfApiRequest($request)
{
$module = Common::getRequestVar('module', '', 'string', $request);
$method = Common::getRequestVar('method', '', 'string', $request);
$isApi = $module === 'API' && !empty($method) && (count(explode('.', $method)) === 2);
retur... | [
"public",
"static",
"function",
"getMethodIfApiRequest",
"(",
"$",
"request",
")",
"{",
"$",
"module",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'module'",
",",
"''",
",",
"'string'",
",",
"$",
"request",
")",
";",
"$",
"method",
"=",
"Common",
"::",
"... | Returns the current API method being executed, if the current request is an API request.
@param array $request eg array('module' => 'API', 'method' => 'Test.getMethod')
@return string|null
@throws Exception | [
"Returns",
"the",
"current",
"API",
"method",
"being",
"executed",
"if",
"the",
"current",
"request",
"is",
"an",
"API",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L389-L396 |
208,927 | matomo-org/matomo | core/API/Request.php | Request.forceReloadAuthUsingTokenAuth | private static function forceReloadAuthUsingTokenAuth($tokenAuth)
{
/**
* Triggered when authenticating an API request, but only if the **token_auth**
* query parameter is found in the request.
*
* Plugins that provide authentication capabilities should subscribe to this ... | php | private static function forceReloadAuthUsingTokenAuth($tokenAuth)
{
/**
* Triggered when authenticating an API request, but only if the **token_auth**
* query parameter is found in the request.
*
* Plugins that provide authentication capabilities should subscribe to this ... | [
"private",
"static",
"function",
"forceReloadAuthUsingTokenAuth",
"(",
"$",
"tokenAuth",
")",
"{",
"/**\n * Triggered when authenticating an API request, but only if the **token_auth**\n * query parameter is found in the request.\n *\n * Plugins that provide authent... | The current session will be authenticated using this token_auth.
It will overwrite the previous Auth object.
@param string $tokenAuth
@return void | [
"The",
"current",
"session",
"will",
"be",
"authenticated",
"using",
"this",
"token_auth",
".",
"It",
"will",
"overwrite",
"the",
"previous",
"Auth",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L424-L445 |
208,928 | matomo-org/matomo | core/API/Request.php | Request.getCurrentUrlWithoutGenericFilters | public static function getCurrentUrlWithoutGenericFilters($params)
{
// unset all filter query params so the related report will show up in its default state,
// unless the filter param was in $queryParams
$genericFiltersInfo = DataTableGenericFilter::getGenericFiltersInformation();
... | php | public static function getCurrentUrlWithoutGenericFilters($params)
{
// unset all filter query params so the related report will show up in its default state,
// unless the filter param was in $queryParams
$genericFiltersInfo = DataTableGenericFilter::getGenericFiltersInformation();
... | [
"public",
"static",
"function",
"getCurrentUrlWithoutGenericFilters",
"(",
"$",
"params",
")",
"{",
"// unset all filter query params so the related report will show up in its default state,",
"// unless the filter param was in $queryParams",
"$",
"genericFiltersInfo",
"=",
"DataTableGen... | Returns the current URL without generic filter query parameters.
@param array $params Query parameter values to override in the new URL.
@return string | [
"Returns",
"the",
"current",
"URL",
"without",
"generic",
"filter",
"query",
"parameters",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L546-L560 |
208,929 | matomo-org/matomo | core/API/Request.php | Request.shouldLoadExpanded | public static function shouldLoadExpanded()
{
// if filter_column_recursive & filter_pattern_recursive are supplied, and flat isn't supplied
// we have to load all the child subtables.
return Common::getRequestVar('filter_column_recursive', false) !== false
&& Common::getRequestV... | php | public static function shouldLoadExpanded()
{
// if filter_column_recursive & filter_pattern_recursive are supplied, and flat isn't supplied
// we have to load all the child subtables.
return Common::getRequestVar('filter_column_recursive', false) !== false
&& Common::getRequestV... | [
"public",
"static",
"function",
"shouldLoadExpanded",
"(",
")",
"{",
"// if filter_column_recursive & filter_pattern_recursive are supplied, and flat isn't supplied",
"// we have to load all the child subtables.",
"return",
"Common",
"::",
"getRequestVar",
"(",
"'filter_column_recursive'... | Returns whether the DataTable result will have to be expanded for the
current request before rendering.
@return bool
@ignore | [
"Returns",
"whether",
"the",
"DataTable",
"result",
"will",
"have",
"to",
"be",
"expanded",
"for",
"the",
"current",
"request",
"before",
"rendering",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L569-L576 |
208,930 | matomo-org/matomo | core/API/Request.php | Request.getRawSegmentFromRequest | public static function getRawSegmentFromRequest()
{
// we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET
$segmentRaw = false;
$segment = Common::getRequestVar('segment', '', 'string');
if (!empty($segment)) {
... | php | public static function getRawSegmentFromRequest()
{
// we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET
$segmentRaw = false;
$segment = Common::getRequestVar('segment', '', 'string');
if (!empty($segment)) {
... | [
"public",
"static",
"function",
"getRawSegmentFromRequest",
"(",
")",
"{",
"// we need the URL encoded segment parameter, we fetch it from _SERVER['QUERY_STRING'] instead of default URL decoded _GET",
"$",
"segmentRaw",
"=",
"false",
";",
"$",
"segment",
"=",
"Common",
"::",
"get... | Returns the segment query parameter from the original request, without modifications.
@return array|bool | [
"Returns",
"the",
"segment",
"query",
"parameter",
"from",
"the",
"original",
"request",
"without",
"modifications",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/API/Request.php#L591-L603 |
208,931 | matomo-org/matomo | core/DataTable/Renderer/Console.php | Console.renderDataTableMap | protected function renderDataTableMap(DataTable\Map $map, $prefix)
{
$output = "Set<hr />";
$prefix = $prefix . ' ';
foreach ($map->getDataTables() as $descTable => $table) {
$output .= $prefix . "<b>" . $descTable . "</b><br />";
$o... | php | protected function renderDataTableMap(DataTable\Map $map, $prefix)
{
$output = "Set<hr />";
$prefix = $prefix . ' ';
foreach ($map->getDataTables() as $descTable => $table) {
$output .= $prefix . "<b>" . $descTable . "</b><br />";
$o... | [
"protected",
"function",
"renderDataTableMap",
"(",
"DataTable",
"\\",
"Map",
"$",
"map",
",",
"$",
"prefix",
")",
"{",
"$",
"output",
"=",
"\"Set<hr />\"",
";",
"$",
"prefix",
"=",
"$",
"prefix",
".",
"' '",
";",
"foreach",
... | Computes the output of the given array of data tables
@param DataTable\Map $map data tables to render
@param string $prefix prefix to output before table data
@return string | [
"Computes",
"the",
"output",
"of",
"the",
"given",
"array",
"of",
"data",
"tables"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Console.php#L53-L63 |
208,932 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime.encodeQuotedPrintable | public static function encodeQuotedPrintable($str,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
$out = '';
$str = self::_encodeQuotedPrintable($str);
// Split encoded text into separate lines
while ($str) {
$ptr = strlen($str);
... | php | public static function encodeQuotedPrintable($str,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
$out = '';
$str = self::_encodeQuotedPrintable($str);
// Split encoded text into separate lines
while ($str) {
$ptr = strlen($str);
... | [
"public",
"static",
"function",
"encodeQuotedPrintable",
"(",
"$",
"str",
",",
"$",
"lineLength",
"=",
"self",
"::",
"LINELENGTH",
",",
"$",
"lineEnd",
"=",
"self",
"::",
"LINEEND",
")",
"{",
"$",
"out",
"=",
"''",
";",
"$",
"str",
"=",
"self",
"::",
... | Encode a given string with the QUOTED_PRINTABLE mechanism and wrap the lines.
@param string $str
@param int $lineLength Defaults to {@link LINELENGTH}
@param int $lineEnd Defaults to {@link LINEEND}
@return string | [
"Encode",
"a",
"given",
"string",
"with",
"the",
"QUOTED_PRINTABLE",
"mechanism",
"and",
"wrap",
"the",
"lines",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L125-L158 |
208,933 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime._encodeQuotedPrintable | private static function _encodeQuotedPrintable($str)
{
$str = str_replace('=', '=3D', $str);
$str = str_replace(self::$qpKeys, self::$qpReplaceValues, $str);
$str = rtrim($str);
return $str;
} | php | private static function _encodeQuotedPrintable($str)
{
$str = str_replace('=', '=3D', $str);
$str = str_replace(self::$qpKeys, self::$qpReplaceValues, $str);
$str = rtrim($str);
return $str;
} | [
"private",
"static",
"function",
"_encodeQuotedPrintable",
"(",
"$",
"str",
")",
"{",
"$",
"str",
"=",
"str_replace",
"(",
"'='",
",",
"'=3D'",
",",
"$",
"str",
")",
";",
"$",
"str",
"=",
"str_replace",
"(",
"self",
"::",
"$",
"qpKeys",
",",
"self",
... | Converts a string into quoted printable format.
@param string $str
@return string | [
"Converts",
"a",
"string",
"into",
"quoted",
"printable",
"format",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L166-L172 |
208,934 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime.encodeQuotedPrintableHeader | public static function encodeQuotedPrintableHeader($str, $charset,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
// Reduce line-length by the length of the required delimiter, charsets and encoding
$prefix = sprintf('=?%s?Q?', $charset);
$lineLength = $lineLengt... | php | public static function encodeQuotedPrintableHeader($str, $charset,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
// Reduce line-length by the length of the required delimiter, charsets and encoding
$prefix = sprintf('=?%s?Q?', $charset);
$lineLength = $lineLengt... | [
"public",
"static",
"function",
"encodeQuotedPrintableHeader",
"(",
"$",
"str",
",",
"$",
"charset",
",",
"$",
"lineLength",
"=",
"self",
"::",
"LINELENGTH",
",",
"$",
"lineEnd",
"=",
"self",
"::",
"LINEEND",
")",
"{",
"// Reduce line-length by the length of the r... | Encode a given string with the QUOTED_PRINTABLE mechanism for Mail Headers.
Mail headers depend on an extended quoted printable algorithm otherwise
a range of bugs can occur.
@param string $str
@param string $charset
@param int $lineLength Defaults to {@link LINELENGTH}
@param int $lineEnd Defaults to {@link LINEEND}... | [
"Encode",
"a",
"given",
"string",
"with",
"the",
"QUOTED_PRINTABLE",
"mechanism",
"for",
"Mail",
"Headers",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L186-L232 |
208,935 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime.getNextQuotedPrintableToken | private static function getNextQuotedPrintableToken($str)
{
if(substr($str, 0, 1) == "=") {
$token = substr($str, 0, 3);
} else {
$token = substr($str, 0, 1);
}
return $token;
} | php | private static function getNextQuotedPrintableToken($str)
{
if(substr($str, 0, 1) == "=") {
$token = substr($str, 0, 3);
} else {
$token = substr($str, 0, 1);
}
return $token;
} | [
"private",
"static",
"function",
"getNextQuotedPrintableToken",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"str",
",",
"0",
",",
"1",
")",
"==",
"\"=\"",
")",
"{",
"$",
"token",
"=",
"substr",
"(",
"$",
"str",
",",
"0",
",",
"3",
"... | Retrieves the first token from a quoted printable string.
@param string $str
@return string | [
"Retrieves",
"the",
"first",
"token",
"from",
"a",
"quoted",
"printable",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L240-L248 |
208,936 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime.encodeBase64Header | public static function encodeBase64Header($str,
$charset,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
$prefix = '=?' . $charset . '?B?';
$suffix = '?=';
$remainingLength = $lineLength - strlen($prefix) - strlen($suffix);
$encodedValue = self::... | php | public static function encodeBase64Header($str,
$charset,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
$prefix = '=?' . $charset . '?B?';
$suffix = '?=';
$remainingLength = $lineLength - strlen($prefix) - strlen($suffix);
$encodedValue = self::... | [
"public",
"static",
"function",
"encodeBase64Header",
"(",
"$",
"str",
",",
"$",
"charset",
",",
"$",
"lineLength",
"=",
"self",
"::",
"LINELENGTH",
",",
"$",
"lineEnd",
"=",
"self",
"::",
"LINEEND",
")",
"{",
"$",
"prefix",
"=",
"'=?'",
".",
"$",
"cha... | Encode a given string in mail header compatible base64 encoding.
@param string $str
@param string $charset
@param int $lineLength Defaults to {@link LINELENGTH}
@param int $lineEnd Defaults to {@link LINEEND}
@return string | [
"Encode",
"a",
"given",
"string",
"in",
"mail",
"header",
"compatible",
"base64",
"encoding",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L259-L272 |
208,937 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime.encodeBase64 | public static function encodeBase64($str,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
} | php | public static function encodeBase64($str,
$lineLength = self::LINELENGTH,
$lineEnd = self::LINEEND)
{
return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
} | [
"public",
"static",
"function",
"encodeBase64",
"(",
"$",
"str",
",",
"$",
"lineLength",
"=",
"self",
"::",
"LINELENGTH",
",",
"$",
"lineEnd",
"=",
"self",
"::",
"LINEEND",
")",
"{",
"return",
"rtrim",
"(",
"chunk_split",
"(",
"base64_encode",
"(",
"$",
... | Encode a given string in base64 encoding and break lines
according to the maximum linelength.
@param string $str
@param int $lineLength Defaults to {@link LINELENGTH}
@param int $lineEnd Defaults to {@link LINEEND}
@return string | [
"Encode",
"a",
"given",
"string",
"in",
"base64",
"encoding",
"and",
"break",
"lines",
"according",
"to",
"the",
"maximum",
"linelength",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L283-L288 |
208,938 | matomo-org/matomo | libs/Zend/Mime.php | Zend_Mime.encode | public static function encode($str, $encoding, $EOL = self::LINEEND)
{
switch ($encoding) {
case self::ENCODING_BASE64:
return self::encodeBase64($str, self::LINELENGTH, $EOL);
case self::ENCODING_QUOTEDPRINTABLE:
return self::encodeQuotedPrintable($s... | php | public static function encode($str, $encoding, $EOL = self::LINEEND)
{
switch ($encoding) {
case self::ENCODING_BASE64:
return self::encodeBase64($str, self::LINELENGTH, $EOL);
case self::ENCODING_QUOTEDPRINTABLE:
return self::encodeQuotedPrintable($s... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"str",
",",
"$",
"encoding",
",",
"$",
"EOL",
"=",
"self",
"::",
"LINEEND",
")",
"{",
"switch",
"(",
"$",
"encoding",
")",
"{",
"case",
"self",
"::",
"ENCODING_BASE64",
":",
"return",
"self",
"::",
... | Encode the given string with the given encoding.
@param string $str
@param string $encoding
@param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
@return string | [
"Encode",
"the",
"given",
"string",
"with",
"the",
"given",
"encoding",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime.php#L315-L330 |
208,939 | matomo-org/matomo | plugins/CoreAdminHome/Tasks.php | Tasks.updateSpammerBlacklist | public function updateSpammerBlacklist()
{
$url = 'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt';
$list = Http::sendHttpRequest($url, 30);
$list = preg_split("/\r\n|\n|\r/", $list);
if (count($list) < 10) {
throw new \Exception(... | php | public function updateSpammerBlacklist()
{
$url = 'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt';
$list = Http::sendHttpRequest($url, 30);
$list = preg_split("/\r\n|\n|\r/", $list);
if (count($list) < 10) {
throw new \Exception(... | [
"public",
"function",
"updateSpammerBlacklist",
"(",
")",
"{",
"$",
"url",
"=",
"'https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt'",
";",
"$",
"list",
"=",
"Http",
"::",
"sendHttpRequest",
"(",
"$",
"url",
",",
"30",
")",
";",
... | Update the referrer spam blacklist
@see https://github.com/matomo-org/referrer-spam-blacklist | [
"Update",
"the",
"referrer",
"spam",
"blacklist"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Tasks.php#L250-L263 |
208,940 | matomo-org/matomo | plugins/CoreAdminHome/Tasks.php | Tasks.getSegmentHashesByIdSite | public function getSegmentHashesByIdSite()
{
//Get a list of hashes of all segments that exist now
$sql = "SELECT DISTINCT definition, enable_only_idsite FROM " . Common::prefixTable('segment')
. " WHERE deleted = 0";
$rows = Db::fetchAll($sql);
$segmentHashes = array();
... | php | public function getSegmentHashesByIdSite()
{
//Get a list of hashes of all segments that exist now
$sql = "SELECT DISTINCT definition, enable_only_idsite FROM " . Common::prefixTable('segment')
. " WHERE deleted = 0";
$rows = Db::fetchAll($sql);
$segmentHashes = array();
... | [
"public",
"function",
"getSegmentHashesByIdSite",
"(",
")",
"{",
"//Get a list of hashes of all segments that exist now",
"$",
"sql",
"=",
"\"SELECT DISTINCT definition, enable_only_idsite FROM \"",
".",
"Common",
"::",
"prefixTable",
"(",
"'segment'",
")",
".",
"\" WHERE delet... | Get a list of all segment hashes that currently exist, indexed by idSite.
@return array | [
"Get",
"a",
"list",
"of",
"all",
"segment",
"hashes",
"that",
"currently",
"exist",
"indexed",
"by",
"idSite",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Tasks.php#L294-L310 |
208,941 | matomo-org/matomo | core/Tracker/Visit/VisitProperties.php | VisitProperties.getProperty | public function getProperty($name)
{
return isset($this->visitInfo[$name]) ? $this->visitInfo[$name] : null;
} | php | public function getProperty($name)
{
return isset($this->visitInfo[$name]) ? $this->visitInfo[$name] : null;
} | [
"public",
"function",
"getProperty",
"(",
"$",
"name",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"visitInfo",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"visitInfo",
"[",
"$",
"name",
"]",
":",
"null",
";",
"}"
] | Returns a visit property, or `null` if none is set.
@param string $name The property name.
@return mixed | [
"Returns",
"a",
"visit",
"property",
"or",
"null",
"if",
"none",
"is",
"set",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Visit/VisitProperties.php#L30-L33 |
208,942 | matomo-org/matomo | libs/Zend/Session.php | Zend_Session.setOptions | public static function setOptions(array $userOptions = array())
{
// set default options on first run only (before applying user settings)
if (!self::$_defaultOptionsSet) {
foreach (self::$_defaultOptions as $defaultOptionName => $defaultOptionValue) {
if (isset(self::$_d... | php | public static function setOptions(array $userOptions = array())
{
// set default options on first run only (before applying user settings)
if (!self::$_defaultOptionsSet) {
foreach (self::$_defaultOptions as $defaultOptionName => $defaultOptionValue) {
if (isset(self::$_d... | [
"public",
"static",
"function",
"setOptions",
"(",
"array",
"$",
"userOptions",
"=",
"array",
"(",
")",
")",
"{",
"// set default options on first run only (before applying user settings)",
"if",
"(",
"!",
"self",
"::",
"$",
"_defaultOptionsSet",
")",
"{",
"foreach",
... | setOptions - set both the class specified
@param array $userOptions - pass-by-keyword style array of <option name, option value> pairs
@throws Zend_Session_Exception
@return void | [
"setOptions",
"-",
"set",
"both",
"the",
"class",
"specified"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Session.php#L199-L230 |
208,943 | matomo-org/matomo | libs/Zend/Mail/Transport/Abstract.php | Zend_Mail_Transport_Abstract._getHeaders | protected function _getHeaders($boundary)
{
if (null !== $boundary) {
// Build multipart mail
$type = $this->_mail->getType();
if (!$type) {
if ($this->_mail->hasAttachments) {
$type = Zend_Mime::MULTIPART_MIXED;
} elsei... | php | protected function _getHeaders($boundary)
{
if (null !== $boundary) {
// Build multipart mail
$type = $this->_mail->getType();
if (!$type) {
if ($this->_mail->hasAttachments) {
$type = Zend_Mime::MULTIPART_MIXED;
} elsei... | [
"protected",
"function",
"_getHeaders",
"(",
"$",
"boundary",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"boundary",
")",
"{",
"// Build multipart mail",
"$",
"type",
"=",
"$",
"this",
"->",
"_mail",
"->",
"getType",
"(",
")",
";",
"if",
"(",
"!",
"$",
... | Return all mail headers as an array
If a boundary is given, a multipart header is generated with a
Content-Type of either multipart/alternative or multipart/mixed depending
on the mail parts present in the {@link $_mail Zend_Mail object} present.
@param string $boundary
@return array | [
"Return",
"all",
"mail",
"headers",
"as",
"an",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Abstract.php#L127-L153 |
208,944 | matomo-org/matomo | libs/Zend/Mail/Transport/Abstract.php | Zend_Mail_Transport_Abstract._prepareHeaders | protected function _prepareHeaders($headers)
{
if (!$this->_mail) {
/**
* @see Zend_Mail_Transport_Exception
*/
// require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception('Missing Zend_Mail object in _mail proper... | php | protected function _prepareHeaders($headers)
{
if (!$this->_mail) {
/**
* @see Zend_Mail_Transport_Exception
*/
// require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception('Missing Zend_Mail object in _mail proper... | [
"protected",
"function",
"_prepareHeaders",
"(",
"$",
"headers",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_mail",
")",
"{",
"/**\n * @see Zend_Mail_Transport_Exception\n */",
"// require_once 'Zend/Mail/Transport/Exception.php';",
"throw",
"new",
... | Prepare header string for use in transport
Prepares and generates {@link $header} based on the headers provided.
@param mixed $headers
@access protected
@return void
@throws Zend_Mail_Transport_Exception if any header lines exceed 998
characters | [
"Prepare",
"header",
"string",
"for",
"use",
"in",
"transport"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Abstract.php#L181-L219 |
208,945 | matomo-org/matomo | libs/Zend/Mail/Transport/Abstract.php | Zend_Mail_Transport_Abstract._buildBody | protected function _buildBody()
{
if (($text = $this->_mail->getBodyText())
&& ($html = $this->_mail->getBodyHtml()))
{
// Generate unique boundary for multipart/alternative
$mime = new Zend_Mime(null);
$boundaryLine = $mime->boundaryLine($this->EOL);
... | php | protected function _buildBody()
{
if (($text = $this->_mail->getBodyText())
&& ($html = $this->_mail->getBodyHtml()))
{
// Generate unique boundary for multipart/alternative
$mime = new Zend_Mime(null);
$boundaryLine = $mime->boundaryLine($this->EOL);
... | [
"protected",
"function",
"_buildBody",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"text",
"=",
"$",
"this",
"->",
"_mail",
"->",
"getBodyText",
"(",
")",
")",
"&&",
"(",
"$",
"html",
"=",
"$",
"this",
"->",
"_mail",
"->",
"getBodyHtml",
"(",
")",
")",
"... | Generate MIME compliant message from the current configuration
If both a text and HTML body are present, generates a
multipart/alternative Zend_Mime_Part containing the headers and contents
of each. Otherwise, uses whichever of the text or HTML parts present.
The content part is then prepended to the list of Zend_Mim... | [
"Generate",
"MIME",
"compliant",
"message",
"from",
"the",
"current",
"configuration"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Abstract.php#L233-L295 |
208,946 | matomo-org/matomo | libs/Zend/Validate/File/Exists.php | Zend_Validate_File_Exists.getDirectory | public function getDirectory($asArray = false)
{
$asArray = (bool) $asArray;
$directory = (string) $this->_directory;
if ($asArray) {
$directory = explode(',', $directory);
}
return $directory;
} | php | public function getDirectory($asArray = false)
{
$asArray = (bool) $asArray;
$directory = (string) $this->_directory;
if ($asArray) {
$directory = explode(',', $directory);
}
return $directory;
} | [
"public",
"function",
"getDirectory",
"(",
"$",
"asArray",
"=",
"false",
")",
"{",
"$",
"asArray",
"=",
"(",
"bool",
")",
"$",
"asArray",
";",
"$",
"directory",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"_directory",
";",
"if",
"(",
"$",
"asArray",... | Returns the set file directories which are checked
@param boolean $asArray Returns the values as array, when false an concated string is returned
@return string | [
"Returns",
"the",
"set",
"file",
"directories",
"which",
"are",
"checked"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Exists.php#L88-L97 |
208,947 | matomo-org/matomo | plugins/Installation/ServerFilesGenerator.php | ServerFilesGenerator.createHtAccessFiles | public static function createHtAccessFiles()
{
$denyAll = self::getDenyAllHtaccessContent();
$allow = self::getAllowHtaccessContent();
$allowAny =
"# Allow any file in this directory\n" .
"<Files \"*\">\n" .
"\t" . $allow . "\n" .
"</Files>\n"... | php | public static function createHtAccessFiles()
{
$denyAll = self::getDenyAllHtaccessContent();
$allow = self::getAllowHtaccessContent();
$allowAny =
"# Allow any file in this directory\n" .
"<Files \"*\">\n" .
"\t" . $allow . "\n" .
"</Files>\n"... | [
"public",
"static",
"function",
"createHtAccessFiles",
"(",
")",
"{",
"$",
"denyAll",
"=",
"self",
"::",
"getDenyAllHtaccessContent",
"(",
")",
";",
"$",
"allow",
"=",
"self",
"::",
"getAllowHtaccessContent",
"(",
")",
";",
"$",
"allowAny",
"=",
"\"# Allow any... | Generate Apache .htaccess files to restrict access
.htaccess files are created on all webservers even Nginx, as sometimes Nginx knows how to handle .htaccess files | [
"Generate",
"Apache",
".",
"htaccess",
"files",
"to",
"restrict",
"access",
".",
"htaccess",
"files",
"are",
"created",
"on",
"all",
"webservers",
"even",
"Nginx",
"as",
"sometimes",
"Nginx",
"knows",
"how",
"to",
"handle",
".",
"htaccess",
"files"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/ServerFilesGenerator.php#L31-L83 |
208,948 | matomo-org/matomo | plugins/Installation/ServerFilesGenerator.php | ServerFilesGenerator.createHtAccess | protected static function createHtAccess($path, $overwrite = true, $content)
{
$file = $path . '/.htaccess';
$content = "# This file is auto generated by Matomo, do not edit directly\n# Please report any issue or improvement directly to the Matomo team.\n\n" . $content;
if ($overwrite || !f... | php | protected static function createHtAccess($path, $overwrite = true, $content)
{
$file = $path . '/.htaccess';
$content = "# This file is auto generated by Matomo, do not edit directly\n# Please report any issue or improvement directly to the Matomo team.\n\n" . $content;
if ($overwrite || !f... | [
"protected",
"static",
"function",
"createHtAccess",
"(",
"$",
"path",
",",
"$",
"overwrite",
"=",
"true",
",",
"$",
"content",
")",
"{",
"$",
"file",
"=",
"$",
"path",
".",
"'/.htaccess'",
";",
"$",
"content",
"=",
"\"# This file is auto generated by Matomo, ... | Create .htaccess file in specified directory
Apache-specific; for IIS @see web.config
.htaccess files are created on all webservers even Nginx, as sometimes Nginx knows how to handle .htaccess files
@param string $path without trailing slash
@param bool $overwrite whether to overwrite an existing file or not
@param ... | [
"Create",
".",
"htaccess",
"file",
"in",
"specified",
"directory"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/ServerFilesGenerator.php#L96-L104 |
208,949 | matomo-org/matomo | plugins/Installation/ServerFilesGenerator.php | ServerFilesGenerator.createWebConfigFiles | protected static function createWebConfigFiles()
{
if (!SettingsServer::isIIS()) {
return;
}
@file_put_contents(PIWIK_INCLUDE_PATH . '/web.config',
'<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
... | php | protected static function createWebConfigFiles()
{
if (!SettingsServer::isIIS()) {
return;
}
@file_put_contents(PIWIK_INCLUDE_PATH . '/web.config',
'<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
... | [
"protected",
"static",
"function",
"createWebConfigFiles",
"(",
")",
"{",
"if",
"(",
"!",
"SettingsServer",
"::",
"isIIS",
"(",
")",
")",
"{",
"return",
";",
"}",
"@",
"file_put_contents",
"(",
"PIWIK_INCLUDE_PATH",
".",
"'/web.config'",
",",
"'<?xml version=\"1... | Generate IIS web.config files to restrict access
Note: for IIS 7 and above | [
"Generate",
"IIS",
"web",
".",
"config",
"files",
"to",
"restrict",
"access"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/ServerFilesGenerator.php#L111-L178 |
208,950 | matomo-org/matomo | plugins/Installation/ServerFilesGenerator.php | ServerFilesGenerator.deleteHtAccessFiles | public static function deleteHtAccessFiles()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH, ".htaccess");
// that match the list of directories we create htaccess files
// (ie. not the root /.htaccess)
$directoriesWithAutoHtaccess = array(
'/js',
'/libs',
... | php | public static function deleteHtAccessFiles()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH, ".htaccess");
// that match the list of directories we create htaccess files
// (ie. not the root /.htaccess)
$directoriesWithAutoHtaccess = array(
'/js',
'/libs',
... | [
"public",
"static",
"function",
"deleteHtAccessFiles",
"(",
")",
"{",
"$",
"files",
"=",
"Filesystem",
"::",
"globr",
"(",
"PIWIK_INCLUDE_PATH",
",",
"\".htaccess\"",
")",
";",
"// that match the list of directories we create htaccess files",
"// (ie. not the root /.htaccess)... | Deletes all existing .htaccess files and web.config files that Matomo may have created, | [
"Deletes",
"all",
"existing",
".",
"htaccess",
"files",
"and",
"web",
".",
"config",
"files",
"that",
"Matomo",
"may",
"have",
"created"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/ServerFilesGenerator.php#L292-L319 |
208,951 | matomo-org/matomo | core/SettingsServer.php | SettingsServer.isGdExtensionEnabled | public static function isGdExtensionEnabled()
{
static $gd = null;
if (is_null($gd)) {
$gd = false;
$extensions = @get_loaded_extensions();
if (is_array($extensions)) {
$gd = in_array('gd', $extensions) && function_exists('imageftbbox');
... | php | public static function isGdExtensionEnabled()
{
static $gd = null;
if (is_null($gd)) {
$gd = false;
$extensions = @get_loaded_extensions();
if (is_array($extensions)) {
$gd = in_array('gd', $extensions) && function_exists('imageftbbox');
... | [
"public",
"static",
"function",
"isGdExtensionEnabled",
"(",
")",
"{",
"static",
"$",
"gd",
"=",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"gd",
")",
")",
"{",
"$",
"gd",
"=",
"false",
";",
"$",
"extensions",
"=",
"@",
"get_loaded_extensions",
"(",
... | Returns `true` if the GD PHP extension is available, `false` if otherwise.
_Note: ImageGraph and the sparkline report visualization depend on the GD extension._
@return bool
@api | [
"Returns",
"true",
"if",
"the",
"GD",
"PHP",
"extension",
"is",
"available",
"false",
"if",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsServer.php#L112-L125 |
208,952 | matomo-org/matomo | core/SettingsServer.php | SettingsServer.raiseMemoryLimitIfNecessary | public static function raiseMemoryLimitIfNecessary()
{
$memoryLimit = self::getMemoryLimitValue();
if ($memoryLimit === false) {
return false;
}
$minimumMemoryLimit = Config::getInstance()->General['minimum_memory_limit'];
if (self::isArchivePhpTriggered()) {
... | php | public static function raiseMemoryLimitIfNecessary()
{
$memoryLimit = self::getMemoryLimitValue();
if ($memoryLimit === false) {
return false;
}
$minimumMemoryLimit = Config::getInstance()->General['minimum_memory_limit'];
if (self::isArchivePhpTriggered()) {
... | [
"public",
"static",
"function",
"raiseMemoryLimitIfNecessary",
"(",
")",
"{",
"$",
"memoryLimit",
"=",
"self",
"::",
"getMemoryLimitValue",
"(",
")",
";",
"if",
"(",
"$",
"memoryLimit",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"minimumMemo... | Raise PHP memory limit if below the minimum required
@return bool true if set; false otherwise | [
"Raise",
"PHP",
"memory",
"limit",
"if",
"below",
"the",
"minimum",
"required"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsServer.php#L132-L153 |
208,953 | matomo-org/matomo | core/SettingsServer.php | SettingsServer.setMemoryLimit | protected static function setMemoryLimit($minimumMemoryLimit)
{
// in Megabytes
$currentValue = self::getMemoryLimitValue();
if ($currentValue === false
|| ($currentValue < $minimumMemoryLimit && @ini_set('memory_limit', $minimumMemoryLimit . 'M'))
) {
return ... | php | protected static function setMemoryLimit($minimumMemoryLimit)
{
// in Megabytes
$currentValue = self::getMemoryLimitValue();
if ($currentValue === false
|| ($currentValue < $minimumMemoryLimit && @ini_set('memory_limit', $minimumMemoryLimit . 'M'))
) {
return ... | [
"protected",
"static",
"function",
"setMemoryLimit",
"(",
"$",
"minimumMemoryLimit",
")",
"{",
"// in Megabytes",
"$",
"currentValue",
"=",
"self",
"::",
"getMemoryLimitValue",
"(",
")",
";",
"if",
"(",
"$",
"currentValue",
"===",
"false",
"||",
"(",
"$",
"cur... | Set PHP memory limit
Note: system settings may prevent scripts from overriding the master value
@param int $minimumMemoryLimit
@return bool true if set; false otherwise | [
"Set",
"PHP",
"memory",
"limit"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsServer.php#L163-L173 |
208,954 | matomo-org/matomo | plugins/VisitorInterest/API.php | API.getNumberOfVisitsByVisitCount | public function getNumberOfVisitsByVisitCount($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable(
Archiver::VISITS_COUNT_RECORD_NAME, $idSite, $period, $date, $segment, Metrics::INDEX_NB_VISITS);
$dataTable->queueFilter('AddSegmentByRangeLabel', array('visitCo... | php | public function getNumberOfVisitsByVisitCount($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable(
Archiver::VISITS_COUNT_RECORD_NAME, $idSite, $period, $date, $segment, Metrics::INDEX_NB_VISITS);
$dataTable->queueFilter('AddSegmentByRangeLabel', array('visitCo... | [
"public",
"function",
"getNumberOfVisitsByVisitCount",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"$",
"dataTable",
"=",
"$",
"this",
"->",
"getDataTable",
"(",
"Archiver",
"::",
"VISITS_COUNT_RECOR... | Returns a DataTable that associates ranges of visit numbers with the count of visits
whose visit number falls within those ranges.
@param int $idSite The site to select data from.
@param string $period The period type.
@param string $date The date type.
@param string|bool $segment The segment.
@return DataTable the ar... | [
"Returns",
"a",
"DataTable",
"that",
"associates",
"ranges",
"of",
"visit",
"numbers",
"with",
"the",
"count",
"of",
"visits",
"whose",
"visit",
"number",
"falls",
"within",
"those",
"ranges",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/VisitorInterest/API.php#L85-L95 |
208,955 | matomo-org/matomo | core/Settings/Measurable/MeasurableSettings.php | MeasurableSettings.makeSetting | protected function makeSetting($name, $defaultValue, $type, $fieldConfigCallback)
{
$setting = new MeasurableSetting($name, $defaultValue, $type, $this->pluginName, $this->idSite);
$setting->setConfigureCallback($fieldConfigCallback);
$this->addSetting($setting);
return $setting;
... | php | protected function makeSetting($name, $defaultValue, $type, $fieldConfigCallback)
{
$setting = new MeasurableSetting($name, $defaultValue, $type, $this->pluginName, $this->idSite);
$setting->setConfigureCallback($fieldConfigCallback);
$this->addSetting($setting);
return $setting;
... | [
"protected",
"function",
"makeSetting",
"(",
"$",
"name",
",",
"$",
"defaultValue",
",",
"$",
"type",
",",
"$",
"fieldConfigCallback",
")",
"{",
"$",
"setting",
"=",
"new",
"MeasurableSetting",
"(",
"$",
"name",
",",
"$",
"defaultValue",
",",
"$",
"type",
... | Creates a new measurable setting.
Settings will be displayed in the UI depending on the order of `makeSetting` calls. This means you can define
the order of the displayed settings by calling makeSetting first for more important settings.
@param string $name The name of the setting that shall be created
@param... | [
"Creates",
"a",
"new",
"measurable",
"setting",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Settings/Measurable/MeasurableSettings.php#L89-L97 |
208,956 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getTableStatus | public function getTableStatus($table)
{
$prefixed = Common::prefixTable($table);
// if we've already gotten every table status, don't issue an un-needed query
if (!is_null($this->tableStatuses) && isset($this->tableStatuses[$prefixed])) {
return $this->tableStatuses[$prefixed];... | php | public function getTableStatus($table)
{
$prefixed = Common::prefixTable($table);
// if we've already gotten every table status, don't issue an un-needed query
if (!is_null($this->tableStatuses) && isset($this->tableStatuses[$prefixed])) {
return $this->tableStatuses[$prefixed];... | [
"public",
"function",
"getTableStatus",
"(",
"$",
"table",
")",
"{",
"$",
"prefixed",
"=",
"Common",
"::",
"prefixTable",
"(",
"$",
"table",
")",
";",
"// if we've already gotten every table status, don't issue an un-needed query",
"if",
"(",
"!",
"is_null",
"(",
"$... | Gets the MySQL table status of the requested Piwik table.
@param string $table The name of the table. Should not be prefixed (ie, 'log_visit' is
correct, 'matomo_log_visit' is not).
@return array See http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html . | [
"Gets",
"the",
"MySQL",
"table",
"status",
"of",
"the",
"requested",
"Piwik",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L64-L74 |
208,957 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getAllTablesStatus | public function getAllTablesStatus($matchingRegex = null)
{
if (is_null($this->tableStatuses)) {
$tablesPiwik = DbHelper::getTablesInstalled();
$this->tableStatuses = array();
foreach ($this->dataAccess->getAllTablesStatus() as $t) {
if (in_array($t['Name... | php | public function getAllTablesStatus($matchingRegex = null)
{
if (is_null($this->tableStatuses)) {
$tablesPiwik = DbHelper::getTablesInstalled();
$this->tableStatuses = array();
foreach ($this->dataAccess->getAllTablesStatus() as $t) {
if (in_array($t['Name... | [
"public",
"function",
"getAllTablesStatus",
"(",
"$",
"matchingRegex",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"tableStatuses",
")",
")",
"{",
"$",
"tablesPiwik",
"=",
"DbHelper",
"::",
"getTablesInstalled",
"(",
")",
";",
"$",... | Gets the result of a SHOW TABLE STATUS query for every Piwik table in the DB.
Non-piwik tables are ignored.
@param string $matchingRegex Regex used to filter out tables whose name doesn't
match it.
@return array The table information. See http://dev.mysql.com/doc/refman/5.5/en/show-table-status.html
for specifics. | [
"Gets",
"the",
"result",
"of",
"a",
"SHOW",
"TABLE",
"STATUS",
"query",
"for",
"every",
"Piwik",
"table",
"in",
"the",
"DB",
".",
"Non",
"-",
"piwik",
"tables",
"are",
"ignored",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L85-L109 |
208,958 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getRowCountsAndSizeByBlobName | public function getRowCountsAndSizeByBlobName($forceCache = false)
{
$extraSelects = array("SUM(OCTET_LENGTH(value)) AS 'blob_size'", "SUM(LENGTH(name)) AS 'name_size'");
$extraCols = array('blob_size', 'name_size');
return $this->getRowCountsByArchiveName(
$this->getAllBlobArchi... | php | public function getRowCountsAndSizeByBlobName($forceCache = false)
{
$extraSelects = array("SUM(OCTET_LENGTH(value)) AS 'blob_size'", "SUM(LENGTH(name)) AS 'name_size'");
$extraCols = array('blob_size', 'name_size');
return $this->getRowCountsByArchiveName(
$this->getAllBlobArchi... | [
"public",
"function",
"getRowCountsAndSizeByBlobName",
"(",
"$",
"forceCache",
"=",
"false",
")",
"{",
"$",
"extraSelects",
"=",
"array",
"(",
"\"SUM(OCTET_LENGTH(value)) AS 'blob_size'\"",
",",
"\"SUM(LENGTH(name)) AS 'name_size'\"",
")",
";",
"$",
"extraCols",
"=",
"a... | Returns a DataTable that lists the number of rows and the estimated amount of space
each blob archive type takes up in the database.
Blob types are differentiated by name.
@param bool $forceCache false to use the cached result, true to run the queries again and
cache the result.
@return DataTable | [
"Returns",
"a",
"DataTable",
"that",
"lists",
"the",
"number",
"of",
"rows",
"and",
"the",
"estimated",
"amount",
"of",
"space",
"each",
"blob",
"archive",
"type",
"takes",
"up",
"in",
"the",
"database",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L165-L172 |
208,959 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getRowCountsByArchiveName | private function getRowCountsByArchiveName($statuses, $getRowSizeMethod, $forceCache = false,
$otherSelects = array(), $otherDataTableColumns = array())
{
$extraCols = '';
if (!empty($otherSelects)) {
$extraCols = ', ' . implode(', ', $other... | php | private function getRowCountsByArchiveName($statuses, $getRowSizeMethod, $forceCache = false,
$otherSelects = array(), $otherDataTableColumns = array())
{
$extraCols = '';
if (!empty($otherSelects)) {
$extraCols = ', ' . implode(', ', $other... | [
"private",
"function",
"getRowCountsByArchiveName",
"(",
"$",
"statuses",
",",
"$",
"getRowSizeMethod",
",",
"$",
"forceCache",
"=",
"false",
",",
"$",
"otherSelects",
"=",
"array",
"(",
")",
",",
"$",
"otherDataTableColumns",
"=",
"array",
"(",
")",
")",
"{... | Utility function. Gets row count of a set of tables grouped by the 'name' column.
This is the implementation of the getRowCountsAndSizeBy... functions. | [
"Utility",
"function",
".",
"Gets",
"row",
"count",
"of",
"a",
"set",
"of",
"tables",
"grouped",
"by",
"the",
"name",
"column",
".",
"This",
"is",
"the",
"implementation",
"of",
"the",
"getRowCountsAndSizeBy",
"...",
"functions",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L194-L232 |
208,960 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getEstimatedRowsSize | public function getEstimatedRowsSize($row_count, $status)
{
if ($status['Rows'] == 0) {
return 0;
}
$avgRowSize = ($status['Data_length'] + $status['Index_length']) / $status['Rows'];
return $avgRowSize * $row_count;
} | php | public function getEstimatedRowsSize($row_count, $status)
{
if ($status['Rows'] == 0) {
return 0;
}
$avgRowSize = ($status['Data_length'] + $status['Index_length']) / $status['Rows'];
return $avgRowSize * $row_count;
} | [
"public",
"function",
"getEstimatedRowsSize",
"(",
"$",
"row_count",
",",
"$",
"status",
")",
"{",
"if",
"(",
"$",
"status",
"[",
"'Rows'",
"]",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"$",
"avgRowSize",
"=",
"(",
"$",
"status",
"[",
"'Data_len... | Gets the estimated database size a count of rows takes in a table. | [
"Gets",
"the",
"estimated",
"database",
"size",
"a",
"count",
"of",
"rows",
"takes",
"in",
"a",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L237-L244 |
208,961 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.getEstimatedBlobArchiveRowSize | public function getEstimatedBlobArchiveRowSize($row_count, $blob_size, $name_size, $status)
{
// calculate the size of each fixed size column in a blob archive table
static $fixedSizeColumnLength = null;
if (is_null($fixedSizeColumnLength)) {
$fixedSizeColumnLength = 0;
... | php | public function getEstimatedBlobArchiveRowSize($row_count, $blob_size, $name_size, $status)
{
// calculate the size of each fixed size column in a blob archive table
static $fixedSizeColumnLength = null;
if (is_null($fixedSizeColumnLength)) {
$fixedSizeColumnLength = 0;
... | [
"public",
"function",
"getEstimatedBlobArchiveRowSize",
"(",
"$",
"row_count",
",",
"$",
"blob_size",
",",
"$",
"name_size",
",",
"$",
"status",
")",
"{",
"// calculate the size of each fixed size column in a blob archive table",
"static",
"$",
"fixedSizeColumnLength",
"=",... | Gets the estimated database size a count of rows in a blob_archive table. Depends on
the data table row to contain the size of all blobs & name strings in the row set it
represents. | [
"Gets",
"the",
"estimated",
"database",
"size",
"a",
"count",
"of",
"rows",
"in",
"a",
"blob_archive",
"table",
".",
"Depends",
"on",
"the",
"data",
"table",
"row",
"to",
"contain",
"the",
"size",
"of",
"all",
"blobs",
"&",
"name",
"strings",
"in",
"the"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L251-L276 |
208,962 | matomo-org/matomo | plugins/DBStats/MySQLMetadataProvider.php | MySQLMetadataProvider.reduceArchiveRowName | public function reduceArchiveRowName($name)
{
// all 'done...' fields are considered the same
if (strpos($name, 'done') === 0) {
return 'done';
}
// check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones)
if (preg_match("/... | php | public function reduceArchiveRowName($name)
{
// all 'done...' fields are considered the same
if (strpos($name, 'done') === 0) {
return 'done';
}
// check for goal id, if present (Goals_... reports should not be reduced here, just Goal_... ones)
if (preg_match("/... | [
"public",
"function",
"reduceArchiveRowName",
"(",
"$",
"name",
")",
"{",
"// all 'done...' fields are considered the same",
"if",
"(",
"strpos",
"(",
"$",
"name",
",",
"'done'",
")",
"===",
"0",
")",
"{",
"return",
"'done'",
";",
"}",
"// check for goal id, if pr... | Reduces the given metric name. Used to simplify certain reports.
Some metrics, like goal metrics, can have different string names. For goal metrics,
there's one name per goal ID. Grouping metrics and reports like these together
simplifies the tables that display them.
This function makes goal names, 'done...' names a... | [
"Reduces",
"the",
"given",
"metric",
"name",
".",
"Used",
"to",
"simplify",
"certain",
"reports",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/DBStats/MySQLMetadataProvider.php#L323-L341 |
208,963 | matomo-org/matomo | libs/Zend/Db/Profiler/Firebug.php | Zend_Db_Profiler_Firebug.queryEnd | public function queryEnd($queryId)
{
$state = parent::queryEnd($queryId);
if (!$this->getEnabled() || $state == self::IGNORED) {
return;
}
$this->_message->setDestroy(false);
$profile = $this->getQueryProfile($queryId);
$this->_totalElapsedTime += $pro... | php | public function queryEnd($queryId)
{
$state = parent::queryEnd($queryId);
if (!$this->getEnabled() || $state == self::IGNORED) {
return;
}
$this->_message->setDestroy(false);
$profile = $this->getQueryProfile($queryId);
$this->_totalElapsedTime += $pro... | [
"public",
"function",
"queryEnd",
"(",
"$",
"queryId",
")",
"{",
"$",
"state",
"=",
"parent",
"::",
"queryEnd",
"(",
"$",
"queryId",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getEnabled",
"(",
")",
"||",
"$",
"state",
"==",
"self",
"::",
"IGNOR... | Intercept the query end and log the profiling data.
@param integer $queryId
@throws Zend_Db_Profiler_Exception
@return void | [
"Intercept",
"the",
"query",
"end",
"and",
"log",
"the",
"profiling",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Profiler/Firebug.php#L122-L141 |
208,964 | matomo-org/matomo | libs/Zend/Db/Profiler/Firebug.php | Zend_Db_Profiler_Firebug.updateMessageLabel | protected function updateMessageLabel()
{
if (!$this->_message) {
return;
}
$this->_message->setLabel(str_replace(array('%label%',
'%totalCount%',
'%totalDuration%'),
... | php | protected function updateMessageLabel()
{
if (!$this->_message) {
return;
}
$this->_message->setLabel(str_replace(array('%label%',
'%totalCount%',
'%totalDuration%'),
... | [
"protected",
"function",
"updateMessageLabel",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_message",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"_message",
"->",
"setLabel",
"(",
"str_replace",
"(",
"array",
"(",
"'%label%'",
",",
"'%totalC... | Update the label of the message holding the profile info.
@return void | [
"Update",
"the",
"label",
"of",
"the",
"message",
"holding",
"the",
"profile",
"info",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Profiler/Firebug.php#L148-L160 |
208,965 | matomo-org/matomo | plugins/PrivacyManager/IPAnonymizer.php | IPAnonymizer.setVisitorIpAddress | public function setVisitorIpAddress(&$ip)
{
$ipObject = IP::fromBinaryIP($ip);
if (!$this->isActive()) {
Common::printDebug("Visitor IP was _not_ anonymized: ". $ipObject->toString());
return;
}
$privacyConfig = new Config();
$newIpObject = self::ap... | php | public function setVisitorIpAddress(&$ip)
{
$ipObject = IP::fromBinaryIP($ip);
if (!$this->isActive()) {
Common::printDebug("Visitor IP was _not_ anonymized: ". $ipObject->toString());
return;
}
$privacyConfig = new Config();
$newIpObject = self::ap... | [
"public",
"function",
"setVisitorIpAddress",
"(",
"&",
"$",
"ip",
")",
"{",
"$",
"ipObject",
"=",
"IP",
"::",
"fromBinaryIP",
"(",
"$",
"ip",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isActive",
"(",
")",
")",
"{",
"Common",
"::",
"printDebug",
... | Hook on Tracker.Visit.setVisitorIp to anomymize visitor IP addresses
@param string $ip IP address in binary format (network format) | [
"Hook",
"on",
"Tracker",
".",
"Visit",
".",
"setVisitorIp",
"to",
"anomymize",
"visitor",
"IP",
"addresses"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/IPAnonymizer.php#L37-L52 |
208,966 | matomo-org/matomo | core/Session.php | Session.isSessionHandler | public static function isSessionHandler($handler)
{
$config = Config::getInstance();
return !isset($config->General['session_save_handler'])
|| $config->General['session_save_handler'] === $handler;
} | php | public static function isSessionHandler($handler)
{
$config = Config::getInstance();
return !isset($config->General['session_save_handler'])
|| $config->General['session_save_handler'] === $handler;
} | [
"public",
"static",
"function",
"isSessionHandler",
"(",
"$",
"handler",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"getInstance",
"(",
")",
";",
"return",
"!",
"isset",
"(",
"$",
"config",
"->",
"General",
"[",
"'session_save_handler'",
"]",
")",
"||",... | Are we using file-based session store?
@return bool True if file-based; false otherwise | [
"Are",
"we",
"using",
"file",
"-",
"based",
"session",
"store?"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Session.php#L34-L39 |
208,967 | matomo-org/matomo | core/DataAccess/LogAggregator.php | LogAggregator.getMetricsFromVisitByDimension | public function getMetricsFromVisitByDimension($dimension)
{
if (!is_array($dimension)) {
$dimension = array($dimension);
}
if (count($dimension) == 1) {
$dimension = array("label" => reset($dimension));
}
$query = $this->queryVisitsByDimension($dimens... | php | public function getMetricsFromVisitByDimension($dimension)
{
if (!is_array($dimension)) {
$dimension = array($dimension);
}
if (count($dimension) == 1) {
$dimension = array("label" => reset($dimension));
}
$query = $this->queryVisitsByDimension($dimens... | [
"public",
"function",
"getMetricsFromVisitByDimension",
"(",
"$",
"dimension",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"dimension",
")",
")",
"{",
"$",
"dimension",
"=",
"array",
"(",
"$",
"dimension",
")",
";",
"}",
"if",
"(",
"count",
"(",
"$... | Helper function that returns an array with common metrics for a given log_visit field distinct values.
The statistics returned are:
- number of unique visitors
- number of visits
- number of actions
- maximum number of action for a visit
- sum of the visits' length in sec
- count of bouncing visits (visits with one pa... | [
"Helper",
"function",
"that",
"returns",
"an",
"array",
"with",
"common",
"metrics",
"for",
"a",
"given",
"log_visit",
"field",
"distinct",
"values",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogAggregator.php#L256-L270 |
208,968 | matomo-org/matomo | core/DataAccess/LogAggregator.php | LogAggregator.queryVisitsByDimension | public function queryVisitsByDimension(array $dimensions = array(), $where = false, array $additionalSelects = array(),
$metrics = false, $rankingQuery = false)
{
$tableName = self::LOG_VISIT_TABLE;
$availableMetrics = $this->getVisitsMetricFields();
... | php | public function queryVisitsByDimension(array $dimensions = array(), $where = false, array $additionalSelects = array(),
$metrics = false, $rankingQuery = false)
{
$tableName = self::LOG_VISIT_TABLE;
$availableMetrics = $this->getVisitsMetricFields();
... | [
"public",
"function",
"queryVisitsByDimension",
"(",
"array",
"$",
"dimensions",
"=",
"array",
"(",
")",
",",
"$",
"where",
"=",
"false",
",",
"array",
"$",
"additionalSelects",
"=",
"array",
"(",
")",
",",
"$",
"metrics",
"=",
"false",
",",
"$",
"rankin... | Executes and returns a query aggregating visit logs, optionally grouping by some dimension. Returns
a DB statement that can be used to iterate over the result
**Result Set**
The following columns are in each row of the result set:
- **{@link Piwik\Metrics::INDEX_NB_UNIQ_VISITORS}**: The total number of unique visito... | [
"Executes",
"and",
"returns",
"a",
"query",
"aggregating",
"visit",
"logs",
"optionally",
"grouping",
"by",
"some",
"dimension",
".",
"Returns",
"a",
"DB",
"statement",
"that",
"can",
"be",
"used",
"to",
"iterate",
"over",
"the",
"result"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogAggregator.php#L326-L361 |
208,969 | matomo-org/matomo | core/DataAccess/LogAggregator.php | LogAggregator.getGeneralQueryBindParams | public function getGeneralQueryBindParams()
{
$bind = array($this->dateStart->toString(Date::DATE_TIME_FORMAT), $this->dateEnd->toString(Date::DATE_TIME_FORMAT));
$bind = array_merge($bind, $this->sites);
return $bind;
} | php | public function getGeneralQueryBindParams()
{
$bind = array($this->dateStart->toString(Date::DATE_TIME_FORMAT), $this->dateEnd->toString(Date::DATE_TIME_FORMAT));
$bind = array_merge($bind, $this->sites);
return $bind;
} | [
"public",
"function",
"getGeneralQueryBindParams",
"(",
")",
"{",
"$",
"bind",
"=",
"array",
"(",
"$",
"this",
"->",
"dateStart",
"->",
"toString",
"(",
"Date",
"::",
"DATE_TIME_FORMAT",
")",
",",
"$",
"this",
"->",
"dateEnd",
"->",
"toString",
"(",
"Date"... | Returns general bind parameters for all log aggregation queries. This includes the datetime
start of entities, datetime end of entities and IDs of all sites.
@return array | [
"Returns",
"general",
"bind",
"parameters",
"for",
"all",
"log",
"aggregation",
"queries",
".",
"This",
"includes",
"the",
"datetime",
"start",
"of",
"entities",
"datetime",
"end",
"of",
"entities",
"and",
"IDs",
"of",
"all",
"sites",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogAggregator.php#L528-L534 |
208,970 | matomo-org/matomo | core/DataAccess/LogAggregator.php | LogAggregator.getSelectsFromRangedColumn | public static function getSelectsFromRangedColumn($column, $ranges, $table, $selectColumnPrefix, $restrictToReturningVisitors = false)
{
$selects = array();
$extraCondition = '';
if ($restrictToReturningVisitors) {
// extra condition for the SQL SELECT that makes sure only retur... | php | public static function getSelectsFromRangedColumn($column, $ranges, $table, $selectColumnPrefix, $restrictToReturningVisitors = false)
{
$selects = array();
$extraCondition = '';
if ($restrictToReturningVisitors) {
// extra condition for the SQL SELECT that makes sure only retur... | [
"public",
"static",
"function",
"getSelectsFromRangedColumn",
"(",
"$",
"column",
",",
"$",
"ranges",
",",
"$",
"table",
",",
"$",
"selectColumnPrefix",
",",
"$",
"restrictToReturningVisitors",
"=",
"false",
")",
"{",
"$",
"selects",
"=",
"array",
"(",
")",
... | Creates and returns an array of SQL `SELECT` expressions that will each count how
many rows have a column whose value is within a certain range.
**Note:** The result of this function is meant for use in the `$additionalSelects` parameter
in one of the query... methods (for example {@link queryVisitsByDimension()}).
*... | [
"Creates",
"and",
"returns",
"an",
"array",
"of",
"SQL",
"SELECT",
"expressions",
"that",
"will",
"each",
"count",
"how",
"many",
"rows",
"have",
"a",
"column",
"whose",
"value",
"is",
"within",
"a",
"certain",
"range",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/LogAggregator.php#L894-L926 |
208,971 | matomo-org/matomo | core/Http.php | Http.sendHttpRequest | public static function sendHttpRequest($aUrl,
$timeout,
$userAgent = null,
$destinationPath = null,
$followDepth = 0,
... | php | public static function sendHttpRequest($aUrl,
$timeout,
$userAgent = null,
$destinationPath = null,
$followDepth = 0,
... | [
"public",
"static",
"function",
"sendHttpRequest",
"(",
"$",
"aUrl",
",",
"$",
"timeout",
",",
"$",
"userAgent",
"=",
"null",
",",
"$",
"destinationPath",
"=",
"null",
",",
"$",
"followDepth",
"=",
"0",
",",
"$",
"acceptLanguage",
"=",
"false",
",",
"$",... | Sends an HTTP request using best available transport method.
@param string $aUrl The target URL.
@param int $timeout The number of seconds to wait before aborting the HTTP request.
@param string|null $userAgent The user agent to use.
@param string|null $destinationPath If supplied, the HTTP response will be saved to t... | [
"Sends",
"an",
"HTTP",
"request",
"using",
"best",
"available",
"transport",
"method",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Http.php#L84-L101 |
208,972 | matomo-org/matomo | core/Http.php | Http.truncateStr | private static function truncateStr($str, $limit)
{
if (strlen($str) > $limit) {
return substr($str, 0, $limit) . '...';
}
return $str;
} | php | private static function truncateStr($str, $limit)
{
if (strlen($str) > $limit) {
return substr($str, 0, $limit) . '...';
}
return $str;
} | [
"private",
"static",
"function",
"truncateStr",
"(",
"$",
"str",
",",
"$",
"limit",
")",
"{",
"if",
"(",
"strlen",
"(",
"$",
"str",
")",
">",
"$",
"limit",
")",
"{",
"return",
"substr",
"(",
"$",
"str",
",",
"0",
",",
"$",
"limit",
")",
".",
"'... | Utility function that truncates a string to an arbitrary limit.
@param string $str The string to truncate.
@param int $limit The maximum length of the truncated string.
@return string | [
"Utility",
"function",
"that",
"truncates",
"a",
"string",
"to",
"an",
"arbitrary",
"limit",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Http.php#L859-L865 |
208,973 | matomo-org/matomo | core/Http.php | Http.getModifiedSinceHeader | public static function getModifiedSinceHeader()
{
$modifiedSince = '';
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
$modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
// strip any trailing data appended to header
if (false !== ($semicolonPos = strpos($modif... | php | public static function getModifiedSinceHeader()
{
$modifiedSince = '';
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
$modifiedSince = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
// strip any trailing data appended to header
if (false !== ($semicolonPos = strpos($modif... | [
"public",
"static",
"function",
"getModifiedSinceHeader",
"(",
")",
"{",
"$",
"modifiedSince",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_IF_MODIFIED_SINCE'",
"]",
")",
")",
"{",
"$",
"modifiedSince",
"=",
"$",
"_SERVER",
"[",
"'H... | Returns the If-Modified-Since HTTP header if it can be found. If it cannot be
found, an empty string is returned.
@return string | [
"Returns",
"the",
"If",
"-",
"Modified",
"-",
"Since",
"HTTP",
"header",
"if",
"it",
"can",
"be",
"found",
".",
"If",
"it",
"cannot",
"be",
"found",
"an",
"empty",
"string",
"is",
"returned",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Http.php#L873-L885 |
208,974 | matomo-org/matomo | core/Http.php | Http.getProxyConfiguration | private static function getProxyConfiguration($url)
{
$hostname = UrlHelper::getHostFromUrl($url);
if (Url::isLocalHost($hostname)) {
return array(null, null, null, null);
}
// proxy configuration
$proxyHost = Config::getInstance()->proxy['host'];
$proxy... | php | private static function getProxyConfiguration($url)
{
$hostname = UrlHelper::getHostFromUrl($url);
if (Url::isLocalHost($hostname)) {
return array(null, null, null, null);
}
// proxy configuration
$proxyHost = Config::getInstance()->proxy['host'];
$proxy... | [
"private",
"static",
"function",
"getProxyConfiguration",
"(",
"$",
"url",
")",
"{",
"$",
"hostname",
"=",
"UrlHelper",
"::",
"getHostFromUrl",
"(",
"$",
"url",
")",
";",
"if",
"(",
"Url",
"::",
"isLocalHost",
"(",
"$",
"hostname",
")",
")",
"{",
"return... | Returns Proxy to use for connecting via HTTP to given URL
@param string $url
@return array | [
"Returns",
"Proxy",
"to",
"use",
"for",
"connecting",
"via",
"HTTP",
"to",
"given",
"URL"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Http.php#L893-L908 |
208,975 | matomo-org/matomo | libs/Zend/Validate/File/Count.php | Zend_Validate_File_Count.setMax | public function setMax($max)
{
if (is_array($max) and isset($max['max'])) {
$max = $max['max'];
}
if (!is_string($max) and !is_numeric($max)) {
// require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception ('Invalid options to validator... | php | public function setMax($max)
{
if (is_array($max) and isset($max['max'])) {
$max = $max['max'];
}
if (!is_string($max) and !is_numeric($max)) {
// require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception ('Invalid options to validator... | [
"public",
"function",
"setMax",
"(",
"$",
"max",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"max",
")",
"and",
"isset",
"(",
"$",
"max",
"[",
"'max'",
"]",
")",
")",
"{",
"$",
"max",
"=",
"$",
"max",
"[",
"'max'",
"]",
";",
"}",
"if",
"(",
... | Sets the maximum file count
@param integer|array $max The maximum file count
@return Zend_Validate_StringLength Provides a fluent interface
@throws Zend_Validate_Exception When max is smaller than min | [
"Sets",
"the",
"maximum",
"file",
"count"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Count.php#L187-L207 |
208,976 | matomo-org/matomo | libs/Zend/Validate/File/Count.php | Zend_Validate_File_Count.addFile | public function addFile($file)
{
if (is_string($file)) {
$file = array($file);
}
if (is_array($file)) {
foreach ($file as $name) {
if (!isset($this->_files[$name]) && !empty($name)) {
$this->_files[$name] = $name;
}... | php | public function addFile($file)
{
if (is_string($file)) {
$file = array($file);
}
if (is_array($file)) {
foreach ($file as $name) {
if (!isset($this->_files[$name]) && !empty($name)) {
$this->_files[$name] = $name;
}... | [
"public",
"function",
"addFile",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"file",
")",
")",
"{",
"$",
"file",
"=",
"array",
"(",
"$",
"file",
")",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"file",
")",
")",
"{",
"foreach",... | Adds a file for validation
@param string|array $file | [
"Adds",
"a",
"file",
"for",
"validation"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Count.php#L214-L229 |
208,977 | matomo-org/matomo | plugins/SitesManager/SitesManager.php | SitesManager.shouldKeepURLFragmentsFor | private static function shouldKeepURLFragmentsFor($site)
{
if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_YES) {
return true;
} else if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_NO) {
return false;
}
return API::getInstance()->getKeepU... | php | private static function shouldKeepURLFragmentsFor($site)
{
if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_YES) {
return true;
} else if ($site['keep_url_fragment'] == self::KEEP_URL_FRAGMENT_NO) {
return false;
}
return API::getInstance()->getKeepU... | [
"private",
"static",
"function",
"shouldKeepURLFragmentsFor",
"(",
"$",
"site",
")",
"{",
"if",
"(",
"$",
"site",
"[",
"'keep_url_fragment'",
"]",
"==",
"self",
"::",
"KEEP_URL_FRAGMENT_YES",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"$",
"s... | Returns whether we should keep URL fragments for a specific site.
@param array $site DB data for the site.
@return bool | [
"Returns",
"whether",
"we",
"should",
"keep",
"URL",
"fragments",
"for",
"a",
"specific",
"site",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L198-L207 |
208,978 | matomo-org/matomo | plugins/SitesManager/SitesManager.php | SitesManager.getTrackerExcludedIps | private function getTrackerExcludedIps($website)
{
$excludedIps = $website['excluded_ips'];
$globalExcludedIps = API::getInstance()->getExcludedIpsGlobal();
$excludedIps .= ',' . $globalExcludedIps;
$ipRanges = array();
foreach (explode(',', $excludedIps) as $ip) {
... | php | private function getTrackerExcludedIps($website)
{
$excludedIps = $website['excluded_ips'];
$globalExcludedIps = API::getInstance()->getExcludedIpsGlobal();
$excludedIps .= ',' . $globalExcludedIps;
$ipRanges = array();
foreach (explode(',', $excludedIps) as $ip) {
... | [
"private",
"function",
"getTrackerExcludedIps",
"(",
"$",
"website",
")",
"{",
"$",
"excludedIps",
"=",
"$",
"website",
"[",
"'excluded_ips'",
"]",
";",
"$",
"globalExcludedIps",
"=",
"API",
"::",
"getInstance",
"(",
")",
"->",
"getExcludedIpsGlobal",
"(",
")"... | Returns the array of excluded IPs to save in the config file
@param array $website
@return array | [
"Returns",
"the",
"array",
"of",
"excluded",
"IPs",
"to",
"save",
"in",
"the",
"config",
"file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L233-L248 |
208,979 | matomo-org/matomo | plugins/SitesManager/SitesManager.php | SitesManager.getExcludedUserAgents | private static function getExcludedUserAgents($website)
{
$excludedUserAgents = API::getInstance()->getExcludedUserAgentsGlobal();
if (API::getInstance()->isSiteSpecificUserAgentExcludeEnabled()) {
$excludedUserAgents .= ',' . $website['excluded_user_agents'];
}
return se... | php | private static function getExcludedUserAgents($website)
{
$excludedUserAgents = API::getInstance()->getExcludedUserAgentsGlobal();
if (API::getInstance()->isSiteSpecificUserAgentExcludeEnabled()) {
$excludedUserAgents .= ',' . $website['excluded_user_agents'];
}
return se... | [
"private",
"static",
"function",
"getExcludedUserAgents",
"(",
"$",
"website",
")",
"{",
"$",
"excludedUserAgents",
"=",
"API",
"::",
"getInstance",
"(",
")",
"->",
"getExcludedUserAgentsGlobal",
"(",
")",
";",
"if",
"(",
"API",
"::",
"getInstance",
"(",
")",
... | Returns the array of excluded user agent substrings for a site. Filters out
any garbage data & trims each entry.
@param array $website The full set of information for a site.
@return array | [
"Returns",
"the",
"array",
"of",
"excluded",
"user",
"agent",
"substrings",
"for",
"a",
"site",
".",
"Filters",
"out",
"any",
"garbage",
"data",
"&",
"trims",
"each",
"entry",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L257-L264 |
208,980 | matomo-org/matomo | plugins/SitesManager/SitesManager.php | SitesManager.getTrackerExcludedQueryParameters | public static function getTrackerExcludedQueryParameters($website)
{
$excludedQueryParameters = $website['excluded_parameters'];
$globalExcludedQueryParameters = API::getInstance()->getExcludedQueryParametersGlobal();
$excludedQueryParameters .= ',' . $globalExcludedQueryParameters;
... | php | public static function getTrackerExcludedQueryParameters($website)
{
$excludedQueryParameters = $website['excluded_parameters'];
$globalExcludedQueryParameters = API::getInstance()->getExcludedQueryParametersGlobal();
$excludedQueryParameters .= ',' . $globalExcludedQueryParameters;
... | [
"public",
"static",
"function",
"getTrackerExcludedQueryParameters",
"(",
"$",
"website",
")",
"{",
"$",
"excludedQueryParameters",
"=",
"$",
"website",
"[",
"'excluded_parameters'",
"]",
";",
"$",
"globalExcludedQueryParameters",
"=",
"API",
"::",
"getInstance",
"(",... | Returns the array of URL query parameters to exclude from URLs
@param array $website
@return array | [
"Returns",
"the",
"array",
"of",
"URL",
"query",
"parameters",
"to",
"exclude",
"from",
"URLs"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L272-L279 |
208,981 | matomo-org/matomo | plugins/SitesManager/SitesManager.php | SitesManager.getTrackerHosts | private function getTrackerHosts($urls)
{
$hosts = array();
foreach ($urls as $url) {
$url = parse_url($url);
if (isset($url['host'])) {
$hosts[] = $url['host'];
}
}
return $hosts;
} | php | private function getTrackerHosts($urls)
{
$hosts = array();
foreach ($urls as $url) {
$url = parse_url($url);
if (isset($url['host'])) {
$hosts[] = $url['host'];
}
}
return $hosts;
} | [
"private",
"function",
"getTrackerHosts",
"(",
"$",
"urls",
")",
"{",
"$",
"hosts",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"urls",
"as",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"if",
"(",
"isset",... | Returns the hosts alias URLs
@param int $idSite
@return array | [
"Returns",
"the",
"hosts",
"alias",
"URLs"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SitesManager.php#L301-L311 |
208,982 | matomo-org/matomo | plugins/CoreVisualizations/JqplotDataGenerator.php | JqplotDataGenerator.factory | public static function factory($type, $properties)
{
switch ($type) {
case 'evolution':
return new JqplotDataGenerator\Evolution($properties, $type);
case 'pie':
case 'bar':
return new JqplotDataGenerator($properties, $type);
de... | php | public static function factory($type, $properties)
{
switch ($type) {
case 'evolution':
return new JqplotDataGenerator\Evolution($properties, $type);
case 'pie':
case 'bar':
return new JqplotDataGenerator($properties, $type);
de... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"type",
",",
"$",
"properties",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'evolution'",
":",
"return",
"new",
"JqplotDataGenerator",
"\\",
"Evolution",
"(",
"$",
"properties",
",",
"$",
... | Creates a new JqplotDataGenerator instance for a graph type and view properties.
@param string $type 'pie', 'bar', or 'evolution'
@param array $properties The view properties.
@throws \Exception
@return JqplotDataGenerator | [
"Creates",
"a",
"new",
"JqplotDataGenerator",
"instance",
"for",
"a",
"graph",
"type",
"and",
"view",
"properties",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/JqplotDataGenerator.php#L45-L56 |
208,983 | matomo-org/matomo | plugins/CoreVisualizations/JqplotDataGenerator.php | JqplotDataGenerator.generate | public function generate($dataTable)
{
$visualization = new Chart();
if ($dataTable->getRowsCount() > 0) {
// if addTotalRow was called in GenerateGraphHTML, add a row containing totals of
// different metrics
if ($this->properties['add_total_row']) {
... | php | public function generate($dataTable)
{
$visualization = new Chart();
if ($dataTable->getRowsCount() > 0) {
// if addTotalRow was called in GenerateGraphHTML, add a row containing totals of
// different metrics
if ($this->properties['add_total_row']) {
... | [
"public",
"function",
"generate",
"(",
"$",
"dataTable",
")",
"{",
"$",
"visualization",
"=",
"new",
"Chart",
"(",
")",
";",
"if",
"(",
"$",
"dataTable",
"->",
"getRowsCount",
"(",
")",
">",
"0",
")",
"{",
"// if addTotalRow was called in GenerateGraphHTML, ad... | Generates JSON graph data and returns it.
@param DataTable|DataTable\Map $dataTable
@return string | [
"Generates",
"JSON",
"graph",
"data",
"and",
"returns",
"it",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/JqplotDataGenerator.php#L78-L94 |
208,984 | matomo-org/matomo | core/DeviceDetectorFactory.php | DeviceDetectorFactory.getInstance | public static function getInstance($userAgent)
{
if (array_key_exists($userAgent, self::$deviceDetectorInstances)) {
return self::$deviceDetectorInstances[$userAgent];
}
$deviceDetector = new DeviceDetector($userAgent);
$deviceDetector->discardBotInformation();
$... | php | public static function getInstance($userAgent)
{
if (array_key_exists($userAgent, self::$deviceDetectorInstances)) {
return self::$deviceDetectorInstances[$userAgent];
}
$deviceDetector = new DeviceDetector($userAgent);
$deviceDetector->discardBotInformation();
$... | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"userAgent",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"userAgent",
",",
"self",
"::",
"$",
"deviceDetectorInstances",
")",
")",
"{",
"return",
"self",
"::",
"$",
"deviceDetectorInstances",
"[",... | Returns a Singleton instance of DeviceDetector for the given user agent
@param string $userAgent
@return DeviceDetector | [
"Returns",
"a",
"Singleton",
"instance",
"of",
"DeviceDetector",
"for",
"the",
"given",
"user",
"agent"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DeviceDetectorFactory.php#L22-L36 |
208,985 | matomo-org/matomo | core/Db/Adapter/Pdo/Mysql.php | Mysql.isConnectionUTF8 | public function isConnectionUTF8()
{
$charsetInfo = $this->fetchAll('SHOW VARIABLES LIKE ?', array('character_set_connection'));
if (empty($charsetInfo)) {
return false;
}
$charset = $charsetInfo[0]['Value'];
return $charset === 'utf8';
} | php | public function isConnectionUTF8()
{
$charsetInfo = $this->fetchAll('SHOW VARIABLES LIKE ?', array('character_set_connection'));
if (empty($charsetInfo)) {
return false;
}
$charset = $charsetInfo[0]['Value'];
return $charset === 'utf8';
} | [
"public",
"function",
"isConnectionUTF8",
"(",
")",
"{",
"$",
"charsetInfo",
"=",
"$",
"this",
"->",
"fetchAll",
"(",
"'SHOW VARIABLES LIKE ?'",
",",
"array",
"(",
"'character_set_connection'",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"charsetInfo",
")",
... | Is the connection character set equal to utf8?
@return bool | [
"Is",
"the",
"connection",
"character",
"set",
"equal",
"to",
"utf8?"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Pdo/Mysql.php#L224-L234 |
208,986 | matomo-org/matomo | core/Db/Adapter/Pdo/Mysql.php | Mysql.query | public function query($sql, $bind = array())
{
if (!is_string($sql)) {
return parent::query($sql, $bind);
}
if (isset($this->cachePreparedStatement[$sql])) {
if (!is_array($bind)) {
$bind = array($bind);
}
$stmt = $this->cache... | php | public function query($sql, $bind = array())
{
if (!is_string($sql)) {
return parent::query($sql, $bind);
}
if (isset($this->cachePreparedStatement[$sql])) {
if (!is_array($bind)) {
$bind = array($bind);
}
$stmt = $this->cache... | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"sql",
")",
")",
"{",
"return",
"parent",
"::",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
")",
";",
"... | Prepares and executes an SQL statement with bound data.
Caches prepared statements to avoid preparing the same query more than once
@param string|Zend_Db_Select $sql The SQL statement with placeholders.
@param array $bind An array of data to bind to the placeholders.
@return Zend_Db_Statement_Interface | [
"Prepares",
"and",
"executes",
"an",
"SQL",
"statement",
"with",
"bound",
"data",
".",
"Caches",
"prepared",
"statements",
"to",
"avoid",
"preparing",
"the",
"same",
"query",
"more",
"than",
"once"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Pdo/Mysql.php#L280-L299 |
208,987 | matomo-org/matomo | libs/HTML/QuickForm2/Controller/Action/Jump.php | HTML_QuickForm2_Controller_Action_Jump.normalizePath | protected static function normalizePath($path)
{
$pathAry = explode('/', $path);
$i = 1;
do {
if ('.' == $pathAry[$i]) {
if ($i < count($pathAry) - 1) {
array_splice($pathAry, $i, 1);
} else {
$pathAry... | php | protected static function normalizePath($path)
{
$pathAry = explode('/', $path);
$i = 1;
do {
if ('.' == $pathAry[$i]) {
if ($i < count($pathAry) - 1) {
array_splice($pathAry, $i, 1);
} else {
$pathAry... | [
"protected",
"static",
"function",
"normalizePath",
"(",
"$",
"path",
")",
"{",
"$",
"pathAry",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"$",
"i",
"=",
"1",
";",
"do",
"{",
"if",
"(",
"'.'",
"==",
"$",
"pathAry",
"[",
"$",
"i",
"... | Removes the '..' and '.' segments from the path component
@param string Path component of the URL, possibly with '.' and '..' segments
@return string Path component of the URL with '.' and '..' segments removed | [
"Removes",
"the",
"..",
"and",
".",
"segments",
"from",
"the",
"path",
"component"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/Action/Jump.php#L82-L115 |
208,988 | matomo-org/matomo | libs/HTML/QuickForm2/Controller/Action/Jump.php | HTML_QuickForm2_Controller_Action_Jump.resolveRelativeURL | protected static function resolveRelativeURL($url)
{
$https = !empty($_SERVER['HTTPS']) && ('off' != strtolower($_SERVER['HTTPS']));
$scheme = ($https? 'https:': 'http:');
if ('//' == substr($url, 0, 2)) {
return $scheme . $url;
} else {
$host = $scheme . ... | php | protected static function resolveRelativeURL($url)
{
$https = !empty($_SERVER['HTTPS']) && ('off' != strtolower($_SERVER['HTTPS']));
$scheme = ($https? 'https:': 'http:');
if ('//' == substr($url, 0, 2)) {
return $scheme . $url;
} else {
$host = $scheme . ... | [
"protected",
"static",
"function",
"resolveRelativeURL",
"(",
"$",
"url",
")",
"{",
"$",
"https",
"=",
"!",
"empty",
"(",
"$",
"_SERVER",
"[",
"'HTTPS'",
"]",
")",
"&&",
"(",
"'off'",
"!=",
"strtolower",
"(",
"$",
"_SERVER",
"[",
"'HTTPS'",
"]",
")",
... | Resolves relative URL using current page's URL as base
The method follows procedure described in section 4 of RFC 1808 and
passes the examples provided in section 5 of said RFC. Values from
$_SERVER array are used for calculation of "current URL"
@param string Relative URL, probably from form's action attribute
@... | [
"Resolves",
"relative",
"URL",
"using",
"current",
"page",
"s",
"URL",
"as",
"base"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller/Action/Jump.php#L127-L156 |
208,989 | matomo-org/matomo | libs/Zend/Config/Writer/Xml.php | Zend_Config_Writer_Xml.render | public function render()
{
$xml = new SimpleXMLElement('<zend-config xmlns:zf="' . Zend_Config_Xml::XML_NAMESPACE . '"/>');
$extends = $this->_config->getExtends();
$sectionName = $this->_config->getSectionName();
if (is_string($sectionName)) {
$child = $xml-... | php | public function render()
{
$xml = new SimpleXMLElement('<zend-config xmlns:zf="' . Zend_Config_Xml::XML_NAMESPACE . '"/>');
$extends = $this->_config->getExtends();
$sectionName = $this->_config->getSectionName();
if (is_string($sectionName)) {
$child = $xml-... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"xml",
"=",
"new",
"SimpleXMLElement",
"(",
"'<zend-config xmlns:zf=\"'",
".",
"Zend_Config_Xml",
"::",
"XML_NAMESPACE",
".",
"'\"/>'",
")",
";",
"$",
"extends",
"=",
"$",
"this",
"->",
"_config",
"->",
"ge... | Render a Zend_Config into a XML config string.
@since 1.10
@return string | [
"Render",
"a",
"Zend_Config",
"into",
"a",
"XML",
"config",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Writer/Xml.php#L46-L78 |
208,990 | matomo-org/matomo | libs/Zend/Config/Writer/Xml.php | Zend_Config_Writer_Xml._addBranch | protected function _addBranch(Zend_Config $config, SimpleXMLElement $xml, SimpleXMLElement $parent)
{
$branchType = null;
foreach ($config as $key => $value) {
if ($branchType === null) {
if (is_numeric($key)) {
$branchType = 'numeric';
... | php | protected function _addBranch(Zend_Config $config, SimpleXMLElement $xml, SimpleXMLElement $parent)
{
$branchType = null;
foreach ($config as $key => $value) {
if ($branchType === null) {
if (is_numeric($key)) {
$branchType = 'numeric';
... | [
"protected",
"function",
"_addBranch",
"(",
"Zend_Config",
"$",
"config",
",",
"SimpleXMLElement",
"$",
"xml",
",",
"SimpleXMLElement",
"$",
"parent",
")",
"{",
"$",
"branchType",
"=",
"null",
";",
"foreach",
"(",
"$",
"config",
"as",
"$",
"key",
"=>",
"$"... | Add a branch to an XML object recursively
@param Zend_Config $config
@param SimpleXMLElement $xml
@param SimpleXMLElement $parent
@return void | [
"Add",
"a",
"branch",
"to",
"an",
"XML",
"object",
"recursively"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Writer/Xml.php#L88-L126 |
208,991 | matomo-org/matomo | core/Tracker/Response.php | Response.getMessageFromException | protected function getMessageFromException($e)
{
// Note: duplicated from FormDatabaseSetup.isAccessDenied
// Avoid leaking the username/db name when access denied
if ($e->getCode() == 1044 || $e->getCode() == 42000) {
return "Error while connecting to the Matomo database - pleas... | php | protected function getMessageFromException($e)
{
// Note: duplicated from FormDatabaseSetup.isAccessDenied
// Avoid leaking the username/db name when access denied
if ($e->getCode() == 1044 || $e->getCode() == 42000) {
return "Error while connecting to the Matomo database - pleas... | [
"protected",
"function",
"getMessageFromException",
"(",
"$",
"e",
")",
"{",
"// Note: duplicated from FormDatabaseSetup.isAccessDenied",
"// Avoid leaking the username/db name when access denied",
"if",
"(",
"$",
"e",
"->",
"getCode",
"(",
")",
"==",
"1044",
"||",
"$",
"... | Gets the error message to output when a tracking request fails.
@param Exception $e
@return string | [
"Gets",
"the",
"error",
"message",
"to",
"output",
"when",
"a",
"tracking",
"request",
"fails",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Response.php#L168-L181 |
208,992 | matomo-org/matomo | plugins/UsersManager/UserPreferences.php | UserPreferences.getDefaultPeriod | public function getDefaultPeriod($defaultDate = null)
{
list($defaultDate, $defaultPeriod) = $this->getDefaultDateAndPeriod($defaultDate);
return $defaultPeriod;
} | php | public function getDefaultPeriod($defaultDate = null)
{
list($defaultDate, $defaultPeriod) = $this->getDefaultDateAndPeriod($defaultDate);
return $defaultPeriod;
} | [
"public",
"function",
"getDefaultPeriod",
"(",
"$",
"defaultDate",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"defaultDate",
",",
"$",
"defaultPeriod",
")",
"=",
"$",
"this",
"->",
"getDefaultDateAndPeriod",
"(",
"$",
"defaultDate",
")",
";",
"return",
"$",
... | Returns default period type for Piwik reports.
@param string $defaultDate the default date string from which the default period will be guessed
@return string `'day'`, `'week'`, `'month'`, `'year'` or `'range'`
@api | [
"Returns",
"default",
"period",
"type",
"for",
"Piwik",
"reports",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/UserPreferences.php#L100-L105 |
208,993 | matomo-org/matomo | plugins/LanguagesManager/TranslationWriter/Filter/ByParameterCount.php | ByParameterCount.filter | public function filter($translations)
{
$cleanedTranslations = array();
foreach ($translations as $pluginName => $pluginTranslations) {
foreach ($pluginTranslations as $key => $translation) {
if (isset($this->baseTranslations[$pluginName][$key])) {
... | php | public function filter($translations)
{
$cleanedTranslations = array();
foreach ($translations as $pluginName => $pluginTranslations) {
foreach ($pluginTranslations as $key => $translation) {
if (isset($this->baseTranslations[$pluginName][$key])) {
... | [
"public",
"function",
"filter",
"(",
"$",
"translations",
")",
"{",
"$",
"cleanedTranslations",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"translations",
"as",
"$",
"pluginName",
"=>",
"$",
"pluginTranslations",
")",
"{",
"foreach",
"(",
"$",
"plug... | Removes all translations where the placeholder parameter count differs to base translation
@param array $translations
@return array filtered translations | [
"Removes",
"all",
"translations",
"where",
"the",
"placeholder",
"parameter",
"count",
"differs",
"to",
"base",
"translation"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/ByParameterCount.php#L33-L63 |
208,994 | matomo-org/matomo | plugins/LanguagesManager/TranslationWriter/Filter/ByParameterCount.php | ByParameterCount._getParametersCountToReplace | protected function _getParametersCountToReplace($string)
{
$sprintfParameters = array('%s', '%1$s', '%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s', '%9$s');
$count = array();
foreach ($sprintfParameters as $parameter) {
$placeholderCount = substr_count($string, $paramete... | php | protected function _getParametersCountToReplace($string)
{
$sprintfParameters = array('%s', '%1$s', '%2$s', '%3$s', '%4$s', '%5$s', '%6$s', '%7$s', '%8$s', '%9$s');
$count = array();
foreach ($sprintfParameters as $parameter) {
$placeholderCount = substr_count($string, $paramete... | [
"protected",
"function",
"_getParametersCountToReplace",
"(",
"$",
"string",
")",
"{",
"$",
"sprintfParameters",
"=",
"array",
"(",
"'%s'",
",",
"'%1$s'",
",",
"'%2$s'",
",",
"'%3$s'",
",",
"'%4$s'",
",",
"'%5$s'",
",",
"'%6$s'",
",",
"'%7$s'",
",",
"'%8$s'"... | Counts the placeholder parameters n given string
@param string $string
@return array | [
"Counts",
"the",
"placeholder",
"parameters",
"n",
"given",
"string"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/ByParameterCount.php#L71-L84 |
208,995 | matomo-org/matomo | core/Updates/3.0.0-b4.php | Updates_3_0_0_b4.getUserDatabaseMigrations | private function getUserDatabaseMigrations($queries)
{
$queries[] = $this->migration->db->changeColumn($this->userTable, 'password', 'password', 'VARCHAR(255) NOT NULL');
return $queries;
} | php | private function getUserDatabaseMigrations($queries)
{
$queries[] = $this->migration->db->changeColumn($this->userTable, 'password', 'password', 'VARCHAR(255) NOT NULL');
return $queries;
} | [
"private",
"function",
"getUserDatabaseMigrations",
"(",
"$",
"queries",
")",
"{",
"$",
"queries",
"[",
"]",
"=",
"$",
"this",
"->",
"migration",
"->",
"db",
"->",
"changeColumn",
"(",
"$",
"this",
"->",
"userTable",
",",
"'password'",
",",
"'password'",
"... | Returns database migrations for this update.
@param Migration[] $queries
@return Migration[] | [
"Returns",
"database",
"migrations",
"for",
"this",
"update",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/3.0.0-b4.php#L64-L69 |
208,996 | matomo-org/matomo | core/Updates/3.0.0-b4.php | Updates_3_0_0_b4.getUserPasswordMigrations | private function getUserPasswordMigrations($queries)
{
$db = Db::get();
$userTable = Common::prefixTable($this->userTable);
$users = $db->fetchAll(
'SELECT `login`, `password` FROM `' . $userTable . '` WHERE LENGTH(`password`) = 32'
);
foreach ($users as ... | php | private function getUserPasswordMigrations($queries)
{
$db = Db::get();
$userTable = Common::prefixTable($this->userTable);
$users = $db->fetchAll(
'SELECT `login`, `password` FROM `' . $userTable . '` WHERE LENGTH(`password`) = 32'
);
foreach ($users as ... | [
"private",
"function",
"getUserPasswordMigrations",
"(",
"$",
"queries",
")",
"{",
"$",
"db",
"=",
"Db",
"::",
"get",
"(",
")",
";",
"$",
"userTable",
"=",
"Common",
"::",
"prefixTable",
"(",
"$",
"this",
"->",
"userTable",
")",
";",
"$",
"users",
"=",... | Returns migrations to hash existing password with bcrypt.
@param Migration[] $queries
@return Migration[] | [
"Returns",
"migrations",
"to",
"hash",
"existing",
"password",
"with",
"bcrypt",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates/3.0.0-b4.php#L76-L98 |
208,997 | matomo-org/matomo | core/Scheduler/Schedule/Schedule.php | Schedule.adjustHour | protected function adjustHour($rescheduledTime)
{
if ($this->hour !== null) {
// Reset the number of minutes and set the scheduled hour to the one specified with setHour()
$rescheduledTime = mktime($this->hour,
0,
date('s', $rescheduledTime),
... | php | protected function adjustHour($rescheduledTime)
{
if ($this->hour !== null) {
// Reset the number of minutes and set the scheduled hour to the one specified with setHour()
$rescheduledTime = mktime($this->hour,
0,
date('s', $rescheduledTime),
... | [
"protected",
"function",
"adjustHour",
"(",
"$",
"rescheduledTime",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hour",
"!==",
"null",
")",
"{",
"// Reset the number of minutes and set the scheduled hour to the one specified with setHour()",
"$",
"rescheduledTime",
"=",
"mkti... | Computes the delta in seconds needed to adjust the rescheduled time to the required hour.
@param int $rescheduledTime The rescheduled time to be adjusted
@return int adjusted rescheduled time | [
"Computes",
"the",
"delta",
"in",
"seconds",
"needed",
"to",
"adjust",
"the",
"rescheduled",
"time",
"to",
"the",
"required",
"hour",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Schedule/Schedule.php#L163-L176 |
208,998 | matomo-org/matomo | core/Scheduler/Schedule/Schedule.php | Schedule.factory | public static function factory($periodType, $periodDay = false)
{
switch ($periodType) {
case 'hourly':
return new Hourly();
case 'daily':
return new Daily();
case 'weekly':
$result = new Weekly();
if ($perio... | php | public static function factory($periodType, $periodDay = false)
{
switch ($periodType) {
case 'hourly':
return new Hourly();
case 'daily':
return new Daily();
case 'weekly':
$result = new Weekly();
if ($perio... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"periodType",
",",
"$",
"periodDay",
"=",
"false",
")",
"{",
"switch",
"(",
"$",
"periodType",
")",
"{",
"case",
"'hourly'",
":",
"return",
"new",
"Hourly",
"(",
")",
";",
"case",
"'daily'",
":",
"re... | Returns a new Schedule instance using a string description of the scheduled period type
and a string description of the day within the period to execute the task on.
@param string $periodType The scheduled period type. Can be `'hourly'`, `'daily'`, `'weekly'`, or `'monthly'`.
@param bool|false|int|string $periodDay A ... | [
"Returns",
"a",
"new",
"Schedule",
"instance",
"using",
"a",
"string",
"description",
"of",
"the",
"scheduled",
"period",
"type",
"and",
"a",
"string",
"description",
"of",
"the",
"day",
"within",
"the",
"period",
"to",
"execute",
"the",
"task",
"on",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Scheduler/Schedule/Schedule.php#L196-L223 |
208,999 | matomo-org/matomo | core/Plugin/Manager.php | Manager.loadActivatedPlugins | public function loadActivatedPlugins()
{
$pluginsToLoad = $this->getActivatedPluginsFromConfig();
if (!SettingsPiwik::isInternetEnabled()) {
$pluginsToLoad = array_filter($pluginsToLoad, function($name) {
$plugin = Manager::makePluginClass($name);
return !... | php | public function loadActivatedPlugins()
{
$pluginsToLoad = $this->getActivatedPluginsFromConfig();
if (!SettingsPiwik::isInternetEnabled()) {
$pluginsToLoad = array_filter($pluginsToLoad, function($name) {
$plugin = Manager::makePluginClass($name);
return !... | [
"public",
"function",
"loadActivatedPlugins",
"(",
")",
"{",
"$",
"pluginsToLoad",
"=",
"$",
"this",
"->",
"getActivatedPluginsFromConfig",
"(",
")",
";",
"if",
"(",
"!",
"SettingsPiwik",
"::",
"isInternetEnabled",
"(",
")",
")",
"{",
"$",
"pluginsToLoad",
"="... | Loads plugin that are enabled | [
"Loads",
"plugin",
"that",
"are",
"enabled"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Manager.php#L107-L117 |
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.