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,800 | matomo-org/matomo | plugins/Actions/Archiver.php | Archiver.archiveDayActionsTime | protected function archiveDayActionsTime($rankingQueryLimit)
{
$rankingQuery = false;
if ($rankingQueryLimit > 0) {
$rankingQuery = new RankingQuery($rankingQueryLimit);
$rankingQuery->setOthersLabel(DataTable::LABEL_SUMMARY_ROW);
$rankingQuery->addLabelColumn('id... | php | protected function archiveDayActionsTime($rankingQueryLimit)
{
$rankingQuery = false;
if ($rankingQueryLimit > 0) {
$rankingQuery = new RankingQuery($rankingQueryLimit);
$rankingQuery->setOthersLabel(DataTable::LABEL_SUMMARY_ROW);
$rankingQuery->addLabelColumn('id... | [
"protected",
"function",
"archiveDayActionsTime",
"(",
"$",
"rankingQueryLimit",
")",
"{",
"$",
"rankingQuery",
"=",
"false",
";",
"if",
"(",
"$",
"rankingQueryLimit",
">",
"0",
")",
"{",
"$",
"rankingQuery",
"=",
"new",
"RankingQuery",
"(",
"$",
"rankingQuery... | Time per action | [
"Time",
"per",
"action"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/Archiver.php#L372-L410 |
208,801 | matomo-org/matomo | plugins/Actions/Archiver.php | Archiver.insertDayReports | protected function insertDayReports()
{
ArchivingHelper::clearActionsCache();
$this->insertPageUrlsReports();
$this->insertDownloadsReports();
$this->insertOutlinksReports();
$this->insertPageTitlesReports();
$this->insertSiteSearchReports();
} | php | protected function insertDayReports()
{
ArchivingHelper::clearActionsCache();
$this->insertPageUrlsReports();
$this->insertDownloadsReports();
$this->insertOutlinksReports();
$this->insertPageTitlesReports();
$this->insertSiteSearchReports();
} | [
"protected",
"function",
"insertDayReports",
"(",
")",
"{",
"ArchivingHelper",
"::",
"clearActionsCache",
"(",
")",
";",
"$",
"this",
"->",
"insertPageUrlsReports",
"(",
")",
";",
"$",
"this",
"->",
"insertDownloadsReports",
"(",
")",
";",
"$",
"this",
"->",
... | Records in the DB the archived reports for Page views, Downloads, Outlinks, and Page titles | [
"Records",
"in",
"the",
"DB",
"the",
"archived",
"reports",
"for",
"Page",
"views",
"Downloads",
"Outlinks",
"and",
"Page",
"titles"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/Archiver.php#L415-L424 |
208,802 | matomo-org/matomo | plugins/UsersManager/Controller.php | Controller.index | public function index()
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeAdminAccess();
$view = new View('@UsersManager/index');
$IdSitesAdmin = Request::processRequest('SitesManager.getSitesIdWithAdminAccess');
$idSiteSelected = 1;
if (count($IdSitesAdmi... | php | public function index()
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeAdminAccess();
$view = new View('@UsersManager/index');
$IdSitesAdmin = Request::processRequest('SitesManager.getSitesIdWithAdminAccess');
$idSiteSelected = 1;
if (count($IdSitesAdmi... | [
"public",
"function",
"index",
"(",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasSomeAdminAccess",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@UsersManager/index'",
")",
";",
"$",
"IdSitesAdmin",
... | The "Manage Users and Permissions" Admin UI screen | [
"The",
"Manage",
"Users",
"and",
"Permissions",
"Admin",
"UI",
"screen"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L51-L105 |
208,803 | matomo-org/matomo | plugins/UsersManager/Controller.php | Controller.getDefaultDates | protected function getDefaultDates()
{
$dates = array(
'today' => $this->translator->translate('Intl_Today'),
'yesterday' => $this->translator->translate('Intl_Yesterday'),
'previous7' => $this->translator->translate('General_PreviousDays', 7),
'previou... | php | protected function getDefaultDates()
{
$dates = array(
'today' => $this->translator->translate('Intl_Today'),
'yesterday' => $this->translator->translate('Intl_Yesterday'),
'previous7' => $this->translator->translate('General_PreviousDays', 7),
'previou... | [
"protected",
"function",
"getDefaultDates",
"(",
")",
"{",
"$",
"dates",
"=",
"array",
"(",
"'today'",
"=>",
"$",
"this",
"->",
"translator",
"->",
"translate",
"(",
"'Intl_Today'",
")",
",",
"'yesterday'",
"=>",
"$",
"this",
"->",
"translator",
"->",
"tra... | Returns the enabled dates that users can select,
in their User Settings page "Report date to load by default"
@throws
@return array | [
"Returns",
"the",
"enabled",
"dates",
"that",
"users",
"can",
"select",
"in",
"their",
"User",
"Settings",
"page",
"Report",
"date",
"to",
"load",
"by",
"default"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L125-L169 |
208,804 | matomo-org/matomo | plugins/UsersManager/Controller.php | Controller.userSettings | public function userSettings()
{
Piwik::checkUserIsNotAnonymous();
$view = new View('@UsersManager/userSettings');
$userLogin = Piwik::getCurrentUserLogin();
$user = Request::processRequest('UsersManager.getUser', array('userLogin' => $userLogin));
$view->userEmail = $user[... | php | public function userSettings()
{
Piwik::checkUserIsNotAnonymous();
$view = new View('@UsersManager/userSettings');
$userLogin = Piwik::getCurrentUserLogin();
$user = Request::processRequest('UsersManager.getUser', array('userLogin' => $userLogin));
$view->userEmail = $user[... | [
"public",
"function",
"userSettings",
"(",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@UsersManager/userSettings'",
")",
";",
"$",
"userLogin",
"=",
"Piwik",
"::",
"getCurrentUserLogin",
"(",
")",... | The "User Settings" admin UI screen view | [
"The",
"User",
"Settings",
"admin",
"UI",
"screen",
"view"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L174-L238 |
208,805 | matomo-org/matomo | plugins/UsersManager/Controller.php | Controller.anonymousSettings | public function anonymousSettings()
{
Piwik::checkUserHasSuperUserAccess();
$view = new View('@UsersManager/anonymousSettings');
$view->availableDefaultDates = $this->getDefaultDates();
$this->initViewAnonymousUserSettings($view);
$this->setBasicVariablesView($view);
... | php | public function anonymousSettings()
{
Piwik::checkUserHasSuperUserAccess();
$view = new View('@UsersManager/anonymousSettings');
$view->availableDefaultDates = $this->getDefaultDates();
$this->initViewAnonymousUserSettings($view);
$this->setBasicVariablesView($view);
... | [
"public",
"function",
"anonymousSettings",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@UsersManager/anonymousSettings'",
")",
";",
"$",
"view",
"->",
"availableDefaultDates",
"=",
"$",
"thi... | The "Anonymous Settings" admin UI screen view | [
"The",
"Anonymous",
"Settings",
"admin",
"UI",
"screen",
"view"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L243-L255 |
208,806 | matomo-org/matomo | plugins/UsersManager/Controller.php | Controller.initViewAnonymousUserSettings | protected function initViewAnonymousUserSettings($view)
{
if (!Piwik::hasUserSuperUserAccess()) {
return;
}
$userLogin = 'anonymous';
// Which websites are available to the anonymous users?
$anonymousSitesAccess = Request::processRequest('UsersManager.getSitesA... | php | protected function initViewAnonymousUserSettings($view)
{
if (!Piwik::hasUserSuperUserAccess()) {
return;
}
$userLogin = 'anonymous';
// Which websites are available to the anonymous users?
$anonymousSitesAccess = Request::processRequest('UsersManager.getSitesA... | [
"protected",
"function",
"initViewAnonymousUserSettings",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"!",
"Piwik",
"::",
"hasUserSuperUserAccess",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"userLogin",
"=",
"'anonymous'",
";",
"// Which websites are available to th... | The Super User can modify Anonymous user settings
@param View $view | [
"The",
"Super",
"User",
"can",
"modify",
"Anonymous",
"user",
"settings"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L275-L334 |
208,807 | matomo-org/matomo | plugins/UsersManager/Controller.php | Controller.recordUserSettings | public function recordUserSettings()
{
$response = new ResponseBuilder(Common::getRequestVar('format'));
try {
$this->checkTokenInUrl();
$defaultReport = Common::getRequestVar('defaultReport');
$defaultDate = Common::getRequestVar('defaultDate');
$lan... | php | public function recordUserSettings()
{
$response = new ResponseBuilder(Common::getRequestVar('format'));
try {
$this->checkTokenInUrl();
$defaultReport = Common::getRequestVar('defaultReport');
$defaultDate = Common::getRequestVar('defaultDate');
$lan... | [
"public",
"function",
"recordUserSettings",
"(",
")",
"{",
"$",
"response",
"=",
"new",
"ResponseBuilder",
"(",
"Common",
"::",
"getRequestVar",
"(",
"'format'",
")",
")",
";",
"try",
"{",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"$",
"defaultR... | Records settings from the "User Settings" page
@throws Exception | [
"Records",
"settings",
"from",
"the",
"User",
"Settings",
"page"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/Controller.php#L367-L406 |
208,808 | matomo-org/matomo | core/TCPDF.php | TCPDF.Footer | public function Footer()
{
//Don't show footer on the frontPage
if ($this->currentPageNo > 1) {
$this->SetY(-15);
$this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]);
$this->Cell(0, 10, $this->footerContent . Piwik::translate('Sched... | php | public function Footer()
{
//Don't show footer on the frontPage
if ($this->currentPageNo > 1) {
$this->SetY(-15);
$this->SetFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]);
$this->Cell(0, 10, $this->footerContent . Piwik::translate('Sched... | [
"public",
"function",
"Footer",
"(",
")",
"{",
"//Don't show footer on the frontPage",
"if",
"(",
"$",
"this",
"->",
"currentPageNo",
">",
"1",
")",
"{",
"$",
"this",
"->",
"SetY",
"(",
"-",
"15",
")",
";",
"$",
"this",
"->",
"SetFont",
"(",
"$",
"this... | Render page footer
@see TCPDF::Footer() | [
"Render",
"page",
"footer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/TCPDF.php#L28-L36 |
208,809 | matomo-org/matomo | core/TCPDF.php | TCPDF.AddPage | public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
{
parent::AddPage($orientation);
$this->setCurrentPageNo();
} | php | public function AddPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false)
{
parent::AddPage($orientation);
$this->setCurrentPageNo();
} | [
"public",
"function",
"AddPage",
"(",
"$",
"orientation",
"=",
"''",
",",
"$",
"format",
"=",
"''",
",",
"$",
"keepmargins",
"=",
"false",
",",
"$",
"tocpage",
"=",
"false",
")",
"{",
"parent",
"::",
"AddPage",
"(",
"$",
"orientation",
")",
";",
"$",... | Add page to document
@see TCPDF::AddPage()
@param string $orientation
@param mixed $format
@param bool $keepmargins
@param bool $tocpage | [
"Add",
"page",
"to",
"document"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/TCPDF.php#L71-L75 |
208,810 | matomo-org/matomo | plugins/Overlay/API.php | API.getExcludedQueryParameters | public function getExcludedQueryParameters($idSite)
{
$sitesManager = APISitesManager::getInstance();
$site = $sitesManager->getSiteFromId($idSite);
try {
return SitesManager::getTrackerExcludedQueryParameters($site);
} catch (Exception $e) {
// an exception ... | php | public function getExcludedQueryParameters($idSite)
{
$sitesManager = APISitesManager::getInstance();
$site = $sitesManager->getSiteFromId($idSite);
try {
return SitesManager::getTrackerExcludedQueryParameters($site);
} catch (Exception $e) {
// an exception ... | [
"public",
"function",
"getExcludedQueryParameters",
"(",
"$",
"idSite",
")",
"{",
"$",
"sitesManager",
"=",
"APISitesManager",
"::",
"getInstance",
"(",
")",
";",
"$",
"site",
"=",
"$",
"sitesManager",
"->",
"getSiteFromId",
"(",
"$",
"idSite",
")",
";",
"tr... | Get excluded query parameters for a site.
This information is used for client side url normalization. | [
"Get",
"excluded",
"query",
"parameters",
"for",
"a",
"site",
".",
"This",
"information",
"is",
"used",
"for",
"client",
"side",
"url",
"normalization",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Overlay/API.php#L44-L56 |
208,811 | matomo-org/matomo | plugins/Overlay/API.php | API.getFollowingPages | public function getFollowingPages($url, $idSite, $period, $date, $segment = false)
{
$url = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
// we don't unsanitize $url here. it will be done in the Transitions plugin.
$resultDataTable = new DataTable;
try {
$limit... | php | public function getFollowingPages($url, $idSite, $period, $date, $segment = false)
{
$url = PageUrl::excludeQueryParametersFromUrl($url, $idSite);
// we don't unsanitize $url here. it will be done in the Transitions plugin.
$resultDataTable = new DataTable;
try {
$limit... | [
"public",
"function",
"getFollowingPages",
"(",
"$",
"url",
",",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
")",
"{",
"$",
"url",
"=",
"PageUrl",
"::",
"excludeQueryParametersFromUrl",
"(",
"$",
"url",
",",
... | Get following pages of a url.
This is done on the logs - not the archives!
Note: if you use this method via the regular API, the number of results will be limited.
Make sure, you set filter_limit=-1 in the request. | [
"Get",
"following",
"pages",
"of",
"a",
"url",
".",
"This",
"is",
"done",
"on",
"the",
"logs",
"-",
"not",
"the",
"archives!"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Overlay/API.php#L65-L93 |
208,812 | matomo-org/matomo | libs/Zend/Mail/Part.php | Zend_Mail_Part._cacheContent | protected function _cacheContent()
{
// caching content if we can't fetch parts
if ($this->_content === null && $this->_mail) {
$this->_content = $this->_mail->getRawContent($this->_messageNum);
}
if (!$this->isMultipart()) {
return;
}
// spl... | php | protected function _cacheContent()
{
// caching content if we can't fetch parts
if ($this->_content === null && $this->_mail) {
$this->_content = $this->_mail->getRawContent($this->_messageNum);
}
if (!$this->isMultipart()) {
return;
}
// spl... | [
"protected",
"function",
"_cacheContent",
"(",
")",
"{",
"// caching content if we can't fetch parts",
"if",
"(",
"$",
"this",
"->",
"_content",
"===",
"null",
"&&",
"$",
"this",
"->",
"_mail",
")",
"{",
"$",
"this",
"->",
"_content",
"=",
"$",
"this",
"->",... | Cache content and split in parts if multipart
@return null
@throws Zend_Mail_Exception | [
"Cache",
"content",
"and",
"split",
"in",
"parts",
"if",
"multipart"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part.php#L202-L230 |
208,813 | matomo-org/matomo | libs/Zend/Mail/Part.php | Zend_Mail_Part.countParts | public function countParts()
{
if ($this->_countParts) {
return $this->_countParts;
}
$this->_countParts = count($this->_parts);
if ($this->_countParts) {
return $this->_countParts;
}
if ($this->_mail && $this->_mail->hasFetchPart) {
... | php | public function countParts()
{
if ($this->_countParts) {
return $this->_countParts;
}
$this->_countParts = count($this->_parts);
if ($this->_countParts) {
return $this->_countParts;
}
if ($this->_mail && $this->_mail->hasFetchPart) {
... | [
"public",
"function",
"countParts",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_countParts",
")",
"{",
"return",
"$",
"this",
"->",
"_countParts",
";",
"}",
"$",
"this",
"->",
"_countParts",
"=",
"count",
"(",
"$",
"this",
"->",
"_parts",
")",
";"... | Count parts of a multipart part
@return int number of sub-parts | [
"Count",
"parts",
"of",
"a",
"multipart",
"part"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part.php#L276-L296 |
208,814 | matomo-org/matomo | libs/Zend/Mail/Part.php | Zend_Mail_Part.getHeaders | public function getHeaders()
{
if ($this->_headers === null) {
if (!$this->_mail) {
$this->_headers = array();
} else {
$part = $this->_mail->getRawHeader($this->_messageNum);
Zend_Mime_Decode::splitMessage($part, $this->_headers, $null... | php | public function getHeaders()
{
if ($this->_headers === null) {
if (!$this->_mail) {
$this->_headers = array();
} else {
$part = $this->_mail->getRawHeader($this->_messageNum);
Zend_Mime_Decode::splitMessage($part, $this->_headers, $null... | [
"public",
"function",
"getHeaders",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_headers",
"===",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_mail",
")",
"{",
"$",
"this",
"->",
"_headers",
"=",
"array",
"(",
")",
";",
"}",
"else",
... | Get all headers
The returned headers are as saved internally. All names are lowercased. The value is a string or an array
if a header with the same name occurs more than once.
@return array headers as array(name => value) | [
"Get",
"all",
"headers"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part.php#L307-L319 |
208,815 | matomo-org/matomo | libs/Zend/Mail/Part.php | Zend_Mail_Part.getHeader | public function getHeader($name, $format = null)
{
if ($this->_headers === null) {
$this->getHeaders();
}
$lowerName = strtolower($name);
if ($this->headerExists($name) == false) {
$lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\1-\2', $name));
... | php | public function getHeader($name, $format = null)
{
if ($this->_headers === null) {
$this->getHeaders();
}
$lowerName = strtolower($name);
if ($this->headerExists($name) == false) {
$lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\1-\2', $name));
... | [
"public",
"function",
"getHeader",
"(",
"$",
"name",
",",
"$",
"format",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_headers",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"getHeaders",
"(",
")",
";",
"}",
"$",
"lowerName",
"=",
"strtolow... | Get a header in specificed format
Internally headers that occur more than once are saved as array, all other as string. If $format
is set to string implode is used to concat the values (with Zend_Mime::LINEEND as delim).
@param string $name name of header, matches case-insensitive, but camel-case is replaced with ... | [
"Get",
"a",
"header",
"in",
"specificed",
"format"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part.php#L332-L367 |
208,816 | matomo-org/matomo | libs/Zend/Mail/Part.php | Zend_Mail_Part.headerExists | public function headerExists($name)
{
$name = strtolower($name);
if(isset($this->_headers[$name])) {
return true;
} else {
return false;
}
} | php | public function headerExists($name)
{
$name = strtolower($name);
if(isset($this->_headers[$name])) {
return true;
} else {
return false;
}
} | [
"public",
"function",
"headerExists",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_headers",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"true",
";",
"}"... | Check wheater the Mail part has a specific header.
@param string $name
@return boolean | [
"Check",
"wheater",
"the",
"Mail",
"part",
"has",
"a",
"specific",
"header",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Part.php#L375-L383 |
208,817 | matomo-org/matomo | plugins/Diagnostics/Diagnostic/RequiredPhpSetting.php | RequiredPhpSetting.check | public function check()
{
$currentValue = (int) ini_get($this->setting);
$return = false;
foreach($this->requiredValues as $key => $requiredValue){
$this->requiredValues[$key]['isValid'] = version_compare($currentValue, $requiredValue['requiredValue'], $requiredValue['op... | php | public function check()
{
$currentValue = (int) ini_get($this->setting);
$return = false;
foreach($this->requiredValues as $key => $requiredValue){
$this->requiredValues[$key]['isValid'] = version_compare($currentValue, $requiredValue['requiredValue'], $requiredValue['op... | [
"public",
"function",
"check",
"(",
")",
"{",
"$",
"currentValue",
"=",
"(",
"int",
")",
"ini_get",
"(",
"$",
"this",
"->",
"setting",
")",
";",
"$",
"return",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"requiredValues",
"as",
"$",
"key",
... | Checks required values against php.ini value.
@return bool | [
"Checks",
"required",
"values",
"against",
"php",
".",
"ini",
"value",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Diagnostics/Diagnostic/RequiredPhpSetting.php#L78-L92 |
208,818 | matomo-org/matomo | core/Tracker/TableLogAction.php | TableLogAction.loadIdsAction | public static function loadIdsAction($actionsNameAndType)
{
// Add url prefix if not set
foreach ($actionsNameAndType as &$action) {
if (2 == count($action)) {
$action[] = null;
}
}
$actionIds = self::queryIdsAction($actionsNameAndType);
... | php | public static function loadIdsAction($actionsNameAndType)
{
// Add url prefix if not set
foreach ($actionsNameAndType as &$action) {
if (2 == count($action)) {
$action[] = null;
}
}
$actionIds = self::queryIdsAction($actionsNameAndType);
... | [
"public",
"static",
"function",
"loadIdsAction",
"(",
"$",
"actionsNameAndType",
")",
"{",
"// Add url prefix if not set",
"foreach",
"(",
"$",
"actionsNameAndType",
"as",
"&",
"$",
"action",
")",
"{",
"if",
"(",
"2",
"==",
"count",
"(",
"$",
"action",
")",
... | This function will find the idaction from the lookup table log_action,
given an Action name, type, and an optional URL Prefix.
This is used to record Page URLs, Page Titles, Ecommerce items SKUs, item names, item categories
If the action name does not exist in the lookup table, it will INSERT it
@param array $actions... | [
"This",
"function",
"will",
"find",
"the",
"idaction",
"from",
"the",
"lookup",
"table",
"log_action",
"given",
"an",
"Action",
"name",
"type",
"and",
"an",
"optional",
"URL",
"Prefix",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/TableLogAction.php#L36-L53 |
208,819 | matomo-org/matomo | core/Tracker/TableLogAction.php | TableLogAction.getIdActionFromSegment | public static function getIdActionFromSegment($valueToMatch, $sqlField, $matchType, $segmentName)
{
if ($segmentName === 'actionType') {
$actionType = (int) $valueToMatch;
$valueToMatch = array();
$sql = 'SELECT idaction FROM ' . Common::prefixTable('log_action') . ' WH... | php | public static function getIdActionFromSegment($valueToMatch, $sqlField, $matchType, $segmentName)
{
if ($segmentName === 'actionType') {
$actionType = (int) $valueToMatch;
$valueToMatch = array();
$sql = 'SELECT idaction FROM ' . Common::prefixTable('log_action') . ' WH... | [
"public",
"static",
"function",
"getIdActionFromSegment",
"(",
"$",
"valueToMatch",
",",
"$",
"sqlField",
",",
"$",
"matchType",
",",
"$",
"segmentName",
")",
"{",
"if",
"(",
"$",
"segmentName",
"===",
"'actionType'",
")",
"{",
"$",
"actionType",
"=",
"(",
... | Convert segment expression to an action ID or an SQL expression.
This method is used as a sqlFilter-callback for the segments of this plugin.
Usually, these callbacks only return a value that should be compared to the
column in the database. In this case, that doesn't work since multiple IDs
can match an expression (e... | [
"Convert",
"segment",
"expression",
"to",
"an",
"action",
"ID",
"or",
"an",
"SQL",
"expression",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/TableLogAction.php#L175-L208 |
208,820 | matomo-org/matomo | core/Tracker/TableLogAction.php | TableLogAction.normaliseActionString | private static function normaliseActionString($actionType, $actionString)
{
$actionString = Common::unsanitizeInputValue($actionString);
if (self::isActionTypeStoredUnsanitized($actionType)) {
return $actionString;
}
return Common::sanitizeInputValue($actionString);
... | php | private static function normaliseActionString($actionType, $actionString)
{
$actionString = Common::unsanitizeInputValue($actionString);
if (self::isActionTypeStoredUnsanitized($actionType)) {
return $actionString;
}
return Common::sanitizeInputValue($actionString);
... | [
"private",
"static",
"function",
"normaliseActionString",
"(",
"$",
"actionType",
",",
"$",
"actionString",
")",
"{",
"$",
"actionString",
"=",
"Common",
"::",
"unsanitizeInputValue",
"(",
"$",
"actionString",
")",
";",
"if",
"(",
"self",
"::",
"isActionTypeStor... | This function will sanitize or not if it's needed for the specified action type
URLs (Download URL, Outlink URL) are stored raw (unsanitized)
while other action types are stored Sanitized
@param $actionType
@param $actionString
@return string | [
"This",
"function",
"will",
"sanitize",
"or",
"not",
"if",
"it",
"s",
"needed",
"for",
"the",
"specified",
"action",
"type"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/TableLogAction.php#L258-L267 |
208,821 | matomo-org/matomo | core/UpdateCheck.php | UpdateCheck.check | public static function check($force = false, $interval = null)
{
if (!SettingsPiwik::isAutoUpdateEnabled()) {
return;
}
if ($interval === null) {
$interval = self::CHECK_INTERVAL;
}
$lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
if ... | php | public static function check($force = false, $interval = null)
{
if (!SettingsPiwik::isAutoUpdateEnabled()) {
return;
}
if ($interval === null) {
$interval = self::CHECK_INTERVAL;
}
$lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
if ... | [
"public",
"static",
"function",
"check",
"(",
"$",
"force",
"=",
"false",
",",
"$",
"interval",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"SettingsPiwik",
"::",
"isAutoUpdateEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"interval",
"... | Check for a newer version
@param bool $force Force check
@param int $interval Interval used for update checks | [
"Check",
"for",
"a",
"newer",
"version"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UpdateCheck.php#L30-L56 |
208,822 | matomo-org/matomo | core/UpdateCheck.php | UpdateCheck.isNewestVersionAvailable | public static function isNewestVersionAvailable()
{
$latestVersion = self::getLatestVersion();
if (!empty($latestVersion)
&& version_compare(Version::VERSION, $latestVersion) == -1
) {
return $latestVersion;
}
return false;
} | php | public static function isNewestVersionAvailable()
{
$latestVersion = self::getLatestVersion();
if (!empty($latestVersion)
&& version_compare(Version::VERSION, $latestVersion) == -1
) {
return $latestVersion;
}
return false;
} | [
"public",
"static",
"function",
"isNewestVersionAvailable",
"(",
")",
"{",
"$",
"latestVersion",
"=",
"self",
"::",
"getLatestVersion",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"latestVersion",
")",
"&&",
"version_compare",
"(",
"Version",
"::",
"VE... | Returns version number of a newer Piwik release.
@return string|bool false if current version is the latest available,
or the latest version number if a newest release is available | [
"Returns",
"version",
"number",
"of",
"a",
"newer",
"Piwik",
"release",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/UpdateCheck.php#L96-L105 |
208,823 | matomo-org/matomo | libs/Zend/Config.php | Zend_Config.next | public function next()
{
if ($this->_skipNextIteration) {
$this->_skipNextIteration = false;
return;
}
next($this->_data);
$this->_index++;
} | php | public function next()
{
if ($this->_skipNextIteration) {
$this->_skipNextIteration = false;
return;
}
next($this->_data);
$this->_index++;
} | [
"public",
"function",
"next",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_skipNextIteration",
")",
"{",
"$",
"this",
"->",
"_skipNextIteration",
"=",
"false",
";",
"return",
";",
"}",
"next",
"(",
"$",
"this",
"->",
"_data",
")",
";",
"$",
"this",... | Defined by Iterator interface | [
"Defined",
"by",
"Iterator",
"interface"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config.php#L278-L286 |
208,824 | matomo-org/matomo | libs/Zend/Config.php | Zend_Config.setExtend | public function setExtend($extendingSection, $extendedSection = null)
{
if ($extendedSection === null && isset($this->_extends[$extendingSection])) {
unset($this->_extends[$extendingSection]);
} else if ($extendedSection !== null) {
$this->_extends[$extendingSection] = $exten... | php | public function setExtend($extendingSection, $extendedSection = null)
{
if ($extendedSection === null && isset($this->_extends[$extendingSection])) {
unset($this->_extends[$extendingSection]);
} else if ($extendedSection !== null) {
$this->_extends[$extendingSection] = $exten... | [
"public",
"function",
"setExtend",
"(",
"$",
"extendingSection",
",",
"$",
"extendedSection",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"extendedSection",
"===",
"null",
"&&",
"isset",
"(",
"$",
"this",
"->",
"_extends",
"[",
"$",
"extendingSection",
"]",
")"... | Set an extend for Zend_Config_Writer
@param string $extendingSection
@param string $extendedSection
@return void | [
"Set",
"an",
"extend",
"for",
"Zend_Config_Writer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config.php#L405-L412 |
208,825 | matomo-org/matomo | libs/Zend/Config.php | Zend_Config._loadFileErrorHandler | protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
{
if ($this->_loadFileErrorStr === null) {
$this->_loadFileErrorStr = $errstr;
} else {
$this->_loadFileErrorStr .= (PHP_EOL . $errstr);
}
} | php | protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
{
if ($this->_loadFileErrorStr === null) {
$this->_loadFileErrorStr = $errstr;
} else {
$this->_loadFileErrorStr .= (PHP_EOL . $errstr);
}
} | [
"protected",
"function",
"_loadFileErrorHandler",
"(",
"$",
"errno",
",",
"$",
"errstr",
",",
"$",
"errfile",
",",
"$",
"errline",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_loadFileErrorStr",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_loadFileErrorStr",... | Handle any errors from simplexml_load_file or parse_ini_file
@param integer $errno
@param string $errstr
@param string $errfile
@param integer $errline | [
"Handle",
"any",
"errors",
"from",
"simplexml_load_file",
"or",
"parse_ini_file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config.php#L447-L454 |
208,826 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.setProfiler | public function setProfiler($profiler)
{
$enabled = null;
$profilerClass = $this->_defaultProfilerClass;
$profilerInstance = null;
if ($profilerIsObject = is_object($profiler)) {
if ($profiler instanceof Zend_Db_Profiler) {
$profilerInstance =... | php | public function setProfiler($profiler)
{
$enabled = null;
$profilerClass = $this->_defaultProfilerClass;
$profilerInstance = null;
if ($profilerIsObject = is_object($profiler)) {
if ($profiler instanceof Zend_Db_Profiler) {
$profilerInstance =... | [
"public",
"function",
"setProfiler",
"(",
"$",
"profiler",
")",
"{",
"$",
"enabled",
"=",
"null",
";",
"$",
"profilerClass",
"=",
"$",
"this",
"->",
"_defaultProfilerClass",
";",
"$",
"profilerInstance",
"=",
"null",
";",
"if",
"(",
"$",
"profilerIsObject",
... | Set the adapter's profiler object.
The argument may be a boolean, an associative array, an instance of
Zend_Db_Profiler, or an instance of Zend_Config.
A boolean argument sets the profiler to enabled if true, or disabled if
false. The profiler class is the adapter's default profiler class,
Zend_Db_Profiler.
An inst... | [
"Set",
"the",
"adapter",
"s",
"profiler",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L357-L414 |
208,827 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.query | public function query($sql, $bind = array())
{
// connect to the database if needed
$this->_connect();
// is the $sql a Zend_Db_Select object?
if ($sql instanceof Zend_Db_Select) {
if (empty($bind)) {
$bind = $sql->getBind();
}
$s... | php | public function query($sql, $bind = array())
{
// connect to the database if needed
$this->_connect();
// is the $sql a Zend_Db_Select object?
if ($sql instanceof Zend_Db_Select) {
if (empty($bind)) {
$bind = $sql->getBind();
}
$s... | [
"public",
"function",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"// connect to the database if needed",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"// is the $sql a Zend_Db_Select object?",
"if",
"(",
"$",
"sql",
"instanc... | Prepares and executes an SQL statement with bound data.
@param mixed $sql The SQL statement with placeholders.
May be a string or Zend_Db_Select.
@param mixed $bind An array of data to bind to the placeholders.
@return Zend_Db_Statement_Interface | [
"Prepares",
"and",
"executes",
"an",
"SQL",
"statement",
"with",
"bound",
"data",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L456-L484 |
208,828 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.beginTransaction | public function beginTransaction()
{
$this->_connect();
$q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION);
$this->_beginTransaction();
$this->_profiler->queryEnd($q);
return $this;
} | php | public function beginTransaction()
{
$this->_connect();
$q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION);
$this->_beginTransaction();
$this->_profiler->queryEnd($q);
return $this;
} | [
"public",
"function",
"beginTransaction",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"q",
"=",
"$",
"this",
"->",
"_profiler",
"->",
"queryStart",
"(",
"'begin'",
",",
"Zend_Db_Profiler",
"::",
"TRANSACTION",
")",
";",
"$",
"this",... | Leave autocommit mode and begin a transaction.
@return Zend_Db_Adapter_Abstract | [
"Leave",
"autocommit",
"mode",
"and",
"begin",
"a",
"transaction",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L491-L498 |
208,829 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.update | public function update($table, array $bind, $where = '')
{
/**
* Build "col = ?" pairs for the statement,
* except for Zend_Db_Expr which is treated literally.
*/
$set = array();
$i = 0;
foreach ($bind as $col => $val) {
if ($val instanceof Zend... | php | public function update($table, array $bind, $where = '')
{
/**
* Build "col = ?" pairs for the statement,
* except for Zend_Db_Expr which is treated literally.
*/
$set = array();
$i = 0;
foreach ($bind as $col => $val) {
if ($val instanceof Zend... | [
"public",
"function",
"update",
"(",
"$",
"table",
",",
"array",
"$",
"bind",
",",
"$",
"where",
"=",
"''",
")",
"{",
"/**\n * Build \"col = ?\" pairs for the statement,\n * except for Zend_Db_Expr which is treated literally.\n */",
"$",
"set",
"=",
... | Updates table rows with specified data based on a WHERE clause.
@param mixed $table The table to update.
@param array $bind Column-value pairs.
@param mixed $where UPDATE WHERE clause(s).
@return int The number of affected rows.
@throws Zend_Db_Adapter_Exception | [
"Updates",
"table",
"rows",
"with",
"specified",
"data",
"based",
"on",
"a",
"WHERE",
"clause",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L589-L640 |
208,830 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.delete | public function delete($table, $where = '')
{
$where = $this->_whereExpr($where);
/**
* Build the DELETE statement
*/
$sql = "DELETE FROM "
. $this->quoteIdentifier($table, true)
. (($where) ? " WHERE $where" : '');
/**
* Execute... | php | public function delete($table, $where = '')
{
$where = $this->_whereExpr($where);
/**
* Build the DELETE statement
*/
$sql = "DELETE FROM "
. $this->quoteIdentifier($table, true)
. (($where) ? " WHERE $where" : '');
/**
* Execute... | [
"public",
"function",
"delete",
"(",
"$",
"table",
",",
"$",
"where",
"=",
"''",
")",
"{",
"$",
"where",
"=",
"$",
"this",
"->",
"_whereExpr",
"(",
"$",
"where",
")",
";",
"/**\n * Build the DELETE statement\n */",
"$",
"sql",
"=",
"\"DELETE ... | Deletes table rows based on a WHERE clause.
@param mixed $table The table to update.
@param mixed $where DELETE WHERE clause(s).
@return int The number of affected rows. | [
"Deletes",
"table",
"rows",
"based",
"on",
"a",
"WHERE",
"clause",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L649-L666 |
208,831 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract._whereExpr | protected function _whereExpr($where)
{
if (empty($where)) {
return $where;
}
if (!is_array($where)) {
$where = array($where);
}
foreach ($where as $cond => &$term) {
// is $cond an int? (i.e. Not a condition)
if (is_int($cond))... | php | protected function _whereExpr($where)
{
if (empty($where)) {
return $where;
}
if (!is_array($where)) {
$where = array($where);
}
foreach ($where as $cond => &$term) {
// is $cond an int? (i.e. Not a condition)
if (is_int($cond))... | [
"protected",
"function",
"_whereExpr",
"(",
"$",
"where",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"where",
")",
")",
"{",
"return",
"$",
"where",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"where",
")",
")",
"{",
"$",
"where",
"=",
"array",
... | Convert an array, string, or Zend_Db_Expr object
into a string to put in a WHERE clause.
@param mixed $where
@return string | [
"Convert",
"an",
"array",
"string",
"or",
"Zend_Db_Expr",
"object",
"into",
"a",
"string",
"to",
"put",
"in",
"a",
"WHERE",
"clause",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L675-L700 |
208,832 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.fetchAll | public function fetchAll($sql, $bind = array(), $fetchMode = null)
{
if ($fetchMode === null) {
$fetchMode = $this->_fetchMode;
}
$stmt = $this->query($sql, $bind);
$result = $stmt->fetchAll($fetchMode);
return $result;
} | php | public function fetchAll($sql, $bind = array(), $fetchMode = null)
{
if ($fetchMode === null) {
$fetchMode = $this->_fetchMode;
}
$stmt = $this->query($sql, $bind);
$result = $stmt->fetchAll($fetchMode);
return $result;
} | [
"public",
"function",
"fetchAll",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
",",
"$",
"fetchMode",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fetchMode",
"===",
"null",
")",
"{",
"$",
"fetchMode",
"=",
"$",
"this",
"->",
"_fetchMode",... | Fetches all SQL result rows as a sequential array.
Uses the current fetchMode for the adapter.
@param string|Zend_Db_Select $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@param mixed $fetchMode Override current fetch mode.
@return array | [
"Fetches",
"all",
"SQL",
"result",
"rows",
"as",
"a",
"sequential",
"array",
".",
"Uses",
"the",
"current",
"fetchMode",
"for",
"the",
"adapter",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L731-L739 |
208,833 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.fetchRow | public function fetchRow($sql, $bind = array(), $fetchMode = null)
{
if ($fetchMode === null) {
$fetchMode = $this->_fetchMode;
}
$stmt = $this->query($sql, $bind);
$result = $stmt->fetch($fetchMode);
return $result;
} | php | public function fetchRow($sql, $bind = array(), $fetchMode = null)
{
if ($fetchMode === null) {
$fetchMode = $this->_fetchMode;
}
$stmt = $this->query($sql, $bind);
$result = $stmt->fetch($fetchMode);
return $result;
} | [
"public",
"function",
"fetchRow",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
",",
"$",
"fetchMode",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fetchMode",
"===",
"null",
")",
"{",
"$",
"fetchMode",
"=",
"$",
"this",
"->",
"_fetchMode",... | Fetches the first row of the SQL result.
Uses the current fetchMode for the adapter.
@param string|Zend_Db_Select $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@param mixed $fetchMode Override current fetch mode.
@return array | [
"Fetches",
"the",
"first",
"row",
"of",
"the",
"SQL",
"result",
".",
"Uses",
"the",
"current",
"fetchMode",
"for",
"the",
"adapter",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L750-L758 |
208,834 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.fetchAssoc | public function fetchAssoc($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$data = array();
while ($row = $stmt->fetch(Zend_Db::FETCH_ASSOC)) {
$tmp = array_values(array_slice($row, 0, 1));
$data[$tmp[0]] = $row;
}
return $data;
} | php | public function fetchAssoc($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$data = array();
while ($row = $stmt->fetch(Zend_Db::FETCH_ASSOC)) {
$tmp = array_values(array_slice($row, 0, 1));
$data[$tmp[0]] = $row;
}
return $data;
} | [
"public",
"function",
"fetchAssoc",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
")",
";",
"$",
"data",
"=",
"array",
"(",
")",
";",
"whi... | Fetches all SQL result rows as an associative array.
The first column is the key, the entire row array is the
value. You should construct the query to be sure that
the first column contains unique values, or else
rows with duplicate values in the first column will
overwrite previous data.
@param string|Zend_Db_Selec... | [
"Fetches",
"all",
"SQL",
"result",
"rows",
"as",
"an",
"associative",
"array",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L773-L782 |
208,835 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.fetchPairs | public function fetchPairs($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$data = array();
while ($row = $stmt->fetch(Zend_Db::FETCH_NUM)) {
$data[$row[0]] = $row[1];
}
return $data;
} | php | public function fetchPairs($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$data = array();
while ($row = $stmt->fetch(Zend_Db::FETCH_NUM)) {
$data[$row[0]] = $row[1];
}
return $data;
} | [
"public",
"function",
"fetchPairs",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
")",
";",
"$",
"data",
"=",
"array",
"(",
")",
";",
"whi... | Fetches all SQL result rows as an array of key-value pairs.
The first column is the key, the second column is the
value.
@param string|Zend_Db_Select $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@return array | [
"Fetches",
"all",
"SQL",
"result",
"rows",
"as",
"an",
"array",
"of",
"key",
"-",
"value",
"pairs",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L808-L816 |
208,836 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.fetchOne | public function fetchOne($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$result = $stmt->fetchColumn(0);
return $result;
} | php | public function fetchOne($sql, $bind = array())
{
$stmt = $this->query($sql, $bind);
$result = $stmt->fetchColumn(0);
return $result;
} | [
"public",
"function",
"fetchOne",
"(",
"$",
"sql",
",",
"$",
"bind",
"=",
"array",
"(",
")",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"query",
"(",
"$",
"sql",
",",
"$",
"bind",
")",
";",
"$",
"result",
"=",
"$",
"stmt",
"->",
"fetchColum... | Fetches the first column of the first row of the SQL result.
@param string|Zend_Db_Select $sql An SQL SELECT statement.
@param mixed $bind Data to bind into SELECT placeholders.
@return string | [
"Fetches",
"the",
"first",
"column",
"of",
"the",
"first",
"row",
"of",
"the",
"SQL",
"result",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L825-L830 |
208,837 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.quoteInto | public function quoteInto($text, $value, $type = null, $count = null)
{
if ($count === null) {
return str_replace('?', $this->quote($value, $type), $text);
} else {
while ($count > 0) {
if (strpos($text, '?') !== false) {
$text = substr_rep... | php | public function quoteInto($text, $value, $type = null, $count = null)
{
if ($count === null) {
return str_replace('?', $this->quote($value, $type), $text);
} else {
while ($count > 0) {
if (strpos($text, '?') !== false) {
$text = substr_rep... | [
"public",
"function",
"quoteInto",
"(",
"$",
"text",
",",
"$",
"value",
",",
"$",
"type",
"=",
"null",
",",
"$",
"count",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"count",
"===",
"null",
")",
"{",
"return",
"str_replace",
"(",
"'?'",
",",
"$",
"thi... | Quotes a value and places into a piece of text at a placeholder.
The placeholder is a question-mark; all placeholders will be replaced
with the quoted value. For example:
<code>
$text = "WHERE date < ?";
$date = "2005-01-02";
$safe = $sql->quoteInto($text, $date);
// $safe = "WHERE date < '2005-01-02'"
</code>
@pa... | [
"Quotes",
"a",
"value",
"and",
"places",
"into",
"a",
"piece",
"of",
"text",
"at",
"a",
"placeholder",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L927-L940 |
208,838 | matomo-org/matomo | libs/Zend/Db/Adapter/Abstract.php | Zend_Db_Adapter_Abstract.foldCase | public function foldCase($key)
{
switch ($this->_caseFolding) {
case Zend_Db::CASE_LOWER:
$value = strtolower((string) $key);
break;
case Zend_Db::CASE_UPPER:
$value = strtoupper((string) $key);
break;
case Z... | php | public function foldCase($key)
{
switch ($this->_caseFolding) {
case Zend_Db::CASE_LOWER:
$value = strtolower((string) $key);
break;
case Zend_Db::CASE_UPPER:
$value = strtoupper((string) $key);
break;
case Z... | [
"public",
"function",
"foldCase",
"(",
"$",
"key",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"_caseFolding",
")",
"{",
"case",
"Zend_Db",
"::",
"CASE_LOWER",
":",
"$",
"value",
"=",
"strtolower",
"(",
"(",
"string",
")",
"$",
"key",
")",
";",
"brea... | Helper method to change the case of the strings used
when returning result sets in FETCH_ASSOC and FETCH_BOTH
modes.
This is not intended to be used by application code,
but the method must be public so the Statement class
can invoke it.
@param string $key
@return string | [
"Helper",
"method",
"to",
"change",
"the",
"case",
"of",
"the",
"strings",
"used",
"when",
"returning",
"result",
"sets",
"in",
"FETCH_ASSOC",
"and",
"FETCH_BOTH",
"modes",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Abstract.php#L1101-L1115 |
208,839 | matomo-org/matomo | core/DataAccess/Model.php | Model.getInvalidatedArchiveIdsSafeToDelete | public function getInvalidatedArchiveIdsSafeToDelete($archiveTable, array $idSites)
{
try {
Db::get()->query('SET SESSION group_concat_max_len=' . (128 * 1024));
} catch (\Exception $ex) {
$this->logger->info("Could not set group_concat_max_len MySQL session variable.");
... | php | public function getInvalidatedArchiveIdsSafeToDelete($archiveTable, array $idSites)
{
try {
Db::get()->query('SET SESSION group_concat_max_len=' . (128 * 1024));
} catch (\Exception $ex) {
$this->logger->info("Could not set group_concat_max_len MySQL session variable.");
... | [
"public",
"function",
"getInvalidatedArchiveIdsSafeToDelete",
"(",
"$",
"archiveTable",
",",
"array",
"$",
"idSites",
")",
"{",
"try",
"{",
"Db",
"::",
"get",
"(",
")",
"->",
"query",
"(",
"'SET SESSION group_concat_max_len='",
".",
"(",
"128",
"*",
"1024",
")... | Returns the archives IDs that have already been invalidated and have been since re-processed.
These archives { archive name (includes segment hash) , idsite, date, period } will be deleted.
@param string $archiveTable
@param array $idSites
@return array
@throws Exception | [
"Returns",
"the",
"archives",
"IDs",
"that",
"have",
"already",
"been",
"invalidated",
"and",
"have",
"been",
"since",
"re",
"-",
"processed",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/Model.php#L49-L98 |
208,840 | matomo-org/matomo | core/DataAccess/Model.php | Model.getSitesWithInvalidatedArchive | public function getSitesWithInvalidatedArchive($numericTable)
{
$rows = Db::fetchAll("SELECT DISTINCT idsite FROM `$numericTable` WHERE name LIKE 'done%' AND value = " . ArchiveWriter::DONE_INVALIDATED);
$result = array();
foreach ($rows as $row) {
$result[] = $row['idsite'];
... | php | public function getSitesWithInvalidatedArchive($numericTable)
{
$rows = Db::fetchAll("SELECT DISTINCT idsite FROM `$numericTable` WHERE name LIKE 'done%' AND value = " . ArchiveWriter::DONE_INVALIDATED);
$result = array();
foreach ($rows as $row) {
$result[] = $row['idsite'];
... | [
"public",
"function",
"getSitesWithInvalidatedArchive",
"(",
"$",
"numericTable",
")",
"{",
"$",
"rows",
"=",
"Db",
"::",
"fetchAll",
"(",
"\"SELECT DISTINCT idsite FROM `$numericTable` WHERE name LIKE 'done%' AND value = \"",
".",
"ArchiveWriter",
"::",
"DONE_INVALIDATED",
"... | Returns the site IDs for invalidated archives in an archive table.
@param string $numericTable The numeric table to search through.
@return int[] | [
"Returns",
"the",
"site",
"IDs",
"for",
"invalidated",
"archives",
"in",
"an",
"archive",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/Model.php#L325-L334 |
208,841 | matomo-org/matomo | core/Db/Adapter/Mysqli.php | Mysqli.checkServerVersion | public function checkServerVersion()
{
$serverVersion = $this->getServerVersion();
$requiredVersion = Config::getInstance()->General['minimum_mysql_version'];
if (version_compare($serverVersion, $requiredVersion) === -1) {
throw new Exception(Piwik::translate('General_Exceptio... | php | public function checkServerVersion()
{
$serverVersion = $this->getServerVersion();
$requiredVersion = Config::getInstance()->General['minimum_mysql_version'];
if (version_compare($serverVersion, $requiredVersion) === -1) {
throw new Exception(Piwik::translate('General_Exceptio... | [
"public",
"function",
"checkServerVersion",
"(",
")",
"{",
"$",
"serverVersion",
"=",
"$",
"this",
"->",
"getServerVersion",
"(",
")",
";",
"$",
"requiredVersion",
"=",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'minimum_mysql_version'",
"... | Check MySQL version
@throws Exception | [
"Check",
"MySQL",
"version"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Mysqli.php#L91-L99 |
208,842 | matomo-org/matomo | core/Db/Adapter/Mysqli.php | Mysqli.exec | public function exec($sqlQuery)
{
$rc = mysqli_query($this->_connection, $sqlQuery);
$rowsAffected = mysqli_affected_rows($this->_connection);
if (!is_bool($rc)) {
mysqli_free_result($rc);
}
return $rowsAffected;
} | php | public function exec($sqlQuery)
{
$rc = mysqli_query($this->_connection, $sqlQuery);
$rowsAffected = mysqli_affected_rows($this->_connection);
if (!is_bool($rc)) {
mysqli_free_result($rc);
}
return $rowsAffected;
} | [
"public",
"function",
"exec",
"(",
"$",
"sqlQuery",
")",
"{",
"$",
"rc",
"=",
"mysqli_query",
"(",
"$",
"this",
"->",
"_connection",
",",
"$",
"sqlQuery",
")",
";",
"$",
"rowsAffected",
"=",
"mysqli_affected_rows",
"(",
"$",
"this",
"->",
"_connection",
... | Execute unprepared SQL query and throw away the result
Workaround some SQL statements not compatible with prepare().
See http://framework.zend.com/issues/browse/ZF-1398
@param string $sqlQuery
@return int Number of rows affected (SELECT/INSERT/UPDATE/DELETE) | [
"Execute",
"unprepared",
"SQL",
"query",
"and",
"throw",
"away",
"the",
"result"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Mysqli.php#L207-L215 |
208,843 | matomo-org/matomo | core/Db/Adapter/Mysqli.php | Mysqli.getClientVersion | public function getClientVersion()
{
$this->_connect();
$version = $this->_connection->server_version;
$major = (int)($version / 10000);
$minor = (int)($version % 10000 / 100);
$revision = (int)($version % 100);
return $major . '.' . $minor . '.' . $revision;... | php | public function getClientVersion()
{
$this->_connect();
$version = $this->_connection->server_version;
$major = (int)($version / 10000);
$minor = (int)($version % 10000 / 100);
$revision = (int)($version % 100);
return $major . '.' . $minor . '.' . $revision;... | [
"public",
"function",
"getClientVersion",
"(",
")",
"{",
"$",
"this",
"->",
"_connect",
"(",
")",
";",
"$",
"version",
"=",
"$",
"this",
"->",
"_connection",
"->",
"server_version",
";",
"$",
"major",
"=",
"(",
"int",
")",
"(",
"$",
"version",
"/",
"... | Get client version
@return string | [
"Get",
"client",
"version"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Adapter/Mysqli.php#L233-L243 |
208,844 | matomo-org/matomo | libs/Zend/Mail/Transport/File.php | Zend_Mail_Transport_File._sendMail | protected function _sendMail()
{
$file = $this->_path . DIRECTORY_SEPARATOR . call_user_func($this->_callback, $this);
if (!is_writable(dirname($file))) {
// require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception(sprintf(
'T... | php | protected function _sendMail()
{
$file = $this->_path . DIRECTORY_SEPARATOR . call_user_func($this->_callback, $this);
if (!is_writable(dirname($file))) {
// require_once 'Zend/Mail/Transport/Exception.php';
throw new Zend_Mail_Transport_Exception(sprintf(
'T... | [
"protected",
"function",
"_sendMail",
"(",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"_path",
".",
"DIRECTORY_SEPARATOR",
".",
"call_user_func",
"(",
"$",
"this",
"->",
"_callback",
",",
"$",
"this",
")",
";",
"if",
"(",
"!",
"is_writable",
"(",
"... | Saves e-mail message to a file
@return void
@throws Zend_Mail_Transport_Exception on not writable target directory
@throws Zend_Mail_Transport_Exception on file_put_contents() failure | [
"Saves",
"e",
"-",
"mail",
"message",
"to",
"a",
"file"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/File.php#L104-L122 |
208,845 | matomo-org/matomo | libs/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo._prepare | protected function _prepare($sql)
{
try {
$this->_stmt = $this->_adapter->getConnection()->prepare($sql);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
... | php | protected function _prepare($sql)
{
try {
$this->_stmt = $this->_adapter->getConnection()->prepare($sql);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
... | [
"protected",
"function",
"_prepare",
"(",
"$",
"sql",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"_stmt",
"=",
"$",
"this",
"->",
"_adapter",
"->",
"getConnection",
"(",
")",
"->",
"prepare",
"(",
"$",
"sql",
")",
";",
"}",
"catch",
"(",
"PDOException"... | Prepare a string SQL statement and create a statement object.
@param string $sql
@return void
@throws Zend_Db_Statement_Exception | [
"Prepare",
"a",
"string",
"SQL",
"statement",
"and",
"create",
"a",
"statement",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L55-L63 |
208,846 | matomo-org/matomo | libs/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo.columnCount | public function columnCount()
{
try {
return $this->_stmt->columnCount();
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | php | public function columnCount()
{
try {
return $this->_stmt->columnCount();
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | [
"public",
"function",
"columnCount",
"(",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"columnCount",
"(",
")",
";",
"}",
"catch",
"(",
"PDOException",
"$",
"e",
")",
"{",
"// require_once 'Zend/Db/Statement/Exception.php';",
"throw",
"new... | Returns the number of columns in the result set.
Returns null if the statement has no result set metadata.
@return int The number of columns.
@throws Zend_Db_Statement_Exception | [
"Returns",
"the",
"number",
"of",
"columns",
"in",
"the",
"result",
"set",
".",
"Returns",
"null",
"if",
"the",
"statement",
"has",
"no",
"result",
"set",
"metadata",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L173-L181 |
208,847 | matomo-org/matomo | libs/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo.getAttribute | public function getAttribute($key)
{
try {
return $this->_stmt->getAttribute($key);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | php | public function getAttribute($key)
{
try {
return $this->_stmt->getAttribute($key);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"getAttribute",
"(",
"$",
"key",
")",
";",
"}",
"catch",
"(",
"PDOException",
"$",
"e",
")",
"{",
"// require_once 'Zend/Db/Statement/E... | Retrieve a statement attribute.
@param integer $key Attribute name.
@return mixed Attribute value.
@throws Zend_Db_Statement_Exception | [
"Retrieve",
"a",
"statement",
"attribute",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L340-L348 |
208,848 | matomo-org/matomo | libs/Zend/Db/Statement/Pdo.php | Zend_Db_Statement_Pdo.setAttribute | public function setAttribute($key, $val)
{
try {
return $this->_stmt->setAttribute($key, $val);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
... | php | public function setAttribute($key, $val)
{
try {
return $this->_stmt->setAttribute($key, $val);
} catch (PDOException $e) {
// require_once 'Zend/Db/Statement/Exception.php';
throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
}
... | [
"public",
"function",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"val",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"_stmt",
"->",
"setAttribute",
"(",
"$",
"key",
",",
"$",
"val",
")",
";",
"}",
"catch",
"(",
"PDOException",
"$",
"e",
")",
... | Set a statement attribute.
@param string $key Attribute name.
@param mixed $val Attribute value.
@return bool
@throws Zend_Db_Statement_Exception | [
"Set",
"a",
"statement",
"attribute",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement/Pdo.php#L411-L419 |
208,849 | matomo-org/matomo | core/Archive/ArchiveInvalidator.php | ArchiveInvalidator.buildRememberArchivedReportIdProcessSafe | private function buildRememberArchivedReportIdProcessSafe($idSite, $date)
{
$id = $this->buildRememberArchivedReportIdForSiteAndDate($idSite, $date);
$id .= '_' . getmypid();
return $id;
} | php | private function buildRememberArchivedReportIdProcessSafe($idSite, $date)
{
$id = $this->buildRememberArchivedReportIdForSiteAndDate($idSite, $date);
$id .= '_' . getmypid();
return $id;
} | [
"private",
"function",
"buildRememberArchivedReportIdProcessSafe",
"(",
"$",
"idSite",
",",
"$",
"date",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"buildRememberArchivedReportIdForSiteAndDate",
"(",
"$",
"idSite",
",",
"$",
"date",
")",
";",
"$",
"id",
".="... | This version is multi process safe on the insert of a new date to invalidate. | [
"This",
"version",
"is",
"multi",
"process",
"safe",
"on",
"the",
"insert",
"of",
"a",
"new",
"date",
"to",
"invalidate",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchiveInvalidator.php#L122-L127 |
208,850 | matomo-org/matomo | core/Archive/ArchiveInvalidator.php | ArchiveInvalidator.getDatesByYearMonthAndPeriodType | private function getDatesByYearMonthAndPeriodType($dates)
{
$result = array();
foreach ($dates as $date) {
$yearMonth = ArchiveTableCreator::getTableMonthFromDate($date);
$result[$yearMonth][null][] = $date->toString();
// since we're removing all periods, we mus... | php | private function getDatesByYearMonthAndPeriodType($dates)
{
$result = array();
foreach ($dates as $date) {
$yearMonth = ArchiveTableCreator::getTableMonthFromDate($date);
$result[$yearMonth][null][] = $date->toString();
// since we're removing all periods, we mus... | [
"private",
"function",
"getDatesByYearMonthAndPeriodType",
"(",
"$",
"dates",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"dates",
"as",
"$",
"date",
")",
"{",
"$",
"yearMonth",
"=",
"ArchiveTableCreator",
"::",
"getTableMonthF... | Called when deleting all periods.
@param Date[] $dates
@return string[][][] | [
"Called",
"when",
"deleting",
"all",
"periods",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Archive/ArchiveInvalidator.php#L278-L291 |
208,851 | matomo-org/matomo | plugins/SitesManager/SiteUrls.php | SiteUrls.groupUrlsByHost | public function groupUrlsByHost($siteUrls)
{
if (empty($siteUrls)) {
return array();
}
$allUrls = array();
foreach ($siteUrls as $idSite => $urls) {
$idSite = (int) $idSite;
foreach ($urls as $url) {
$urlParsed = @parse_url($url);... | php | public function groupUrlsByHost($siteUrls)
{
if (empty($siteUrls)) {
return array();
}
$allUrls = array();
foreach ($siteUrls as $idSite => $urls) {
$idSite = (int) $idSite;
foreach ($urls as $url) {
$urlParsed = @parse_url($url);... | [
"public",
"function",
"groupUrlsByHost",
"(",
"$",
"siteUrls",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"siteUrls",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"allUrls",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"siteUrls",
"... | Groups all URLs by host, path and idsite.
@param array $urls An array containing URLs by idsite,
eg array(array($idSite = 1 => array('apache.piwik', 'apache2.piwik'), 2 => array(), ...))
as returned by {@link getAllCachedSiteUrls()} and {@link getAllSiteUrls}
@return array All urls grouped by host => path => idSites.... | [
"Groups",
"all",
"URLs",
"by",
"host",
"path",
"and",
"idsite",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/SitesManager/SiteUrls.php#L43-L83 |
208,852 | matomo-org/matomo | libs/HTML/QuickForm2/Rule/MaxFileSize.php | HTML_QuickForm2_Rule_MaxFileSize.setConfig | public function setConfig($config)
{
if (0 >= $config) {
throw new HTML_QuickForm2_InvalidArgumentException(
'MaxFileSize Rule requires a positive size limit, ' .
preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
);
}
ret... | php | public function setConfig($config)
{
if (0 >= $config) {
throw new HTML_QuickForm2_InvalidArgumentException(
'MaxFileSize Rule requires a positive size limit, ' .
preg_replace('/\s+/', ' ', var_export($config, true)) . ' given'
);
}
ret... | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"0",
">=",
"$",
"config",
")",
"{",
"throw",
"new",
"HTML_QuickForm2_InvalidArgumentException",
"(",
"'MaxFileSize Rule requires a positive size limit, '",
".",
"preg_replace",
"(",
"'/\\s+/'"... | Sets maximum allowed file size
@param int Maximum allowed size
@return HTML_QuickForm2_Rule
@throws HTML_QuickForm2_InvalidArgumentException if a bogus size limit was provided | [
"Sets",
"maximum",
"allowed",
"file",
"size"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Rule/MaxFileSize.php#L95-L104 |
208,853 | matomo-org/matomo | core/Nonce.php | Nonce.getNonce | public static function getNonce($id, $ttl = 600)
{
// save session-dependent nonce
$ns = new SessionNamespace($id);
$nonce = $ns->nonce;
// re-use an unexpired nonce (a small deviation from the "used only once" principle, so long as we do not reset the expiration)
// to hand... | php | public static function getNonce($id, $ttl = 600)
{
// save session-dependent nonce
$ns = new SessionNamespace($id);
$nonce = $ns->nonce;
// re-use an unexpired nonce (a small deviation from the "used only once" principle, so long as we do not reset the expiration)
// to hand... | [
"public",
"static",
"function",
"getNonce",
"(",
"$",
"id",
",",
"$",
"ttl",
"=",
"600",
")",
"{",
"// save session-dependent nonce",
"$",
"ns",
"=",
"new",
"SessionNamespace",
"(",
"$",
"id",
")",
";",
"$",
"nonce",
"=",
"$",
"ns",
"->",
"nonce",
";",... | Returns an existing nonce by ID. If none exists, a new nonce will be generated.
@param string $id Unique id to avoid namespace conflicts, e.g., `'ModuleName.ActionName'`.
@param int $ttl Optional time-to-live in seconds; default is 5 minutes. (ie, in 5 minutes,
the nonce will no longer be valid).
@return string | [
"Returns",
"an",
"existing",
"nonce",
"by",
"ID",
".",
"If",
"none",
"exists",
"a",
"new",
"nonce",
"will",
"be",
"generated",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Nonce.php#L36-L55 |
208,854 | matomo-org/matomo | core/Nonce.php | Nonce.verifyNonce | public static function verifyNonce($id, $cnonce)
{
$ns = new SessionNamespace($id);
$nonce = $ns->nonce;
// validate token
if (empty($cnonce) || $cnonce !== $nonce) {
return false;
}
// validate referrer
$referrer = Url::getReferrer();
if... | php | public static function verifyNonce($id, $cnonce)
{
$ns = new SessionNamespace($id);
$nonce = $ns->nonce;
// validate token
if (empty($cnonce) || $cnonce !== $nonce) {
return false;
}
// validate referrer
$referrer = Url::getReferrer();
if... | [
"public",
"static",
"function",
"verifyNonce",
"(",
"$",
"id",
",",
"$",
"cnonce",
")",
"{",
"$",
"ns",
"=",
"new",
"SessionNamespace",
"(",
"$",
"id",
")",
";",
"$",
"nonce",
"=",
"$",
"ns",
"->",
"nonce",
";",
"// validate token",
"if",
"(",
"empty... | Returns if a nonce is valid and comes from a valid request.
A nonce is valid if it matches the current nonce and if the current nonce
has not expired.
The request is valid if the referrer is a local URL (see {@link Url::isLocalUrl()})
and if the HTTP origin is valid (see {@link getAcceptableOrigins()}).
@param strin... | [
"Returns",
"if",
"a",
"nonce",
"is",
"valid",
"and",
"comes",
"from",
"a",
"valid",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Nonce.php#L70-L96 |
208,855 | matomo-org/matomo | core/Nonce.php | Nonce.checkNonce | public static function checkNonce($nonceName, $nonce = null)
{
if ($nonce === null) {
$nonce = Common::getRequestVar('nonce', null, 'string');
}
if (!self::verifyNonce($nonceName, $nonce)) {
throw new \Exception(Piwik::translate('General_ExceptionNonceMismatch'));
... | php | public static function checkNonce($nonceName, $nonce = null)
{
if ($nonce === null) {
$nonce = Common::getRequestVar('nonce', null, 'string');
}
if (!self::verifyNonce($nonceName, $nonce)) {
throw new \Exception(Piwik::translate('General_ExceptionNonceMismatch'));
... | [
"public",
"static",
"function",
"checkNonce",
"(",
"$",
"nonceName",
",",
"$",
"nonce",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"nonce",
"===",
"null",
")",
"{",
"$",
"nonce",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'nonce'",
",",
"null",
",",
"'s... | Verifies and discards a nonce.
@param string $nonceName The nonce's unique ID. See {@link getNonce()}.
@param string|null $nonce The nonce from the client. If `null`, the value from the
**nonce** query parameter is used.
@throws \Exception if the nonce is invalid. See {@link verifyNonce()}. | [
"Verifies",
"and",
"discards",
"a",
"nonce",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Nonce.php#L165-L176 |
208,856 | matomo-org/matomo | plugins/Actions/API.php | API.getEntryPageUrls | public function getEntryPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
$this->filte... | php | public function getEntryPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
$this->filte... | [
"public",
"function",
"getEntryPageUrls",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"expanded",
"=",
"false",
",",
"$",
"idSubtable",
"=",
"false",
",",
"$",
"flat",
"=",
"false",
")",
"{",... | Returns a DataTable with analytics information for every unique entry page URL, for
the specified site, period & segment. | [
"Returns",
"a",
"DataTable",
"with",
"analytics",
"information",
"for",
"every",
"unique",
"entry",
"page",
"URL",
"for",
"the",
"specified",
"site",
"period",
"&",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L170-L177 |
208,857 | matomo-org/matomo | plugins/Actions/API.php | API.getExitPageUrls | public function getExitPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
$this->filter... | php | public function getExitPageUrls($idSite, $period, $date, $segment = false, $expanded = false, $idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
$this->filter... | [
"public",
"function",
"getExitPageUrls",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"expanded",
"=",
"false",
",",
"$",
"idSubtable",
"=",
"false",
",",
"$",
"flat",
"=",
"false",
")",
"{",
... | Returns a DataTable with analytics information for every unique exit page URL, for
the specified site, period & segment. | [
"Returns",
"a",
"DataTable",
"with",
"analytics",
"information",
"for",
"every",
"unique",
"exit",
"page",
"URL",
"for",
"the",
"specified",
"site",
"period",
"&",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L183-L190 |
208,858 | matomo-org/matomo | plugins/Actions/API.php | API.getEntryPageTitles | public function getEntryPageTitles($idSite, $period, $date, $segment = false, $expanded = false,
$idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSu... | php | public function getEntryPageTitles($idSite, $period, $date, $segment = false, $expanded = false,
$idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSu... | [
"public",
"function",
"getEntryPageTitles",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"expanded",
"=",
"false",
",",
"$",
"idSubtable",
"=",
"false",
",",
"$",
"flat",
"=",
"false",
")",
"{... | Returns a DataTable with analytics information for every unique entry page title
for the given site, time period & segment. | [
"Returns",
"a",
"DataTable",
"with",
"analytics",
"information",
"for",
"every",
"unique",
"entry",
"page",
"title",
"for",
"the",
"given",
"site",
"time",
"period",
"&",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L218-L226 |
208,859 | matomo-org/matomo | plugins/Actions/API.php | API.getExitPageTitles | public function getExitPageTitles($idSite, $period, $date, $segment = false, $expanded = false,
$idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSubt... | php | public function getExitPageTitles($idSite, $period, $date, $segment = false, $expanded = false,
$idSubtable = false, $flat = false)
{
Piwik::checkUserHasViewAccess($idSite);
$dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSubt... | [
"public",
"function",
"getExitPageTitles",
"(",
"$",
"idSite",
",",
"$",
"period",
",",
"$",
"date",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"expanded",
"=",
"false",
",",
"$",
"idSubtable",
"=",
"false",
",",
"$",
"flat",
"=",
"false",
")",
"{"... | Returns a DataTable with analytics information for every unique exit page title
for the given site, time period & segment. | [
"Returns",
"a",
"DataTable",
"with",
"analytics",
"information",
"for",
"every",
"unique",
"exit",
"page",
"title",
"for",
"the",
"given",
"site",
"time",
"period",
"&",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L232-L240 |
208,860 | matomo-org/matomo | plugins/Actions/API.php | API.getFilterPageDatatableSearch | protected function getFilterPageDatatableSearch($callBackParameters, $search, $actionType, $table = false,
$searchTree = false)
{
if ($searchTree === false) {
// build the query parts that are searched inside the tree
if ($actionTyp... | php | protected function getFilterPageDatatableSearch($callBackParameters, $search, $actionType, $table = false,
$searchTree = false)
{
if ($searchTree === false) {
// build the query parts that are searched inside the tree
if ($actionTyp... | [
"protected",
"function",
"getFilterPageDatatableSearch",
"(",
"$",
"callBackParameters",
",",
"$",
"search",
",",
"$",
"actionType",
",",
"$",
"table",
"=",
"false",
",",
"$",
"searchTree",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"searchTree",
"===",
"false"... | Will search in the DataTable for a Label matching the searched string
and return only the matching row, or an empty datatable | [
"Will",
"search",
"in",
"the",
"DataTable",
"for",
"a",
"Label",
"matching",
"the",
"searched",
"string",
"and",
"return",
"only",
"the",
"matching",
"row",
"or",
"an",
"empty",
"datatable"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L398-L438 |
208,861 | matomo-org/matomo | plugins/Actions/API.php | API.doFilterPageDatatableSearch | protected function doFilterPageDatatableSearch($callBackParameters, $table, $searchTree)
{
// filter a data table array
if ($table instanceof DataTable\Map) {
foreach ($table->getDataTables() as $subTable) {
$filteredSubTable = $this->doFilterPageDatatableSearch($callBack... | php | protected function doFilterPageDatatableSearch($callBackParameters, $table, $searchTree)
{
// filter a data table array
if ($table instanceof DataTable\Map) {
foreach ($table->getDataTables() as $subTable) {
$filteredSubTable = $this->doFilterPageDatatableSearch($callBack... | [
"protected",
"function",
"doFilterPageDatatableSearch",
"(",
"$",
"callBackParameters",
",",
"$",
"table",
",",
"$",
"searchTree",
")",
"{",
"// filter a data table array",
"if",
"(",
"$",
"table",
"instanceof",
"DataTable",
"\\",
"Map",
")",
"{",
"foreach",
"(",
... | This looks very similar to LabelFilter.php should it be refactored somehow? FIXME | [
"This",
"looks",
"very",
"similar",
"to",
"LabelFilter",
".",
"php",
"should",
"it",
"be",
"refactored",
"somehow?",
"FIXME"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Actions/API.php#L443-L497 |
208,862 | matomo-org/matomo | plugins/ExampleAPI/API.php | API.getSum | public function getSum($a = 0, $b = 0)
{
if (!is_numeric($a) || !is_numeric($b)) {
throw new \Exception('Given parameters need to be numeric');
}
return (float)($a + $b);
} | php | public function getSum($a = 0, $b = 0)
{
if (!is_numeric($a) || !is_numeric($b)) {
throw new \Exception('Given parameters need to be numeric');
}
return (float)($a + $b);
} | [
"public",
"function",
"getSum",
"(",
"$",
"a",
"=",
"0",
",",
"$",
"b",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"a",
")",
"||",
"!",
"is_numeric",
"(",
"$",
"b",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Giv... | Sums two floats and returns the result.
The paramaters are set automatically from the GET request
when the API function is called. You can also use default values
as shown in this example.
@param float|int $a
@param float|int $b
@return float | [
"Sums",
"two",
"floats",
"and",
"returns",
"the",
"result",
".",
"The",
"paramaters",
"are",
"set",
"automatically",
"from",
"the",
"GET",
"request",
"when",
"the",
"API",
"function",
"is",
"called",
".",
"You",
"can",
"also",
"use",
"default",
"values",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExampleAPI/API.php#L77-L84 |
208,863 | matomo-org/matomo | plugins/ExampleAPI/API.php | API.getCompetitionDatatable | public function getCompetitionDatatable()
{
$dataTable = new DataTable();
$row1 = new Row();
$row1->setColumns(array('name' => 'piwik', 'license' => 'GPL'));
// Rows Metadata is useful to store non stats data for example (logos, urls, etc.)
// When printed out, they are sim... | php | public function getCompetitionDatatable()
{
$dataTable = new DataTable();
$row1 = new Row();
$row1->setColumns(array('name' => 'piwik', 'license' => 'GPL'));
// Rows Metadata is useful to store non stats data for example (logos, urls, etc.)
// When printed out, they are sim... | [
"public",
"function",
"getCompetitionDatatable",
"(",
")",
"{",
"$",
"dataTable",
"=",
"new",
"DataTable",
"(",
")",
";",
"$",
"row1",
"=",
"new",
"Row",
"(",
")",
";",
"$",
"row1",
"->",
"setColumns",
"(",
"array",
"(",
"'name'",
"=>",
"'piwik'",
",",... | Returns a custom data table.
This data table will be converted to all available formats
when requested in the API request.
@return DataTable | [
"Returns",
"a",
"custom",
"data",
"table",
".",
"This",
"data",
"table",
"will",
"be",
"converted",
"to",
"all",
"available",
"formats",
"when",
"requested",
"in",
"the",
"API",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExampleAPI/API.php#L115-L130 |
208,864 | matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.getKnownSegmentsToArchive | public static function getKnownSegmentsToArchive()
{
$cacheId = 'KnownSegmentsToArchive';
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = Config::getInstance()->Segments;
$segment... | php | public static function getKnownSegmentsToArchive()
{
$cacheId = 'KnownSegmentsToArchive';
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = Config::getInstance()->Segments;
$segment... | [
"public",
"static",
"function",
"getKnownSegmentsToArchive",
"(",
")",
"{",
"$",
"cacheId",
"=",
"'KnownSegmentsToArchive'",
";",
"$",
"cache",
"=",
"PiwikCache",
"::",
"getTransientCache",
"(",
")",
";",
"if",
"(",
"$",
"cache",
"->",
"contains",
"(",
"$",
... | Returns every stored segment to pre-process for each site during cron archiving.
@return array The list of stored segments that apply to all sites. | [
"Returns",
"every",
"stored",
"segment",
"to",
"pre",
"-",
"process",
"for",
"each",
"site",
"during",
"cron",
"archiving",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L63-L107 |
208,865 | matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.getKnownSegmentsToArchiveForSite | public static function getKnownSegmentsToArchiveForSite($idSite)
{
$cacheId = 'KnownSegmentsToArchiveForSite' . $idSite;
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = array();
/... | php | public static function getKnownSegmentsToArchiveForSite($idSite)
{
$cacheId = 'KnownSegmentsToArchiveForSite' . $idSite;
$cache = PiwikCache::getTransientCache();
if ($cache->contains($cacheId)) {
return $cache->fetch($cacheId);
}
$segments = array();
/... | [
"public",
"static",
"function",
"getKnownSegmentsToArchiveForSite",
"(",
"$",
"idSite",
")",
"{",
"$",
"cacheId",
"=",
"'KnownSegmentsToArchiveForSite'",
".",
"$",
"idSite",
";",
"$",
"cache",
"=",
"PiwikCache",
"::",
"getTransientCache",
"(",
")",
";",
"if",
"(... | Returns the list of stored segments to pre-process for an individual site when executing
cron archiving.
@param int $idSite The ID of the site to get stored segments for.
@return string[] The list of stored segments that apply to the requested site. | [
"Returns",
"the",
"list",
"of",
"stored",
"segments",
"to",
"pre",
"-",
"process",
"for",
"an",
"individual",
"site",
"when",
"executing",
"cron",
"archiving",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L116-L158 |
208,866 | matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.getWebsitesCountToDisplay | public static function getWebsitesCountToDisplay()
{
$count = max(Config::getInstance()->General['site_selector_max_sites'],
Config::getInstance()->General['autocomplete_min_sites']);
return (int)$count;
} | php | public static function getWebsitesCountToDisplay()
{
$count = max(Config::getInstance()->General['site_selector_max_sites'],
Config::getInstance()->General['autocomplete_min_sites']);
return (int)$count;
} | [
"public",
"static",
"function",
"getWebsitesCountToDisplay",
"(",
")",
"{",
"$",
"count",
"=",
"max",
"(",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'site_selector_max_sites'",
"]",
",",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"G... | Number of websites to show in the Website selector
@return int | [
"Number",
"of",
"websites",
"to",
"show",
"in",
"the",
"Website",
"selector"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L165-L170 |
208,867 | matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.isUniqueVisitorsEnabled | public static function isUniqueVisitorsEnabled($periodLabel)
{
$generalSettings = Config::getInstance()->General;
$settingName = "enable_processing_unique_visitors_$periodLabel";
$result = !empty($generalSettings[$settingName]) && $generalSettings[$settingName] == 1;
// check enabl... | php | public static function isUniqueVisitorsEnabled($periodLabel)
{
$generalSettings = Config::getInstance()->General;
$settingName = "enable_processing_unique_visitors_$periodLabel";
$result = !empty($generalSettings[$settingName]) && $generalSettings[$settingName] == 1;
// check enabl... | [
"public",
"static",
"function",
"isUniqueVisitorsEnabled",
"(",
"$",
"periodLabel",
")",
"{",
"$",
"generalSettings",
"=",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
";",
"$",
"settingName",
"=",
"\"enable_processing_unique_visitors_$periodLabel\"",
";"... | Returns true if unique visitors should be processed for the given period type.
Unique visitor processing is controlled by the `[General] enable_processing_unique_visitors_...`
INI config options. By default, unique visitors are processed only for day/week/month periods.
@param string $periodLabel `"day"`, `"week"`, `... | [
"Returns",
"true",
"if",
"unique",
"visitors",
"should",
"be",
"processed",
"for",
"the",
"given",
"period",
"type",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L332-L347 |
208,868 | matomo-org/matomo | core/SettingsPiwik.php | SettingsPiwik.checkPiwikServerWorking | public static function checkPiwikServerWorking($piwikServerUrl, $acceptInvalidSSLCertificates = false)
{
// Now testing if the webserver is running
try {
$fetched = Http::sendHttpRequestBy('curl',
$piwikServerUrl,
... | php | public static function checkPiwikServerWorking($piwikServerUrl, $acceptInvalidSSLCertificates = false)
{
// Now testing if the webserver is running
try {
$fetched = Http::sendHttpRequestBy('curl',
$piwikServerUrl,
... | [
"public",
"static",
"function",
"checkPiwikServerWorking",
"(",
"$",
"piwikServerUrl",
",",
"$",
"acceptInvalidSSLCertificates",
"=",
"false",
")",
"{",
"// Now testing if the webserver is running",
"try",
"{",
"$",
"fetched",
"=",
"Http",
"::",
"sendHttpRequestBy",
"("... | Returns true if the Piwik server appears to be working.
If the Piwik server is in an error state (eg. some directories are not writable and Piwik displays error message),
or if the Piwik server is "offline",
this will return false..
@param $piwikServerUrl
@param bool $acceptInvalidSSLCertificates
@throws Exception
@r... | [
"Returns",
"true",
"if",
"the",
"Piwik",
"server",
"appears",
"to",
"be",
"working",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/SettingsPiwik.php#L373-L411 |
208,869 | matomo-org/matomo | core/Plugin/LogTablesProvider.php | LogTablesProvider.getLogTable | public function getLogTable($tableNameWithoutPrefix)
{
foreach ($this->getAllLogTables() as $table) {
if ($table->getName() === $tableNameWithoutPrefix) {
return $table;
}
}
} | php | public function getLogTable($tableNameWithoutPrefix)
{
foreach ($this->getAllLogTables() as $table) {
if ($table->getName() === $tableNameWithoutPrefix) {
return $table;
}
}
} | [
"public",
"function",
"getLogTable",
"(",
"$",
"tableNameWithoutPrefix",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllLogTables",
"(",
")",
"as",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"table",
"->",
"getName",
"(",
")",
"===",
"$",
"tableNameWit... | Get an instance of a specific log table if such a log table exists.
@param string $tableNameWithoutPrefix eg "log_visit"
@return LogTable|null | [
"Get",
"an",
"instance",
"of",
"a",
"specific",
"log",
"table",
"if",
"such",
"a",
"log",
"table",
"exists",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/LogTablesProvider.php#L38-L45 |
208,870 | matomo-org/matomo | core/Plugin/LogTablesProvider.php | LogTablesProvider.getAllLogTables | public function getAllLogTables()
{
if (!isset($this->tablesCache)) {
$tables = $this->pluginManager->findMultipleComponents('Tracker', 'Piwik\\Tracker\\LogTable');
$logTables = array();
/**
* Only used for tests. Triggered to add custom log tables which ar... | php | public function getAllLogTables()
{
if (!isset($this->tablesCache)) {
$tables = $this->pluginManager->findMultipleComponents('Tracker', 'Piwik\\Tracker\\LogTable');
$logTables = array();
/**
* Only used for tests. Triggered to add custom log tables which ar... | [
"public",
"function",
"getAllLogTables",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"tablesCache",
")",
")",
"{",
"$",
"tables",
"=",
"$",
"this",
"->",
"pluginManager",
"->",
"findMultipleComponents",
"(",
"'Tracker'",
",",
"'Piwik\\\... | Get all log table instances defined by any activated and loaded plugin. The returned tables are not sorted in
any order.
@return LogTable[] | [
"Get",
"all",
"log",
"table",
"instances",
"defined",
"by",
"any",
"activated",
"and",
"loaded",
"plugin",
".",
"The",
"returned",
"tables",
"are",
"not",
"sorted",
"in",
"any",
"order",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/LogTablesProvider.php#L52-L86 |
208,871 | matomo-org/matomo | plugins/ExampleTracker/Columns/ExampleVisitDimension.php | ExampleVisitDimension.onExistingVisit | public function onExistingVisit(Request $request, Visitor $visitor, $action)
{
if (empty($action)) {
return false; // Do not change an already persisted value
}
return $visitor->getVisitorColumn($this->columnName) + 1;
} | php | public function onExistingVisit(Request $request, Visitor $visitor, $action)
{
if (empty($action)) {
return false; // Do not change an already persisted value
}
return $visitor->getVisitorColumn($this->columnName) + 1;
} | [
"public",
"function",
"onExistingVisit",
"(",
"Request",
"$",
"request",
",",
"Visitor",
"$",
"visitor",
",",
"$",
"action",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"action",
")",
")",
"{",
"return",
"false",
";",
"// Do not change an already persisted value",... | The onExistingVisit method is triggered when a visitor was recognized meaning it is not a new visitor.
If you want you can overwrite any previous value set by the event onNewVisit. By returning boolean false no value
will be updated. If you do not want to perform any action on a new visit you can just remove this metho... | [
"The",
"onExistingVisit",
"method",
"is",
"triggered",
"when",
"a",
"visitor",
"was",
"recognized",
"meaning",
"it",
"is",
"not",
"a",
"new",
"visitor",
".",
"If",
"you",
"want",
"you",
"can",
"overwrite",
"any",
"previous",
"value",
"set",
"by",
"the",
"e... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ExampleTracker/Columns/ExampleVisitDimension.php#L101-L108 |
208,872 | matomo-org/matomo | plugins/Live/ProfileSummaryProvider.php | ProfileSummaryProvider.getAllInstances | public function getAllInstances()
{
$cacheId = CacheId::pluginAware('ProfileSummaries');
$cache = Cache::getTransientCache();
if (!$cache->contains($cacheId)) {
$instances = [];
/**
* Triggered to add new live profile summaries.
*
... | php | public function getAllInstances()
{
$cacheId = CacheId::pluginAware('ProfileSummaries');
$cache = Cache::getTransientCache();
if (!$cache->contains($cacheId)) {
$instances = [];
/**
* Triggered to add new live profile summaries.
*
... | [
"public",
"function",
"getAllInstances",
"(",
")",
"{",
"$",
"cacheId",
"=",
"CacheId",
"::",
"pluginAware",
"(",
"'ProfileSummaries'",
")",
";",
"$",
"cache",
"=",
"Cache",
"::",
"getTransientCache",
"(",
")",
";",
"if",
"(",
"!",
"$",
"cache",
"->",
"c... | Returns all available profile summaries
@return ProfileSummaryAbstract[]
@throws \Exception | [
"Returns",
"all",
"available",
"profile",
"summaries"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/ProfileSummaryProvider.php#L38-L86 |
208,873 | matomo-org/matomo | core/Intl/Data/Provider/CurrencyDataProvider.php | CurrencyDataProvider.getCurrencyList | public function getCurrencyList()
{
if ($this->currencyList === null) {
$this->currencyList = require __DIR__ . '/../Resources/currencies.php';
$custom = Config::getInstance()->General['currencies'];
foreach ($custom as $code => $name) {
$this->currencyLi... | php | public function getCurrencyList()
{
if ($this->currencyList === null) {
$this->currencyList = require __DIR__ . '/../Resources/currencies.php';
$custom = Config::getInstance()->General['currencies'];
foreach ($custom as $code => $name) {
$this->currencyLi... | [
"public",
"function",
"getCurrencyList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currencyList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"currencyList",
"=",
"require",
"__DIR__",
".",
"'/../Resources/currencies.php'",
";",
"$",
"custom",
"=",
"Conf... | Returns the list of all known currency symbols.
@return array An array mapping currency codes to their respective currency symbols
and a description, eg, `array('USD' => array('$', 'US dollar'))`.
@api | [
"Returns",
"the",
"list",
"of",
"all",
"known",
"currency",
"symbols",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Intl/Data/Provider/CurrencyDataProvider.php#L27-L39 |
208,874 | matomo-org/matomo | libs/Zend/Mime/Decode.php | Zend_Mime_Decode.splitMessageStruct | public static function splitMessageStruct($message, $boundary, $EOL = Zend_Mime::LINEEND)
{
$parts = self::splitMime($message, $boundary);
if (count($parts) <= 0) {
return null;
}
$result = array();
foreach ($parts as $part) {
self::splitMessage($part,... | php | public static function splitMessageStruct($message, $boundary, $EOL = Zend_Mime::LINEEND)
{
$parts = self::splitMime($message, $boundary);
if (count($parts) <= 0) {
return null;
}
$result = array();
foreach ($parts as $part) {
self::splitMessage($part,... | [
"public",
"static",
"function",
"splitMessageStruct",
"(",
"$",
"message",
",",
"$",
"boundary",
",",
"$",
"EOL",
"=",
"Zend_Mime",
"::",
"LINEEND",
")",
"{",
"$",
"parts",
"=",
"self",
"::",
"splitMime",
"(",
"$",
"message",
",",
"$",
"boundary",
")",
... | decodes a mime encoded String and returns a
struct of parts with header and body
@param string $message raw message content
@param string $boundary boundary as found in content-type
@param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
@return array|null parts as array('header' => array(name => val... | [
"decodes",
"a",
"mime",
"encoded",
"String",
"and",
"returns",
"a",
"struct",
"of",
"parts",
"with",
"header",
"and",
"body"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Decode.php#L90-L103 |
208,875 | matomo-org/matomo | libs/Zend/Mime/Decode.php | Zend_Mime_Decode.splitHeaderField | public static function splitHeaderField($field, $wantedPart = null, $firstName = 0)
{
$wantedPart = strtolower($wantedPart);
$firstName = strtolower($firstName);
// special case - a bit optimized
if ($firstName === $wantedPart) {
$field = strtok($field, ';');
... | php | public static function splitHeaderField($field, $wantedPart = null, $firstName = 0)
{
$wantedPart = strtolower($wantedPart);
$firstName = strtolower($firstName);
// special case - a bit optimized
if ($firstName === $wantedPart) {
$field = strtok($field, ';');
... | [
"public",
"static",
"function",
"splitHeaderField",
"(",
"$",
"field",
",",
"$",
"wantedPart",
"=",
"null",
",",
"$",
"firstName",
"=",
"0",
")",
"{",
"$",
"wantedPart",
"=",
"strtolower",
"(",
"$",
"wantedPart",
")",
";",
"$",
"firstName",
"=",
"strtolo... | split a header field like content type in its different parts
@param string $type header field
@param string $wantedPart the wanted part, else an array with all parts is returned
@param string $firstName key name for the first part
@return string|array wanted part or all parts as array($firstName => firstPar... | [
"split",
"a",
"header",
"field",
"like",
"content",
"type",
"in",
"its",
"different",
"parts"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mime/Decode.php#L190-L230 |
208,876 | matomo-org/matomo | plugins/UserCountry/Commands/AttributeHistoricalDataWithLocations.php | AttributeHistoricalDataWithLocations.onVisitProcessed | public function onVisitProcessed(OutputInterface $output)
{
++$this->processed;
$percent = ceil($this->processed / $this->amountOfVisits * 100);
if ($percent > $this->processedPercent
&& $percent % $this->percentStep === 0
) {
$output->writeln(sprintf('%d%% ... | php | public function onVisitProcessed(OutputInterface $output)
{
++$this->processed;
$percent = ceil($this->processed / $this->amountOfVisits * 100);
if ($percent > $this->processedPercent
&& $percent % $this->percentStep === 0
) {
$output->writeln(sprintf('%d%% ... | [
"public",
"function",
"onVisitProcessed",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"++",
"$",
"this",
"->",
"processed",
";",
"$",
"percent",
"=",
"ceil",
"(",
"$",
"this",
"->",
"processed",
"/",
"$",
"this",
"->",
"amountOfVisits",
"*",
"100",
... | Print information about progress.
@param OutputInterface $output | [
"Print",
"information",
"about",
"progress",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Commands/AttributeHistoricalDataWithLocations.php#L148-L161 |
208,877 | matomo-org/matomo | core/ReportRenderer/Pdf.php | Pdf.paintMessage | private function paintMessage($message)
{
$this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportSimpleFontSize);
$this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
$message = $this->formatText($message);
... | php | private function paintMessage($message)
{
$this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportSimpleFontSize);
$this->TCPDF->SetTextColor($this->reportTextColor[0], $this->reportTextColor[1], $this->reportTextColor[2]);
$message = $this->formatText($message);
... | [
"private",
"function",
"paintMessage",
"(",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"TCPDF",
"->",
"SetFont",
"(",
"$",
"this",
"->",
"reportFont",
",",
"$",
"this",
"->",
"reportFontStyle",
",",
"$",
"this",
"->",
"reportSimpleFontSize",
")",
";",
... | Prints a message
@param string $message
@return void | [
"Prints",
"a",
"message"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/ReportRenderer/Pdf.php#L535-L542 |
208,878 | matomo-org/matomo | plugins/UsersManager/API.php | API.getAvailableRoles | public function getAvailableRoles()
{
Piwik::checkUserHasSomeAdminAccess();
$response = array();
foreach ($this->roleProvider->getAllRoles() as $role) {
$response[] = array(
'id' => $role->getId(),
'name' => $role->getName(),
'des... | php | public function getAvailableRoles()
{
Piwik::checkUserHasSomeAdminAccess();
$response = array();
foreach ($this->roleProvider->getAllRoles() as $role) {
$response[] = array(
'id' => $role->getId(),
'name' => $role->getName(),
'des... | [
"public",
"function",
"getAvailableRoles",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeAdminAccess",
"(",
")",
";",
"$",
"response",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"roleProvider",
"->",
"getAllRoles",
"(",
")",
"as",
"$"... | Get the list of all available roles.
It does not return the super user role, and neither the "noaccess" role.
@return array[] Returns an array containing information about each role | [
"Get",
"the",
"list",
"of",
"all",
"available",
"roles",
".",
"It",
"does",
"not",
"return",
"the",
"super",
"user",
"role",
"and",
"neither",
"the",
"noaccess",
"role",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L138-L154 |
208,879 | matomo-org/matomo | plugins/UsersManager/API.php | API.getAvailableCapabilities | public function getAvailableCapabilities()
{
Piwik::checkUserHasSomeAdminAccess();
$response = array();
foreach ($this->capabilityProvider->getAllCapabilities() as $capability) {
$response[] = array(
'id' => $capability->getId(),
'name' => $capab... | php | public function getAvailableCapabilities()
{
Piwik::checkUserHasSomeAdminAccess();
$response = array();
foreach ($this->capabilityProvider->getAllCapabilities() as $capability) {
$response[] = array(
'id' => $capability->getId(),
'name' => $capab... | [
"public",
"function",
"getAvailableCapabilities",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeAdminAccess",
"(",
")",
";",
"$",
"response",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"capabilityProvider",
"->",
"getAllCapabilities",
"(",
... | Get the list of all available capabilities.
@return array[] Returns an array containing information about each capability | [
"Get",
"the",
"list",
"of",
"all",
"available",
"capabilities",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L160-L178 |
208,880 | matomo-org/matomo | plugins/UsersManager/API.php | API.setUserPreference | public function setUserPreference($userLogin, $preferenceName, $preferenceValue)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
Option::set($this->getPreferenceId($userLogin, $preferenceName), $preferenceValue);
} | php | public function setUserPreference($userLogin, $preferenceName, $preferenceValue)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
Option::set($this->getPreferenceId($userLogin, $preferenceName), $preferenceValue);
} | [
"public",
"function",
"setUserPreference",
"(",
"$",
"userLogin",
",",
"$",
"preferenceName",
",",
"$",
"preferenceValue",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"userLogin",
")",
";",
"Option",
"::",
"set",
"(",
"$",
"this"... | Sets a user preference
@param string $userLogin
@param string $preferenceName
@param string $preferenceValue
@return void | [
"Sets",
"a",
"user",
"preference"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L187-L191 |
208,881 | matomo-org/matomo | plugins/UsersManager/API.php | API.getUserPreference | public function getUserPreference($userLogin, $preferenceName)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
$optionValue = $this->getPreferenceValue($userLogin, $preferenceName);
if ($optionValue !== false) {
return $optionValue;
}
return $this-... | php | public function getUserPreference($userLogin, $preferenceName)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
$optionValue = $this->getPreferenceValue($userLogin, $preferenceName);
if ($optionValue !== false) {
return $optionValue;
}
return $this-... | [
"public",
"function",
"getUserPreference",
"(",
"$",
"userLogin",
",",
"$",
"preferenceName",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"userLogin",
")",
";",
"$",
"optionValue",
"=",
"$",
"this",
"->",
"getPreferenceValue",
"(",... | Gets a user preference
@param string $userLogin
@param string $preferenceName
@return bool|string | [
"Gets",
"a",
"user",
"preference"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L199-L210 |
208,882 | matomo-org/matomo | plugins/UsersManager/API.php | API.initUserPreferenceWithDefault | public function initUserPreferenceWithDefault($userLogin, $preferenceName)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
$optionValue = $this->getPreferenceValue($userLogin, $preferenceName);
if ($optionValue === false) {
$defaultValue = $this->getDefaultUserPref... | php | public function initUserPreferenceWithDefault($userLogin, $preferenceName)
{
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
$optionValue = $this->getPreferenceValue($userLogin, $preferenceName);
if ($optionValue === false) {
$defaultValue = $this->getDefaultUserPref... | [
"public",
"function",
"initUserPreferenceWithDefault",
"(",
"$",
"userLogin",
",",
"$",
"preferenceName",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"userLogin",
")",
";",
"$",
"optionValue",
"=",
"$",
"this",
"->",
"getPreferenceVa... | Sets a user preference in the DB using the preference's default value.
@param string $userLogin
@param string $preferenceName
@ignore | [
"Sets",
"a",
"user",
"preference",
"in",
"the",
"DB",
"using",
"the",
"preference",
"s",
"default",
"value",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L218-L231 |
208,883 | matomo-org/matomo | plugins/UsersManager/API.php | API.getAllUsersPreferences | public function getAllUsersPreferences(array $preferenceNames)
{
Piwik::checkUserHasSuperUserAccess();
$userPreferences = array();
foreach($preferenceNames as $preferenceName) {
$optionNameMatchAllUsers = $this->getPreferenceId('%', $preferenceName);
$preferences = O... | php | public function getAllUsersPreferences(array $preferenceNames)
{
Piwik::checkUserHasSuperUserAccess();
$userPreferences = array();
foreach($preferenceNames as $preferenceName) {
$optionNameMatchAllUsers = $this->getPreferenceId('%', $preferenceName);
$preferences = O... | [
"public",
"function",
"getAllUsersPreferences",
"(",
"array",
"$",
"preferenceNames",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"$",
"userPreferences",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"preferenceNames",
"as",
"$",
... | Returns an array of Preferences
@param $preferenceNames array of preference names
@return array
@ignore | [
"Returns",
"an",
"array",
"of",
"Preferences"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L239-L256 |
208,884 | matomo-org/matomo | plugins/UsersManager/API.php | API.addUser | public function addUser($userLogin, $password, $email, $alias = false, $_isPasswordHashed = false, $initialIdSite = null)
{
Piwik::checkUserHasSomeAdminAccess();
if (!Piwik::hasUserSuperUserAccess()) {
if (empty($initialIdSite)) {
throw new \Exception(Piwik::translate("U... | php | public function addUser($userLogin, $password, $email, $alias = false, $_isPasswordHashed = false, $initialIdSite = null)
{
Piwik::checkUserHasSomeAdminAccess();
if (!Piwik::hasUserSuperUserAccess()) {
if (empty($initialIdSite)) {
throw new \Exception(Piwik::translate("U... | [
"public",
"function",
"addUser",
"(",
"$",
"userLogin",
",",
"$",
"password",
",",
"$",
"email",
",",
"$",
"alias",
"=",
"false",
",",
"$",
"_isPasswordHashed",
"=",
"false",
",",
"$",
"initialIdSite",
"=",
"null",
")",
"{",
"Piwik",
"::",
"checkUserHasS... | Add a user in the database.
A user is defined by
- a login that has to be unique and valid
- a password that has to be valid
- an alias
- an email that has to be in a correct format
@see userExists()
@see isValidLoginString()
@see isValidPasswordString()
@see isValidEmailString()
@exception in case of an invalid para... | [
"Add",
"a",
"user",
"in",
"the",
"database",
".",
"A",
"user",
"is",
"defined",
"by",
"-",
"a",
"login",
"that",
"has",
"to",
"be",
"unique",
"and",
"valid",
"-",
"a",
"password",
"that",
"has",
"to",
"be",
"valid",
"-",
"an",
"alias",
"-",
"an",
... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L650-L695 |
208,885 | matomo-org/matomo | plugins/UsersManager/API.php | API.getUsersHavingSuperUserAccess | public function getUsersHavingSuperUserAccess()
{
Piwik::checkUserIsNotAnonymous();
$users = $this->model->getUsersHavingSuperUserAccess();
$users = $this->enrichUsers($users);
// we do not filter these users by access and return them all since we need to print this information in ... | php | public function getUsersHavingSuperUserAccess()
{
Piwik::checkUserIsNotAnonymous();
$users = $this->model->getUsersHavingSuperUserAccess();
$users = $this->enrichUsers($users);
// we do not filter these users by access and return them all since we need to print this information in ... | [
"public",
"function",
"getUsersHavingSuperUserAccess",
"(",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"$",
"users",
"=",
"$",
"this",
"->",
"model",
"->",
"getUsersHavingSuperUserAccess",
"(",
")",
";",
"$",
"users",
"=",
"$",
"this",
... | Returns a list of all Super Users containing there userLogin and email address.
@return array | [
"Returns",
"a",
"list",
"of",
"all",
"Super",
"Users",
"containing",
"there",
"userLogin",
"and",
"email",
"address",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L738-L749 |
208,886 | matomo-org/matomo | plugins/UsersManager/API.php | API.regenerateTokenAuth | public function regenerateTokenAuth($userLogin)
{
$this->checkUserIsNotAnonymous($userLogin);
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
$this->model->updateUserTokenAuth(
$userLogin,
$this->createTokenAuth($userLogin)
);
} | php | public function regenerateTokenAuth($userLogin)
{
$this->checkUserIsNotAnonymous($userLogin);
Piwik::checkUserHasSuperUserAccessOrIsTheUser($userLogin);
$this->model->updateUserTokenAuth(
$userLogin,
$this->createTokenAuth($userLogin)
);
} | [
"public",
"function",
"regenerateTokenAuth",
"(",
"$",
"userLogin",
")",
"{",
"$",
"this",
"->",
"checkUserIsNotAnonymous",
"(",
"$",
"userLogin",
")",
";",
"Piwik",
"::",
"checkUserHasSuperUserAccessOrIsTheUser",
"(",
"$",
"userLogin",
")",
";",
"$",
"this",
"-... | Regenerate the token_auth associated with a user.
If the user currently logged in regenerates his own token, he will be logged out.
His previous token will be rendered invalid.
@param string $userLogin
@throws Exception | [
"Regenerate",
"the",
"token_auth",
"associated",
"with",
"a",
"user",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L831-L841 |
208,887 | matomo-org/matomo | plugins/UsersManager/API.php | API.deleteUser | public function deleteUser($userLogin)
{
Piwik::checkUserHasSuperUserAccess();
$this->checkUserIsNotAnonymous($userLogin);
$this->checkUserExist($userLogin);
if ($this->isUserTheOnlyUserHavingSuperUserAccess($userLogin)) {
$message = Piwik::translate("UsersManager_Excep... | php | public function deleteUser($userLogin)
{
Piwik::checkUserHasSuperUserAccess();
$this->checkUserIsNotAnonymous($userLogin);
$this->checkUserExist($userLogin);
if ($this->isUserTheOnlyUserHavingSuperUserAccess($userLogin)) {
$message = Piwik::translate("UsersManager_Excep... | [
"public",
"function",
"deleteUser",
"(",
"$",
"userLogin",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"$",
"this",
"->",
"checkUserIsNotAnonymous",
"(",
"$",
"userLogin",
")",
";",
"$",
"this",
"->",
"checkUserExist",
"(",
"$",
"u... | Delete one or more users and all its access, given its login.
@param string $userLogin the user login(s).
@throws Exception if the user doesn't exist or if deleting the users would leave no superusers.
@return bool true on success | [
"Delete",
"one",
"or",
"more",
"users",
"and",
"all",
"its",
"access",
"given",
"its",
"login",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L949-L967 |
208,888 | matomo-org/matomo | plugins/UsersManager/API.php | API.userExists | public function userExists($userLogin)
{
if ($userLogin == 'anonymous') {
return true;
}
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeViewAccess();
if ($userLogin == Piwik::getCurrentUserLogin()) {
return true;
}
return $... | php | public function userExists($userLogin)
{
if ($userLogin == 'anonymous') {
return true;
}
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeViewAccess();
if ($userLogin == Piwik::getCurrentUserLogin()) {
return true;
}
return $... | [
"public",
"function",
"userExists",
"(",
"$",
"userLogin",
")",
"{",
"if",
"(",
"$",
"userLogin",
"==",
"'anonymous'",
")",
"{",
"return",
"true",
";",
"}",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasSomeViewAccess",
... | Returns true if the given userLogin is known in the database
@param string $userLogin
@return bool true if the user is known | [
"Returns",
"true",
"if",
"the",
"given",
"userLogin",
"is",
"known",
"in",
"the",
"database"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L975-L989 |
208,889 | matomo-org/matomo | plugins/UsersManager/API.php | API.getUserLoginFromUserEmail | public function getUserLoginFromUserEmail($userEmail)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeAdminAccess();
$this->checkUserEmailExists($userEmail);
$user = $this->model->getUserByEmail($userEmail);
// any user with some admin access is allowed to find ... | php | public function getUserLoginFromUserEmail($userEmail)
{
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSomeAdminAccess();
$this->checkUserEmailExists($userEmail);
$user = $this->model->getUserByEmail($userEmail);
// any user with some admin access is allowed to find ... | [
"public",
"function",
"getUserLoginFromUserEmail",
"(",
"$",
"userEmail",
")",
"{",
"Piwik",
"::",
"checkUserIsNotAnonymous",
"(",
")",
";",
"Piwik",
"::",
"checkUserHasSomeAdminAccess",
"(",
")",
";",
"$",
"this",
"->",
"checkUserEmailExists",
"(",
"$",
"userEmai... | Returns the first login name of an existing user that has the given email address. If no user can be found for
this user an error will be returned.
@param string $userEmail
@return bool true if the user is known | [
"Returns",
"the",
"first",
"login",
"name",
"of",
"an",
"existing",
"user",
"that",
"has",
"the",
"given",
"email",
"address",
".",
"If",
"no",
"user",
"can",
"be",
"found",
"for",
"this",
"user",
"an",
"error",
"will",
"be",
"returned",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L1012-L1024 |
208,890 | matomo-org/matomo | plugins/UsersManager/API.php | API.setUserAccess | public function setUserAccess($userLogin, $access, $idSites)
{
if ($access != 'noaccess') {
$this->checkAccessType($access);
}
$idSites = $this->getIdSitesCheckAdminAccess($idSites);
if ($userLogin === 'anonymous' &&
(is_array($access) || !in_array($access, ... | php | public function setUserAccess($userLogin, $access, $idSites)
{
if ($access != 'noaccess') {
$this->checkAccessType($access);
}
$idSites = $this->getIdSitesCheckAdminAccess($idSites);
if ($userLogin === 'anonymous' &&
(is_array($access) || !in_array($access, ... | [
"public",
"function",
"setUserAccess",
"(",
"$",
"userLogin",
",",
"$",
"access",
",",
"$",
"idSites",
")",
"{",
"if",
"(",
"$",
"access",
"!=",
"'noaccess'",
")",
"{",
"$",
"this",
"->",
"checkAccessType",
"(",
"$",
"access",
")",
";",
"}",
"$",
"id... | Set an access level to a given user for a list of websites ID.
If access = 'noaccess' the current access (if any) will be deleted.
If access = 'view' or 'admin' the current access level is deleted and updated with the new value.
@param string $userLogin The user login
@param string|array $access Access to grant. Must... | [
"Set",
"an",
"access",
"level",
"to",
"a",
"given",
"user",
"for",
"a",
"list",
"of",
"websites",
"ID",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L1041-L1100 |
208,891 | matomo-org/matomo | plugins/UsersManager/API.php | API.removeCapabilities | public function removeCapabilities($userLogin, $capabilities, $idSites)
{
$idSites = $this->getIdSitesCheckAdminAccess($idSites);
$this->checkUserExists($userLogin);
if (!is_array($capabilities)){
$capabilities = array($capabilities);
}
foreach ($capabilities a... | php | public function removeCapabilities($userLogin, $capabilities, $idSites)
{
$idSites = $this->getIdSitesCheckAdminAccess($idSites);
$this->checkUserExists($userLogin);
if (!is_array($capabilities)){
$capabilities = array($capabilities);
}
foreach ($capabilities a... | [
"public",
"function",
"removeCapabilities",
"(",
"$",
"userLogin",
",",
"$",
"capabilities",
",",
"$",
"idSites",
")",
"{",
"$",
"idSites",
"=",
"$",
"this",
"->",
"getIdSitesCheckAdminAccess",
"(",
"$",
"idSites",
")",
";",
"$",
"this",
"->",
"checkUserExis... | Removes the given capabilities from the given user for the given sites.
The capability will be only removed if it is actually granted as a separate capability. If the user has a role
that includes a specific capability, for example "Admin", then the capability will not be removed because the
assigned role will always i... | [
"Removes",
"the",
"given",
"capabilities",
"from",
"the",
"given",
"user",
"for",
"the",
"given",
"sites",
".",
"The",
"capability",
"will",
"be",
"only",
"removed",
"if",
"it",
"is",
"actually",
"granted",
"as",
"a",
"separate",
"capability",
".",
"If",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L1194-L1214 |
208,892 | matomo-org/matomo | plugins/UsersManager/API.php | API.createTokenAuth | public function createTokenAuth($userLogin)
{
return md5($userLogin . microtime(true) . Common::generateUniqId() . SettingsPiwik::getSalt());
} | php | public function createTokenAuth($userLogin)
{
return md5($userLogin . microtime(true) . Common::generateUniqId() . SettingsPiwik::getSalt());
} | [
"public",
"function",
"createTokenAuth",
"(",
"$",
"userLogin",
")",
"{",
"return",
"md5",
"(",
"$",
"userLogin",
".",
"microtime",
"(",
"true",
")",
".",
"Common",
"::",
"generateUniqId",
"(",
")",
".",
"SettingsPiwik",
"::",
"getSalt",
"(",
")",
")",
"... | Generates a new random authentication token.
@param string $userLogin Login
@return string | [
"Generates",
"a",
"new",
"random",
"authentication",
"token",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L1319-L1322 |
208,893 | matomo-org/matomo | plugins/UsersManager/API.php | API.getTokenAuth | public function getTokenAuth($userLogin, $md5Password)
{
UsersManager::checkPasswordHash($md5Password, Piwik::translate('UsersManager_ExceptionPasswordMD5HashExpected'));
$user = $this->model->getUser($userLogin);
if (empty($user) || !$this->password->verify($md5Password, $user['password']... | php | public function getTokenAuth($userLogin, $md5Password)
{
UsersManager::checkPasswordHash($md5Password, Piwik::translate('UsersManager_ExceptionPasswordMD5HashExpected'));
$user = $this->model->getUser($userLogin);
if (empty($user) || !$this->password->verify($md5Password, $user['password']... | [
"public",
"function",
"getTokenAuth",
"(",
"$",
"userLogin",
",",
"$",
"md5Password",
")",
"{",
"UsersManager",
"::",
"checkPasswordHash",
"(",
"$",
"md5Password",
",",
"Piwik",
"::",
"translate",
"(",
"'UsersManager_ExceptionPasswordMD5HashExpected'",
")",
")",
";"... | Returns the user's API token.
If the username/password combination is incorrect an invalid token will be returned.
@param string $userLogin Login
@param string $md5Password hashed string of the password (using current hash function; MD5-named for historical reasons)
@return string | [
"Returns",
"the",
"user",
"s",
"API",
"token",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UsersManager/API.php#L1333-L1355 |
208,894 | matomo-org/matomo | core/Translation/Transifex/API.php | API.getAvailableResources | public function getAvailableResources()
{
$cache = Cache::getTransientCache();
$cacheId = 'transifex_resources_' . $this->projectSlug;
$resources = $cache->fetch($cacheId);
if (empty($resources)) {
$apiPath = 'project/' . $this->projectSlug . '/resources';
$r... | php | public function getAvailableResources()
{
$cache = Cache::getTransientCache();
$cacheId = 'transifex_resources_' . $this->projectSlug;
$resources = $cache->fetch($cacheId);
if (empty($resources)) {
$apiPath = 'project/' . $this->projectSlug . '/resources';
$r... | [
"public",
"function",
"getAvailableResources",
"(",
")",
"{",
"$",
"cache",
"=",
"Cache",
"::",
"getTransientCache",
"(",
")",
";",
"$",
"cacheId",
"=",
"'transifex_resources_'",
".",
"$",
"this",
"->",
"projectSlug",
";",
"$",
"resources",
"=",
"$",
"cache"... | Returns all resources available on Transifex project
@return array | [
"Returns",
"all",
"resources",
"available",
"on",
"Transifex",
"project"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Transifex/API.php#L35-L48 |
208,895 | matomo-org/matomo | core/Translation/Transifex/API.php | API.resourceExists | public function resourceExists($resource)
{
$resources = $this->getAvailableResources();
foreach ($resources as $res) {
if ($res->slug == $resource) {
return true;
}
}
return false;
} | php | public function resourceExists($resource)
{
$resources = $this->getAvailableResources();
foreach ($resources as $res) {
if ($res->slug == $resource) {
return true;
}
}
return false;
} | [
"public",
"function",
"resourceExists",
"(",
"$",
"resource",
")",
"{",
"$",
"resources",
"=",
"$",
"this",
"->",
"getAvailableResources",
"(",
")",
";",
"foreach",
"(",
"$",
"resources",
"as",
"$",
"res",
")",
"{",
"if",
"(",
"$",
"res",
"->",
"slug",... | Checks if the given resource exists in Transifex project
@param string $resource
@return bool | [
"Checks",
"if",
"the",
"given",
"resource",
"exists",
"in",
"Transifex",
"project"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Transifex/API.php#L56-L65 |
208,896 | matomo-org/matomo | core/Translation/Transifex/API.php | API.getAvailableLanguageCodes | public function getAvailableLanguageCodes()
{
$cache = Cache::getTransientCache();
$cacheId = 'transifex_languagescodes_' . $this->projectSlug;
$languageCodes = $cache->fetch($cacheId);
if (empty($languageCodes)) {
$apiData = $this->getApiResults('project/' . $this->proj... | php | public function getAvailableLanguageCodes()
{
$cache = Cache::getTransientCache();
$cacheId = 'transifex_languagescodes_' . $this->projectSlug;
$languageCodes = $cache->fetch($cacheId);
if (empty($languageCodes)) {
$apiData = $this->getApiResults('project/' . $this->proj... | [
"public",
"function",
"getAvailableLanguageCodes",
"(",
")",
"{",
"$",
"cache",
"=",
"Cache",
"::",
"getTransientCache",
"(",
")",
";",
"$",
"cacheId",
"=",
"'transifex_languagescodes_'",
".",
"$",
"this",
"->",
"projectSlug",
";",
"$",
"languageCodes",
"=",
"... | Returns all language codes the transifex project is available for
@return array
@throws AuthenticationFailedException
@throws Exception | [
"Returns",
"all",
"language",
"codes",
"the",
"transifex",
"project",
"is",
"available",
"for"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Transifex/API.php#L74-L88 |
208,897 | matomo-org/matomo | core/Translation/Transifex/API.php | API.getTranslations | public function getTranslations($resource, $language, $raw = false)
{
if ($this->resourceExists($resource)) {
$apiPath = 'project/' . $this->projectSlug . '/resource/' . $resource . '/translation/' . $language . '/?mode=onlytranslated&file';
return $this->getApiResults($apiPath, $raw... | php | public function getTranslations($resource, $language, $raw = false)
{
if ($this->resourceExists($resource)) {
$apiPath = 'project/' . $this->projectSlug . '/resource/' . $resource . '/translation/' . $language . '/?mode=onlytranslated&file';
return $this->getApiResults($apiPath, $raw... | [
"public",
"function",
"getTranslations",
"(",
"$",
"resource",
",",
"$",
"language",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resourceExists",
"(",
"$",
"resource",
")",
")",
"{",
"$",
"apiPath",
"=",
"'project/'",
".",
... | Return the translations for the given resource and language
@param string $resource e.g. piwik-base, piwik-plugin-api,...
@param string $language e.g. de, pt_BR, hy,...
@param bool $raw if true plain response wil be returned (unparsed json)
@return mixed
@throws AuthenticationFailedException
@throws Exception | [
"Return",
"the",
"translations",
"for",
"the",
"given",
"resource",
"and",
"language"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Transifex/API.php#L113-L120 |
208,898 | matomo-org/matomo | core/Translation/Transifex/API.php | API.getApiResults | protected function getApiResults($apiPath, $raw = false)
{
$apiUrl = $this->apiUrl . $apiPath;
$response = Http::sendHttpRequest($apiUrl, 1000, null, null, 5, false, false, true, 'GET', $this->username, $this->password);
$httpStatus = $response['status'];
$response = $response['dat... | php | protected function getApiResults($apiPath, $raw = false)
{
$apiUrl = $this->apiUrl . $apiPath;
$response = Http::sendHttpRequest($apiUrl, 1000, null, null, 5, false, false, true, 'GET', $this->username, $this->password);
$httpStatus = $response['status'];
$response = $response['dat... | [
"protected",
"function",
"getApiResults",
"(",
"$",
"apiPath",
",",
"$",
"raw",
"=",
"false",
")",
"{",
"$",
"apiUrl",
"=",
"$",
"this",
"->",
"apiUrl",
".",
"$",
"apiPath",
";",
"$",
"response",
"=",
"Http",
"::",
"sendHttpRequest",
"(",
"$",
"apiUrl"... | Returns response for API request with given path
@param $apiPath
@param bool $raw
@return mixed
@throws AuthenticationFailedException
@throws Exception | [
"Returns",
"response",
"for",
"API",
"request",
"with",
"given",
"path"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Translation/Transifex/API.php#L131-L147 |
208,899 | matomo-org/matomo | plugins/CoreHome/DataTableRowAction/RowEvolution.php | RowEvolution.getRowEvolutionGraph | public function getRowEvolutionGraph($graphType = false, $metrics = false)
{
// set up the view data table
$view = Factory::build($graphType ? : $this->graphType, $this->apiMethod,
$controllerAction = 'CoreHome.getRowEvolutionGraph', $forceDefault = true);
$view->setDataTable($th... | php | public function getRowEvolutionGraph($graphType = false, $metrics = false)
{
// set up the view data table
$view = Factory::build($graphType ? : $this->graphType, $this->apiMethod,
$controllerAction = 'CoreHome.getRowEvolutionGraph', $forceDefault = true);
$view->setDataTable($th... | [
"public",
"function",
"getRowEvolutionGraph",
"(",
"$",
"graphType",
"=",
"false",
",",
"$",
"metrics",
"=",
"false",
")",
"{",
"// set up the view data table",
"$",
"view",
"=",
"Factory",
"::",
"build",
"(",
"$",
"graphType",
"?",
":",
"$",
"this",
"->",
... | Generic method to get an evolution graph or a sparkline for the row evolution popover.
Do as much as possible from outside the controller.
@param string|bool $graphType
@param array|bool $metrics
@return Factory | [
"Generic",
"method",
"to",
"get",
"an",
"evolution",
"graph",
"or",
"a",
"sparkline",
"for",
"the",
"row",
"evolution",
"popover",
".",
"Do",
"as",
"much",
"as",
"possible",
"from",
"outside",
"the",
"controller",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/DataTableRowAction/RowEvolution.php#L197-L224 |
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.