id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
209,300 | matomo-org/matomo | libs/HTML/QuickForm2/Controller.php | HTML_QuickForm2_Controller.getFirstInvalidPage | public function getFirstInvalidPage()
{
foreach ($this->pages as $id => $page) {
if (!$this->getSessionContainer()->getValidationStatus($id)) {
return $page;
}
}
return null;
} | php | public function getFirstInvalidPage()
{
foreach ($this->pages as $id => $page) {
if (!$this->getSessionContainer()->getValidationStatus($id)) {
return $page;
}
}
return null;
} | [
"public",
"function",
"getFirstInvalidPage",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"pages",
"as",
"$",
"id",
"=>",
"$",
"page",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getSessionContainer",
"(",
")",
"->",
"getValidationStatus",
"(",
... | Returns the first page that failed validation
@return HTML_QuickForm2_Controller_Page|null | [
"Returns",
"the",
"first",
"page",
"that",
"failed",
"validation"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L426-L434 |
209,301 | matomo-org/matomo | libs/HTML/QuickForm2/Controller.php | HTML_QuickForm2_Controller.addDataSource | public function addDataSource(HTML_QuickForm2_DataSource $datasource)
{
$this->getSessionContainer()->storeDatasources(
array_merge($this->getSessionContainer()->getDatasources(),
array($datasource))
);
} | php | public function addDataSource(HTML_QuickForm2_DataSource $datasource)
{
$this->getSessionContainer()->storeDatasources(
array_merge($this->getSessionContainer()->getDatasources(),
array($datasource))
);
} | [
"public",
"function",
"addDataSource",
"(",
"HTML_QuickForm2_DataSource",
"$",
"datasource",
")",
"{",
"$",
"this",
"->",
"getSessionContainer",
"(",
")",
"->",
"storeDatasources",
"(",
"array_merge",
"(",
"$",
"this",
"->",
"getSessionContainer",
"(",
")",
"->",
... | Adds a new data source to the Controller
Note that Controller data sources are stored in session, so your data source
implementation should properly handle its (un)serialization.
@param HTML_QuickForm2_DataSource Data source | [
"Adds",
"a",
"new",
"data",
"source",
"to",
"the",
"Controller"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L444-L450 |
209,302 | matomo-org/matomo | libs/HTML/QuickForm2/Controller.php | HTML_QuickForm2_Controller.getValue | public function getValue()
{
$values = array();
foreach (array_keys($this->pages) as $id) {
$pageValues = $this->getSessionContainer()->getValues($id);
// skip elements representing actions
foreach ($pageValues as $key => $value) {
if (0 !== strpos... | php | public function getValue()
{
$values = array();
foreach (array_keys($this->pages) as $id) {
$pageValues = $this->getSessionContainer()->getValues($id);
// skip elements representing actions
foreach ($pageValues as $key => $value) {
if (0 !== strpos... | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"pages",
")",
"as",
"$",
"id",
")",
"{",
"$",
"pageValues",
"=",
"$",
"this",
"->",
"getSessionContaine... | Returns the form's values
@return array | [
"Returns",
"the",
"form",
"s",
"values"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Controller.php#L457-L474 |
209,303 | matomo-org/matomo | plugins/Live/VisitorDetails.php | VisitorDetails.fetchFirstVisit | private function fetchFirstVisit()
{
$response = Request::processRequest('Live.getFirstVisitForVisitorId', [
'idSite' => $this->getIdSite(),
'visitorId' => $this->getVisitorId(),
]);
return $response->getFirstRow();
} | php | private function fetchFirstVisit()
{
$response = Request::processRequest('Live.getFirstVisitForVisitorId', [
'idSite' => $this->getIdSite(),
'visitorId' => $this->getVisitorId(),
]);
return $response->getFirstRow();
} | [
"private",
"function",
"fetchFirstVisit",
"(",
")",
"{",
"$",
"response",
"=",
"Request",
"::",
"processRequest",
"(",
"'Live.getFirstVisitForVisitorId'",
",",
"[",
"'idSite'",
"=>",
"$",
"this",
"->",
"getIdSite",
"(",
")",
",",
"'visitorId'",
"=>",
"$",
"thi... | Fetch first visit from Live API
@return DataTable\Row | [
"Fetch",
"first",
"visit",
"from",
"Live",
"API"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/VisitorDetails.php#L217-L225 |
209,304 | matomo-org/matomo | plugins/Live/VisitorDetails.php | VisitorDetails.getVisitorProfileVisitSummary | private function getVisitorProfileVisitSummary($visit)
{
$today = Date::today();
$serverDate = $visit->getColumn('firstActionTimestamp');
return array(
'date' => $serverDate,
'prettyDate' => Date::factory($serverDate)->getLocalized(Date::DATE_FORMAT_L... | php | private function getVisitorProfileVisitSummary($visit)
{
$today = Date::today();
$serverDate = $visit->getColumn('firstActionTimestamp');
return array(
'date' => $serverDate,
'prettyDate' => Date::factory($serverDate)->getLocalized(Date::DATE_FORMAT_L... | [
"private",
"function",
"getVisitorProfileVisitSummary",
"(",
"$",
"visit",
")",
"{",
"$",
"today",
"=",
"Date",
"::",
"today",
"(",
")",
";",
"$",
"serverDate",
"=",
"$",
"visit",
"->",
"getColumn",
"(",
"'firstActionTimestamp'",
")",
";",
"return",
"array",... | Returns a summary for an important visit. Used to describe the first & last visits of a visitor.
@param DataTable\Row $visit
@return array | [
"Returns",
"a",
"summary",
"for",
"an",
"important",
"visit",
".",
"Used",
"to",
"describe",
"the",
"first",
"&",
"last",
"visits",
"of",
"a",
"visitor",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/VisitorDetails.php#L233-L246 |
209,305 | matomo-org/matomo | plugins/Live/VisitorDetails.php | VisitorDetails.getReferrerSummaryForVisit | public static function getReferrerSummaryForVisit($visit)
{
$referrerType = $visit->getColumn('referrerType');
if ($referrerType === false
|| $referrerType == 'direct'
) {
return Piwik::translate('Referrers_DirectEntry');
}
if ($referrerType == 'searc... | php | public static function getReferrerSummaryForVisit($visit)
{
$referrerType = $visit->getColumn('referrerType');
if ($referrerType === false
|| $referrerType == 'direct'
) {
return Piwik::translate('Referrers_DirectEntry');
}
if ($referrerType == 'searc... | [
"public",
"static",
"function",
"getReferrerSummaryForVisit",
"(",
"$",
"visit",
")",
"{",
"$",
"referrerType",
"=",
"$",
"visit",
"->",
"getColumn",
"(",
"'referrerType'",
")",
";",
"if",
"(",
"$",
"referrerType",
"===",
"false",
"||",
"$",
"referrerType",
... | Returns a summary for a visit's referral.
@param DataTable\Row $visit
@return bool|mixed|string | [
"Returns",
"a",
"summary",
"for",
"a",
"visit",
"s",
"referral",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/VisitorDetails.php#L255-L288 |
209,306 | matomo-org/matomo | libs/Zend/Config/Yaml.php | Zend_Config_Yaml.decode | public static function decode($yaml)
{
$lines = explode("\n", $yaml);
reset($lines);
return self::_decodeYaml(0, $lines);
} | php | public static function decode($yaml)
{
$lines = explode("\n", $yaml);
reset($lines);
return self::_decodeYaml(0, $lines);
} | [
"public",
"static",
"function",
"decode",
"(",
"$",
"yaml",
")",
"{",
"$",
"lines",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"yaml",
")",
";",
"reset",
"(",
"$",
"lines",
")",
";",
"return",
"self",
"::",
"_decodeYaml",
"(",
"0",
",",
"$",
"lines"... | Very dumb YAML parser
Until we have Zend_Yaml...
@param string $yaml YAML source
@return array Decoded data | [
"Very",
"dumb",
"YAML",
"parser"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Yaml.php#L268-L273 |
209,307 | matomo-org/matomo | libs/Zend/Config/Yaml.php | Zend_Config_Yaml._replaceConstants | protected static function _replaceConstants($value)
{
foreach (self::_getConstants() as $constant) {
if (strstr($value, $constant)) {
$value = str_replace($constant, constant($constant), $value);
}
}
return $value;
} | php | protected static function _replaceConstants($value)
{
foreach (self::_getConstants() as $constant) {
if (strstr($value, $constant)) {
$value = str_replace($constant, constant($constant), $value);
}
}
return $value;
} | [
"protected",
"static",
"function",
"_replaceConstants",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"self",
"::",
"_getConstants",
"(",
")",
"as",
"$",
"constant",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"value",
",",
"$",
"constant",
")",
")",
"{",
... | Replace any constants referenced in a string with their values
@param string $value
@return string | [
"Replace",
"any",
"constants",
"referenced",
"in",
"a",
"string",
"with",
"their",
"values"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Yaml.php#L360-L368 |
209,308 | matomo-org/matomo | core/Plugin/ReportsProvider.php | ReportsProvider.factory | public static function factory($module, $action)
{
$listApiToReport = self::getMapOfModuleActionsToReport();
$api = $module . '.' . ucfirst($action);
if (!array_key_exists($api, $listApiToReport)) {
return null;
}
$klassName = $listApiToReport[$api];
re... | php | public static function factory($module, $action)
{
$listApiToReport = self::getMapOfModuleActionsToReport();
$api = $module . '.' . ucfirst($action);
if (!array_key_exists($api, $listApiToReport)) {
return null;
}
$klassName = $listApiToReport[$api];
re... | [
"public",
"static",
"function",
"factory",
"(",
"$",
"module",
",",
"$",
"action",
")",
"{",
"$",
"listApiToReport",
"=",
"self",
"::",
"getMapOfModuleActionsToReport",
"(",
")",
";",
"$",
"api",
"=",
"$",
"module",
".",
"'.'",
".",
"ucfirst",
"(",
"$",
... | Get an instance of a specific report belonging to the given module and having the given action.
@param string $module
@param string $action
@return null|\Piwik\Plugin\Report
@api | [
"Get",
"an",
"instance",
"of",
"a",
"specific",
"report",
"belonging",
"to",
"the",
"given",
"module",
"and",
"having",
"the",
"given",
"action",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ReportsProvider.php#L34-L46 |
209,309 | matomo-org/matomo | core/Plugin/ReportsProvider.php | ReportsProvider.getAllReports | public function getAllReports()
{
$reports = $this->getAllReportClasses();
$cacheId = CacheId::siteAware(CacheId::languageAware('Reports' . md5(implode('', $reports))));
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
$instances = array();
... | php | public function getAllReports()
{
$reports = $this->getAllReportClasses();
$cacheId = CacheId::siteAware(CacheId::languageAware('Reports' . md5(implode('', $reports))));
$cache = PiwikCache::getTransientCache();
if (!$cache->contains($cacheId)) {
$instances = array();
... | [
"public",
"function",
"getAllReports",
"(",
")",
"{",
"$",
"reports",
"=",
"$",
"this",
"->",
"getAllReportClasses",
"(",
")",
";",
"$",
"cacheId",
"=",
"CacheId",
"::",
"siteAware",
"(",
"CacheId",
"::",
"languageAware",
"(",
"'Reports'",
".",
"md5",
"(",... | Returns a list of all available reports. Even not enabled reports will be returned. They will be already sorted
depending on the order and category of the report.
@return \Piwik\Plugin\Report[]
@api | [
"Returns",
"a",
"list",
"of",
"all",
"available",
"reports",
".",
"Even",
"not",
"enabled",
"reports",
"will",
"be",
"returned",
".",
"They",
"will",
"be",
"already",
"sorted",
"depending",
"on",
"the",
"order",
"and",
"category",
"of",
"the",
"report",
".... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/ReportsProvider.php#L117-L172 |
209,310 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.addReference | public function addReference($ruleKey, $columns, $refTableClass, $refColumns,
$onDelete = null, $onUpdate = null)
{
$reference = array(self::COLUMNS => (array) $columns,
self::REF_TABLE_CLASS => $refTableClass,
se... | php | public function addReference($ruleKey, $columns, $refTableClass, $refColumns,
$onDelete = null, $onUpdate = null)
{
$reference = array(self::COLUMNS => (array) $columns,
self::REF_TABLE_CLASS => $refTableClass,
se... | [
"public",
"function",
"addReference",
"(",
"$",
"ruleKey",
",",
"$",
"columns",
",",
"$",
"refTableClass",
",",
"$",
"refColumns",
",",
"$",
"onDelete",
"=",
"null",
",",
"$",
"onUpdate",
"=",
"null",
")",
"{",
"$",
"reference",
"=",
"array",
"(",
"sel... | Add a reference to the reference map
@param string $ruleKey
@param string|array $columns
@param string $refTableClass
@param string|array $refColumns
@param string $onDelete
@param string $onUpdate
@return Zend_Db_Table_Abstract | [
"Add",
"a",
"reference",
"to",
"the",
"reference",
"map"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L423-L441 |
209,311 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.setDefaultSource | public function setDefaultSource($defaultSource = self::DEFAULT_NONE)
{
if (!in_array($defaultSource, array(self::DEFAULT_CLASS, self::DEFAULT_DB, self::DEFAULT_NONE))) {
$defaultSource = self::DEFAULT_NONE;
}
$this->_defaultSource = $defaultSource;
return $this;
} | php | public function setDefaultSource($defaultSource = self::DEFAULT_NONE)
{
if (!in_array($defaultSource, array(self::DEFAULT_CLASS, self::DEFAULT_DB, self::DEFAULT_NONE))) {
$defaultSource = self::DEFAULT_NONE;
}
$this->_defaultSource = $defaultSource;
return $this;
} | [
"public",
"function",
"setDefaultSource",
"(",
"$",
"defaultSource",
"=",
"self",
"::",
"DEFAULT_NONE",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"defaultSource",
",",
"array",
"(",
"self",
"::",
"DEFAULT_CLASS",
",",
"self",
"::",
"DEFAULT_DB",
",",
... | set the defaultSource property - this tells the table class where to find default values
@param string $defaultSource
@return Zend_Db_Table_Abstract | [
"set",
"the",
"defaultSource",
"property",
"-",
"this",
"tells",
"the",
"table",
"class",
"where",
"to",
"find",
"default",
"values"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L512-L520 |
209,312 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.setDefaultValues | public function setDefaultValues(Array $defaultValues)
{
foreach ($defaultValues as $defaultName => $defaultValue) {
if (array_key_exists($defaultName, $this->_metadata)) {
$this->_defaultValues[$defaultName] = $defaultValue;
}
}
return $this;
} | php | public function setDefaultValues(Array $defaultValues)
{
foreach ($defaultValues as $defaultName => $defaultValue) {
if (array_key_exists($defaultName, $this->_metadata)) {
$this->_defaultValues[$defaultName] = $defaultValue;
}
}
return $this;
} | [
"public",
"function",
"setDefaultValues",
"(",
"Array",
"$",
"defaultValues",
")",
"{",
"foreach",
"(",
"$",
"defaultValues",
"as",
"$",
"defaultName",
"=>",
"$",
"defaultValue",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"defaultName",
",",
"$",
"th... | set the default values for the table class
@param array $defaultValues
@return Zend_Db_Table_Abstract | [
"set",
"the",
"default",
"values",
"for",
"the",
"table",
"class"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L538-L546 |
209,313 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract._setupDatabaseAdapter | protected function _setupDatabaseAdapter()
{
if (! $this->_db) {
$this->_db = self::getDefaultAdapter();
if (!$this->_db instanceof Zend_Db_Adapter_Abstract) {
// require_once 'Zend/Db/Table/Exception.php';
throw new Zend_Db_Table_Exception('No adapter... | php | protected function _setupDatabaseAdapter()
{
if (! $this->_db) {
$this->_db = self::getDefaultAdapter();
if (!$this->_db instanceof Zend_Db_Adapter_Abstract) {
// require_once 'Zend/Db/Table/Exception.php';
throw new Zend_Db_Table_Exception('No adapter... | [
"protected",
"function",
"_setupDatabaseAdapter",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_db",
")",
"{",
"$",
"this",
"->",
"_db",
"=",
"self",
"::",
"getDefaultAdapter",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_db",
"instanceo... | Initialize database adapter.
@return void
@throws Zend_Db_Table_Exception | [
"Initialize",
"database",
"adapter",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L749-L758 |
209,314 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract._getReferenceMapNormalized | protected function _getReferenceMapNormalized()
{
$referenceMapNormalized = array();
foreach ($this->_referenceMap as $rule => $map) {
$referenceMapNormalized[$rule] = array();
foreach ($map as $key => $value) {
switch ($key) {
// norma... | php | protected function _getReferenceMapNormalized()
{
$referenceMapNormalized = array();
foreach ($this->_referenceMap as $rule => $map) {
$referenceMapNormalized[$rule] = array();
foreach ($map as $key => $value) {
switch ($key) {
// norma... | [
"protected",
"function",
"_getReferenceMapNormalized",
"(",
")",
"{",
"$",
"referenceMapNormalized",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_referenceMap",
"as",
"$",
"rule",
"=>",
"$",
"map",
")",
"{",
"$",
"referenceMapNormalized",
... | Returns a normalized version of the reference map
@return array | [
"Returns",
"a",
"normalized",
"version",
"of",
"the",
"reference",
"map"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L927-L957 |
209,315 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.select | public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
{
// require_once 'Zend/Db/Table/Select.php';
$select = new Zend_Db_Table_Select($this);
if ($withFromPart == self::SELECT_WITH_FROM_PART) {
$select->from($this->info(self::NAME), Zend_Db_Table_Select::SQL_WIL... | php | public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
{
// require_once 'Zend/Db/Table/Select.php';
$select = new Zend_Db_Table_Select($this);
if ($withFromPart == self::SELECT_WITH_FROM_PART) {
$select->from($this->info(self::NAME), Zend_Db_Table_Select::SQL_WIL... | [
"public",
"function",
"select",
"(",
"$",
"withFromPart",
"=",
"self",
"::",
"SELECT_WITHOUT_FROM_PART",
")",
"{",
"// require_once 'Zend/Db/Table/Select.php';",
"$",
"select",
"=",
"new",
"Zend_Db_Table_Select",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"withFr... | Returns an instance of a Zend_Db_Table_Select object.
@param bool $withFromPart Whether or not to include the from part of the select based on the table
@return Zend_Db_Table_Select | [
"Returns",
"an",
"instance",
"of",
"a",
"Zend_Db_Table_Select",
"object",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L1015-L1023 |
209,316 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract.isIdentity | public function isIdentity($column)
{
$this->_setupPrimaryKey();
if (!isset($this->_metadata[$column])) {
/**
* @see Zend_Db_Table_Exception
*/
// require_once 'Zend/Db/Table/Exception.php';
throw new Zend_Db_Table_Exception('Column "' ... | php | public function isIdentity($column)
{
$this->_setupPrimaryKey();
if (!isset($this->_metadata[$column])) {
/**
* @see Zend_Db_Table_Exception
*/
// require_once 'Zend/Db/Table/Exception.php';
throw new Zend_Db_Table_Exception('Column "' ... | [
"public",
"function",
"isIdentity",
"(",
"$",
"column",
")",
"{",
"$",
"this",
"->",
"_setupPrimaryKey",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_metadata",
"[",
"$",
"column",
"]",
")",
")",
"{",
"/**\n * @see Zend_D... | Check if the provided column is an identity of the table
@param string $column
@throws Zend_Db_Table_Exception
@return boolean | [
"Check",
"if",
"the",
"provided",
"column",
"is",
"an",
"identity",
"of",
"the",
"table"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L1106-L1120 |
209,317 | matomo-org/matomo | libs/Zend/Db/Table/Abstract.php | Zend_Db_Table_Abstract._fetch | protected function _fetch(Zend_Db_Table_Select $select)
{
$stmt = $this->_db->query($select);
$data = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
return $data;
} | php | protected function _fetch(Zend_Db_Table_Select $select)
{
$stmt = $this->_db->query($select);
$data = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
return $data;
} | [
"protected",
"function",
"_fetch",
"(",
"Zend_Db_Table_Select",
"$",
"select",
")",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"_db",
"->",
"query",
"(",
"$",
"select",
")",
";",
"$",
"data",
"=",
"$",
"stmt",
"->",
"fetchAll",
"(",
"Zend_Db",
"::",
"... | Support method for fetching rows.
@param Zend_Db_Table_Select $select query options.
@return array An array containing the row results in FETCH_ASSOC mode. | [
"Support",
"method",
"for",
"fetching",
"rows",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Table/Abstract.php#L1527-L1532 |
209,318 | matomo-org/matomo | core/DataAccess/ArchiveSelector.php | ArchiveSelector.getArchiveIds | public static function getArchiveIds($siteIds, $periods, $segment, $plugins)
{
if (empty($siteIds)) {
throw new \Exception("Website IDs could not be read from the request, ie. idSite=");
}
foreach ($siteIds as $index => $siteId) {
$siteIds[$index] = (int) $siteId;
... | php | public static function getArchiveIds($siteIds, $periods, $segment, $plugins)
{
if (empty($siteIds)) {
throw new \Exception("Website IDs could not be read from the request, ie. idSite=");
}
foreach ($siteIds as $index => $siteId) {
$siteIds[$index] = (int) $siteId;
... | [
"public",
"static",
"function",
"getArchiveIds",
"(",
"$",
"siteIds",
",",
"$",
"periods",
",",
"$",
"segment",
",",
"$",
"plugins",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"siteIds",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"\"Website ID... | Queries and returns archive IDs for a set of sites, periods, and a segment.
@param array $siteIds
@param array $periods
@param Segment $segment
@param array $plugins List of plugin names for which data is being requested.
@return array Archive IDs are grouped by archive name and period range, ie,
array(
'VisitsSummary... | [
"Queries",
"and",
"returns",
"archive",
"IDs",
"for",
"a",
"set",
"of",
"sites",
"periods",
"and",
"a",
"segment",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/ArchiveSelector.php#L149-L219 |
209,319 | matomo-org/matomo | core/DataAccess/ArchiveSelector.php | ArchiveSelector.getArchiveData | public static function getArchiveData($archiveIds, $recordNames, $archiveDataType, $idSubtable)
{
$chunk = new Chunk();
// create the SQL to select archive data
$loadAllSubtables = $idSubtable == Archive::ID_SUBTABLE_LOAD_ALL_SUBTABLES;
if ($loadAllSubtables) {
$name = r... | php | public static function getArchiveData($archiveIds, $recordNames, $archiveDataType, $idSubtable)
{
$chunk = new Chunk();
// create the SQL to select archive data
$loadAllSubtables = $idSubtable == Archive::ID_SUBTABLE_LOAD_ALL_SUBTABLES;
if ($loadAllSubtables) {
$name = r... | [
"public",
"static",
"function",
"getArchiveData",
"(",
"$",
"archiveIds",
",",
"$",
"recordNames",
",",
"$",
"archiveDataType",
",",
"$",
"idSubtable",
")",
"{",
"$",
"chunk",
"=",
"new",
"Chunk",
"(",
")",
";",
"// create the SQL to select archive data",
"$",
... | Queries and returns archive data using a set of archive IDs.
@param array $archiveIds The IDs of the archives to get data from.
@param array $recordNames The names of the data to retrieve (ie, nb_visits, nb_actions, etc.).
Note: You CANNOT pass multiple recordnames if $loadAllSubtables=true.
@param string $archiveData... | [
"Queries",
"and",
"returns",
"archive",
"data",
"using",
"a",
"set",
"of",
"archive",
"IDs",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/ArchiveSelector.php#L233-L314 |
209,320 | matomo-org/matomo | core/DataAccess/ArchiveSelector.php | ArchiveSelector.getNameCondition | private static function getNameCondition(array $plugins, Segment $segment)
{
// the flags used to tell how the archiving process for a specific archive was completed,
// if it was completed
$doneFlags = Rules::getDoneFlags($plugins, $segment);
$allDoneFlags = "'" . implode("','", ... | php | private static function getNameCondition(array $plugins, Segment $segment)
{
// the flags used to tell how the archiving process for a specific archive was completed,
// if it was completed
$doneFlags = Rules::getDoneFlags($plugins, $segment);
$allDoneFlags = "'" . implode("','", ... | [
"private",
"static",
"function",
"getNameCondition",
"(",
"array",
"$",
"plugins",
",",
"Segment",
"$",
"segment",
")",
"{",
"// the flags used to tell how the archiving process for a specific archive was completed,",
"// if it was completed",
"$",
"doneFlags",
"=",
"Rules",
... | Returns the SQL condition used to find successfully completed archives that
this instance is querying for.
@param array $plugins
@param Segment $segment
@return string | [
"Returns",
"the",
"SQL",
"condition",
"used",
"to",
"find",
"successfully",
"completed",
"archives",
"that",
"this",
"instance",
"is",
"querying",
"for",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataAccess/ArchiveSelector.php#L359-L370 |
209,321 | matomo-org/matomo | core/DataTable/Renderer.php | Renderer.setTable | public function setTable($table)
{
if (!is_array($table)
&& !($table instanceof DataTableInterface)
) {
throw new Exception("DataTable renderers renderer accepts only DataTable, Simple and Map instances, and arrays.");
}
$this->table = $table;
} | php | public function setTable($table)
{
if (!is_array($table)
&& !($table instanceof DataTableInterface)
) {
throw new Exception("DataTable renderers renderer accepts only DataTable, Simple and Map instances, and arrays.");
}
$this->table = $table;
} | [
"public",
"function",
"setTable",
"(",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"table",
")",
"&&",
"!",
"(",
"$",
"table",
"instanceof",
"DataTableInterface",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"DataTable renderers ren... | Set the DataTable to be rendered
@param DataTable|Simple|DataTable\Map $table table to be rendered
@throws Exception | [
"Set",
"the",
"DataTable",
"to",
"be",
"rendered"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer.php#L130-L138 |
209,322 | matomo-org/matomo | core/DataTable/Renderer.php | Renderer.formatValueXml | public static function formatValueXml($value)
{
if (is_string($value)
&& !is_numeric($value)
) {
$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');
// make sure non-UTF-8 chars don't cause htmlspecialchars to choke
if (function_exists('mb_conver... | php | public static function formatValueXml($value)
{
if (is_string($value)
&& !is_numeric($value)
) {
$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');
// make sure non-UTF-8 chars don't cause htmlspecialchars to choke
if (function_exists('mb_conver... | [
"public",
"static",
"function",
"formatValueXml",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
"&&",
"!",
"is_numeric",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"html_entity_decode",
"(",
"$",
"value",
",",
... | Format a value to xml
@param string|number|bool $value value to format
@return int|string | [
"Format",
"a",
"value",
"to",
"xml"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer.php#L183-L203 |
209,323 | matomo-org/matomo | core/DataTable/Renderer.php | Renderer.translateColumnNames | protected function translateColumnNames($names)
{
if (!$this->apiMethod) {
return $names;
}
// load the translations only once
// when multiple dates are requested (date=...,...&period=day), the meta data would
// be loaded lots of times otherwise
if ($th... | php | protected function translateColumnNames($names)
{
if (!$this->apiMethod) {
return $names;
}
// load the translations only once
// when multiple dates are requested (date=...,...&period=day), the meta data would
// be loaded lots of times otherwise
if ($th... | [
"protected",
"function",
"translateColumnNames",
"(",
"$",
"names",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"apiMethod",
")",
"{",
"return",
"$",
"names",
";",
"}",
"// load the translations only once",
"// when multiple dates are requested (date=...,...&period=day... | Translate column names to the current language.
Used in subclasses.
@param array $names
@return array | [
"Translate",
"column",
"names",
"to",
"the",
"current",
"language",
".",
"Used",
"in",
"subclasses",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer.php#L212-L253 |
209,324 | matomo-org/matomo | libs/Zend/Db/Adapter/Oracle.php | Zend_Db_Adapter_Oracle.isConnected | public function isConnected()
{
return ((bool) (is_resource($this->_connection)
&& (get_resource_type($this->_connection) == 'oci8 connection'
|| get_resource_type($this->_connection) == 'oci8 persistent connection')));
} | php | public function isConnected()
{
return ((bool) (is_resource($this->_connection)
&& (get_resource_type($this->_connection) == 'oci8 connection'
|| get_resource_type($this->_connection) == 'oci8 persistent connection')));
} | [
"public",
"function",
"isConnected",
"(",
")",
"{",
"return",
"(",
"(",
"bool",
")",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"_connection",
")",
"&&",
"(",
"get_resource_type",
"(",
"$",
"this",
"->",
"_connection",
")",
"==",
"'oci8 connection'",
"||"... | Test if a connection is active
@return boolean | [
"Test",
"if",
"a",
"connection",
"is",
"active"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Oracle.php#L147-L152 |
209,325 | matomo-org/matomo | libs/Zend/Db/Adapter/Oracle.php | Zend_Db_Adapter_Oracle.getLobAsString | public function getLobAsString()
{
if ($this->_lobAsString === null) {
// if never set by user, we use driver option if it exists otherwise false
if (isset($this->_config['driver_options']) &&
isset($this->_config['driver_options']['lob_as_string'])) {
... | php | public function getLobAsString()
{
if ($this->_lobAsString === null) {
// if never set by user, we use driver option if it exists otherwise false
if (isset($this->_config['driver_options']) &&
isset($this->_config['driver_options']['lob_as_string'])) {
... | [
"public",
"function",
"getLobAsString",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_lobAsString",
"===",
"null",
")",
"{",
"// if never set by user, we use driver option if it exists otherwise false",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_config",
"[",
... | Return whether or not LOB are returned as string
@return boolean | [
"Return",
"whether",
"or",
"not",
"LOB",
"are",
"returned",
"as",
"string"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Oracle.php#L184-L196 |
209,326 | matomo-org/matomo | libs/Zend/Config/Writer.php | Zend_Config_Writer.setOptions | public function setOptions(array $options)
{
foreach ($options as $key => $value) {
if (in_array(strtolower($key), $this->_skipOptions)) {
continue;
}
$method = 'set' . ucfirst($key);
if (method_exists($this, $method)) {
$this-... | php | public function setOptions(array $options)
{
foreach ($options as $key => $value) {
if (in_array(strtolower($key), $this->_skipOptions)) {
continue;
}
$method = 'set' . ucfirst($key);
if (method_exists($this, $method)) {
$this-... | [
"public",
"function",
"setOptions",
"(",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"in_array",
"(",
"strtolower",
"(",
"$",
"key",
")",
",",
"$",
"this",
"->",
"_sk... | Set options via an array
@param array $options
@return Zend_Config_Writer | [
"Set",
"options",
"via",
"an",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Writer.php#L79-L93 |
209,327 | matomo-org/matomo | core/DataTable/Filter/ExcludeLowPopulation.php | ExcludeLowPopulation.selectColumnToExclude | private function selectColumnToExclude($columnToFilter, $row)
{
if ($row->hasColumn($columnToFilter)) {
return $columnToFilter;
}
// filter_excludelowpop=nb_visits but the column name is still Metrics::INDEX_NB_VISITS in the table
$columnIdToName = Metrics::getMappingFro... | php | private function selectColumnToExclude($columnToFilter, $row)
{
if ($row->hasColumn($columnToFilter)) {
return $columnToFilter;
}
// filter_excludelowpop=nb_visits but the column name is still Metrics::INDEX_NB_VISITS in the table
$columnIdToName = Metrics::getMappingFro... | [
"private",
"function",
"selectColumnToExclude",
"(",
"$",
"columnToFilter",
",",
"$",
"row",
")",
"{",
"if",
"(",
"$",
"row",
"->",
"hasColumn",
"(",
"$",
"columnToFilter",
")",
")",
"{",
"return",
"$",
"columnToFilter",
";",
"}",
"// filter_excludelowpop=nb_v... | Sets the column to be used for Excluding low population
@param DataTable\Row $row
@return int | [
"Sets",
"the",
"column",
"to",
"be",
"used",
"for",
"Excluding",
"low",
"population"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/ExcludeLowPopulation.php#L107-L124 |
209,328 | matomo-org/matomo | core/DataTable/Row/DataTableSummaryRow.php | DataTableSummaryRow.sumTable | private function sumTable($table)
{
$metadata = $table->getMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME);
$enableCopyMetadata = false;
foreach ($table->getRowsWithoutSummaryRow() as $row) {
$this->sumRow($row, $enableCopyMetadata, $metadata);
}
$summ... | php | private function sumTable($table)
{
$metadata = $table->getMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME);
$enableCopyMetadata = false;
foreach ($table->getRowsWithoutSummaryRow() as $row) {
$this->sumRow($row, $enableCopyMetadata, $metadata);
}
$summ... | [
"private",
"function",
"sumTable",
"(",
"$",
"table",
")",
"{",
"$",
"metadata",
"=",
"$",
"table",
"->",
"getMetadata",
"(",
"DataTable",
"::",
"COLUMN_AGGREGATION_OPS_METADATA_NAME",
")",
";",
"$",
"enableCopyMetadata",
"=",
"false",
";",
"foreach",
"(",
"$"... | Sums a tables row with this one.
@param DataTable $table | [
"Sums",
"a",
"tables",
"row",
"with",
"this",
"one",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Row/DataTableSummaryRow.php#L58-L72 |
209,329 | matomo-org/matomo | core/Plugin/Dimension/VisitDimension.php | VisitDimension.getDimensions | public static function getDimensions(Plugin $plugin)
{
$dimensions = $plugin->findMultipleComponents('Columns', '\\Piwik\\Plugin\\Dimension\\VisitDimension');
$instances = array();
foreach ($dimensions as $dimension) {
$instances[] = new $dimension();
}
return ... | php | public static function getDimensions(Plugin $plugin)
{
$dimensions = $plugin->findMultipleComponents('Columns', '\\Piwik\\Plugin\\Dimension\\VisitDimension');
$instances = array();
foreach ($dimensions as $dimension) {
$instances[] = new $dimension();
}
return ... | [
"public",
"static",
"function",
"getDimensions",
"(",
"Plugin",
"$",
"plugin",
")",
"{",
"$",
"dimensions",
"=",
"$",
"plugin",
"->",
"findMultipleComponents",
"(",
"'Columns'",
",",
"'\\\\Piwik\\\\Plugin\\\\Dimension\\\\VisitDimension'",
")",
";",
"$",
"instances",
... | Get all visit dimensions that are defined by the given plugin.
@param Plugin $plugin
@return VisitDimension[]
@ignore | [
"Get",
"all",
"visit",
"dimensions",
"that",
"are",
"defined",
"by",
"the",
"given",
"plugin",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Plugin/Dimension/VisitDimension.php#L338-L348 |
209,330 | matomo-org/matomo | core/Updates.php | Updates.enableMaintenanceMode | public static function enableMaintenanceMode()
{
$config = Config::getInstance();
$tracker = $config->Tracker;
$tracker['record_statistics'] = 0;
$config->Tracker = $tracker;
$general = $config->General;
$general['maintenance_mode'] = 1;
$config->General = $... | php | public static function enableMaintenanceMode()
{
$config = Config::getInstance();
$tracker = $config->Tracker;
$tracker['record_statistics'] = 0;
$config->Tracker = $tracker;
$general = $config->General;
$general['maintenance_mode'] = 1;
$config->General = $... | [
"public",
"static",
"function",
"enableMaintenanceMode",
"(",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"getInstance",
"(",
")",
";",
"$",
"tracker",
"=",
"$",
"config",
"->",
"Tracker",
";",
"$",
"tracker",
"[",
"'record_statistics'",
"]",
"=",
"0",
... | Enables maintenance mode. Should be used for updates where Piwik will be unavailable
for a large amount of time. | [
"Enables",
"maintenance",
"mode",
".",
"Should",
"be",
"used",
"for",
"updates",
"where",
"Piwik",
"will",
"be",
"unavailable",
"for",
"a",
"large",
"amount",
"of",
"time",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updates.php#L112-L125 |
209,331 | matomo-org/matomo | plugins/CoreUpdater/UpdateCommunication.php | UpdateCommunication.isEnabled | public function isEnabled()
{
$isEnabled = (bool) Config::getInstance()->General['enable_update_communication'];
if($isEnabled === true && SettingsPiwik::isInternetEnabled() === true){
return true;
}
return false;
} | php | public function isEnabled()
{
$isEnabled = (bool) Config::getInstance()->General['enable_update_communication'];
if($isEnabled === true && SettingsPiwik::isInternetEnabled() === true){
return true;
}
return false;
} | [
"public",
"function",
"isEnabled",
"(",
")",
"{",
"$",
"isEnabled",
"=",
"(",
"bool",
")",
"Config",
"::",
"getInstance",
"(",
")",
"->",
"General",
"[",
"'enable_update_communication'",
"]",
";",
"if",
"(",
"$",
"isEnabled",
"===",
"true",
"&&",
"Settings... | Checks whether update communication in general is enabled or not.
@return bool | [
"Checks",
"whether",
"update",
"communication",
"in",
"general",
"is",
"enabled",
"or",
"not",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreUpdater/UpdateCommunication.php#L32-L41 |
209,332 | matomo-org/matomo | plugins/CoreUpdater/UpdateCommunication.php | UpdateCommunication.sendEmailNotification | protected function sendEmailNotification($subject, $message)
{
$superUsers = UsersManagerApi::getInstance()->getUsersHavingSuperUserAccess();
foreach ($superUsers as $superUser) {
$mail = new Mail();
$mail->setDefaultFromPiwik();
$mail->addTo($superUser['email'])... | php | protected function sendEmailNotification($subject, $message)
{
$superUsers = UsersManagerApi::getInstance()->getUsersHavingSuperUserAccess();
foreach ($superUsers as $superUser) {
$mail = new Mail();
$mail->setDefaultFromPiwik();
$mail->addTo($superUser['email'])... | [
"protected",
"function",
"sendEmailNotification",
"(",
"$",
"subject",
",",
"$",
"message",
")",
"{",
"$",
"superUsers",
"=",
"UsersManagerApi",
"::",
"getInstance",
"(",
")",
"->",
"getUsersHavingSuperUserAccess",
"(",
")",
";",
"foreach",
"(",
"$",
"superUsers... | Send an email notification to all super users.
@param $subject
@param $message | [
"Send",
"an",
"email",
"notification",
"to",
"all",
"super",
"users",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreUpdater/UpdateCommunication.php#L97-L109 |
209,333 | matomo-org/matomo | plugins/Referrers/Social.php | Social.loadYmlData | public function loadYmlData($yml)
{
$searchEngines = \Spyc::YAMLLoadString($yml);
$this->definitionList = $this->transformData($searchEngines);
return $this->definitionList;
} | php | public function loadYmlData($yml)
{
$searchEngines = \Spyc::YAMLLoadString($yml);
$this->definitionList = $this->transformData($searchEngines);
return $this->definitionList;
} | [
"public",
"function",
"loadYmlData",
"(",
"$",
"yml",
")",
"{",
"$",
"searchEngines",
"=",
"\\",
"Spyc",
"::",
"YAMLLoadString",
"(",
"$",
"yml",
")",
";",
"$",
"this",
"->",
"definitionList",
"=",
"$",
"this",
"->",
"transformData",
"(",
"$",
"searchEng... | Parses the given YML string and caches the resulting definitions
@param string $yml
@return array | [
"Parses",
"the",
"given",
"YML",
"string",
"and",
"caches",
"the",
"resulting",
"definitions"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L75-L82 |
209,334 | matomo-org/matomo | plugins/Referrers/Social.php | Social.isSocialUrl | public function isSocialUrl($url, $socialName = false)
{
foreach ($this->getDefinitions() as $domain => $name) {
if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) {
return true;
}
}
return ... | php | public function isSocialUrl($url, $socialName = false)
{
foreach ($this->getDefinitions() as $domain => $name) {
if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url) && ($socialName === false || $name == $socialName)) {
return true;
}
}
return ... | [
"public",
"function",
"isSocialUrl",
"(",
"$",
"url",
",",
"$",
"socialName",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"domain",
"=>",
"$",
"name",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/(^... | Returns true if a URL belongs to a social network, false if otherwise.
@param string $url The URL to check.
@param string|bool $socialName The social network's name to check for, or false to check
for any.
@return bool | [
"Returns",
"true",
"if",
"a",
"URL",
"belongs",
"to",
"a",
"social",
"network",
"false",
"if",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L107-L118 |
209,335 | matomo-org/matomo | plugins/Referrers/Social.php | Social.getSocialNetworkFromDomain | public function getSocialNetworkFromDomain($url)
{
foreach ($this->getDefinitions() as $domain => $name) {
if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url)) {
return $name;
}
}
return Piwik::translate('General_Unknown');
} | php | public function getSocialNetworkFromDomain($url)
{
foreach ($this->getDefinitions() as $domain => $name) {
if (preg_match('/(^|[\.\/])'.$domain.'([\.\/]|$)/', $url)) {
return $name;
}
}
return Piwik::translate('General_Unknown');
} | [
"public",
"function",
"getSocialNetworkFromDomain",
"(",
"$",
"url",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"domain",
"=>",
"$",
"name",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/(^|[\\.\\/])'",
".",
"$",
"do... | Get's social network name from URL.
@param string $url
@return string | [
"Get",
"s",
"social",
"network",
"name",
"from",
"URL",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L127-L138 |
209,336 | matomo-org/matomo | plugins/Referrers/Social.php | Social.getMainUrl | public function getMainUrl($url)
{
$social = $this->getSocialNetworkFromDomain($url);
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return $url;
} | php | public function getMainUrl($url)
{
$social = $this->getSocialNetworkFromDomain($url);
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return $url;
} | [
"public",
"function",
"getMainUrl",
"(",
"$",
"url",
")",
"{",
"$",
"social",
"=",
"$",
"this",
"->",
"getSocialNetworkFromDomain",
"(",
"$",
"url",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"domain",
"=>",
"$"... | Returns the main url of the social network the given url matches
@param string $url
@return string | [
"Returns",
"the",
"main",
"url",
"of",
"the",
"social",
"network",
"the",
"given",
"url",
"matches"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L147-L158 |
209,337 | matomo-org/matomo | plugins/Referrers/Social.php | Social.getMainUrlFromName | public function getMainUrlFromName($social)
{
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return null;
} | php | public function getMainUrlFromName($social)
{
foreach ($this->getDefinitions() as $domain => $name) {
if ($name == $social) {
return $domain;
}
}
return null;
} | [
"public",
"function",
"getMainUrlFromName",
"(",
"$",
"social",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"domain",
"=>",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"$",
"social",
")",
"{",
"return"... | Returns the main url of the given social network
@param string $social
@return string | [
"Returns",
"the",
"main",
"url",
"of",
"the",
"given",
"social",
"network"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L167-L177 |
209,338 | matomo-org/matomo | plugins/Referrers/Social.php | Social.getLogoFromUrl | public function getLogoFromUrl($domain)
{
$social = $this->getSocialNetworkFromDomain($domain);
$socialNetworks = $this->getDefinitions();
$filePattern = 'plugins/Morpheus/icons/dist/socials/%s.png';
$socialDomains = array_keys($socialNetworks, $social);
foreach ($socialDom... | php | public function getLogoFromUrl($domain)
{
$social = $this->getSocialNetworkFromDomain($domain);
$socialNetworks = $this->getDefinitions();
$filePattern = 'plugins/Morpheus/icons/dist/socials/%s.png';
$socialDomains = array_keys($socialNetworks, $social);
foreach ($socialDom... | [
"public",
"function",
"getLogoFromUrl",
"(",
"$",
"domain",
")",
"{",
"$",
"social",
"=",
"$",
"this",
"->",
"getSocialNetworkFromDomain",
"(",
"$",
"domain",
")",
";",
"$",
"socialNetworks",
"=",
"$",
"this",
"->",
"getDefinitions",
"(",
")",
";",
"$",
... | Return social network logo path by URL
@param string $domain
@return string path
@see plugins/Morpheus/icons/dist/socials/ | [
"Return",
"social",
"network",
"logo",
"path",
"by",
"URL"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Social.php#L187-L202 |
209,339 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.renderWidgetContainer | public function renderWidgetContainer()
{
Piwik::checkUserHasSomeViewAccess();
$this->checkSitePermission();
$view = new View('@CoreHome/widgetContainer');
$view->isWidgetized = (bool) Common::getRequestVar('widget', 0, 'int');
$view->containerId = Common::getRequestVar('co... | php | public function renderWidgetContainer()
{
Piwik::checkUserHasSomeViewAccess();
$this->checkSitePermission();
$view = new View('@CoreHome/widgetContainer');
$view->isWidgetized = (bool) Common::getRequestVar('widget', 0, 'int');
$view->containerId = Common::getRequestVar('co... | [
"public",
"function",
"renderWidgetContainer",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeViewAccess",
"(",
")",
";",
"$",
"this",
"->",
"checkSitePermission",
"(",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@CoreHome/widgetContainer'",
")",
";",
"$... | This is only used for exported widgets
@return string
@throws Exception
@throws \Piwik\NoAccessException | [
"This",
"is",
"only",
"used",
"for",
"exported",
"widgets"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L67-L77 |
209,340 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.getRowEvolutionPopover | public function getRowEvolutionPopover()
{
$rowEvolution = $this->makeRowEvolution($isMulti = false);
$view = new View('@CoreHome/getRowEvolutionPopover');
return $rowEvolution->renderPopover($this, $view);
} | php | public function getRowEvolutionPopover()
{
$rowEvolution = $this->makeRowEvolution($isMulti = false);
$view = new View('@CoreHome/getRowEvolutionPopover');
return $rowEvolution->renderPopover($this, $view);
} | [
"public",
"function",
"getRowEvolutionPopover",
"(",
")",
"{",
"$",
"rowEvolution",
"=",
"$",
"this",
"->",
"makeRowEvolution",
"(",
"$",
"isMulti",
"=",
"false",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@CoreHome/getRowEvolutionPopover'",
")",
";",
... | Render the entire row evolution popover for a single row | [
"Render",
"the",
"entire",
"row",
"evolution",
"popover",
"for",
"a",
"single",
"row"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L208-L213 |
209,341 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.getMultiRowEvolutionPopover | public function getMultiRowEvolutionPopover()
{
$rowEvolution = $this->makeRowEvolution($isMulti = true);
$view = new View('@CoreHome/getMultiRowEvolutionPopover');
return $rowEvolution->renderPopover($this, $view);
} | php | public function getMultiRowEvolutionPopover()
{
$rowEvolution = $this->makeRowEvolution($isMulti = true);
$view = new View('@CoreHome/getMultiRowEvolutionPopover');
return $rowEvolution->renderPopover($this, $view);
} | [
"public",
"function",
"getMultiRowEvolutionPopover",
"(",
")",
"{",
"$",
"rowEvolution",
"=",
"$",
"this",
"->",
"makeRowEvolution",
"(",
"$",
"isMulti",
"=",
"true",
")",
";",
"$",
"view",
"=",
"new",
"View",
"(",
"'@CoreHome/getMultiRowEvolutionPopover'",
")",... | Render the entire row evolution popover for multiple rows | [
"Render",
"the",
"entire",
"row",
"evolution",
"popover",
"for",
"multiple",
"rows"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L216-L221 |
209,342 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.getRowEvolutionGraph | public function getRowEvolutionGraph($fetch = false, $rowEvolution = null)
{
if (empty($rowEvolution)) {
$label = Common::getRequestVar('label', '', 'string');
$isMultiRowEvolution = strpos($label, ',') !== false;
$rowEvolution = $this->makeRowEvolution($isMultiRowEvolut... | php | public function getRowEvolutionGraph($fetch = false, $rowEvolution = null)
{
if (empty($rowEvolution)) {
$label = Common::getRequestVar('label', '', 'string');
$isMultiRowEvolution = strpos($label, ',') !== false;
$rowEvolution = $this->makeRowEvolution($isMultiRowEvolut... | [
"public",
"function",
"getRowEvolutionGraph",
"(",
"$",
"fetch",
"=",
"false",
",",
"$",
"rowEvolution",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"rowEvolution",
")",
")",
"{",
"$",
"label",
"=",
"Common",
"::",
"getRequestVar",
"(",
"'label'... | Generic method to get an evolution graph or a sparkline for the row evolution popover | [
"Generic",
"method",
"to",
"get",
"an",
"evolution",
"graph",
"or",
"a",
"sparkline",
"for",
"the",
"row",
"evolution",
"popover"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L224-L236 |
209,343 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.makeRowEvolution | private function makeRowEvolution($isMultiRowEvolution, $graphType = null)
{
if ($isMultiRowEvolution) {
return new MultiRowEvolution($this->idSite, $this->date, $graphType);
} else {
return new RowEvolution($this->idSite, $this->date, $graphType);
}
} | php | private function makeRowEvolution($isMultiRowEvolution, $graphType = null)
{
if ($isMultiRowEvolution) {
return new MultiRowEvolution($this->idSite, $this->date, $graphType);
} else {
return new RowEvolution($this->idSite, $this->date, $graphType);
}
} | [
"private",
"function",
"makeRowEvolution",
"(",
"$",
"isMultiRowEvolution",
",",
"$",
"graphType",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"isMultiRowEvolution",
")",
"{",
"return",
"new",
"MultiRowEvolution",
"(",
"$",
"this",
"->",
"idSite",
",",
"$",
"this... | Utility function. Creates a RowEvolution instance. | [
"Utility",
"function",
".",
"Creates",
"a",
"RowEvolution",
"instance",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L239-L246 |
209,344 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.checkForUpdates | public function checkForUpdates()
{
Piwik::checkUserHasSomeAdminAccess();
$this->checkTokenInUrl();
// perform check (but only once every 10s)
UpdateCheck::check($force = false, UpdateCheck::UI_CLICK_CHECK_INTERVAL);
$view = new View('@CoreHome/checkForUpdates');
$t... | php | public function checkForUpdates()
{
Piwik::checkUserHasSomeAdminAccess();
$this->checkTokenInUrl();
// perform check (but only once every 10s)
UpdateCheck::check($force = false, UpdateCheck::UI_CLICK_CHECK_INTERVAL);
$view = new View('@CoreHome/checkForUpdates');
$t... | [
"public",
"function",
"checkForUpdates",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSomeAdminAccess",
"(",
")",
";",
"$",
"this",
"->",
"checkTokenInUrl",
"(",
")",
";",
"// perform check (but only once every 10s)",
"UpdateCheck",
"::",
"check",
"(",
"$",
"force",
... | Forces a check for updates and re-renders the header message.
This will check piwik.org at most once per 10s. | [
"Forces",
"a",
"check",
"for",
"updates",
"and",
"re",
"-",
"renders",
"the",
"header",
"message",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L253-L264 |
209,345 | matomo-org/matomo | plugins/CoreHome/Controller.php | Controller.redirectToPaypal | public function redirectToPaypal()
{
$parameters = Request::getRequestArrayFromString($request = null);
foreach ($parameters as $name => $param) {
if ($name == 'idSite'
|| $name == 'module'
|| $name == 'action'
) {
unset($parame... | php | public function redirectToPaypal()
{
$parameters = Request::getRequestArrayFromString($request = null);
foreach ($parameters as $name => $param) {
if ($name == 'idSite'
|| $name == 'module'
|| $name == 'action'
) {
unset($parame... | [
"public",
"function",
"redirectToPaypal",
"(",
")",
"{",
"$",
"parameters",
"=",
"Request",
"::",
"getRequestArrayFromString",
"(",
"$",
"request",
"=",
"null",
")",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"name",
"=>",
"$",
"param",
")",
"{",
... | Redirects the user to a paypal so they can donate to Piwik. | [
"Redirects",
"the",
"user",
"to",
"a",
"paypal",
"so",
"they",
"can",
"donate",
"to",
"Piwik",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreHome/Controller.php#L269-L298 |
209,346 | matomo-org/matomo | core/DataTable/Renderer/Xml.php | Xml.renderArray | private function renderArray($array, $prefixLines)
{
$isAssociativeArray = Piwik::isAssociativeArray($array);
// check if array contains arrays, and if not wrap the result in an extra <row> element
// (only check if this is the root renderArray call)
// NOTE: this is for backwards c... | php | private function renderArray($array, $prefixLines)
{
$isAssociativeArray = Piwik::isAssociativeArray($array);
// check if array contains arrays, and if not wrap the result in an extra <row> element
// (only check if this is the root renderArray call)
// NOTE: this is for backwards c... | [
"private",
"function",
"renderArray",
"(",
"$",
"array",
",",
"$",
"prefixLines",
")",
"{",
"$",
"isAssociativeArray",
"=",
"Piwik",
"::",
"isAssociativeArray",
"(",
"$",
"array",
")",
";",
"// check if array contains arrays, and if not wrap the result in an extra <row> e... | Renders an array as XML.
@param array $array The array to render.
@param string $prefixLines The string to prefix each line in the output.
@return string | [
"Renders",
"an",
"array",
"as",
"XML",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Xml.php#L136-L213 |
209,347 | matomo-org/matomo | core/DataTable/Renderer/Xml.php | Xml.renderDataTableMap | protected function renderDataTableMap($table, $array, $prefixLines = "")
{
// CASE 1
//array
// 'day1' => string '14' (length=2)
// 'day2' => string '6' (length=1)
$firstTable = current($array);
if (!is_array($firstTable)) {
$xml = '';
$nameD... | php | protected function renderDataTableMap($table, $array, $prefixLines = "")
{
// CASE 1
//array
// 'day1' => string '14' (length=2)
// 'day2' => string '6' (length=1)
$firstTable = current($array);
if (!is_array($firstTable)) {
$xml = '';
$nameD... | [
"protected",
"function",
"renderDataTableMap",
"(",
"$",
"table",
",",
"$",
"array",
",",
"$",
"prefixLines",
"=",
"\"\"",
")",
"{",
"// CASE 1",
"//array",
"// 'day1' => string '14' (length=2)",
"// 'day2' => string '6' (length=1)",
"$",
"firstTable",
"=",
"current",... | Computes the output for the given data table array
@param Map $table
@param array $array
@param string $prefixLines
@return string | [
"Computes",
"the",
"output",
"for",
"the",
"given",
"data",
"table",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Xml.php#L223-L330 |
209,348 | matomo-org/matomo | core/DataTable/Renderer/Xml.php | Xml.renderDataTable | protected function renderDataTable($array, $prefixLine = "")
{
$columnsHaveInvalidChars = $this->areTableLabelsInvalidXmlTagNames(reset($array));
$out = '';
foreach ($array as $rowId => $row) {
if (!is_array($row)) {
$value = self::formatValueXml($row);
... | php | protected function renderDataTable($array, $prefixLine = "")
{
$columnsHaveInvalidChars = $this->areTableLabelsInvalidXmlTagNames(reset($array));
$out = '';
foreach ($array as $rowId => $row) {
if (!is_array($row)) {
$value = self::formatValueXml($row);
... | [
"protected",
"function",
"renderDataTable",
"(",
"$",
"array",
",",
"$",
"prefixLine",
"=",
"\"\"",
")",
"{",
"$",
"columnsHaveInvalidChars",
"=",
"$",
"this",
"->",
"areTableLabelsInvalidXmlTagNames",
"(",
"reset",
"(",
"$",
"array",
")",
")",
";",
"$",
"ou... | Computes the output for the given data array
@param array $array
@param string $prefixLine
@return string | [
"Computes",
"the",
"output",
"for",
"the",
"given",
"data",
"array"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Xml.php#L339-L396 |
209,349 | matomo-org/matomo | core/DataTable/Renderer/Xml.php | Xml.isValidXmlTagName | private static function isValidXmlTagName($str)
{
static $validTagRegex = null;
if ($validTagRegex === null) {
$invalidTagChars = "!\"#$%&'()*+,\\/;<=>?@[\\]\\\\^`{|}~";
$invalidTagStartChars = $invalidTagChars . "\\-.0123456789";
$validTagRegex = "/^[^" . $inval... | php | private static function isValidXmlTagName($str)
{
static $validTagRegex = null;
if ($validTagRegex === null) {
$invalidTagChars = "!\"#$%&'()*+,\\/;<=>?@[\\]\\\\^`{|}~";
$invalidTagStartChars = $invalidTagChars . "\\-.0123456789";
$validTagRegex = "/^[^" . $inval... | [
"private",
"static",
"function",
"isValidXmlTagName",
"(",
"$",
"str",
")",
"{",
"static",
"$",
"validTagRegex",
"=",
"null",
";",
"if",
"(",
"$",
"validTagRegex",
"===",
"null",
")",
"{",
"$",
"invalidTagChars",
"=",
"\"!\\\"#$%&'()*+,\\\\/;<=>?@[\\\\]\\\\\\\\^`{... | Returns true if a string is a valid XML tag name, false if otherwise.
@param string $str
@return bool | [
"Returns",
"true",
"if",
"a",
"string",
"is",
"a",
"valid",
"XML",
"tag",
"name",
"false",
"if",
"otherwise",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Xml.php#L432-L444 |
209,350 | matomo-org/matomo | libs/Zend/Mail/Transport/Smtp.php | Zend_Mail_Transport_Smtp._sendMail | public function _sendMail()
{
// If sending multiple messages per session use existing adapter
if (!($this->_connection instanceof Zend_Mail_Protocol_Smtp)) {
// Check if authentication is required and determine required class
$connectionClass = 'Zend_Mail_Protocol_Smtp';
... | php | public function _sendMail()
{
// If sending multiple messages per session use existing adapter
if (!($this->_connection instanceof Zend_Mail_Protocol_Smtp)) {
// Check if authentication is required and determine required class
$connectionClass = 'Zend_Mail_Protocol_Smtp';
... | [
"public",
"function",
"_sendMail",
"(",
")",
"{",
"// If sending multiple messages per session use existing adapter",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"_connection",
"instanceof",
"Zend_Mail_Protocol_Smtp",
")",
")",
"{",
"// Check if authentication is required and det... | Send an email via the SMTP connection protocol
The connection via the protocol adapter is made just-in-time to allow a
developer to add a custom adapter if required before mail is sent.
@return void
@todo Rename this to sendMail, it's a public method... | [
"Send",
"an",
"email",
"via",
"the",
"SMTP",
"connection",
"protocol"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Smtp.php#L185-L216 |
209,351 | matomo-org/matomo | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.getValue | public function getValue()
{
$values = array();
foreach ($this as $child) {
$value = $child->getValue();
if (null !== $value) {
if ($child instanceof HTML_QuickForm2_Container
&& !$child->prependsName()
) {
... | php | public function getValue()
{
$values = array();
foreach ($this as $child) {
$value = $child->getValue();
if (null !== $value) {
if ($child instanceof HTML_QuickForm2_Container
&& !$child->prependsName()
) {
... | [
"public",
"function",
"getValue",
"(",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"child",
")",
"{",
"$",
"value",
"=",
"$",
"child",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"null",
"!==",
... | Returns the element's value
The default implementation for Containers is to return an array with
contained elements' values. The array is indexed the same way $_GET and
$_POST arrays would be for these elements.
@return array|null | [
"Returns",
"the",
"element",
"s",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L115-L145 |
209,352 | matomo-org/matomo | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.getElementById | public function getElementById($id)
{
foreach ($this->getRecursiveIterator() as $element) {
if ($id == $element->getId()) {
return $element;
}
}
return null;
} | php | public function getElementById($id)
{
foreach ($this->getRecursiveIterator() as $element) {
if ($id == $element->getId()) {
return $element;
}
}
return null;
} | [
"public",
"function",
"getElementById",
"(",
"$",
"id",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRecursiveIterator",
"(",
")",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"id",
"==",
"$",
"element",
"->",
"getId",
"(",
")",
")",
"{",
"r... | Returns an element if its id is found
@param string Element id to find
@return HTML_QuickForm2_Node|null | [
"Returns",
"an",
"element",
"if",
"its",
"id",
"is",
"found"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L263-L271 |
209,353 | matomo-org/matomo | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.getElementsByName | public function getElementsByName($name)
{
$found = array();
foreach ($this->getRecursiveIterator() as $element) {
if ($element->getName() == $name) {
$found[] = $element;
}
}
return $found;
} | php | public function getElementsByName($name)
{
$found = array();
foreach ($this->getRecursiveIterator() as $element) {
if ($element->getName() == $name) {
$found[] = $element;
}
}
return $found;
} | [
"public",
"function",
"getElementsByName",
"(",
"$",
"name",
")",
"{",
"$",
"found",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRecursiveIterator",
"(",
")",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"->",
"g... | Returns an array of elements which name corresponds to element
@param string Elements name to find
@return array | [
"Returns",
"an",
"array",
"of",
"elements",
"which",
"name",
"corresponds",
"to",
"element"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L279-L288 |
209,354 | matomo-org/matomo | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.render | public function render(HTML_QuickForm2_Renderer $renderer)
{
foreach ($this->rules as $rule) {
if ($rule[1] & HTML_QuickForm2_Rule::RUNAT_CLIENT) {
$renderer->getJavascriptBuilder()->addRule($rule[0]);
}
}
$renderer->startContainer($this);
fore... | php | public function render(HTML_QuickForm2_Renderer $renderer)
{
foreach ($this->rules as $rule) {
if ($rule[1] & HTML_QuickForm2_Rule::RUNAT_CLIENT) {
$renderer->getJavascriptBuilder()->addRule($rule[0]);
}
}
$renderer->startContainer($this);
fore... | [
"public",
"function",
"render",
"(",
"HTML_QuickForm2_Renderer",
"$",
"renderer",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"rule",
")",
"{",
"if",
"(",
"$",
"rule",
"[",
"1",
"]",
"&",
"HTML_QuickForm2_Rule",
"::",
"RUNAT_CLIENT",
... | Renders the container using the given renderer
@param HTML_QuickForm2_Renderer Renderer instance
@return HTML_QuickForm2_Renderer | [
"Renders",
"the",
"container",
"using",
"the",
"given",
"renderer"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L419-L432 |
209,355 | matomo-org/matomo | libs/HTML/QuickForm2/Container.php | HTML_QuickForm2_Container.getJavascriptValue | public function getJavascriptValue()
{
$args = array();
foreach ($this as $child) {
if ($child instanceof HTML_QuickForm2_Container) {
$args[] = $child->getJavascriptValue();
} else {
$args[] = "'" . $child->getId() . "'";
}
... | php | public function getJavascriptValue()
{
$args = array();
foreach ($this as $child) {
if ($child instanceof HTML_QuickForm2_Container) {
$args[] = $child->getJavascriptValue();
} else {
$args[] = "'" . $child->getId() . "'";
}
... | [
"public",
"function",
"getJavascriptValue",
"(",
")",
"{",
"$",
"args",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"instanceof",
"HTML_QuickForm2_Container",
")",
"{",
"$",
"args",
"... | Returns Javascript code for getting the element's value
@return string | [
"Returns",
"Javascript",
"code",
"for",
"getting",
"the",
"element",
"s",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Container.php#L446-L457 |
209,356 | matomo-org/matomo | plugins/LanguagesManager/TranslationWriter/Filter/UnnecassaryWhitespaces.php | UnnecassaryWhitespaces.filter | public function filter($translations)
{
foreach ($translations as $pluginName => $pluginTranslations) {
foreach ($pluginTranslations as $key => $translation) {
$baseTranslation = '';
if (isset($this->baseTranslations[$pluginName][$key])) {
$ba... | php | public function filter($translations)
{
foreach ($translations as $pluginName => $pluginTranslations) {
foreach ($pluginTranslations as $key => $translation) {
$baseTranslation = '';
if (isset($this->baseTranslations[$pluginName][$key])) {
$ba... | [
"public",
"function",
"filter",
"(",
"$",
"translations",
")",
"{",
"foreach",
"(",
"$",
"translations",
"as",
"$",
"pluginName",
"=>",
"$",
"pluginTranslations",
")",
"{",
"foreach",
"(",
"$",
"pluginTranslations",
"as",
"$",
"key",
"=>",
"$",
"translation"... | Removes all unnecassary whitespaces and newlines from the given translations
@param array $translations
@return array filtered translations | [
"Removes",
"all",
"unnecassary",
"whitespaces",
"and",
"newlines",
"from",
"the",
"given",
"translations"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/UnnecassaryWhitespaces.php#L33-L61 |
209,357 | matomo-org/matomo | plugins/Diagnostics/Diagnostic/DiagnosticResult.php | DiagnosticResult.getStatus | public function getStatus()
{
$status = self::STATUS_OK;
foreach ($this->getItems() as $item) {
if ($item->getStatus() === self::STATUS_ERROR) {
return self::STATUS_ERROR;
}
if ($item->getStatus() === self::STATUS_WARNING) {
$stat... | php | public function getStatus()
{
$status = self::STATUS_OK;
foreach ($this->getItems() as $item) {
if ($item->getStatus() === self::STATUS_ERROR) {
return self::STATUS_ERROR;
}
if ($item->getStatus() === self::STATUS_WARNING) {
$stat... | [
"public",
"function",
"getStatus",
"(",
")",
"{",
"$",
"status",
"=",
"self",
"::",
"STATUS_OK",
";",
"foreach",
"(",
"$",
"this",
"->",
"getItems",
"(",
")",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"->",
"getStatus",
"(",
")",
"===",
... | Returns the worst status of the items.
@return string One of the `STATUS_*` constants. | [
"Returns",
"the",
"worst",
"status",
"of",
"the",
"items",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Diagnostics/Diagnostic/DiagnosticResult.php#L105-L120 |
209,358 | matomo-org/matomo | plugins/LanguagesManager/TranslationWriter/Filter/EmptyTranslations.php | EmptyTranslations.filter | public function filter($translations)
{
$translationsBefore = $translations;
foreach ($translations as $plugin => &$pluginTranslations) {
$pluginTranslations = array_filter($pluginTranslations, function ($value) {
return !empty($value) && '' != trim($value);
... | php | public function filter($translations)
{
$translationsBefore = $translations;
foreach ($translations as $plugin => &$pluginTranslations) {
$pluginTranslations = array_filter($pluginTranslations, function ($value) {
return !empty($value) && '' != trim($value);
... | [
"public",
"function",
"filter",
"(",
"$",
"translations",
")",
"{",
"$",
"translationsBefore",
"=",
"$",
"translations",
";",
"foreach",
"(",
"$",
"translations",
"as",
"$",
"plugin",
"=>",
"&",
"$",
"pluginTranslations",
")",
"{",
"$",
"pluginTranslations",
... | Removes all empty translations
@param array $translations
@return array filtered translations | [
"Removes",
"all",
"empty",
"translations"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/LanguagesManager/TranslationWriter/Filter/EmptyTranslations.php#L21-L43 |
209,359 | matomo-org/matomo | plugins/Dashboard/Dashboard.php | Dashboard.getLayoutForUser | public function getLayoutForUser($login, $idDashboard)
{
$return = $this->getModel()->getLayoutForUser($login, $idDashboard);
if (count($return) == 0) {
return false;
}
return $return[0]['layout'];
} | php | public function getLayoutForUser($login, $idDashboard)
{
$return = $this->getModel()->getLayoutForUser($login, $idDashboard);
if (count($return) == 0) {
return false;
}
return $return[0]['layout'];
} | [
"public",
"function",
"getLayoutForUser",
"(",
"$",
"login",
",",
"$",
"idDashboard",
")",
"{",
"$",
"return",
"=",
"$",
"this",
"->",
"getModel",
"(",
")",
"->",
"getLayoutForUser",
"(",
"$",
"login",
",",
"$",
"idDashboard",
")",
";",
"if",
"(",
"cou... | Returns the layout in the DB for the given user, or false if the layout has not been set yet.
Parameters must be checked BEFORE this function call
@param string $login
@param int $idDashboard
@return bool|string | [
"Returns",
"the",
"layout",
"in",
"the",
"DB",
"for",
"the",
"given",
"user",
"or",
"false",
"if",
"the",
"layout",
"has",
"not",
"been",
"set",
"yet",
".",
"Parameters",
"must",
"be",
"checked",
"BEFORE",
"this",
"function",
"call"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Dashboard/Dashboard.php#L132-L141 |
209,360 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.onAttributeChange | protected function onAttributeChange($name, $value = null)
{
if ('name' == $name) {
if (null === $value) {
throw new HTML_QuickForm2_InvalidArgumentException(
"Required attribute 'name' can not be removed"
);
} else {
... | php | protected function onAttributeChange($name, $value = null)
{
if ('name' == $name) {
if (null === $value) {
throw new HTML_QuickForm2_InvalidArgumentException(
"Required attribute 'name' can not be removed"
);
} else {
... | [
"protected",
"function",
"onAttributeChange",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"'name'",
"==",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"value",
")",
"{",
"throw",
"new",
"HTML_QuickForm2_InvalidArgument... | Intercepts setting 'name' and 'id' attributes
These attributes should always be present and thus trying to remove them
will result in an exception. Changing their values is delegated to
setName() and setId() methods, respectively
@param string Attribute name
@param string Attribute value, null if attribute is... | [
"Intercepts",
"setting",
"name",
"and",
"id",
"attributes"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L156-L175 |
209,361 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.generateId | protected static function generateId($elementName)
{
$stop = !self::getOption('id_force_append_index');
$tokens = strlen($elementName)
? explode('[', str_replace(']', '', $elementName))
: ($stop? array('qfauto', ''): array('qfauto'));
$co... | php | protected static function generateId($elementName)
{
$stop = !self::getOption('id_force_append_index');
$tokens = strlen($elementName)
? explode('[', str_replace(']', '', $elementName))
: ($stop? array('qfauto', ''): array('qfauto'));
$co... | [
"protected",
"static",
"function",
"generateId",
"(",
"$",
"elementName",
")",
"{",
"$",
"stop",
"=",
"!",
"self",
"::",
"getOption",
"(",
"'id_force_append_index'",
")",
";",
"$",
"tokens",
"=",
"strlen",
"(",
"$",
"elementName",
")",
"?",
"explode",
"(",... | Generates an id for the element
Called when an element is created without explicitly given id
@param string Element name
@return string The generated element id | [
"Generates",
"an",
"id",
"for",
"the",
"element"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L206-L245 |
209,362 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.storeId | protected static function storeId($id)
{
$tokens = explode('-', $id);
$container =& self::$ids;
do {
$token = array_shift($tokens);
if (!isset($container[$token])) {
$container[$token] = array();
}
$container =& $container[... | php | protected static function storeId($id)
{
$tokens = explode('-', $id);
$container =& self::$ids;
do {
$token = array_shift($tokens);
if (!isset($container[$token])) {
$container[$token] = array();
}
$container =& $container[... | [
"protected",
"static",
"function",
"storeId",
"(",
"$",
"id",
")",
"{",
"$",
"tokens",
"=",
"explode",
"(",
"'-'",
",",
"$",
"id",
")",
";",
"$",
"container",
"=",
"&",
"self",
"::",
"$",
"ids",
";",
"do",
"{",
"$",
"token",
"=",
"array_shift",
"... | Stores the explicitly given id to prevent duplicate id generation
@param string Element id | [
"Stores",
"the",
"explicitly",
"given",
"id",
"to",
"prevent",
"duplicate",
"id",
"generation"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L253-L265 |
209,363 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.setId | public function setId($id = null)
{
if (is_null($id)) {
$id = self::generateId($this->getName());
} else {
self::storeId($id);
}
$this->attributes['id'] = (string)$id;
return $this;
} | php | public function setId($id = null)
{
if (is_null($id)) {
$id = self::generateId($this->getName());
} else {
self::storeId($id);
}
$this->attributes['id'] = (string)$id;
return $this;
} | [
"public",
"function",
"setId",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"id",
")",
")",
"{",
"$",
"id",
"=",
"self",
"::",
"generateId",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
";",
"}",
"else",
"{",
"s... | Sets the elements id
Please note that elements should always have an id in QuickForm2 and
therefore it will not be possible to remove the element's id or set it to
an empty value. If id is not explicitly given, it will be autogenerated.
@param string Element's id, will be autogenerated if not given
@return HTML... | [
"Sets",
"the",
"elements",
"id"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L328-L337 |
209,364 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.toggleFrozen | public function toggleFrozen($freeze = null)
{
$old = $this->frozen;
if (null !== $freeze) {
$this->frozen = (bool)$freeze;
}
return $old;
} | php | public function toggleFrozen($freeze = null)
{
$old = $this->frozen;
if (null !== $freeze) {
$this->frozen = (bool)$freeze;
}
return $old;
} | [
"public",
"function",
"toggleFrozen",
"(",
"$",
"freeze",
"=",
"null",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"frozen",
";",
"if",
"(",
"null",
"!==",
"$",
"freeze",
")",
"{",
"$",
"this",
"->",
"frozen",
"=",
"(",
"bool",
")",
"$",
"freez... | Changes the element's frozen status
@param bool Whether the element should be frozen or editable. If
omitted, the method will not change the frozen status,
just return its current value
@return bool Old value of element's frozen status | [
"Changes",
"the",
"element",
"s",
"frozen",
"status"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L392-L399 |
209,365 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.persistentFreeze | public function persistentFreeze($persistent = null)
{
$old = $this->persistent;
if (null !== $persistent) {
$this->persistent = (bool)$persistent;
}
return $old;
} | php | public function persistentFreeze($persistent = null)
{
$old = $this->persistent;
if (null !== $persistent) {
$this->persistent = (bool)$persistent;
}
return $old;
} | [
"public",
"function",
"persistentFreeze",
"(",
"$",
"persistent",
"=",
"null",
")",
"{",
"$",
"old",
"=",
"$",
"this",
"->",
"persistent",
";",
"if",
"(",
"null",
"!==",
"$",
"persistent",
")",
"{",
"$",
"this",
"->",
"persistent",
"=",
"(",
"bool",
... | Changes the element's persistent freeze behaviour
If persistent freeze is on, the element's value will be kept (and
submitted) in a hidden field when the element is frozen.
@param bool New value for "persistent freeze". If omitted, the
method will not set anything, just return the current
value of the flag.
@re... | [
"Changes",
"the",
"element",
"s",
"persistent",
"freeze",
"behaviour"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L413-L420 |
209,366 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.setContainer | protected function setContainer(HTML_QuickForm2_Container $container = null)
{
if (null !== $container) {
$check = $container;
do {
if ($this === $check) {
throw new HTML_QuickForm2_InvalidArgumentException(
'Cannot set an e... | php | protected function setContainer(HTML_QuickForm2_Container $container = null)
{
if (null !== $container) {
$check = $container;
do {
if ($this === $check) {
throw new HTML_QuickForm2_InvalidArgumentException(
'Cannot set an e... | [
"protected",
"function",
"setContainer",
"(",
"HTML_QuickForm2_Container",
"$",
"container",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"container",
")",
"{",
"$",
"check",
"=",
"$",
"container",
";",
"do",
"{",
"if",
"(",
"$",
"this",
"===",
... | Adds the link to the element containing current
@param HTML_QuickForm2_Container Element containing the current one,
null if the link should really be
removed (if removing from container)
@throws HTML_QuickForm2_InvalidArgumentException If trying to set a
child of an element as its container | [
"Adds",
"the",
"link",
"to",
"the",
"element",
"containing",
"current"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L432-L451 |
209,367 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.addRule | public function addRule($rule, $messageOrRunAt = '', $options = null,
$runAt = HTML_QuickForm2_Rule::RUNAT_SERVER)
{
if ($rule instanceof HTML_QuickForm2_Rule) {
$rule->setOwner($this);
$runAt = '' == $messageOrRunAt? HTML_QuickForm2_Rule::RUNAT_SERVER: $m... | php | public function addRule($rule, $messageOrRunAt = '', $options = null,
$runAt = HTML_QuickForm2_Rule::RUNAT_SERVER)
{
if ($rule instanceof HTML_QuickForm2_Rule) {
$rule->setOwner($this);
$runAt = '' == $messageOrRunAt? HTML_QuickForm2_Rule::RUNAT_SERVER: $m... | [
"public",
"function",
"addRule",
"(",
"$",
"rule",
",",
"$",
"messageOrRunAt",
"=",
"''",
",",
"$",
"options",
"=",
"null",
",",
"$",
"runAt",
"=",
"HTML_QuickForm2_Rule",
"::",
"RUNAT_SERVER",
")",
"{",
"if",
"(",
"$",
"rule",
"instanceof",
"HTML_QuickFor... | Adds a validation rule
@param HTML_QuickForm2_Rule|string Validation rule or rule type
@param string|int If first parameter is rule type, then
message to display if validation fails, otherwise constant showing
whether to perfom validation client-side and/or server-side
@param mixed ... | [
"Adds",
"a",
"validation",
"rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L500-L517 |
209,368 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.removeRule | public function removeRule(HTML_QuickForm2_Rule $rule)
{
foreach ($this->rules as $i => $r) {
if ($r[0] === $rule) {
unset($this->rules[$i]);
break;
}
}
return $rule;
} | php | public function removeRule(HTML_QuickForm2_Rule $rule)
{
foreach ($this->rules as $i => $r) {
if ($r[0] === $rule) {
unset($this->rules[$i]);
break;
}
}
return $rule;
} | [
"public",
"function",
"removeRule",
"(",
"HTML_QuickForm2_Rule",
"$",
"rule",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rules",
"as",
"$",
"i",
"=>",
"$",
"r",
")",
"{",
"if",
"(",
"$",
"r",
"[",
"0",
"]",
"===",
"$",
"rule",
")",
"{",
"unset... | Removes a validation rule
The method will *not* throw an Exception if the rule wasn't added to the
element.
@param HTML_QuickForm2_Rule Validation rule to remove
@return HTML_QuickForm2_Rule Removed rule | [
"Removes",
"a",
"validation",
"rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L528-L537 |
209,369 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.createRule | public function createRule($type, $message = '', $options = null)
{
return HTML_QuickForm2_Factory::createRule($type, $this, $message, $options);
} | php | public function createRule($type, $message = '', $options = null)
{
return HTML_QuickForm2_Factory::createRule($type, $this, $message, $options);
} | [
"public",
"function",
"createRule",
"(",
"$",
"type",
",",
"$",
"message",
"=",
"''",
",",
"$",
"options",
"=",
"null",
")",
"{",
"return",
"HTML_QuickForm2_Factory",
"::",
"createRule",
"(",
"$",
"type",
",",
"$",
"this",
",",
"$",
"message",
",",
"$"... | Creates a validation rule
This method is mostly useful when when chaining several rules together
via {@link HTML_QuickForm2_Rule::and_()} and {@link HTML_QuickForm2_Rule::or_()}
methods:
<code>
$first->addRule('nonempty', 'Fill in either first or second field')
->or_($second->createRule('nonempty'));
</code>
@param ... | [
"Creates",
"a",
"validation",
"rule"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L558-L561 |
209,370 | matomo-org/matomo | libs/HTML/QuickForm2/Node.php | HTML_QuickForm2_Node.applyFilters | protected function applyFilters($value)
{
foreach ($this->filters as $filter) {
if (is_array($value) && !empty($filter['recursive'])) {
array_walk_recursive($value,
array('HTML_QuickForm2_Node', 'applyFilter'), $filter);
} else {
s... | php | protected function applyFilters($value)
{
foreach ($this->filters as $filter) {
if (is_array($value) && !empty($filter['recursive'])) {
array_walk_recursive($value,
array('HTML_QuickForm2_Node', 'applyFilter'), $filter);
} else {
s... | [
"protected",
"function",
"applyFilters",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"as",
"$",
"filter",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"empty",
"(",
"$",
"filter",
"[",
"'recursive... | Applies element filters on element value
@param mixed Element value
@return mixed Filtered value | [
"Applies",
"element",
"filters",
"on",
"element",
"value"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/HTML/QuickForm2/Node.php#L668-L679 |
209,371 | matomo-org/matomo | core/EventDispatcher.php | EventDispatcher.postEvent | public function postEvent($eventName, $params, $pending = false, $plugins = null)
{
if ($pending) {
$this->pendingEvents[] = array($eventName, $params);
}
$manager = $this->pluginManager;
if (empty($plugins)) {
$plugins = $manager->getPluginsLoadedAndActivat... | php | public function postEvent($eventName, $params, $pending = false, $plugins = null)
{
if ($pending) {
$this->pendingEvents[] = array($eventName, $params);
}
$manager = $this->pluginManager;
if (empty($plugins)) {
$plugins = $manager->getPluginsLoadedAndActivat... | [
"public",
"function",
"postEvent",
"(",
"$",
"eventName",
",",
"$",
"params",
",",
"$",
"pending",
"=",
"false",
",",
"$",
"plugins",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"pending",
")",
"{",
"$",
"this",
"->",
"pendingEvents",
"[",
"]",
"=",
"ar... | Triggers an event, executing all callbacks associated with it.
@param string $eventName The name of the event, ie, API.getReportMetadata.
@param array $params The parameters to pass to each callback when executing.
@param bool $pending Whether this event should be posted again for plugins
loaded after the event is fir... | [
"Triggers",
"an",
"event",
"executing",
"all",
"callbacks",
"associated",
"with",
"it",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/EventDispatcher.php#L88-L144 |
209,372 | matomo-org/matomo | core/EventDispatcher.php | EventDispatcher.postPendingEventsTo | public function postPendingEventsTo($plugin)
{
foreach ($this->pendingEvents as $eventInfo) {
list($eventName, $eventParams) = $eventInfo;
$this->postEvent($eventName, $eventParams, $pending = false, array($plugin));
}
} | php | public function postPendingEventsTo($plugin)
{
foreach ($this->pendingEvents as $eventInfo) {
list($eventName, $eventParams) = $eventInfo;
$this->postEvent($eventName, $eventParams, $pending = false, array($plugin));
}
} | [
"public",
"function",
"postPendingEventsTo",
"(",
"$",
"plugin",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"pendingEvents",
"as",
"$",
"eventInfo",
")",
"{",
"list",
"(",
"$",
"eventName",
",",
"$",
"eventParams",
")",
"=",
"$",
"eventInfo",
";",
"$",... | Re-posts all pending events to the given plugin.
@param Plugin $plugin | [
"Re",
"-",
"posts",
"all",
"pending",
"events",
"to",
"the",
"given",
"plugin",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/EventDispatcher.php#L176-L182 |
209,373 | matomo-org/matomo | libs/Zend/Config/Writer/Array.php | Zend_Config_Writer_Array.render | public function render()
{
$data = $this->_config->toArray();
$sectionName = $this->_config->getSectionName();
if (is_string($sectionName)) {
$data = array($sectionName => $data);
}
$arrayString = "<?php\n"
. "return " . var_export($d... | php | public function render()
{
$data = $this->_config->toArray();
$sectionName = $this->_config->getSectionName();
if (is_string($sectionName)) {
$data = array($sectionName => $data);
}
$arrayString = "<?php\n"
. "return " . var_export($d... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"_config",
"->",
"toArray",
"(",
")",
";",
"$",
"sectionName",
"=",
"$",
"this",
"->",
"_config",
"->",
"getSectionName",
"(",
")",
";",
"if",
"(",
"is_string",
"(",
... | Render a Zend_Config into a PHP Array config string.
@since 1.10
@return string | [
"Render",
"a",
"Zend_Config",
"into",
"a",
"PHP",
"Array",
"config",
"string",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Config/Writer/Array.php#L41-L54 |
209,374 | matomo-org/matomo | core/DataArray.php | DataArray.makeEmptyRow | public static function makeEmptyRow()
{
return array(Metrics::INDEX_NB_UNIQ_VISITORS => 0,
Metrics::INDEX_NB_VISITS => 0,
Metrics::INDEX_NB_ACTIONS => 0,
Metrics::INDEX_NB_USERS => 0,
Metrics... | php | public static function makeEmptyRow()
{
return array(Metrics::INDEX_NB_UNIQ_VISITORS => 0,
Metrics::INDEX_NB_VISITS => 0,
Metrics::INDEX_NB_ACTIONS => 0,
Metrics::INDEX_NB_USERS => 0,
Metrics... | [
"public",
"static",
"function",
"makeEmptyRow",
"(",
")",
"{",
"return",
"array",
"(",
"Metrics",
"::",
"INDEX_NB_UNIQ_VISITORS",
"=>",
"0",
",",
"Metrics",
"::",
"INDEX_NB_VISITS",
"=>",
"0",
",",
"Metrics",
"::",
"INDEX_NB_ACTIONS",
"=>",
"0",
",",
"Metrics"... | Returns an empty row containing default metrics
@return array | [
"Returns",
"an",
"empty",
"row",
"containing",
"default",
"metrics"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataArray.php#L60-L71 |
209,375 | matomo-org/matomo | core/DataArray.php | DataArray.sumMetrics | public function sumMetrics($label, $row)
{
foreach ($row as $columnName => $columnValue) {
if (empty($columnValue)) {
continue;
}
if (empty($this->data[$label][$columnName])) {
$this->data[$label][$columnName] = 0;
}
... | php | public function sumMetrics($label, $row)
{
foreach ($row as $columnName => $columnValue) {
if (empty($columnValue)) {
continue;
}
if (empty($this->data[$label][$columnName])) {
$this->data[$label][$columnName] = 0;
}
... | [
"public",
"function",
"sumMetrics",
"(",
"$",
"label",
",",
"$",
"row",
")",
"{",
"foreach",
"(",
"$",
"row",
"as",
"$",
"columnName",
"=>",
"$",
"columnValue",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"columnValue",
")",
")",
"{",
"continue",
";",
... | Generic function that will sum all columns of the given row, at the specified label's row.
@param $label
@param $row
@throws Exception if the the data row contains non numeric values | [
"Generic",
"function",
"that",
"will",
"sum",
"all",
"columns",
"of",
"the",
"given",
"row",
"at",
"the",
"specified",
"label",
"s",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataArray.php#L308-L322 |
209,376 | matomo-org/matomo | core/DataArray.php | DataArray.enrichWithConversions | protected function enrichWithConversions(&$data)
{
foreach ($data as &$values) {
if (!isset($values[Metrics::INDEX_GOALS])) {
continue;
}
// When per goal metrics are processed, general 'visits converted' is not meaningful because
// it could d... | php | protected function enrichWithConversions(&$data)
{
foreach ($data as &$values) {
if (!isset($values[Metrics::INDEX_GOALS])) {
continue;
}
// When per goal metrics are processed, general 'visits converted' is not meaningful because
// it could d... | [
"protected",
"function",
"enrichWithConversions",
"(",
"&",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"&",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"values",
"[",
"Metrics",
"::",
"INDEX_GOALS",
"]",
")",
")",
"{",
... | Given an array of stats, it will process the sum of goal conversions
and sum of revenue and add it in the stats array in two new fields.
@param array $data Passed by reference, two new columns
will be added: total conversions, and total revenue, for all goals for this label/row | [
"Given",
"an",
"array",
"of",
"stats",
"it",
"will",
"process",
"the",
"sum",
"of",
"goal",
"conversions",
"and",
"sum",
"of",
"revenue",
"and",
"add",
"it",
"in",
"the",
"stats",
"array",
"in",
"two",
"new",
"fields",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataArray.php#L378-L409 |
209,377 | matomo-org/matomo | core/DataArray.php | DataArray.isRowActions | public static function isRowActions($row)
{
return (count($row) == count(static::makeEmptyActionRow())) && isset($row[Metrics::INDEX_NB_ACTIONS]);
} | php | public static function isRowActions($row)
{
return (count($row) == count(static::makeEmptyActionRow())) && isset($row[Metrics::INDEX_NB_ACTIONS]);
} | [
"public",
"static",
"function",
"isRowActions",
"(",
"$",
"row",
")",
"{",
"return",
"(",
"count",
"(",
"$",
"row",
")",
"==",
"count",
"(",
"static",
"::",
"makeEmptyActionRow",
"(",
")",
")",
")",
"&&",
"isset",
"(",
"$",
"row",
"[",
"Metrics",
"::... | Returns true if the row looks like an Action metrics row
@param $row
@return bool | [
"Returns",
"true",
"if",
"the",
"row",
"looks",
"like",
"an",
"Action",
"metrics",
"row"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataArray.php#L417-L420 |
209,378 | matomo-org/matomo | core/DataArray.php | DataArray.asDataTable | public function asDataTable()
{
$dataArray = $this->getDataArray();
$dataArrayTwoLevels = $this->getDataArrayWithTwoLevels();
$subtableByLabel = null;
if (!empty($dataArrayTwoLevels)) {
$subtableByLabel = array();
foreach ($dataArrayTwoLevels as $label => $su... | php | public function asDataTable()
{
$dataArray = $this->getDataArray();
$dataArrayTwoLevels = $this->getDataArrayWithTwoLevels();
$subtableByLabel = null;
if (!empty($dataArrayTwoLevels)) {
$subtableByLabel = array();
foreach ($dataArrayTwoLevels as $label => $su... | [
"public",
"function",
"asDataTable",
"(",
")",
"{",
"$",
"dataArray",
"=",
"$",
"this",
"->",
"getDataArray",
"(",
")",
";",
"$",
"dataArrayTwoLevels",
"=",
"$",
"this",
"->",
"getDataArrayWithTwoLevels",
"(",
")",
";",
"$",
"subtableByLabel",
"=",
"null",
... | Converts array to a datatable
@return \Piwik\DataTable | [
"Converts",
"array",
"to",
"a",
"datatable"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataArray.php#L427-L440 |
209,379 | matomo-org/matomo | plugins/CoreAdminHome/API.php | API.invalidateArchivedReports | public function invalidateArchivedReports($idSites, $dates, $period = false, $segment = false, $cascadeDown = false)
{
$idSites = Site::getIdSitesFromIdSitesString($idSites);
if (empty($idSites)) {
throw new Exception("Specify a value for &idSites= as a comma separated list of website ID... | php | public function invalidateArchivedReports($idSites, $dates, $period = false, $segment = false, $cascadeDown = false)
{
$idSites = Site::getIdSitesFromIdSitesString($idSites);
if (empty($idSites)) {
throw new Exception("Specify a value for &idSites= as a comma separated list of website ID... | [
"public",
"function",
"invalidateArchivedReports",
"(",
"$",
"idSites",
",",
"$",
"dates",
",",
"$",
"period",
"=",
"false",
",",
"$",
"segment",
"=",
"false",
",",
"$",
"cascadeDown",
"=",
"false",
")",
"{",
"$",
"idSites",
"=",
"Site",
"::",
"getIdSite... | Invalidates report data, forcing it to be recomputed during the next archiving run.
Note: This is done automatically when tracking or importing visits in the past.
@param string $idSites Comma separated list of site IDs to invalidate reports for.
@param string $dates Comma separated list of dates of periods to invali... | [
"Invalidates",
"report",
"data",
"forcing",
"it",
"to",
"be",
"recomputed",
"during",
"the",
"next",
"archiving",
"run",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L140-L168 |
209,380 | matomo-org/matomo | plugins/CoreAdminHome/API.php | API.runCronArchiving | public function runCronArchiving()
{
Piwik::checkUserHasSuperUserAccess();
// HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)
/** @var \Monolog\Logger $logger */
$logger = StaticContainer::get('Psr\Log\LoggerInterface');
$hand... | php | public function runCronArchiving()
{
Piwik::checkUserHasSuperUserAccess();
// HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)
/** @var \Monolog\Logger $logger */
$logger = StaticContainer::get('Psr\Log\LoggerInterface');
$hand... | [
"public",
"function",
"runCronArchiving",
"(",
")",
"{",
"Piwik",
"::",
"checkUserHasSuperUserAccess",
"(",
")",
";",
"// HTTP request: logs needs to be dumped in the HTTP response (on top of existing log destinations)",
"/** @var \\Monolog\\Logger $logger */",
"$",
"logger",
"=",
... | Initiates cron archiving via web request.
@hideExceptForSuperUser | [
"Initiates",
"cron",
"archiving",
"via",
"web",
"request",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L175-L188 |
209,381 | matomo-org/matomo | plugins/CoreAdminHome/API.php | API.deleteAllTrackingFailures | public function deleteAllTrackingFailures()
{
if (Piwik::hasUserSuperUserAccess()) {
$this->trackingFailures->deleteAllTrackingFailures();
} else {
Piwik::checkUserHasSomeAdminAccess();
$idSites = Access::getInstance()->getSitesIdWithAdminAccess();
Piw... | php | public function deleteAllTrackingFailures()
{
if (Piwik::hasUserSuperUserAccess()) {
$this->trackingFailures->deleteAllTrackingFailures();
} else {
Piwik::checkUserHasSomeAdminAccess();
$idSites = Access::getInstance()->getSitesIdWithAdminAccess();
Piw... | [
"public",
"function",
"deleteAllTrackingFailures",
"(",
")",
"{",
"if",
"(",
"Piwik",
"::",
"hasUserSuperUserAccess",
"(",
")",
")",
"{",
"$",
"this",
"->",
"trackingFailures",
"->",
"deleteAllTrackingFailures",
"(",
")",
";",
"}",
"else",
"{",
"Piwik",
"::",
... | Deletes all tracking failures this user has at least admin access to.
A super user will also delete tracking failures for sites that don't exist. | [
"Deletes",
"all",
"tracking",
"failures",
"this",
"user",
"has",
"at",
"least",
"admin",
"access",
"to",
".",
"A",
"super",
"user",
"will",
"also",
"delete",
"tracking",
"failures",
"for",
"sites",
"that",
"don",
"t",
"exist",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L194-L204 |
209,382 | matomo-org/matomo | plugins/CoreAdminHome/API.php | API.deleteTrackingFailure | public function deleteTrackingFailure($idSite, $idFailure)
{
$idSite = (int) $idSite;
Piwik::checkUserHasAdminAccess($idSite);
$this->trackingFailures->deleteTrackingFailure($idSite, $idFailure);
} | php | public function deleteTrackingFailure($idSite, $idFailure)
{
$idSite = (int) $idSite;
Piwik::checkUserHasAdminAccess($idSite);
$this->trackingFailures->deleteTrackingFailure($idSite, $idFailure);
} | [
"public",
"function",
"deleteTrackingFailure",
"(",
"$",
"idSite",
",",
"$",
"idFailure",
")",
"{",
"$",
"idSite",
"=",
"(",
"int",
")",
"$",
"idSite",
";",
"Piwik",
"::",
"checkUserHasAdminAccess",
"(",
"$",
"idSite",
")",
";",
"$",
"this",
"->",
"track... | Deletes a specific tracking failure
@param int $idSite
@param int $idFailure | [
"Deletes",
"a",
"specific",
"tracking",
"failure"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L211-L217 |
209,383 | matomo-org/matomo | plugins/CoreAdminHome/API.php | API.getTrackingFailures | public function getTrackingFailures()
{
if (Piwik::hasUserSuperUserAccess()) {
$failures = $this->trackingFailures->getAllFailures();
} else {
Piwik::checkUserHasSomeAdminAccess();
$idSites = Access::getInstance()->getSitesIdWithAdminAccess();
Piwik::c... | php | public function getTrackingFailures()
{
if (Piwik::hasUserSuperUserAccess()) {
$failures = $this->trackingFailures->getAllFailures();
} else {
Piwik::checkUserHasSomeAdminAccess();
$idSites = Access::getInstance()->getSitesIdWithAdminAccess();
Piwik::c... | [
"public",
"function",
"getTrackingFailures",
"(",
")",
"{",
"if",
"(",
"Piwik",
"::",
"hasUserSuperUserAccess",
"(",
")",
")",
"{",
"$",
"failures",
"=",
"$",
"this",
"->",
"trackingFailures",
"->",
"getAllFailures",
"(",
")",
";",
"}",
"else",
"{",
"Piwik... | Get all tracking failures. A user retrieves only tracking failures for sites with at least admin access.
A super user will also retrieve failed requests for sites that don't exist.
@return array | [
"Get",
"all",
"tracking",
"failures",
".",
"A",
"user",
"retrieves",
"only",
"tracking",
"failures",
"for",
"sites",
"with",
"at",
"least",
"admin",
"access",
".",
"A",
"super",
"user",
"will",
"also",
"retrieve",
"failed",
"requests",
"for",
"sites",
"that"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L224-L237 |
209,384 | matomo-org/matomo | plugins/CoreAdminHome/API.php | API.getDatesToInvalidateFromString | private function getDatesToInvalidateFromString($dates)
{
$toInvalidate = array();
$invalidDates = array();
$dates = explode(',', trim($dates));
$dates = array_unique($dates);
foreach ($dates as $theDate) {
$theDate = trim($theDate);
try {
... | php | private function getDatesToInvalidateFromString($dates)
{
$toInvalidate = array();
$invalidDates = array();
$dates = explode(',', trim($dates));
$dates = array_unique($dates);
foreach ($dates as $theDate) {
$theDate = trim($theDate);
try {
... | [
"private",
"function",
"getDatesToInvalidateFromString",
"(",
"$",
"dates",
")",
"{",
"$",
"toInvalidate",
"=",
"array",
"(",
")",
";",
"$",
"invalidDates",
"=",
"array",
"(",
")",
";",
"$",
"dates",
"=",
"explode",
"(",
"','",
",",
"trim",
"(",
"$",
"... | Ensure the specified dates are valid.
Store invalid date so we can log them
@param array $dates
@return Date[] | [
"Ensure",
"the",
"specified",
"dates",
"are",
"valid",
".",
"Store",
"invalid",
"date",
"so",
"we",
"can",
"log",
"them"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/API.php#L245-L270 |
209,385 | matomo-org/matomo | core/DataTable.php | DataTable.filter | public function filter($className, $parameters = array())
{
if ($className instanceof \Closure
|| is_array($className)
) {
array_unshift($parameters, $this);
call_user_func_array($className, $parameters);
return;
}
if (in_array($classN... | php | public function filter($className, $parameters = array())
{
if ($className instanceof \Closure
|| is_array($className)
) {
array_unshift($parameters, $this);
call_user_func_array($className, $parameters);
return;
}
if (in_array($classN... | [
"public",
"function",
"filter",
"(",
"$",
"className",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"className",
"instanceof",
"\\",
"Closure",
"||",
"is_array",
"(",
"$",
"className",
")",
")",
"{",
"array_unshift",
"(",
"... | Applies a filter to this datatable.
If {@link enableRecursiveFilters()} was called, the filter will be applied
to all subtables as well.
@param string|Closure $className Class name, eg. `"Sort"` or "Piwik\DataTable\Filters\Sort"`. If no
namespace is supplied, `Piwik\DataTable\BaseFilter` is assumed. This parameter
ca... | [
"Applies",
"a",
"filter",
"to",
"this",
"datatable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L492-L520 |
209,386 | matomo-org/matomo | core/DataTable.php | DataTable.filterSubtables | public function filterSubtables($className, $parameters = array())
{
foreach ($this->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable) {
$subtable->filter($className, $parameters);
$subtable->filterSubtables($classNa... | php | public function filterSubtables($className, $parameters = array())
{
foreach ($this->getRowsWithoutSummaryRow() as $row) {
$subtable = $row->getSubtable();
if ($subtable) {
$subtable->filter($className, $parameters);
$subtable->filterSubtables($classNa... | [
"public",
"function",
"filterSubtables",
"(",
"$",
"className",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getRowsWithoutSummaryRow",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"subtable",
"=",
"$",
"r... | Applies a filter to all subtables but not to this datatable.
@param string|Closure $className Class name, eg. `"Sort"` or "Piwik\DataTable\Filters\Sort"`. If no
namespace is supplied, `Piwik\DataTable\BaseFilter` is assumed. This parameter
can also be a closure that takes a DataTable as its first parameter.
@param arr... | [
"Applies",
"a",
"filter",
"to",
"all",
"subtables",
"but",
"not",
"to",
"this",
"datatable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L530-L539 |
209,387 | matomo-org/matomo | core/DataTable.php | DataTable.addDataTable | public function addDataTable(DataTable $tableToSum)
{
if ($tableToSum instanceof Simple) {
if ($tableToSum->getRowsCount() > 1) {
throw new Exception("Did not expect a Simple table with more than one row in addDataTable()");
}
$row = $tableToSum->getFirstR... | php | public function addDataTable(DataTable $tableToSum)
{
if ($tableToSum instanceof Simple) {
if ($tableToSum->getRowsCount() > 1) {
throw new Exception("Did not expect a Simple table with more than one row in addDataTable()");
}
$row = $tableToSum->getFirstR... | [
"public",
"function",
"addDataTable",
"(",
"DataTable",
"$",
"tableToSum",
")",
"{",
"if",
"(",
"$",
"tableToSum",
"instanceof",
"Simple",
")",
"{",
"if",
"(",
"$",
"tableToSum",
"->",
"getRowsCount",
"(",
")",
">",
"1",
")",
"{",
"throw",
"new",
"Except... | Sums a DataTable to this one.
This method will sum rows that have the same label. If a row is found in `$tableToSum` whose
label is not found in `$this`, the row will be added to `$this`.
If the subtables for this table are loaded, they will be summed as well.
Rows are summed together by summing individual columns. ... | [
"Sums",
"a",
"DataTable",
"to",
"this",
"one",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L625-L645 |
209,388 | matomo-org/matomo | core/DataTable.php | DataTable.rebuildIndex | public function rebuildIndex()
{
$this->rowsIndexByLabel = array();
$this->rebuildIndexContinuously = true;
foreach ($this->rows as $id => $row) {
$label = $row->getColumn('label');
if ($label !== false) {
$this->rowsIndexByLabel[$label] = $id;
... | php | public function rebuildIndex()
{
$this->rowsIndexByLabel = array();
$this->rebuildIndexContinuously = true;
foreach ($this->rows as $id => $row) {
$label = $row->getColumn('label');
if ($label !== false) {
$this->rowsIndexByLabel[$label] = $id;
... | [
"public",
"function",
"rebuildIndex",
"(",
")",
"{",
"$",
"this",
"->",
"rowsIndexByLabel",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"rebuildIndexContinuously",
"=",
"true",
";",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"id",
"=>",
... | Rebuilds the index used to lookup a row by label
@internal | [
"Rebuilds",
"the",
"index",
"used",
"to",
"lookup",
"a",
"row",
"by",
"label"
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L722-L742 |
209,389 | matomo-org/matomo | core/DataTable.php | DataTable.addRow | public function addRow(Row $row)
{
// if there is a upper limit on the number of allowed rows and the table is full,
// add the new row to the summary row
if ($this->maximumAllowedRows > 0
&& $this->getRowsCount() >= $this->maximumAllowedRows - 1
) {
if ($this... | php | public function addRow(Row $row)
{
// if there is a upper limit on the number of allowed rows and the table is full,
// add the new row to the summary row
if ($this->maximumAllowedRows > 0
&& $this->getRowsCount() >= $this->maximumAllowedRows - 1
) {
if ($this... | [
"public",
"function",
"addRow",
"(",
"Row",
"$",
"row",
")",
"{",
"// if there is a upper limit on the number of allowed rows and the table is full,",
"// add the new row to the summary row",
"if",
"(",
"$",
"this",
"->",
"maximumAllowedRows",
">",
"0",
"&&",
"$",
"this",
... | Adds a row to this table.
If {@link setMaximumAllowedRows()} was called and the current row count is
at the maximum, the new row will be summed to the summary row. If there is no summary row,
this row is set as the summary row.
@param Row $row
@return Row `$row` or the summary row if we're at the maximum number of ro... | [
"Adds",
"a",
"row",
"to",
"this",
"table",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L790-L819 |
209,390 | matomo-org/matomo | core/DataTable.php | DataTable.addSummaryRow | public function addSummaryRow(Row $row)
{
$this->summaryRow = $row;
// add summary row to index
if (!$this->indexNotUpToDate
&& $this->rebuildIndexContinuously
) {
$label = $row->getColumn('label');
if ($label !== false) {
$this->r... | php | public function addSummaryRow(Row $row)
{
$this->summaryRow = $row;
// add summary row to index
if (!$this->indexNotUpToDate
&& $this->rebuildIndexContinuously
) {
$label = $row->getColumn('label');
if ($label !== false) {
$this->r... | [
"public",
"function",
"addSummaryRow",
"(",
"Row",
"$",
"row",
")",
"{",
"$",
"this",
"->",
"summaryRow",
"=",
"$",
"row",
";",
"// add summary row to index",
"if",
"(",
"!",
"$",
"this",
"->",
"indexNotUpToDate",
"&&",
"$",
"this",
"->",
"rebuildIndexContin... | Sets the summary row.
_Note: A DataTable can have only one summary row._
@param Row $row
@return Row Returns `$row`. | [
"Sets",
"the",
"summary",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L829-L844 |
209,391 | matomo-org/matomo | core/DataTable.php | DataTable.getColumn | public function getColumn($name)
{
$columnValues = array();
foreach ($this->getRows() as $row) {
$columnValues[] = $row->getColumn($name);
}
return $columnValues;
} | php | public function getColumn($name)
{
$columnValues = array();
foreach ($this->getRows() as $row) {
$columnValues[] = $row->getColumn($name);
}
return $columnValues;
} | [
"public",
"function",
"getColumn",
"(",
"$",
"name",
")",
"{",
"$",
"columnValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"columnValues",
"[",
"]",
"=",
"$",
"row",
"... | Returns an array containing all column values for the requested column.
@param string $name The column name.
@return array The array of column values. | [
"Returns",
"an",
"array",
"containing",
"all",
"column",
"values",
"for",
"the",
"requested",
"column",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L920-L927 |
209,392 | matomo-org/matomo | core/DataTable.php | DataTable.getColumns | public function getColumns()
{
$result = array();
foreach ($this->getRows() as $row) {
$columns = $row->getColumns();
if (!empty($columns)) {
$result = array_keys($columns);
break;
}
}
// make sure column names are ... | php | public function getColumns()
{
$result = array();
foreach ($this->getRows() as $row) {
$columns = $row->getColumns();
if (!empty($columns)) {
$result = array_keys($columns);
break;
}
}
// make sure column names are ... | [
"public",
"function",
"getColumns",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"columns",
"=",
"$",
"row",
"->",
"getColumns",
"(",
")",
";",... | Returns the names of every column this DataTable contains. This method will return the
columns of the first row with data and will assume they occur in every other row as well.
_ Note: If column names still use their in-database INDEX values (@see Metrics), they
will be converted to their string name in the array resu... | [
"Returns",
"the",
"names",
"of",
"every",
"column",
"this",
"DataTable",
"contains",
".",
"This",
"method",
"will",
"return",
"the",
"columns",
"of",
"the",
"first",
"row",
"with",
"data",
"and",
"will",
"assume",
"they",
"occur",
"in",
"every",
"other",
"... | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L958-L977 |
209,393 | matomo-org/matomo | core/DataTable.php | DataTable.getRowsMetadata | public function getRowsMetadata($name)
{
$metadataValues = array();
foreach ($this->getRows() as $row) {
$metadataValues[] = $row->getMetadata($name);
}
return $metadataValues;
} | php | public function getRowsMetadata($name)
{
$metadataValues = array();
foreach ($this->getRows() as $row) {
$metadataValues[] = $row->getMetadata($name);
}
return $metadataValues;
} | [
"public",
"function",
"getRowsMetadata",
"(",
"$",
"name",
")",
"{",
"$",
"metadataValues",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRows",
"(",
")",
"as",
"$",
"row",
")",
"{",
"$",
"metadataValues",
"[",
"]",
"=",
"$",
... | Returns an array containing the requested metadata value of each row.
@param string $name The metadata column to return.
@return array | [
"Returns",
"an",
"array",
"containing",
"the",
"requested",
"metadata",
"value",
"of",
"each",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L985-L992 |
209,394 | matomo-org/matomo | core/DataTable.php | DataTable.getRowsCount | public function getRowsCount()
{
if (is_null($this->summaryRow)) {
return count($this->rows);
} else {
return count($this->rows) + 1;
}
} | php | public function getRowsCount()
{
if (is_null($this->summaryRow)) {
return count($this->rows);
} else {
return count($this->rows) + 1;
}
} | [
"public",
"function",
"getRowsCount",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"summaryRow",
")",
")",
"{",
"return",
"count",
"(",
"$",
"this",
"->",
"rows",
")",
";",
"}",
"else",
"{",
"return",
"count",
"(",
"$",
"this",
"->"... | Returns the number of rows in the table including the summary row.
@return int | [
"Returns",
"the",
"number",
"of",
"rows",
"in",
"the",
"table",
"including",
"the",
"summary",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L999-L1006 |
209,395 | matomo-org/matomo | core/DataTable.php | DataTable.getFirstRow | public function getFirstRow()
{
if (count($this->rows) == 0) {
if (!is_null($this->summaryRow)) {
return $this->summaryRow;
}
return false;
}
return reset($this->rows);
} | php | public function getFirstRow()
{
if (count($this->rows) == 0) {
if (!is_null($this->summaryRow)) {
return $this->summaryRow;
}
return false;
}
return reset($this->rows);
} | [
"public",
"function",
"getFirstRow",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"rows",
")",
"==",
"0",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"summaryRow",
")",
")",
"{",
"return",
"$",
"this",
"->",
"summar... | Returns the first row of the DataTable.
@return Row|false The first row or `false` if it cannot be found. | [
"Returns",
"the",
"first",
"row",
"of",
"the",
"DataTable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1013-L1022 |
209,396 | matomo-org/matomo | core/DataTable.php | DataTable.getLastRow | public function getLastRow()
{
if (!is_null($this->summaryRow)) {
return $this->summaryRow;
}
if (count($this->rows) == 0) {
return false;
}
return end($this->rows);
} | php | public function getLastRow()
{
if (!is_null($this->summaryRow)) {
return $this->summaryRow;
}
if (count($this->rows) == 0) {
return false;
}
return end($this->rows);
} | [
"public",
"function",
"getLastRow",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"summaryRow",
")",
")",
"{",
"return",
"$",
"this",
"->",
"summaryRow",
";",
"}",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"rows",
")",
"==",
... | Returns the last row of the DataTable. If there is a summary row, it
will always be considered the last row.
@return Row|false The last row or `false` if it cannot be found. | [
"Returns",
"the",
"last",
"row",
"of",
"the",
"DataTable",
".",
"If",
"there",
"is",
"a",
"summary",
"row",
"it",
"will",
"always",
"be",
"considered",
"the",
"last",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1030-L1041 |
209,397 | matomo-org/matomo | core/DataTable.php | DataTable.getRowsCountRecursive | public function getRowsCountRecursive()
{
$totalCount = 0;
foreach ($this->rows as $row) {
$subTable = $row->getSubtable();
if ($subTable) {
$count = $subTable->getRowsCountRecursive();
$totalCount += $count;
}
}
$t... | php | public function getRowsCountRecursive()
{
$totalCount = 0;
foreach ($this->rows as $row) {
$subTable = $row->getSubtable();
if ($subTable) {
$count = $subTable->getRowsCountRecursive();
$totalCount += $count;
}
}
$t... | [
"public",
"function",
"getRowsCountRecursive",
"(",
")",
"{",
"$",
"totalCount",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"subTable",
"=",
"$",
"row",
"->",
"getSubtable",
"(",
")",
";",
"if",
"(",
... | Returns the number of rows in the entire DataTable hierarchy. This is the number of rows in this DataTable
summed with the row count of each descendant subtable.
@return int | [
"Returns",
"the",
"number",
"of",
"rows",
"in",
"the",
"entire",
"DataTable",
"hierarchy",
".",
"This",
"is",
"the",
"number",
"of",
"rows",
"in",
"this",
"DataTable",
"summed",
"with",
"the",
"row",
"count",
"of",
"each",
"descendant",
"subtable",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1049-L1062 |
209,398 | matomo-org/matomo | core/DataTable.php | DataTable.renameColumn | public function renameColumn($oldName, $newName)
{
foreach ($this->rows as $row) {
$row->renameColumn($oldName, $newName);
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->renameColumn($oldName, $newName);
}
}
if (!... | php | public function renameColumn($oldName, $newName)
{
foreach ($this->rows as $row) {
$row->renameColumn($oldName, $newName);
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->renameColumn($oldName, $newName);
}
}
if (!... | [
"public",
"function",
"renameColumn",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"row",
")",
"{",
"$",
"row",
"->",
"renameColumn",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
";",
"... | Rename a column in every row. This change is applied recursively to all subtables.
@param string $oldName Old column name.
@param string $newName New column name. | [
"Rename",
"a",
"column",
"in",
"every",
"row",
".",
"This",
"change",
"is",
"applied",
"recursively",
"to",
"all",
"subtables",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1086-L1102 |
209,399 | matomo-org/matomo | core/DataTable.php | DataTable.deleteColumns | public function deleteColumns($names, $deleteRecursiveInSubtables = false)
{
foreach ($this->rows as $row) {
foreach ($names as $name) {
$row->deleteColumn($name);
}
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->d... | php | public function deleteColumns($names, $deleteRecursiveInSubtables = false)
{
foreach ($this->rows as $row) {
foreach ($names as $name) {
$row->deleteColumn($name);
}
$subTable = $row->getSubtable();
if ($subTable) {
$subTable->d... | [
"public",
"function",
"deleteColumns",
"(",
"$",
"names",
",",
"$",
"deleteRecursiveInSubtables",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"rows",
"as",
"$",
"row",
")",
"{",
"foreach",
"(",
"$",
"names",
"as",
"$",
"name",
")",
"{",
... | Deletes several columns by name in every row.
@param array $names List of column names to delete.
@param bool $deleteRecursiveInSubtables Whether to apply this change to all subtables or not. | [
"Deletes",
"several",
"columns",
"by",
"name",
"in",
"every",
"row",
"."
] | 72df150735664275a60a7861e468c6ff3b152a14 | https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable.php#L1110-L1131 |
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.