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,800
matomo-org/matomo
core/Updater/Migration/Db/Factory.php
Factory.addIndex
public function addIndex($table, $columnNames, $indexName = '') { $table = $this->prefixTable($table); if (!is_array($columnNames)) { $columnNames = array($columnNames); } return $this->container->make('Piwik\Updater\Migration\Db\AddIndex', array( 'table' =>...
php
public function addIndex($table, $columnNames, $indexName = '') { $table = $this->prefixTable($table); if (!is_array($columnNames)) { $columnNames = array($columnNames); } return $this->container->make('Piwik\Updater\Migration\Db\AddIndex', array( 'table' =>...
[ "public", "function", "addIndex", "(", "$", "table", ",", "$", "columnNames", ",", "$", "indexName", "=", "''", ")", "{", "$", "table", "=", "$", "this", "->", "prefixTable", "(", "$", "table", ")", ";", "if", "(", "!", "is_array", "(", "$", "colum...
Adds an index to an existing database table. This is equivalent to an `ADD INDEX indexname (column_name_1, column_name_2)` in SQL. It adds a normal index, no unique index. Note: If no indexName is specified, it will automatically generate a name for this index if which is basically: `'index_' . implode('_', $columnNa...
[ "Adds", "an", "index", "to", "an", "existing", "database", "table", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updater/Migration/Db/Factory.php#L255-L266
209,801
matomo-org/matomo
core/Updater/Migration/Db/Factory.php
Factory.addPrimaryKey
public function addPrimaryKey($table, $columnNames) { $table = $this->prefixTable($table); if (!is_array($columnNames)) { $columnNames = array($columnNames); } return $this->container->make('Piwik\Updater\Migration\Db\AddPrimaryKey', array( 'table' => $table,...
php
public function addPrimaryKey($table, $columnNames) { $table = $this->prefixTable($table); if (!is_array($columnNames)) { $columnNames = array($columnNames); } return $this->container->make('Piwik\Updater\Migration\Db\AddPrimaryKey', array( 'table' => $table,...
[ "public", "function", "addPrimaryKey", "(", "$", "table", ",", "$", "columnNames", ")", "{", "$", "table", "=", "$", "this", "->", "prefixTable", "(", "$", "table", ")", ";", "if", "(", "!", "is_array", "(", "$", "columnNames", ")", ")", "{", "$", ...
Adds a primary key to an existing database table. This is equivalent to an `ADD PRIMARY KEY(column_name_1, column_name_2)` in SQL. @param string $table Unprefixed database table name, eg 'log_visit'. @param string[]|string $columnNames Either one or multiple column names, eg array('column_name_1', 'column_name_2') @...
[ "Adds", "a", "primary", "key", "to", "an", "existing", "database", "table", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Updater/Migration/Db/Factory.php#L337-L347
209,802
matomo-org/matomo
plugins/Proxy/Controller.php
Controller.redirect
public function redirect() { $url = Common::getRequestVar('url', '', 'string', $_GET); if (!UrlHelper::isLookLikeUrl($url)) { die('Please check the &url= parameter: it should to be a valid URL'); } // validate referrer $referrer = Url::getReferrer(); if (e...
php
public function redirect() { $url = Common::getRequestVar('url', '', 'string', $_GET); if (!UrlHelper::isLookLikeUrl($url)) { die('Please check the &url= parameter: it should to be a valid URL'); } // validate referrer $referrer = Url::getReferrer(); if (e...
[ "public", "function", "redirect", "(", ")", "{", "$", "url", "=", "Common", "::", "getRequestVar", "(", "'url'", ",", "''", ",", "'string'", ",", "$", "_GET", ")", ";", "if", "(", "!", "UrlHelper", "::", "isLookLikeUrl", "(", "$", "url", ")", ")", ...
Output redirection page instead of linking directly to avoid exposing the referrer on the Piwik demo. @internal param string $url (via $_GET) @deprecated @since 3.6.0
[ "Output", "redirection", "page", "instead", "of", "linking", "directly", "to", "avoid", "exposing", "the", "referrer", "on", "the", "Piwik", "demo", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Proxy/Controller.php#L79-L103
209,803
matomo-org/matomo
plugins/UserCountry/LocationProvider/GeoIp.php
GeoIp.completeLocationResult
public function completeLocationResult(&$location) { parent::completeLocationResult($location); // set region name if region code is set if (empty($location[self::REGION_NAME_KEY]) && !empty($location[self::REGION_CODE_KEY]) && !empty($location[self::COUNTRY_CODE_KEY...
php
public function completeLocationResult(&$location) { parent::completeLocationResult($location); // set region name if region code is set if (empty($location[self::REGION_NAME_KEY]) && !empty($location[self::REGION_CODE_KEY]) && !empty($location[self::COUNTRY_CODE_KEY...
[ "public", "function", "completeLocationResult", "(", "&", "$", "location", ")", "{", "parent", "::", "completeLocationResult", "(", "$", "location", ")", ";", "// set region name if region code is set", "if", "(", "empty", "(", "$", "location", "[", "self", "::", ...
Attempts to fill in some missing information in a GeoIP location. This method will call LocationProvider::completeLocationResult and then try to set the region name of the location if the country code & region code are set. @param array $location The location information to modify.
[ "Attempts", "to", "fill", "in", "some", "missing", "information", "in", "a", "GeoIP", "location", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp.php#L56-L69
209,804
matomo-org/matomo
plugins/UserCountry/LocationProvider/GeoIp.php
GeoIp.getRegionNames
public static function getRegionNames() { if (is_null(self::$regionNames)) { $GEOIP_REGION_NAME = array(); require_once PIWIK_INCLUDE_PATH . '/libs/MaxMindGeoIP/geoipregionvars.php'; self::$regionNames = $GEOIP_REGION_NAME; } return self::$regionNames; ...
php
public static function getRegionNames() { if (is_null(self::$regionNames)) { $GEOIP_REGION_NAME = array(); require_once PIWIK_INCLUDE_PATH . '/libs/MaxMindGeoIP/geoipregionvars.php'; self::$regionNames = $GEOIP_REGION_NAME; } return self::$regionNames; ...
[ "public", "static", "function", "getRegionNames", "(", ")", "{", "if", "(", "is_null", "(", "self", "::", "$", "regionNames", ")", ")", "{", "$", "GEOIP_REGION_NAME", "=", "array", "(", ")", ";", "require_once", "PIWIK_INCLUDE_PATH", ".", "'/libs/MaxMindGeoIP/...
Returns an array of region names mapped by country code & region code. @return array
[ "Returns", "an", "array", "of", "region", "names", "mapped", "by", "country", "code", "&", "region", "code", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp.php#L166-L175
209,805
matomo-org/matomo
plugins/UserCountry/LocationProvider/GeoIp.php
GeoIp.getPathToGeoIpDatabase
public static function getPathToGeoIpDatabase($possibleFileNames) { foreach ($possibleFileNames as $filename) { $path = self::getPathForGeoIpDatabase($filename); if (file_exists($path)) { return $path; } } return false; }
php
public static function getPathToGeoIpDatabase($possibleFileNames) { foreach ($possibleFileNames as $filename) { $path = self::getPathForGeoIpDatabase($filename); if (file_exists($path)) { return $path; } } return false; }
[ "public", "static", "function", "getPathToGeoIpDatabase", "(", "$", "possibleFileNames", ")", "{", "foreach", "(", "$", "possibleFileNames", "as", "$", "filename", ")", "{", "$", "path", "=", "self", "::", "getPathForGeoIpDatabase", "(", "$", "filename", ")", ...
Returns the path of an existing GeoIP database or false if none can be found. @param array $possibleFileNames The list of possible file names for the GeoIP database. @return string|false
[ "Returns", "the", "path", "of", "an", "existing", "GeoIP", "database", "or", "false", "if", "none", "can", "be", "found", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp.php#L183-L192
209,806
matomo-org/matomo
plugins/UserCountry/LocationProvider/GeoIp.php
GeoIp.isDatabaseInstalled
public static function isDatabaseInstalled() { return self::getPathToGeoIpDatabase(self::$dbNames['loc']) || self::getPathToGeoIpDatabase(self::$dbNames['isp']) || self::getPathToGeoIpDatabase(self::$dbNames['org']); }
php
public static function isDatabaseInstalled() { return self::getPathToGeoIpDatabase(self::$dbNames['loc']) || self::getPathToGeoIpDatabase(self::$dbNames['isp']) || self::getPathToGeoIpDatabase(self::$dbNames['org']); }
[ "public", "static", "function", "isDatabaseInstalled", "(", ")", "{", "return", "self", "::", "getPathToGeoIpDatabase", "(", "self", "::", "$", "dbNames", "[", "'loc'", "]", ")", "||", "self", "::", "getPathToGeoIpDatabase", "(", "self", "::", "$", "dbNames", ...
Returns true if there is a GeoIP database in the 'misc' directory. @return bool
[ "Returns", "true", "if", "there", "is", "a", "GeoIP", "database", "in", "the", "misc", "directory", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/GeoIp.php#L228-L233
209,807
matomo-org/matomo
plugins/CoreAdminHome/Controller.php
Controller.trackingCodeGenerator
public function trackingCodeGenerator() { Piwik::checkUserHasSomeViewAccess(); $view = new View('@CoreAdminHome/trackingCodeGenerator'); $this->setBasicVariablesView($view); $view->topMenu = MenuTop::getInstance()->getMenu(); $viewableIdSites = APISitesManager::get...
php
public function trackingCodeGenerator() { Piwik::checkUserHasSomeViewAccess(); $view = new View('@CoreAdminHome/trackingCodeGenerator'); $this->setBasicVariablesView($view); $view->topMenu = MenuTop::getInstance()->getMenu(); $viewableIdSites = APISitesManager::get...
[ "public", "function", "trackingCodeGenerator", "(", ")", "{", "Piwik", "::", "checkUserHasSomeViewAccess", "(", ")", ";", "$", "view", "=", "new", "View", "(", "'@CoreAdminHome/trackingCodeGenerator'", ")", ";", "$", "this", "->", "setBasicVariablesView", "(", "$"...
Renders and echo's an admin page that lets users generate custom JavaScript tracking code and custom image tracker links.
[ "Renders", "and", "echo", "s", "an", "admin", "page", "that", "lets", "users", "generate", "custom", "JavaScript", "tracking", "code", "and", "custom", "image", "tracker", "links", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreAdminHome/Controller.php#L173-L215
209,808
matomo-org/matomo
plugins/Live/Visitor.php
Visitor.getAllVisitorDetailsInstances
public static function getAllVisitorDetailsInstances() { $cacheId = CacheId::pluginAware('VisitorDetails'); $cache = Cache::getTransientCache(); if (!$cache->contains($cacheId)) { $instances = [ new VisitorDetails() // needs to be first ]; ...
php
public static function getAllVisitorDetailsInstances() { $cacheId = CacheId::pluginAware('VisitorDetails'); $cache = Cache::getTransientCache(); if (!$cache->contains($cacheId)) { $instances = [ new VisitorDetails() // needs to be first ]; ...
[ "public", "static", "function", "getAllVisitorDetailsInstances", "(", ")", "{", "$", "cacheId", "=", "CacheId", "::", "pluginAware", "(", "'VisitorDetails'", ")", ";", "$", "cache", "=", "Cache", "::", "getTransientCache", "(", ")", ";", "if", "(", "!", "$",...
Returns all available visitor details instances @return VisitorDetailsAbstract[] @throws \Exception
[ "Returns", "all", "available", "visitor", "details", "instances" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Live/Visitor.php#L71-L127
209,809
matomo-org/matomo
libs/Zend/Validate/File/Md5.php
Zend_Validate_File_Md5.setHash
public function setHash($options) { if (!is_array($options)) { $options = (array) $options; } $options['algorithm'] = 'md5'; parent::setHash($options); return $this; }
php
public function setHash($options) { if (!is_array($options)) { $options = (array) $options; } $options['algorithm'] = 'md5'; parent::setHash($options); return $this; }
[ "public", "function", "setHash", "(", "$", "options", ")", "{", "if", "(", "!", "is_array", "(", "$", "options", ")", ")", "{", "$", "options", "=", "(", "array", ")", "$", "options", ";", "}", "$", "options", "[", "'algorithm'", "]", "=", "'md5'",...
Sets the md5 hash for one or multiple files @param string|array $options @param string $algorithm (Deprecated) Algorithm to use, fixed to md5 @return Zend_Validate_File_Hash Provides a fluent interface
[ "Sets", "the", "md5", "hash", "for", "one", "or", "multiple", "files" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Md5.php#L99-L108
209,810
matomo-org/matomo
libs/Zend/Validate/File/Md5.php
Zend_Validate_File_Md5.addHash
public function addHash($options) { if (!is_array($options)) { $options = (array) $options; } $options['algorithm'] = 'md5'; parent::addHash($options); return $this; }
php
public function addHash($options) { if (!is_array($options)) { $options = (array) $options; } $options['algorithm'] = 'md5'; parent::addHash($options); return $this; }
[ "public", "function", "addHash", "(", "$", "options", ")", "{", "if", "(", "!", "is_array", "(", "$", "options", ")", ")", "{", "$", "options", "=", "(", "array", ")", "$", "options", ";", "}", "$", "options", "[", "'algorithm'", "]", "=", "'md5'",...
Adds the md5 hash for one or multiple files @param string|array $options @param string $algorithm (Deprecated) Algorithm to use, fixed to md5 @return Zend_Validate_File_Hash Provides a fluent interface
[ "Adds", "the", "md5", "hash", "for", "one", "or", "multiple", "files" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Validate/File/Md5.php#L129-L138
209,811
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.downloadFreeGeoIPDB
public function downloadFreeGeoIPDB() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($this->isGeoIp2Enabled()) { return $this->downloadFreeGeoIP2DB(); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTo...
php
public function downloadFreeGeoIPDB() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($this->isGeoIp2Enabled()) { return $this->downloadFreeGeoIP2DB(); } if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTo...
[ "public", "function", "downloadFreeGeoIPDB", "(", ")", "{", "$", "this", "->", "dieIfGeolocationAdminIsDisabled", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "if", "(", "$", "this", "->", "isGeoIp2Enabled", "(", ")", ")", "{", ...
Starts or continues download of GeoLiteCity.dat. To avoid a server/PHP timeout & to show progress of the download to the user, we use the HTTP Range header to download one chunk of the file at a time. After each chunk, it is the browser's responsibility to call the method again to continue the download. Input: 'conti...
[ "Starts", "or", "continues", "download", "of", "GeoLiteCity", ".", "dat", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L109-L148
209,812
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.downloadFreeGeoIP2DB
public function downloadFreeGeoIP2DB() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); Json::sendHeaderJSON(); $outputPath = GeoIp2::getPathForGeoIpData...
php
public function downloadFreeGeoIP2DB() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); Json::sendHeaderJSON(); $outputPath = GeoIp2::getPathForGeoIpData...
[ "public", "function", "downloadFreeGeoIP2DB", "(", ")", "{", "$", "this", "->", "dieIfGeolocationAdminIsDisabled", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "if", "(", "$", "_SERVER", "[", "\"REQUEST_METHOD\"", "]", "==", "\"POS...
Starts or continues download of GeoLite2-City.mmdb. To avoid a server/PHP timeout & to show progress of the download to the user, we use the HTTP Range header to download one chunk of the file at a time. After each chunk, it is the browser's responsibility to call the method again to continue the download. Input: 'co...
[ "Starts", "or", "continues", "download", "of", "GeoLite2", "-", "City", ".", "mmdb", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L167-L206
209,813
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.setUpdaterManageVars
private function setUpdaterManageVars($view) { $view->isGeoIp2Available = $this->isGeoIp2Enabled(); if ($this->isGeoIp2Enabled()) { // Get GeoIPLegacy Update information to show them $urls = GeoIPAutoUpdater::getConfiguredUrls(); $view->geoIPLegacyLocUrl = $urls...
php
private function setUpdaterManageVars($view) { $view->isGeoIp2Available = $this->isGeoIp2Enabled(); if ($this->isGeoIp2Enabled()) { // Get GeoIPLegacy Update information to show them $urls = GeoIPAutoUpdater::getConfiguredUrls(); $view->geoIPLegacyLocUrl = $urls...
[ "private", "function", "setUpdaterManageVars", "(", "$", "view", ")", "{", "$", "view", "->", "isGeoIp2Available", "=", "$", "this", "->", "isGeoIp2Enabled", "(", ")", ";", "if", "(", "$", "this", "->", "isGeoIp2Enabled", "(", ")", ")", "{", "// Get GeoIPL...
Sets some variables needed by the _updaterManage.twig template. @param View $view
[ "Sets", "some", "variables", "needed", "by", "the", "_updaterManage", ".", "twig", "template", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L221-L263
209,814
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.updateGeoIPLinks
public function updateGeoIPLinks() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($_SERVER["REQUEST_METHOD"] == "POST") { Json::sendHeaderJSON(); try { $this->checkTokenInUrl(); if ($this->isGeoIp...
php
public function updateGeoIPLinks() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($_SERVER["REQUEST_METHOD"] == "POST") { Json::sendHeaderJSON(); try { $this->checkTokenInUrl(); if ($this->isGeoIp...
[ "public", "function", "updateGeoIPLinks", "(", ")", "{", "$", "this", "->", "dieIfGeolocationAdminIsDisabled", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "if", "(", "$", "_SERVER", "[", "\"REQUEST_METHOD\"", "]", "==", "\"POST\""...
Sets the URLs used to download new versions of the installed GeoIP databases. Input (query params): 'loc_db' - URL for a GeoIP location database. 'isp_db' - URL for a GeoIP ISP database (optional). 'org_db' - URL for a GeoIP Org database (optional). 'period' - 'weekly' or 'monthly'. Determines how often update is run....
[ "Sets", "the", "URLs", "used", "to", "download", "new", "versions", "of", "the", "installed", "GeoIP", "databases", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L278-L312
209,815
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.downloadMissingGeoIpDb
public function downloadMissingGeoIpDb() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($_SERVER["REQUEST_METHOD"] == "POST") { try { $this->checkTokenInUrl(); Json::sendHeaderJSON(); // base...
php
public function downloadMissingGeoIpDb() { $this->dieIfGeolocationAdminIsDisabled(); Piwik::checkUserHasSuperUserAccess(); if ($_SERVER["REQUEST_METHOD"] == "POST") { try { $this->checkTokenInUrl(); Json::sendHeaderJSON(); // base...
[ "public", "function", "downloadMissingGeoIpDb", "(", ")", "{", "$", "this", "->", "dieIfGeolocationAdminIsDisabled", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "if", "(", "$", "_SERVER", "[", "\"REQUEST_METHOD\"", "]", "==", "\"P...
Starts or continues a download for a missing GeoIP database. A database is missing if it has an update URL configured, but the actual database is not available in the misc directory. Input: 'url' - The URL to download the database from. 'continue' - 1 if we're continuing a download, 0 if we're starting one. Output: '...
[ "Starts", "or", "continues", "a", "download", "for", "a", "missing", "GeoIP", "database", ".", "A", "database", "is", "missing", "if", "it", "has", "an", "update", "URL", "configured", "but", "the", "actual", "database", "is", "not", "available", "in", "th...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L331-L384
209,816
matomo-org/matomo
plugins/UserCountry/Controller.php
Controller.getLocationUsingProvider
public function getLocationUsingProvider() { $providerId = Common::getRequestVar('id'); $provider = LocationProvider::getProviderById($providerId); if (empty($provider)) { throw new Exception("Invalid provider ID: '$providerId'."); } $location = $provider->getLoc...
php
public function getLocationUsingProvider() { $providerId = Common::getRequestVar('id'); $provider = LocationProvider::getProviderById($providerId); if (empty($provider)) { throw new Exception("Invalid provider ID: '$providerId'."); } $location = $provider->getLoc...
[ "public", "function", "getLocationUsingProvider", "(", ")", "{", "$", "providerId", "=", "Common", "::", "getRequestVar", "(", "'id'", ")", ";", "$", "provider", "=", "LocationProvider", "::", "getProviderById", "(", "$", "providerId", ")", ";", "if", "(", "...
Echo's a pretty formatted location using a specific LocationProvider. Input: The 'id' query parameter must be set to the ID of the LocationProvider to use. Output: The pretty formatted location that was obtained. Will be HTML.
[ "Echo", "s", "a", "pretty", "formatted", "location", "using", "a", "specific", "LocationProvider", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/Controller.php#L395-L410
209,817
matomo-org/matomo
libs/Zend/Db/Statement.php
Zend_Db_Statement._stripQuoted
protected function _stripQuoted($sql) { // get the character for delimited id quotes, // this is usually " but in MySQL is ` $d = $this->_adapter->quoteIdentifier('a'); $d = $d[0]; // get the value used as an escaped delimited id quote, // e.g. \" or "" or \` ...
php
protected function _stripQuoted($sql) { // get the character for delimited id quotes, // this is usually " but in MySQL is ` $d = $this->_adapter->quoteIdentifier('a'); $d = $d[0]; // get the value used as an escaped delimited id quote, // e.g. \" or "" or \` ...
[ "protected", "function", "_stripQuoted", "(", "$", "sql", ")", "{", "// get the character for delimited id quotes,", "// this is usually \" but in MySQL is `", "$", "d", "=", "$", "this", "->", "_adapter", "->", "quoteIdentifier", "(", "'a'", ")", ";", "$", "d", "="...
Remove parts of a SQL string that contain quoted strings of values or identifiers. @param string $sql @return string
[ "Remove", "parts", "of", "a", "SQL", "string", "that", "contain", "quoted", "strings", "of", "values", "or", "identifiers", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement.php#L177-L211
209,818
matomo-org/matomo
libs/Zend/Db/Statement.php
Zend_Db_Statement._fetchBound
public function _fetchBound($row) { foreach ($row as $key => $value) { // bindColumn() takes 1-based integer positions // but fetch() returns 0-based integer indexes if (is_int($key)) { $key++; } // set results only to variables tha...
php
public function _fetchBound($row) { foreach ($row as $key => $value) { // bindColumn() takes 1-based integer positions // but fetch() returns 0-based integer indexes if (is_int($key)) { $key++; } // set results only to variables tha...
[ "public", "function", "_fetchBound", "(", "$", "row", ")", "{", "foreach", "(", "$", "row", "as", "$", "key", "=>", "$", "value", ")", "{", "// bindColumn() takes 1-based integer positions", "// but fetch() returns 0-based integer indexes", "if", "(", "is_int", "(",...
Helper function to map retrieved row to bound column variables @param array $row @return bool True
[ "Helper", "function", "to", "map", "retrieved", "row", "to", "bound", "column", "variables" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Statement.php#L449-L463
209,819
matomo-org/matomo
plugins/MultiSites/API.php
API.getAll
public function getAll($period, $date, $segment = false, $_restrictSitesToLogin = false, $enhanced = false, $pattern = false, $showColumns = array()) { Piwik::checkUserHasSomeViewAccess(); $sites = $this->getSitesIdFromPattern($pattern, $_restrictSitesToLogin); if (!empty($showColumns) && ...
php
public function getAll($period, $date, $segment = false, $_restrictSitesToLogin = false, $enhanced = false, $pattern = false, $showColumns = array()) { Piwik::checkUserHasSomeViewAccess(); $sites = $this->getSitesIdFromPattern($pattern, $_restrictSitesToLogin); if (!empty($showColumns) && ...
[ "public", "function", "getAll", "(", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "_restrictSitesToLogin", "=", "false", ",", "$", "enhanced", "=", "false", ",", "$", "pattern", "=", "false", ",", "$", "showColumns", "=...
Returns a report displaying the total visits, actions and revenue, as well as the evolution of these values, of all existing sites over a specified period of time. If the specified period is not a 'range', this function will calculcate evolution metrics. Evolution metrics are metrics that display the percent increase/...
[ "Returns", "a", "report", "displaying", "the", "total", "visits", "actions", "and", "revenue", "as", "well", "as", "the", "evolution", "of", "these", "values", "of", "all", "existing", "sites", "over", "a", "specified", "period", "of", "time", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MultiSites/API.php#L88-L112
209,820
matomo-org/matomo
plugins/MultiSites/API.php
API.getSitesIdFromPattern
private function getSitesIdFromPattern($pattern, $_restrictSitesToLogin) { // First clear cache Site::clearCache(); if (empty($pattern)) { /** @var Scheduler $scheduler */ $scheduler = StaticContainer::getContainer()->get('Piwik\Scheduler\Scheduler'); //...
php
private function getSitesIdFromPattern($pattern, $_restrictSitesToLogin) { // First clear cache Site::clearCache(); if (empty($pattern)) { /** @var Scheduler $scheduler */ $scheduler = StaticContainer::getContainer()->get('Piwik\Scheduler\Scheduler'); //...
[ "private", "function", "getSitesIdFromPattern", "(", "$", "pattern", ",", "$", "_restrictSitesToLogin", ")", "{", "// First clear cache", "Site", "::", "clearCache", "(", ")", ";", "if", "(", "empty", "(", "$", "pattern", ")", ")", "{", "/** @var Scheduler $sche...
Fetches the list of sites which names match the string pattern @param string $pattern @param bool $_restrictSitesToLogin @return array|string
[ "Fetches", "the", "list", "of", "sites", "which", "names", "match", "the", "string", "pattern" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MultiSites/API.php#L121-L160
209,821
matomo-org/matomo
plugins/MultiSites/API.php
API.calculateEvolutionPercentages
private function calculateEvolutionPercentages($currentData, $pastData, $apiMetrics) { if (get_class($currentData) != get_class($pastData)) { // sanity check for regressions throw new Exception("Expected \$pastData to be of type " . get_class($currentData) . " - got " . get_class...
php
private function calculateEvolutionPercentages($currentData, $pastData, $apiMetrics) { if (get_class($currentData) != get_class($pastData)) { // sanity check for regressions throw new Exception("Expected \$pastData to be of type " . get_class($currentData) . " - got " . get_class...
[ "private", "function", "calculateEvolutionPercentages", "(", "$", "currentData", ",", "$", "pastData", ",", "$", "apiMetrics", ")", "{", "if", "(", "get_class", "(", "$", "currentData", ")", "!=", "get_class", "(", "$", "pastData", ")", ")", "{", "// sanity ...
Performs a binary filter of two DataTables in order to correctly calculate evolution metrics. @param DataTable|DataTable\Map $currentData @param DataTable|DataTable\Map $pastData @param array $apiMetrics The array of string fields to calculate evolution metrics for. @throws Exception
[ "Performs", "a", "binary", "filter", "of", "two", "DataTables", "in", "order", "to", "correctly", "calculate", "evolution", "metrics", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MultiSites/API.php#L321-L350
209,822
matomo-org/matomo
plugins/MultiSites/API.php
API.setPastTotalVisitsMetadata
private function setPastTotalVisitsMetadata($dataTable, $pastTable) { if ($pastTable instanceof DataTable) { $total = 0; $metric = 'nb_visits'; $rows = $pastTable->getRows(); $rows = $this->filterRowsForTotalsCalculation($rows); foreach ($rows a...
php
private function setPastTotalVisitsMetadata($dataTable, $pastTable) { if ($pastTable instanceof DataTable) { $total = 0; $metric = 'nb_visits'; $rows = $pastTable->getRows(); $rows = $this->filterRowsForTotalsCalculation($rows); foreach ($rows a...
[ "private", "function", "setPastTotalVisitsMetadata", "(", "$", "dataTable", ",", "$", "pastTable", ")", "{", "if", "(", "$", "pastTable", "instanceof", "DataTable", ")", "{", "$", "total", "=", "0", ";", "$", "metric", "=", "'nb_visits'", ";", "$", "rows",...
Sets the number of total visits in tha pastTable on the dataTable as metadata. @param DataTable $dataTable @param DataTable $pastTable
[ "Sets", "the", "number", "of", "total", "visits", "in", "tha", "pastTable", "on", "the", "dataTable", "as", "metadata", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/MultiSites/API.php#L463-L478
209,823
matomo-org/matomo
plugins/PrivacyManager/Controller.php
Controller.getDatabaseSize
public function getDatabaseSize() { Piwik::checkUserHasSuperUserAccess(); $view = new View('@PrivacyManager/getDatabaseSize'); $forceEstimate = Common::getRequestVar('forceEstimate', 0); $view->dbStats = $this->getDeleteDBSizeEstimate($getSettingsFromQuery = true, $forceEstimate); ...
php
public function getDatabaseSize() { Piwik::checkUserHasSuperUserAccess(); $view = new View('@PrivacyManager/getDatabaseSize'); $forceEstimate = Common::getRequestVar('forceEstimate', 0); $view->dbStats = $this->getDeleteDBSizeEstimate($getSettingsFromQuery = true, $forceEstimate); ...
[ "public", "function", "getDatabaseSize", "(", ")", "{", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "view", "=", "new", "View", "(", "'@PrivacyManager/getDatabaseSize'", ")", ";", "$", "forceEstimate", "=", "Common", "::", "getRequestVar", ...
Echo's an HTML chunk describing the current database size, and the estimated space savings after the scheduled data purge is run.
[ "Echo", "s", "an", "HTML", "chunk", "describing", "the", "current", "database", "size", "and", "the", "estimated", "space", "savings", "after", "the", "scheduled", "data", "purge", "is", "run", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/Controller.php#L150-L160
209,824
matomo-org/matomo
plugins/PrivacyManager/Controller.php
Controller.executeDataPurge
public function executeDataPurge() { $this->checkDataPurgeAdminSettingsIsEnabled(); Piwik::checkUserHasSuperUserAccess(); $this->checkTokenInUrl(); // if the request isn't a POST, redirect to index if ($_SERVER["REQUEST_METHOD"] != "POST" && !Common::isPhpCliMod...
php
public function executeDataPurge() { $this->checkDataPurgeAdminSettingsIsEnabled(); Piwik::checkUserHasSuperUserAccess(); $this->checkTokenInUrl(); // if the request isn't a POST, redirect to index if ($_SERVER["REQUEST_METHOD"] != "POST" && !Common::isPhpCliMod...
[ "public", "function", "executeDataPurge", "(", ")", "{", "$", "this", "->", "checkDataPurgeAdminSettingsIsEnabled", "(", ")", ";", "Piwik", "::", "checkUserHasSuperUserAccess", "(", ")", ";", "$", "this", "->", "checkTokenInUrl", "(", ")", ";", "// if the request ...
Executes a data purge, deleting raw data and report data using the current config options. Echo's the result of getDatabaseSize after purging.
[ "Executes", "a", "data", "purge", "deleting", "raw", "data", "and", "report", "data", "using", "the", "current", "config", "options", ".", "Echo", "s", "the", "result", "of", "getDatabaseSize", "after", "purging", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/PrivacyManager/Controller.php#L217-L242
209,825
matomo-org/matomo
plugins/Overlay/Controller.php
Controller.index
public function index() { Piwik::checkUserHasViewAccess($this->idSite); $template = '@Overlay/index'; if (Config::getInstance()->General['overlay_disable_framed_mode']) { $template = '@Overlay/index_noframe'; } $view = new View($template); $this->setGen...
php
public function index() { Piwik::checkUserHasViewAccess($this->idSite); $template = '@Overlay/index'; if (Config::getInstance()->General['overlay_disable_framed_mode']) { $template = '@Overlay/index_noframe'; } $view = new View($template); $this->setGen...
[ "public", "function", "index", "(", ")", "{", "Piwik", "::", "checkUserHasViewAccess", "(", "$", "this", "->", "idSite", ")", ";", "$", "template", "=", "'@Overlay/index'", ";", "if", "(", "Config", "::", "getInstance", "(", ")", "->", "General", "[", "'...
The index of the plugin
[ "The", "index", "of", "the", "plugin" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Overlay/Controller.php#L42-L61
209,826
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Ibm/Db2.php
Zend_Db_Adapter_Pdo_Ibm_Db2.describeTable
public function describeTable($tableName, $schemaName = null) { $sql = "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno, c.typename, c.default, c.nulls, c.length, c.scale, c.identity, tc.type AS tabconsttype, k.colseq FROM syscat.columns c ...
php
public function describeTable($tableName, $schemaName = null) { $sql = "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno, c.typename, c.default, c.nulls, c.length, c.scale, c.identity, tc.type AS tabconsttype, k.colseq FROM syscat.columns c ...
[ "public", "function", "describeTable", "(", "$", "tableName", ",", "$", "schemaName", "=", "null", ")", "{", "$", "sql", "=", "\"SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno,\n c.typename, c.default, c.nulls, c.length, c.scale,\n c.identity...
DB2 catalog lookup for describe table @param string $tableName @param string $schemaName OPTIONAL @return array
[ "DB2", "catalog", "lookup", "for", "describe", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Db2.php#L77-L155
209,827
matomo-org/matomo
libs/Zend/Db/Adapter/Pdo/Ibm/Db2.php
Zend_Db_Adapter_Pdo_Ibm_Db2.lastSequenceId
public function lastSequenceId($sequenceName) { $sql = 'SELECT PREVVAL FOR '.$this->_adapter->quoteIdentifier($sequenceName).' AS VAL FROM SYSIBM.SYSDUMMY1'; $value = $this->_adapter->fetchOne($sql); return $value; }
php
public function lastSequenceId($sequenceName) { $sql = 'SELECT PREVVAL FOR '.$this->_adapter->quoteIdentifier($sequenceName).' AS VAL FROM SYSIBM.SYSDUMMY1'; $value = $this->_adapter->fetchOne($sql); return $value; }
[ "public", "function", "lastSequenceId", "(", "$", "sequenceName", ")", "{", "$", "sql", "=", "'SELECT PREVVAL FOR '", ".", "$", "this", "->", "_adapter", "->", "quoteIdentifier", "(", "$", "sequenceName", ")", ".", "' AS VAL FROM SYSIBM.SYSDUMMY1'", ";", "$", "v...
DB2-specific last sequence id @param string $sequenceName @return integer
[ "DB2", "-", "specific", "last", "sequence", "id" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Db/Adapter/Pdo/Ibm/Db2.php#L209-L214
209,828
matomo-org/matomo
core/Tracker/PageUrl.php
PageUrl.excludeQueryParametersFromUrl
public static function excludeQueryParametersFromUrl($originalUrl, $idSite) { $originalUrl = self::cleanupUrl($originalUrl); $parsedUrl = @parse_url($originalUrl); $parsedUrl = self::cleanupHostAndHashTag($parsedUrl, $idSite); $parametersToExclude = self::getQueryParametersToExclude...
php
public static function excludeQueryParametersFromUrl($originalUrl, $idSite) { $originalUrl = self::cleanupUrl($originalUrl); $parsedUrl = @parse_url($originalUrl); $parsedUrl = self::cleanupHostAndHashTag($parsedUrl, $idSite); $parametersToExclude = self::getQueryParametersToExclude...
[ "public", "static", "function", "excludeQueryParametersFromUrl", "(", "$", "originalUrl", ",", "$", "idSite", ")", "{", "$", "originalUrl", "=", "self", "::", "cleanupUrl", "(", "$", "originalUrl", ")", ";", "$", "parsedUrl", "=", "@", "parse_url", "(", "$",...
Given the Input URL, will exclude all query parameters set for this site @static @param $originalUrl @param $idSite @return bool|string Returned URL is HTML entities decoded
[ "Given", "the", "Input", "URL", "will", "exclude", "all", "query", "parameters", "set", "for", "this", "site" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L39-L65
209,829
matomo-org/matomo
core/Tracker/PageUrl.php
PageUrl.getQueryParametersToExclude
public static function getQueryParametersToExclude($idSite) { $campaignTrackingParameters = Common::getCampaignParameters(); $campaignTrackingParameters = array_merge( $campaignTrackingParameters[0], // campaign name parameters $campaignTrackingParameters[1] // campaign keyw...
php
public static function getQueryParametersToExclude($idSite) { $campaignTrackingParameters = Common::getCampaignParameters(); $campaignTrackingParameters = array_merge( $campaignTrackingParameters[0], // campaign name parameters $campaignTrackingParameters[1] // campaign keyw...
[ "public", "static", "function", "getQueryParametersToExclude", "(", "$", "idSite", ")", "{", "$", "campaignTrackingParameters", "=", "Common", "::", "getCampaignParameters", "(", ")", ";", "$", "campaignTrackingParameters", "=", "array_merge", "(", "$", "campaignTrack...
Returns the array of parameters names that must be excluded from the Query String in all tracked URLs @static @param $idSite @return array
[ "Returns", "the", "array", "of", "parameters", "names", "that", "must", "be", "excluded", "from", "the", "Query", "String", "in", "all", "tracked", "URLs" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L73-L103
209,830
matomo-org/matomo
core/Tracker/PageUrl.php
PageUrl.getUrlParameterNamesToExcludeFromUrl
protected static function getUrlParameterNamesToExcludeFromUrl() { $paramsToExclude = Config::getInstance()->Tracker['url_query_parameter_to_exclude_from_url']; $paramsToExclude = explode(",", $paramsToExclude); $paramsToExclude = array_map('trim', $paramsToExclude); return $paramsTo...
php
protected static function getUrlParameterNamesToExcludeFromUrl() { $paramsToExclude = Config::getInstance()->Tracker['url_query_parameter_to_exclude_from_url']; $paramsToExclude = explode(",", $paramsToExclude); $paramsToExclude = array_map('trim', $paramsToExclude); return $paramsTo...
[ "protected", "static", "function", "getUrlParameterNamesToExcludeFromUrl", "(", ")", "{", "$", "paramsToExclude", "=", "Config", "::", "getInstance", "(", ")", "->", "Tracker", "[", "'url_query_parameter_to_exclude_from_url'", "]", ";", "$", "paramsToExclude", "=", "e...
Returns the list of URL query parameters that should be removed from the tracked URL query string. @return array
[ "Returns", "the", "list", "of", "URL", "query", "parameters", "that", "should", "be", "removed", "from", "the", "tracked", "URL", "query", "string", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L110-L116
209,831
matomo-org/matomo
core/Tracker/PageUrl.php
PageUrl.reconstructNormalizedUrl
public static function reconstructNormalizedUrl($url, $prefixId) { $map = array_flip(self::$urlPrefixMap); if ($prefixId !== null && isset($map[$prefixId])) { $fullUrl = $map[$prefixId] . $url; } else { $fullUrl = $url; } // Clean up host & hash tags...
php
public static function reconstructNormalizedUrl($url, $prefixId) { $map = array_flip(self::$urlPrefixMap); if ($prefixId !== null && isset($map[$prefixId])) { $fullUrl = $map[$prefixId] . $url; } else { $fullUrl = $url; } // Clean up host & hash tags...
[ "public", "static", "function", "reconstructNormalizedUrl", "(", "$", "url", ",", "$", "prefixId", ")", "{", "$", "map", "=", "array_flip", "(", "self", "::", "$", "urlPrefixMap", ")", ";", "if", "(", "$", "prefixId", "!==", "null", "&&", "isset", "(", ...
Build the full URL from the prefix ID and the rest. @param string $url @param integer $prefixId @return string
[ "Build", "the", "full", "URL", "from", "the", "prefix", "ID", "and", "the", "rest", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L310-L330
209,832
matomo-org/matomo
core/Tracker/PageUrl.php
PageUrl.normalizeUrl
public static function normalizeUrl($url) { foreach (self::$urlPrefixMap as $prefix => $id) { if (strtolower(substr($url, 0, strlen($prefix))) == $prefix) { return array( 'url' => substr($url, strlen($prefix)), 'prefixId' => $id ...
php
public static function normalizeUrl($url) { foreach (self::$urlPrefixMap as $prefix => $id) { if (strtolower(substr($url, 0, strlen($prefix))) == $prefix) { return array( 'url' => substr($url, strlen($prefix)), 'prefixId' => $id ...
[ "public", "static", "function", "normalizeUrl", "(", "$", "url", ")", "{", "foreach", "(", "self", "::", "$", "urlPrefixMap", "as", "$", "prefix", "=>", "$", "id", ")", "{", "if", "(", "strtolower", "(", "substr", "(", "$", "url", ",", "0", ",", "s...
Extract the prefix from a URL. Return the prefix ID and the rest. @param string $url @return array
[ "Extract", "the", "prefix", "from", "a", "URL", ".", "Return", "the", "prefix", "ID", "and", "the", "rest", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/PageUrl.php#L339-L351
209,833
matomo-org/matomo
plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php
Evolution.getSeriesLabel
private function getSeriesLabel($rowLabel, $columnName) { $metricLabel = @$this->properties['translations'][$columnName]; if ($rowLabel !== false) { // eg. "Yahoo! (Visits)" $label = "$rowLabel ($metricLabel)"; } else { // eg. "Visits" $label ...
php
private function getSeriesLabel($rowLabel, $columnName) { $metricLabel = @$this->properties['translations'][$columnName]; if ($rowLabel !== false) { // eg. "Yahoo! (Visits)" $label = "$rowLabel ($metricLabel)"; } else { // eg. "Visits" $label ...
[ "private", "function", "getSeriesLabel", "(", "$", "rowLabel", ",", "$", "columnName", ")", "{", "$", "metricLabel", "=", "@", "$", "this", "->", "properties", "[", "'translations'", "]", "[", "$", "columnName", "]", ";", "if", "(", "$", "rowLabel", "!==...
Derive the series label from the row label and the column name. If the row label is set, both the label and the column name are displayed. @param string $rowLabel @param string $columnName @return string
[ "Derive", "the", "series", "label", "from", "the", "row", "label", "and", "the", "column", "name", ".", "If", "the", "row", "label", "is", "set", "both", "the", "label", "and", "the", "column", "name", "are", "displayed", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php#L120-L133
209,834
matomo-org/matomo
core/DataTable/Filter/PivotByDimension.php
PivotByDimension.filter
public function filter($table) { // set of all column names in the pivoted table mapped with the sum of all column // values. used later in truncating and ordering the pivoted table's columns. $columnSet = array(); // if no pivot column was set, use the first one found in the row ...
php
public function filter($table) { // set of all column names in the pivoted table mapped with the sum of all column // values. used later in truncating and ordering the pivoted table's columns. $columnSet = array(); // if no pivot column was set, use the first one found in the row ...
[ "public", "function", "filter", "(", "$", "table", ")", "{", "// set of all column names in the pivoted table mapped with the sum of all column", "// values. used later in truncating and ordering the pivoted table's columns.", "$", "columnSet", "=", "array", "(", ")", ";", "// if n...
Pivots to table. @param DataTable $table The table to manipulate.
[ "Pivots", "to", "table", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/PivotByDimension.php#L181-L258
209,835
matomo-org/matomo
core/DataTable/Filter/PivotByDimension.php
PivotByDimension.getIntersectedTable
private function getIntersectedTable(DataTable $table, Row $row) { if ($this->isPivotDimensionSubtable()) { return $this->loadSubtable($table, $row); } if ($this->isFetchingBySegmentEnabled) { $segment = $row->getMetadata('segment'); if (empty($segment)) ...
php
private function getIntersectedTable(DataTable $table, Row $row) { if ($this->isPivotDimensionSubtable()) { return $this->loadSubtable($table, $row); } if ($this->isFetchingBySegmentEnabled) { $segment = $row->getMetadata('segment'); if (empty($segment)) ...
[ "private", "function", "getIntersectedTable", "(", "DataTable", "$", "table", ",", "Row", "$", "row", ")", "{", "if", "(", "$", "this", "->", "isPivotDimensionSubtable", "(", ")", ")", "{", "return", "$", "this", "->", "loadSubtable", "(", "$", "table", ...
An intersected table is a table that describes visits by a certain dimension for the visits represented by a row in another table. This method fetches intersected tables either via subtable or by using a segment. Read the class docs for more info.
[ "An", "intersected", "table", "is", "a", "table", "that", "describes", "visits", "by", "a", "certain", "dimension", "for", "the", "visits", "represented", "by", "a", "row", "in", "another", "table", ".", "This", "method", "fetches", "intersected", "tables", ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/PivotByDimension.php#L265-L291
209,836
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.getTableCreateSql
public function getTableCreateSql($tableName) { $tables = DbHelper::getTablesCreateSql(); if (!isset($tables[$tableName])) { throw new Exception("The table '$tableName' SQL creation code couldn't be found."); } return $tables[$tableName]; }
php
public function getTableCreateSql($tableName) { $tables = DbHelper::getTablesCreateSql(); if (!isset($tables[$tableName])) { throw new Exception("The table '$tableName' SQL creation code couldn't be found."); } return $tables[$tableName]; }
[ "public", "function", "getTableCreateSql", "(", "$", "tableName", ")", "{", "$", "tables", "=", "DbHelper", "::", "getTablesCreateSql", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "tables", "[", "$", "tableName", "]", ")", ")", "{", "throw", "new...
Get the SQL to create a specific Piwik table @param string $tableName @throws Exception @return string SQL
[ "Get", "the", "SQL", "to", "create", "a", "specific", "Piwik", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L325-L334
209,837
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.getTablesNames
public function getTablesNames() { $aTables = array_keys($this->getTablesCreateSql()); $prefixTables = $this->getTablePrefix(); $return = array(); foreach ($aTables as $table) { $return[] = $prefixTables . $table; } return $return; }
php
public function getTablesNames() { $aTables = array_keys($this->getTablesCreateSql()); $prefixTables = $this->getTablePrefix(); $return = array(); foreach ($aTables as $table) { $return[] = $prefixTables . $table; } return $return; }
[ "public", "function", "getTablesNames", "(", ")", "{", "$", "aTables", "=", "array_keys", "(", "$", "this", "->", "getTablesCreateSql", "(", ")", ")", ";", "$", "prefixTables", "=", "$", "this", "->", "getTablePrefix", "(", ")", ";", "$", "return", "=", ...
Names of all the prefixed tables in piwik Doesn't use the DB @return array Table names
[ "Names", "of", "all", "the", "prefixed", "tables", "in", "piwik", "Doesn", "t", "use", "the", "DB" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L342-L353
209,838
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.getTableColumns
public function getTableColumns($tableName) { $db = $this->getDb(); $allColumns = $db->fetchAll("SHOW COLUMNS FROM " . $tableName); $fields = array(); foreach ($allColumns as $column) { $fields[trim($column['Field'])] = $column; } return $fields; }
php
public function getTableColumns($tableName) { $db = $this->getDb(); $allColumns = $db->fetchAll("SHOW COLUMNS FROM " . $tableName); $fields = array(); foreach ($allColumns as $column) { $fields[trim($column['Field'])] = $column; } return $fields; }
[ "public", "function", "getTableColumns", "(", "$", "tableName", ")", "{", "$", "db", "=", "$", "this", "->", "getDb", "(", ")", ";", "$", "allColumns", "=", "$", "db", "->", "fetchAll", "(", "\"SHOW COLUMNS FROM \"", ".", "$", "tableName", ")", ";", "$...
Get list of installed columns in a table @param string $tableName The name of a table. @return array Installed columns indexed by the column name.
[ "Get", "list", "of", "installed", "columns", "in", "a", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L362-L374
209,839
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.getTablesInstalled
public function getTablesInstalled($forceReload = true) { if (is_null($this->tablesInstalled) || $forceReload === true ) { $db = $this->getDb(); $prefixTables = $this->getTablePrefixEscaped(); $allTables = $this->getAllExistingTables($prefixTables); ...
php
public function getTablesInstalled($forceReload = true) { if (is_null($this->tablesInstalled) || $forceReload === true ) { $db = $this->getDb(); $prefixTables = $this->getTablePrefixEscaped(); $allTables = $this->getAllExistingTables($prefixTables); ...
[ "public", "function", "getTablesInstalled", "(", "$", "forceReload", "=", "true", ")", "{", "if", "(", "is_null", "(", "$", "this", "->", "tablesInstalled", ")", "||", "$", "forceReload", "===", "true", ")", "{", "$", "db", "=", "$", "this", "->", "get...
Get list of tables installed @param bool $forceReload Invalidate cache @return array installed Tables
[ "Get", "list", "of", "tables", "installed" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L382-L408
209,840
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.createTable
public function createTable($nameWithoutPrefix, $createDefinition) { $statement = sprintf("CREATE TABLE `%s` ( %s ) ENGINE=%s DEFAULT CHARSET=utf8 ;", Common::prefixTable($nameWithoutPrefix), $createDefinition, $this->get...
php
public function createTable($nameWithoutPrefix, $createDefinition) { $statement = sprintf("CREATE TABLE `%s` ( %s ) ENGINE=%s DEFAULT CHARSET=utf8 ;", Common::prefixTable($nameWithoutPrefix), $createDefinition, $this->get...
[ "public", "function", "createTable", "(", "$", "nameWithoutPrefix", ",", "$", "createDefinition", ")", "{", "$", "statement", "=", "sprintf", "(", "\"CREATE TABLE `%s` ( %s ) ENGINE=%s DEFAULT CHARSET=utf8 ;\"", ",", "Common", "::", "prefixTable", "(", "$", "nameWithout...
Creates a new table in the database. @param string $nameWithoutPrefix The name of the table without any piwik prefix. @param string $createDefinition The table create definition, see the "MySQL CREATE TABLE" specification for more information. @throws \Exception
[ "Creates", "a", "new", "table", "in", "the", "database", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L444-L460
209,841
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.createTables
public function createTables() { $db = $this->getDb(); $prefixTables = $this->getTablePrefix(); $tablesAlreadyInstalled = $this->getTablesInstalled(); $tablesToCreate = $this->getTablesCreateSql(); unset($tablesToCreate['archive_blob']); unset($tablesToCreate['archiv...
php
public function createTables() { $db = $this->getDb(); $prefixTables = $this->getTablePrefix(); $tablesAlreadyInstalled = $this->getTablesInstalled(); $tablesToCreate = $this->getTablesCreateSql(); unset($tablesToCreate['archive_blob']); unset($tablesToCreate['archiv...
[ "public", "function", "createTables", "(", ")", "{", "$", "db", "=", "$", "this", "->", "getDb", "(", ")", ";", "$", "prefixTables", "=", "$", "this", "->", "getTablePrefix", "(", ")", ";", "$", "tablesAlreadyInstalled", "=", "$", "this", "->", "getTab...
Create all tables
[ "Create", "all", "tables" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L475-L491
209,842
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.createAnonymousUser
public function createAnonymousUser() { $now = Date::factory('now')->getDatetime(); // The anonymous user is the user that is assigned by default // note that the token_auth value is anonymous, which is assigned by default as well in the Login plugin $db = $this->getDb(); $d...
php
public function createAnonymousUser() { $now = Date::factory('now')->getDatetime(); // The anonymous user is the user that is assigned by default // note that the token_auth value is anonymous, which is assigned by default as well in the Login plugin $db = $this->getDb(); $d...
[ "public", "function", "createAnonymousUser", "(", ")", "{", "$", "now", "=", "Date", "::", "factory", "(", "'now'", ")", "->", "getDatetime", "(", ")", ";", "// The anonymous user is the user that is assigned by default", "// note that the token_auth value is anonymous, whi...
Creates an entry in the User table for the "anonymous" user.
[ "Creates", "an", "entry", "in", "the", "User", "table", "for", "the", "anonymous", "user", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L496-L505
209,843
matomo-org/matomo
core/Db/Schema/Mysql.php
Mysql.getInstallVersion
public function getInstallVersion() { Option::clearCachedOption(self::OPTION_NAME_MATOMO_INSTALL_VERSION); $version = Option::get(self::OPTION_NAME_MATOMO_INSTALL_VERSION); if (!empty($version)) { return $version; } }
php
public function getInstallVersion() { Option::clearCachedOption(self::OPTION_NAME_MATOMO_INSTALL_VERSION); $version = Option::get(self::OPTION_NAME_MATOMO_INSTALL_VERSION); if (!empty($version)) { return $version; } }
[ "public", "function", "getInstallVersion", "(", ")", "{", "Option", "::", "clearCachedOption", "(", "self", "::", "OPTION_NAME_MATOMO_INSTALL_VERSION", ")", ";", "$", "version", "=", "Option", "::", "get", "(", "self", "::", "OPTION_NAME_MATOMO_INSTALL_VERSION", ")"...
Returns which Matomo version was used to install this Matomo for the first time.
[ "Returns", "which", "Matomo", "version", "was", "used", "to", "install", "this", "Matomo", "for", "the", "first", "time", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Db/Schema/Mysql.php#L520-L527
209,844
matomo-org/matomo
plugins/ScheduledReports/ScheduledReports.php
ScheduledReports.deleteSiteReport
public function deleteSiteReport($idSite) { $idReports = API::getInstance()->getReports($idSite); foreach ($idReports as $report) { $idReport = $report['idreport']; API::getInstance()->deleteReport($idReport); } }
php
public function deleteSiteReport($idSite) { $idReports = API::getInstance()->getReports($idSite); foreach ($idReports as $report) { $idReport = $report['idreport']; API::getInstance()->deleteReport($idReport); } }
[ "public", "function", "deleteSiteReport", "(", "$", "idSite", ")", "{", "$", "idReports", "=", "API", "::", "getInstance", "(", ")", "->", "getReports", "(", "$", "idSite", ")", ";", "foreach", "(", "$", "idReports", "as", "$", "report", ")", "{", "$",...
Delete reports for the website
[ "Delete", "reports", "for", "the", "website" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/ScheduledReports.php#L121-L129
209,845
matomo-org/matomo
plugins/ScheduledReports/ScheduledReports.php
ScheduledReports.getPeriodToFrequency
public static function getPeriodToFrequency() { return array( Schedule::PERIOD_NEVER => Piwik::translate('General_Never'), Schedule::PERIOD_DAY => Piwik::translate('General_Daily'), Schedule::PERIOD_WEEK => Piwik::translate('General_Weekly'), Schedule::PERI...
php
public static function getPeriodToFrequency() { return array( Schedule::PERIOD_NEVER => Piwik::translate('General_Never'), Schedule::PERIOD_DAY => Piwik::translate('General_Daily'), Schedule::PERIOD_WEEK => Piwik::translate('General_Weekly'), Schedule::PERI...
[ "public", "static", "function", "getPeriodToFrequency", "(", ")", "{", "return", "array", "(", "Schedule", "::", "PERIOD_NEVER", "=>", "Piwik", "::", "translate", "(", "'General_Never'", ")", ",", "Schedule", "::", "PERIOD_DAY", "=>", "Piwik", "::", "translate",...
Used in the Report Listing @ignore
[ "Used", "in", "the", "Report", "Listing" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ScheduledReports/ScheduledReports.php#L596-L604
209,846
matomo-org/matomo
core/Columns/MetricsList.php
MetricsList.remove
public function remove($metricCategory, $metricName = false) { foreach ($this->metrics as $index => $metric) { if ($metric->getCategoryId() === $metricCategory) { if (!$metricName || $metric->getName() === $metricName) { unset($this->metrics[$index]); ...
php
public function remove($metricCategory, $metricName = false) { foreach ($this->metrics as $index => $metric) { if ($metric->getCategoryId() === $metricCategory) { if (!$metricName || $metric->getName() === $metricName) { unset($this->metrics[$index]); ...
[ "public", "function", "remove", "(", "$", "metricCategory", ",", "$", "metricName", "=", "false", ")", "{", "foreach", "(", "$", "this", "->", "metrics", "as", "$", "index", "=>", "$", "metric", ")", "{", "if", "(", "$", "metric", "->", "getCategoryId"...
Removes one or more metrics from the metrics list. @param string $metricCategory The metric category id. Can be a translation token eg 'General_Visits' see {@link Metric::getCategory()}. @param string|false $metricName The name of the metric to remove eg 'nb_visits'. If not supplied, all metrics within that category w...
[ "Removes", "one", "or", "more", "metrics", "from", "the", "metrics", "list", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/MetricsList.php#L66-L76
209,847
matomo-org/matomo
core/Columns/MetricsList.php
MetricsList.get
public static function get() { $cache = Cache::getTransientCache(); $cacheKey = CacheId::siteAware('MetricsList'); if ($cache->contains($cacheKey)) { return $cache->fetch($cacheKey); } $list = new static; /** * Triggered to add new metrics that...
php
public static function get() { $cache = Cache::getTransientCache(); $cacheKey = CacheId::siteAware('MetricsList'); if ($cache->contains($cacheKey)) { return $cache->fetch($cacheKey); } $list = new static; /** * Triggered to add new metrics that...
[ "public", "static", "function", "get", "(", ")", "{", "$", "cache", "=", "Cache", "::", "getTransientCache", "(", ")", ";", "$", "cacheKey", "=", "CacheId", "::", "siteAware", "(", "'MetricsList'", ")", ";", "if", "(", "$", "cache", "->", "contains", "...
Get all metrics defined in the Piwik platform. @ignore @return static
[ "Get", "all", "metrics", "defined", "in", "the", "Piwik", "platform", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Columns/MetricsList.php#L103-L189
209,848
matomo-org/matomo
core/DataTable/Renderer/Csv.php
Csv.renderTable
protected function renderTable($table, &$allColumns = array()) { if (is_array($table)) { // convert array to DataTable $table = DataTable::makeFromSimpleArray($table); } if ($table instanceof DataTable\Map) { $str = $this->renderDataTableMap($table, $allC...
php
protected function renderTable($table, &$allColumns = array()) { if (is_array($table)) { // convert array to DataTable $table = DataTable::makeFromSimpleArray($table); } if ($table instanceof DataTable\Map) { $str = $this->renderDataTableMap($table, $allC...
[ "protected", "function", "renderTable", "(", "$", "table", ",", "&", "$", "allColumns", "=", "array", "(", ")", ")", "{", "if", "(", "is_array", "(", "$", "table", ")", ")", "{", "// convert array to DataTable", "$", "table", "=", "DataTable", "::", "mak...
Computes the output of the given data table @param DataTable|array $table @param array $allColumns @return string
[ "Computes", "the", "output", "of", "the", "given", "data", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L119-L132
209,849
matomo-org/matomo
core/DataTable/Renderer/Csv.php
Csv.renderDataTableMap
protected function renderDataTableMap($table, &$allColumns = array()) { $str = ''; foreach ($table->getDataTables() as $currentLinePrefix => $dataTable) { $returned = explode("\n", $this->renderTable($dataTable, $allColumns)); // get rid of the columns names $ret...
php
protected function renderDataTableMap($table, &$allColumns = array()) { $str = ''; foreach ($table->getDataTables() as $currentLinePrefix => $dataTable) { $returned = explode("\n", $this->renderTable($dataTable, $allColumns)); // get rid of the columns names $ret...
[ "protected", "function", "renderDataTableMap", "(", "$", "table", ",", "&", "$", "allColumns", "=", "array", "(", ")", ")", "{", "$", "str", "=", "''", ";", "foreach", "(", "$", "table", "->", "getDataTables", "(", ")", "as", "$", "currentLinePrefix", ...
Computes the output of the given data table array @param DataTable\Map $table @param array $allColumns @return string
[ "Computes", "the", "output", "of", "the", "given", "data", "table", "array" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L141-L167
209,850
matomo-org/matomo
core/DataTable/Renderer/Csv.php
Csv.renderDataTable
protected function renderDataTable($table, &$allColumns = array()) { if ($table instanceof Simple) { $row = $table->getFirstRow(); if ($row !== false) { $columnNameToValue = $row->getColumns(); if (count($columnNameToValue) == 1) { ...
php
protected function renderDataTable($table, &$allColumns = array()) { if ($table instanceof Simple) { $row = $table->getFirstRow(); if ($row !== false) { $columnNameToValue = $row->getColumns(); if (count($columnNameToValue) == 1) { ...
[ "protected", "function", "renderDataTable", "(", "$", "table", ",", "&", "$", "allColumns", "=", "array", "(", ")", ")", "{", "if", "(", "$", "table", "instanceof", "Simple", ")", "{", "$", "row", "=", "$", "table", "->", "getFirstRow", "(", ")", ";"...
Converts the output of the given simple data table @param DataTable|Simple $table @param array $allColumns @return string
[ "Converts", "the", "output", "of", "the", "given", "simple", "data", "table" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L176-L206
209,851
matomo-org/matomo
core/DataTable/Renderer/Csv.php
Csv.getHeaderLine
private function getHeaderLine($columnMetrics) { foreach ($columnMetrics as $index => $value) { if (in_array($value, $this->unsupportedColumns)) { unset($columnMetrics[$index]); } } if ($this->translateColumnNames) { $columnMetrics = $this...
php
private function getHeaderLine($columnMetrics) { foreach ($columnMetrics as $index => $value) { if (in_array($value, $this->unsupportedColumns)) { unset($columnMetrics[$index]); } } if ($this->translateColumnNames) { $columnMetrics = $this...
[ "private", "function", "getHeaderLine", "(", "$", "columnMetrics", ")", "{", "foreach", "(", "$", "columnMetrics", "as", "$", "index", "=>", "$", "value", ")", "{", "if", "(", "in_array", "(", "$", "value", ",", "$", "this", "->", "unsupportedColumns", "...
Returns the CSV header line for a set of metrics. Will translate columns if desired. @param array $columnMetrics @return array
[ "Returns", "the", "CSV", "header", "line", "for", "a", "set", "of", "metrics", ".", "Will", "translate", "columns", "if", "desired", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L214-L231
209,852
matomo-org/matomo
core/DataTable/Renderer/Csv.php
Csv.renderHeader
protected function renderHeader() { $fileName = Piwik::translate('General_Export'); $period = Common::getRequestVar('period', false); $date = Common::getRequestVar('date', false); if ($period || $date) { // in test cases, there are no request params set if (...
php
protected function renderHeader() { $fileName = Piwik::translate('General_Export'); $period = Common::getRequestVar('period', false); $date = Common::getRequestVar('date', false); if ($period || $date) { // in test cases, there are no request params set if (...
[ "protected", "function", "renderHeader", "(", ")", "{", "$", "fileName", "=", "Piwik", "::", "translate", "(", "'General_Export'", ")", ";", "$", "period", "=", "Common", "::", "getRequestVar", "(", "'period'", ",", "false", ")", ";", "$", "date", "=", "...
Sends the http headers for csv file
[ "Sends", "the", "http", "headers", "for", "csv", "file" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Renderer/Csv.php#L294-L322
209,853
matomo-org/matomo
core/DataTable/Filter/ReplaceColumnNames.php
ReplaceColumnNames.getRenamedColumns
protected function getRenamedColumns($columns) { $newColumns = array(); foreach ($columns as $columnName => $columnValue) { $renamedColumn = $this->getRenamedColumn($columnName); if ($renamedColumn) { if ($renamedColumn == 'goals') { $colum...
php
protected function getRenamedColumns($columns) { $newColumns = array(); foreach ($columns as $columnName => $columnValue) { $renamedColumn = $this->getRenamedColumn($columnName); if ($renamedColumn) { if ($renamedColumn == 'goals') { $colum...
[ "protected", "function", "getRenamedColumns", "(", "$", "columns", ")", "{", "$", "newColumns", "=", "array", "(", ")", ";", "foreach", "(", "$", "columns", "as", "$", "columnName", "=>", "$", "columnValue", ")", "{", "$", "renamedColumn", "=", "$", "thi...
Checks the given columns and renames them if required @param array $columns @return array
[ "Checks", "the", "given", "columns", "and", "renames", "them", "if", "required" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/Filter/ReplaceColumnNames.php#L124-L147
209,854
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._getMetadatas
protected function _getMetadatas($id) { if (isset($this->_metadatasArray[$id])) { return $this->_metadatasArray[$id]; } else { $metadatas = $this->_loadMetadatas($id); if (!$metadatas) { return false; } $this->_setMetadatas(...
php
protected function _getMetadatas($id) { if (isset($this->_metadatasArray[$id])) { return $this->_metadatasArray[$id]; } else { $metadatas = $this->_loadMetadatas($id); if (!$metadatas) { return false; } $this->_setMetadatas(...
[ "protected", "function", "_getMetadatas", "(", "$", "id", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_metadatasArray", "[", "$", "id", "]", ")", ")", "{", "return", "$", "this", "->", "_metadatasArray", "[", "$", "id", "]", ";", "}", "e...
Get a metadatas record @param string $id Cache id @return array|false Associative array of metadatas
[ "Get", "a", "metadatas", "record" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L475-L487
209,855
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._setMetadatas
protected function _setMetadatas($id, $metadatas, $save = true) { if (count($this->_metadatasArray) >= $this->_options['metadatas_array_max_size']) { $n = (int) ($this->_options['metadatas_array_max_size'] / 10); $this->_metadatasArray = array_slice($this->_metadatasArray, $n); ...
php
protected function _setMetadatas($id, $metadatas, $save = true) { if (count($this->_metadatasArray) >= $this->_options['metadatas_array_max_size']) { $n = (int) ($this->_options['metadatas_array_max_size'] / 10); $this->_metadatasArray = array_slice($this->_metadatasArray, $n); ...
[ "protected", "function", "_setMetadatas", "(", "$", "id", ",", "$", "metadatas", ",", "$", "save", "=", "true", ")", "{", "if", "(", "count", "(", "$", "this", "->", "_metadatasArray", ")", ">=", "$", "this", "->", "_options", "[", "'metadatas_array_max_...
Set a metadatas record @param string $id Cache id @param array $metadatas Associative array of metadatas @param boolean $save optional pass false to disable saving to file @return boolean True if no problem
[ "Set", "a", "metadatas", "record" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L497-L511
209,856
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._delMetadatas
protected function _delMetadatas($id) { if (isset($this->_metadatasArray[$id])) { unset($this->_metadatasArray[$id]); } $file = $this->_metadatasFile($id); return $this->_remove($file); }
php
protected function _delMetadatas($id) { if (isset($this->_metadatasArray[$id])) { unset($this->_metadatasArray[$id]); } $file = $this->_metadatasFile($id); return $this->_remove($file); }
[ "protected", "function", "_delMetadatas", "(", "$", "id", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "_metadatasArray", "[", "$", "id", "]", ")", ")", "{", "unset", "(", "$", "this", "->", "_metadatasArray", "[", "$", "id", "]", ")", ";"...
Drop a metadata record @param string $id Cache id @return boolean True if no problem
[ "Drop", "a", "metadata", "record" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L519-L526
209,857
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._loadMetadatas
protected function _loadMetadatas($id) { $file = $this->_metadatasFile($id); $result = $this->_fileGetContents($file); if (!$result) { return false; } $tmp = @unserialize($result); return $tmp; }
php
protected function _loadMetadatas($id) { $file = $this->_metadatasFile($id); $result = $this->_fileGetContents($file); if (!$result) { return false; } $tmp = @unserialize($result); return $tmp; }
[ "protected", "function", "_loadMetadatas", "(", "$", "id", ")", "{", "$", "file", "=", "$", "this", "->", "_metadatasFile", "(", "$", "id", ")", ";", "$", "result", "=", "$", "this", "->", "_fileGetContents", "(", "$", "file", ")", ";", "if", "(", ...
Load metadatas from disk @param string $id Cache id @return array|false Metadatas associative array
[ "Load", "metadatas", "from", "disk" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L544-L553
209,858
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._saveMetadatas
protected function _saveMetadatas($id, $metadatas) { $file = $this->_metadatasFile($id); $result = $this->_filePutContents($file, serialize($metadatas)); if (!$result) { return false; } return true; }
php
protected function _saveMetadatas($id, $metadatas) { $file = $this->_metadatasFile($id); $result = $this->_filePutContents($file, serialize($metadatas)); if (!$result) { return false; } return true; }
[ "protected", "function", "_saveMetadatas", "(", "$", "id", ",", "$", "metadatas", ")", "{", "$", "file", "=", "$", "this", "->", "_metadatasFile", "(", "$", "id", ")", ";", "$", "result", "=", "$", "this", "->", "_filePutContents", "(", "$", "file", ...
Save metadatas to disk @param string $id Cache id @param array $metadatas Associative array @return boolean True if no problem
[ "Save", "metadatas", "to", "disk" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L562-L570
209,859
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._isMetadatasFile
protected function _isMetadatasFile($fileName) { $id = $this->_fileNameToId($fileName); if (substr($id, 0, 21) == 'internal-metadatas---') { return true; } else { return false; } }
php
protected function _isMetadatasFile($fileName) { $id = $this->_fileNameToId($fileName); if (substr($id, 0, 21) == 'internal-metadatas---') { return true; } else { return false; } }
[ "protected", "function", "_isMetadatasFile", "(", "$", "fileName", ")", "{", "$", "id", "=", "$", "this", "->", "_fileNameToId", "(", "$", "fileName", ")", ";", "if", "(", "substr", "(", "$", "id", ",", "0", ",", "21", ")", "==", "'internal-metadatas--...
Check if the given filename is a metadatas one @param string $fileName File name @return boolean True if it's a metadatas one
[ "Check", "if", "the", "given", "filename", "is", "a", "metadatas", "one" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L591-L599
209,860
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._recursiveMkdirAndChmod
protected function _recursiveMkdirAndChmod($id) { if ($this->_options['hashed_directory_level'] <=0) { return true; } $partsArray = $this->_path($id, true); foreach ($partsArray as $part) { if (!is_dir($part)) { @mkdir($part, $this->_options['h...
php
protected function _recursiveMkdirAndChmod($id) { if ($this->_options['hashed_directory_level'] <=0) { return true; } $partsArray = $this->_path($id, true); foreach ($partsArray as $part) { if (!is_dir($part)) { @mkdir($part, $this->_options['h...
[ "protected", "function", "_recursiveMkdirAndChmod", "(", "$", "id", ")", "{", "if", "(", "$", "this", "->", "_options", "[", "'hashed_directory_level'", "]", "<=", "0", ")", "{", "return", "true", ";", "}", "$", "partsArray", "=", "$", "this", "->", "_pa...
Make the directory strucuture for the given id @param string $id cache id @return boolean true
[ "Make", "the", "directory", "strucuture", "for", "the", "given", "id" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L914-L927
209,861
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._fileGetContents
protected function _fileGetContents($file) { $result = false; if (!is_file($file)) { return false; } $f = @fopen($file, 'rb'); if ($f) { if ($this->_options['file_locking']) @flock($f, LOCK_SH); $result = stream_get_contents($f); ...
php
protected function _fileGetContents($file) { $result = false; if (!is_file($file)) { return false; } $f = @fopen($file, 'rb'); if ($f) { if ($this->_options['file_locking']) @flock($f, LOCK_SH); $result = stream_get_contents($f); ...
[ "protected", "function", "_fileGetContents", "(", "$", "file", ")", "{", "$", "result", "=", "false", ";", "if", "(", "!", "is_file", "(", "$", "file", ")", ")", "{", "return", "false", ";", "}", "$", "f", "=", "@", "fopen", "(", "$", "file", ","...
Return the file content of the given file @param string $file File complete path @return string File content (or false if problem)
[ "Return", "the", "file", "content", "of", "the", "given", "file" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L954-L968
209,862
matomo-org/matomo
libs/Zend/Cache/Backend/File.php
Zend_Cache_Backend_File._filePutContents
protected function _filePutContents($file, $string) { $result = false; $f = @fopen($file, 'ab+'); if ($f) { if ($this->_options['file_locking']) @flock($f, LOCK_EX); fseek($f, 0); ftruncate($f, 0); $tmp = @fwrite($f, $string); if (!...
php
protected function _filePutContents($file, $string) { $result = false; $f = @fopen($file, 'ab+'); if ($f) { if ($this->_options['file_locking']) @flock($f, LOCK_EX); fseek($f, 0); ftruncate($f, 0); $tmp = @fwrite($f, $string); if (!...
[ "protected", "function", "_filePutContents", "(", "$", "file", ",", "$", "string", ")", "{", "$", "result", "=", "false", ";", "$", "f", "=", "@", "fopen", "(", "$", "file", ",", "'ab+'", ")", ";", "if", "(", "$", "f", ")", "{", "if", "(", "$",...
Put the given string into the given file @param string $file File complete path @param string $string String to put in file @return boolean true if no problem
[ "Put", "the", "given", "string", "into", "the", "given", "file" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Cache/Backend/File.php#L977-L993
209,863
matomo-org/matomo
core/QuickForm2.php
QuickForm2.getSubmitValue
public function getSubmitValue($elementName) { $value = $this->getValue(); return isset($value[$elementName]) ? $value[$elementName] : null; }
php
public function getSubmitValue($elementName) { $value = $this->getValue(); return isset($value[$elementName]) ? $value[$elementName] : null; }
[ "public", "function", "getSubmitValue", "(", "$", "elementName", ")", "{", "$", "value", "=", "$", "this", "->", "getValue", "(", ")", ";", "return", "isset", "(", "$", "value", "[", "$", "elementName", "]", ")", "?", "$", "value", "[", "$", "element...
Ported from HTML_QuickForm to minimize changes to Controllers @param string $elementName @return mixed
[ "Ported", "from", "HTML_QuickForm", "to", "minimize", "changes", "to", "Controllers" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/QuickForm2.php#L104-L108
209,864
matomo-org/matomo
core/QuickForm2.php
QuickForm2.getFormData
public function getFormData($groupErrors = true) { if (!self::$registered) { HTML_QuickForm2_Renderer::register('smarty', 'HTML_QuickForm2_Renderer_Smarty'); self::$registered = true; } // Create the renderer object $renderer = HTML_QuickForm2_Renderer::facto...
php
public function getFormData($groupErrors = true) { if (!self::$registered) { HTML_QuickForm2_Renderer::register('smarty', 'HTML_QuickForm2_Renderer_Smarty'); self::$registered = true; } // Create the renderer object $renderer = HTML_QuickForm2_Renderer::facto...
[ "public", "function", "getFormData", "(", "$", "groupErrors", "=", "true", ")", "{", "if", "(", "!", "self", "::", "$", "registered", ")", "{", "HTML_QuickForm2_Renderer", "::", "register", "(", "'smarty'", ",", "'HTML_QuickForm2_Renderer_Smarty'", ")", ";", "...
Returns the rendered form as an array. @param bool $groupErrors Whether to group errors together or not. @return array
[ "Returns", "the", "rendered", "form", "as", "an", "array", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/QuickForm2.php#L129-L144
209,865
matomo-org/matomo
plugins/Transitions/API.php
API.getTransitionsForAction
public function getTransitionsForAction($actionName, $actionType, $idSite, $period, $date, $segment = false, $limitBeforeGrouping = false, $parts = 'all') { Piwik::checkUserHasViewAccess($idSite); // get idaction of the requested action $idaction ...
php
public function getTransitionsForAction($actionName, $actionType, $idSite, $period, $date, $segment = false, $limitBeforeGrouping = false, $parts = 'all') { Piwik::checkUserHasViewAccess($idSite); // get idaction of the requested action $idaction ...
[ "public", "function", "getTransitionsForAction", "(", "$", "actionName", ",", "$", "actionType", ",", "$", "idSite", ",", "$", "period", ",", "$", "date", ",", "$", "segment", "=", "false", ",", "$", "limitBeforeGrouping", "=", "false", ",", "$", "parts", ...
General method to get transitions for an action @param $actionName @param $actionType "url"|"title" @param $idSite @param $period @param $date @param bool $segment @param bool $limitBeforeGrouping @param string $parts @return array @throws Exception
[ "General", "method", "to", "get", "transitions", "for", "an", "action" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Transitions/API.php#L61-L123
209,866
matomo-org/matomo
plugins/Transitions/API.php
API.deriveIdAction
private function deriveIdAction($actionName, $actionType) { switch ($actionType) { case 'url': $originalActionName = $actionName; $actionName = Common::unsanitizeInputValue($actionName); $id = TableLogAction::getIdActionFromSegment($actionName, 'id...
php
private function deriveIdAction($actionName, $actionType) { switch ($actionType) { case 'url': $originalActionName = $actionName; $actionName = Common::unsanitizeInputValue($actionName); $id = TableLogAction::getIdActionFromSegment($actionName, 'id...
[ "private", "function", "deriveIdAction", "(", "$", "actionName", ",", "$", "actionType", ")", "{", "switch", "(", "$", "actionType", ")", "{", "case", "'url'", ":", "$", "originalActionName", "=", "$", "actionName", ";", "$", "actionName", "=", "Common", "...
Derive the action ID from the request action name and type.
[ "Derive", "the", "action", "ID", "from", "the", "request", "action", "name", "and", "type", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Transitions/API.php#L128-L159
209,867
matomo-org/matomo
core/Visualization/Sparkline.php
Sparkline.setWidth
public function setWidth($width) { if (!is_numeric($width) || $width <= 0) { return; } if ($width > self::MAX_WIDTH) { $this->_width = self::MAX_WIDTH; } else { $this->_width = (int)$width; } }
php
public function setWidth($width) { if (!is_numeric($width) || $width <= 0) { return; } if ($width > self::MAX_WIDTH) { $this->_width = self::MAX_WIDTH; } else { $this->_width = (int)$width; } }
[ "public", "function", "setWidth", "(", "$", "width", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "width", ")", "||", "$", "width", "<=", "0", ")", "{", "return", ";", "}", "if", "(", "$", "width", ">", "self", "::", "MAX_WIDTH", ")", "{", ...
Sets the width of the sparkline @param int $width
[ "Sets", "the", "width", "of", "the", "sparkline" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Visualization/Sparkline.php#L116-L125
209,868
matomo-org/matomo
core/Visualization/Sparkline.php
Sparkline.setHeight
public function setHeight($height) { if (!is_numeric($height) || $height <= 0) { return; } if ($height > self::MAX_HEIGHT) { $this->_height = self::MAX_HEIGHT; } else { $this->_height = (int)$height; } }
php
public function setHeight($height) { if (!is_numeric($height) || $height <= 0) { return; } if ($height > self::MAX_HEIGHT) { $this->_height = self::MAX_HEIGHT; } else { $this->_height = (int)$height; } }
[ "public", "function", "setHeight", "(", "$", "height", ")", "{", "if", "(", "!", "is_numeric", "(", "$", "height", ")", "||", "$", "height", "<=", "0", ")", "{", "return", ";", "}", "if", "(", "$", "height", ">", "self", "::", "MAX_HEIGHT", ")", ...
Sets the height of the sparkline @param int $height
[ "Sets", "the", "height", "of", "the", "sparkline" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Visualization/Sparkline.php#L139-L148
209,869
matomo-org/matomo
core/Visualization/Sparkline.php
Sparkline.setSparklineColors
private function setSparklineColors($sparkline) { $colors = Common::getRequestVar('colors', false, 'json'); if (empty($colors)) { // quick fix so row evolution sparklines will have color in widgetize's iframes $colors = array( 'backgroundColor' => '#ffffff', ...
php
private function setSparklineColors($sparkline) { $colors = Common::getRequestVar('colors', false, 'json'); if (empty($colors)) { // quick fix so row evolution sparklines will have color in widgetize's iframes $colors = array( 'backgroundColor' => '#ffffff', ...
[ "private", "function", "setSparklineColors", "(", "$", "sparkline", ")", "{", "$", "colors", "=", "Common", "::", "getRequestVar", "(", "'colors'", ",", "false", ",", "'json'", ")", ";", "if", "(", "empty", "(", "$", "colors", ")", ")", "{", "// quick fi...
Sets the sparkline colors @param \Davaxi\Sparkline $sparkline
[ "Sets", "the", "sparkline", "colors" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Visualization/Sparkline.php#L155-L189
209,870
matomo-org/matomo
core/Period/Week.php
Week.getLocalizedLongString
public function getLocalizedLongString() { $string = $this->getTranslatedRange($this->getRangeFormat()); return $this->translator->translate('Intl_PeriodWeek') . " " . $string; }
php
public function getLocalizedLongString() { $string = $this->getTranslatedRange($this->getRangeFormat()); return $this->translator->translate('Intl_PeriodWeek') . " " . $string; }
[ "public", "function", "getLocalizedLongString", "(", ")", "{", "$", "string", "=", "$", "this", "->", "getTranslatedRange", "(", "$", "this", "->", "getRangeFormat", "(", ")", ")", ";", "return", "$", "this", "->", "translator", "->", "translate", "(", "'I...
Returns the current period as a localized long string @return string
[ "Returns", "the", "current", "period", "as", "a", "localized", "long", "string" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Period/Week.php#L36-L40
209,871
matomo-org/matomo
core/Period/Week.php
Week.generate
protected function generate() { if ($this->subperiodsProcessed) { return; } parent::generate(); $date = $this->date; if ($date->toString('N') > 1) { $date = $date->subDay($date->toString('N') - 1); } $startWeek = $date; $cur...
php
protected function generate() { if ($this->subperiodsProcessed) { return; } parent::generate(); $date = $this->date; if ($date->toString('N') > 1) { $date = $date->subDay($date->toString('N') - 1); } $startWeek = $date; $cur...
[ "protected", "function", "generate", "(", ")", "{", "if", "(", "$", "this", "->", "subperiodsProcessed", ")", "{", "return", ";", "}", "parent", "::", "generate", "(", ")", ";", "$", "date", "=", "$", "this", "->", "date", ";", "if", "(", "$", "dat...
Generates the subperiods - one for each day in the week
[ "Generates", "the", "subperiods", "-", "one", "for", "each", "day", "in", "the", "week" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Period/Week.php#L60-L80
209,872
matomo-org/matomo
core/Tracker/Cache.php
Cache.regenerateCacheWebsiteAttributes
public static function regenerateCacheWebsiteAttributes($idSites = array()) { if (!is_array($idSites)) { $idSites = array($idSites); } foreach ($idSites as $idSite) { self::deleteCacheWebsiteAttributes($idSite); self::getCacheWebsiteAttributes($idSite); ...
php
public static function regenerateCacheWebsiteAttributes($idSites = array()) { if (!is_array($idSites)) { $idSites = array($idSites); } foreach ($idSites as $idSite) { self::deleteCacheWebsiteAttributes($idSite); self::getCacheWebsiteAttributes($idSite); ...
[ "public", "static", "function", "regenerateCacheWebsiteAttributes", "(", "$", "idSites", "=", "array", "(", ")", ")", "{", "if", "(", "!", "is_array", "(", "$", "idSites", ")", ")", "{", "$", "idSites", "=", "array", "(", "$", "idSites", ")", ";", "}",...
Regenerate Tracker cache files @param array|int $idSites Array of idSites to clear cache for
[ "Regenerate", "Tracker", "cache", "files" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Tracker/Cache.php#L189-L199
209,873
matomo-org/matomo
core/Option.php
Option.set
public static function set($name, $value, $autoload = 0) { self::getInstance()->setValue($name, $value, $autoload); }
php
public static function set($name, $value, $autoload = 0) { self::getInstance()->setValue($name, $value, $autoload); }
[ "public", "static", "function", "set", "(", "$", "name", ",", "$", "value", ",", "$", "autoload", "=", "0", ")", "{", "self", "::", "getInstance", "(", ")", "->", "setValue", "(", "$", "name", ",", "$", "value", ",", "$", "autoload", ")", ";", "}...
Sets an option value by name. @param string $name The option name. @param string $value The value to set the option to. @param int $autoLoad If set to 1, this option value will be automatically loaded when Piwik is initialzed; should be set to 1 for options that will be used in every Piwik request.
[ "Sets", "an", "option", "value", "by", "name", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Option.php#L69-L72
209,874
matomo-org/matomo
core/Option.php
Option.autoload
protected function autoload() { if ($this->loaded) { return; } $table = Common::prefixTable('option'); $sql = 'SELECT option_value, option_name FROM `' . $table . '` WHERE autoload = 1'; $all = Db::fetchAll($sql); foreach ($all as $option) { ...
php
protected function autoload() { if ($this->loaded) { return; } $table = Common::prefixTable('option'); $sql = 'SELECT option_value, option_name FROM `' . $table . '` WHERE autoload = 1'; $all = Db::fetchAll($sql); foreach ($all as $option) { ...
[ "protected", "function", "autoload", "(", ")", "{", "if", "(", "$", "this", "->", "loaded", ")", "{", "return", ";", "}", "$", "table", "=", "Common", "::", "prefixTable", "(", "'option'", ")", ";", "$", "sql", "=", "'SELECT option_value, option_name FROM ...
Initialize cache with autoload settings. @return void
[ "Initialize", "cache", "with", "autoload", "settings", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Option.php#L263-L278
209,875
matomo-org/matomo
core/Segment.php
Segment.willBeArchived
public function willBeArchived() { if ($this->isEmpty()) { return true; } $idSites = $this->idSites; if (!is_array($idSites)) { $idSites = array($this->idSites); } return Rules::isRequestAuthorizedToArchive() || Rules::isBrowserAr...
php
public function willBeArchived() { if ($this->isEmpty()) { return true; } $idSites = $this->idSites; if (!is_array($idSites)) { $idSites = array($this->idSites); } return Rules::isRequestAuthorizedToArchive() || Rules::isBrowserAr...
[ "public", "function", "willBeArchived", "(", ")", "{", "if", "(", "$", "this", "->", "isEmpty", "(", ")", ")", "{", "return", "true", ";", "}", "$", "idSites", "=", "$", "this", "->", "idSites", ";", "if", "(", "!", "is_array", "(", "$", "idSites",...
Detects whether the Piwik instance is configured to be able to archive this segment. It checks whether the segment will be either archived via browser or cli archiving. It does not check if the segment has been archived. If you want to know whether the segment has been archived, the actual report data needs to be reque...
[ "Detects", "whether", "the", "Piwik", "instance", "is", "configured", "to", "be", "able", "to", "archive", "this", "segment", ".", "It", "checks", "whether", "the", "segment", "will", "be", "either", "archived", "via", "browser", "or", "cli", "archiving", "....
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment.php#L235-L249
209,876
matomo-org/matomo
core/Segment.php
Segment.getSelectQuery
public function getSelectQuery($select, $from, $where = false, $bind = array(), $orderBy = false, $groupBy = false, $limit = 0, $offset = 0) { $segmentExpression = $this->segmentExpression; $limitAndOffset = null; if($limit > 0) { $limitAndOffset = (int) $offset . ', ' . (int) $...
php
public function getSelectQuery($select, $from, $where = false, $bind = array(), $orderBy = false, $groupBy = false, $limit = 0, $offset = 0) { $segmentExpression = $this->segmentExpression; $limitAndOffset = null; if($limit > 0) { $limitAndOffset = (int) $offset . ', ' . (int) $...
[ "public", "function", "getSelectQuery", "(", "$", "select", ",", "$", "from", ",", "$", "where", "=", "false", ",", "$", "bind", "=", "array", "(", ")", ",", "$", "orderBy", "=", "false", ",", "$", "groupBy", "=", "false", ",", "$", "limit", "=", ...
Extend an SQL query that aggregates data over one of the 'log_' tables with segment expressions. @param string $select The select clause. Should NOT include the **SELECT** just the columns, eg, `'t1.col1 as col1, t2.col2 as col2'`. @param array $from Array of table names (without prefix), eg, `array('log_visit', 'log_...
[ "Extend", "an", "SQL", "query", "that", "aggregates", "data", "over", "one", "of", "the", "log_", "tables", "with", "segment", "expressions", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment.php#L335-L346
209,877
matomo-org/matomo
core/Segment.php
Segment.combine
public static function combine($segment, $operator, $segmentCondition) { if (empty($segment)) { return $segmentCondition; } if (empty($segmentCondition) || self::containsCondition($segment, $operator, $segmentCondition) ) { return $segment; ...
php
public static function combine($segment, $operator, $segmentCondition) { if (empty($segment)) { return $segmentCondition; } if (empty($segmentCondition) || self::containsCondition($segment, $operator, $segmentCondition) ) { return $segment; ...
[ "public", "static", "function", "combine", "(", "$", "segment", ",", "$", "operator", ",", "$", "segmentCondition", ")", "{", "if", "(", "empty", "(", "$", "segment", ")", ")", "{", "return", "$", "segmentCondition", ";", "}", "if", "(", "empty", "(", ...
Combines this segment with another segment condition, if the segment condition is not already in the segment. The combination is naive in that it does not take order of operations into account. @param string $segment @param string $operator The operator to use. Should be either SegmentExpression::AND_DELIMITER or Seg...
[ "Combines", "this", "segment", "with", "another", "segment", "condition", "if", "the", "segment", "condition", "is", "not", "already", "in", "the", "segment", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Segment.php#L371-L384
209,878
matomo-org/matomo
plugins/ImageGraph/StaticGraph.php
StaticGraph.sendToDisk
public function sendToDisk($filename) { $filePath = self::getOutputPath($filename); $this->pImage->render($filePath); return $filePath; }
php
public function sendToDisk($filename) { $filePath = self::getOutputPath($filename); $this->pImage->render($filePath); return $filePath; }
[ "public", "function", "sendToDisk", "(", "$", "filename", ")", "{", "$", "filePath", "=", "self", "::", "getOutputPath", "(", "$", "filename", ")", ";", "$", "this", "->", "pImage", "->", "render", "(", "$", "filePath", ")", ";", "return", "$", "filePa...
Save rendering to disk @param string $filename without path @return string path of file
[ "Save", "rendering", "to", "disk" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/ImageGraph/StaticGraph.php#L98-L103
209,879
matomo-org/matomo
plugins/Referrers/Tasks.php
Tasks.updateSearchEngines
public function updateSearchEngines() { $url = 'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/SearchEngines.yml'; $list = Http::sendHttpRequest($url, 30); $searchEngines = SearchEngine::getInstance()->loadYmlData($list); if (count($searchEngines) < ...
php
public function updateSearchEngines() { $url = 'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/SearchEngines.yml'; $list = Http::sendHttpRequest($url, 30); $searchEngines = SearchEngine::getInstance()->loadYmlData($list); if (count($searchEngines) < ...
[ "public", "function", "updateSearchEngines", "(", ")", "{", "$", "url", "=", "'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/SearchEngines.yml'", ";", "$", "list", "=", "Http", "::", "sendHttpRequest", "(", "$", "url", ",", "30", ")", ...
Update the search engine definitions @see https://github.com/matomo-org/searchengine-and-social-list
[ "Update", "the", "search", "engine", "definitions" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Tasks.php#L31-L40
209,880
matomo-org/matomo
plugins/Referrers/Tasks.php
Tasks.updateSocials
public function updateSocials() { $url = 'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/Socials.yml'; $list = Http::sendHttpRequest($url, 30); $socials = Social::getInstance()->loadYmlData($list); if (count($socials) < 50) { return; ...
php
public function updateSocials() { $url = 'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/Socials.yml'; $list = Http::sendHttpRequest($url, 30); $socials = Social::getInstance()->loadYmlData($list); if (count($socials) < 50) { return; ...
[ "public", "function", "updateSocials", "(", ")", "{", "$", "url", "=", "'https://raw.githubusercontent.com/matomo-org/searchengine-and-social-list/master/Socials.yml'", ";", "$", "list", "=", "Http", "::", "sendHttpRequest", "(", "$", "url", ",", "30", ")", ";", "$", ...
Update the social definitions @see https://github.com/matomo-org/searchengine-and-social-list
[ "Update", "the", "social", "definitions" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Referrers/Tasks.php#L47-L56
209,881
matomo-org/matomo
libs/Zend/Mail/Transport/Sendmail.php
Zend_Mail_Transport_Sendmail._prepareHeaders
protected function _prepareHeaders($headers) { if (!$this->_mail) { /** * @see Zend_Mail_Transport_Exception */ // require_once 'Zend/Mail/Transport/Exception.php'; throw new Zend_Mail_Transport_Exception('_prepareHeaders requires a registered Ze...
php
protected function _prepareHeaders($headers) { if (!$this->_mail) { /** * @see Zend_Mail_Transport_Exception */ // require_once 'Zend/Mail/Transport/Exception.php'; throw new Zend_Mail_Transport_Exception('_prepareHeaders requires a registered Ze...
[ "protected", "function", "_prepareHeaders", "(", "$", "headers", ")", "{", "if", "(", "!", "$", "this", "->", "_mail", ")", "{", "/**\n * @see Zend_Mail_Transport_Exception\n */", "// require_once 'Zend/Mail/Transport/Exception.php';", "throw", "new", ...
Format and fix headers mail() uses its $to and $subject arguments to set the To: and Subject: headers, respectively. This method strips those out as a sanity check to prevent duplicate header entries. @access protected @param array $headers @return void @throws Zend_Mail_Transport_Exception
[ "Format", "and", "fix", "headers" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/libs/Zend/Mail/Transport/Sendmail.php#L154-L202
209,882
matomo-org/matomo
plugins/Installation/FormDatabaseSetup.php
FormDatabaseSetup.createDatabaseObject
public function createDatabaseObject() { $dbname = trim($this->getSubmitValue('dbname')); if (empty($dbname)) // disallow database object creation w/ no selected database { throw new Exception("No database name"); } $adapter = $this->getSubmitValue('adapter'); ...
php
public function createDatabaseObject() { $dbname = trim($this->getSubmitValue('dbname')); if (empty($dbname)) // disallow database object creation w/ no selected database { throw new Exception("No database name"); } $adapter = $this->getSubmitValue('adapter'); ...
[ "public", "function", "createDatabaseObject", "(", ")", "{", "$", "dbname", "=", "trim", "(", "$", "this", "->", "getSubmitValue", "(", "'dbname'", ")", ")", ";", "if", "(", "empty", "(", "$", "dbname", ")", ")", "// disallow database object creation w/ no sel...
Creates database object based on form data. @throws Exception|Zend_Db_Adapter_Exception @return array The database connection info. Can be passed into Piwik::createDatabaseObject.
[ "Creates", "database", "object", "based", "on", "form", "data", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/FormDatabaseSetup.php#L111-L167
209,883
matomo-org/matomo
plugins/Installation/FormDatabaseSetup.php
Rule_checkUserPrivileges.validateOwner
public function validateOwner() { // try and create the database object try { $this->createDatabaseObject(); } catch (Exception $ex) { if ($this->isAccessDenied($ex)) { return false; } else { return true; // if we can't crea...
php
public function validateOwner() { // try and create the database object try { $this->createDatabaseObject(); } catch (Exception $ex) { if ($this->isAccessDenied($ex)) { return false; } else { return true; // if we can't crea...
[ "public", "function", "validateOwner", "(", ")", "{", "// try and create the database object", "try", "{", "$", "this", "->", "createDatabaseObject", "(", ")", ";", "}", "catch", "(", "Exception", "$", "ex", ")", "{", "if", "(", "$", "this", "->", "isAccessD...
Checks that the DB user entered in the form has the necessary privileges for Piwik to run.
[ "Checks", "that", "the", "DB", "user", "entered", "in", "the", "form", "has", "the", "necessary", "privileges", "for", "Piwik", "to", "run", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/FormDatabaseSetup.php#L193-L246
209,884
matomo-org/matomo
plugins/Installation/FormDatabaseSetup.php
Rule_checkUserPrivileges.getRequiredPrivileges
public static function getRequiredPrivileges() { return array( 'CREATE' => 'CREATE TABLE ' . self::TEST_TABLE_NAME . ' ( id INT AUTO_INCREMENT, value INT, PRIMARY KEY (id), ...
php
public static function getRequiredPrivileges() { return array( 'CREATE' => 'CREATE TABLE ' . self::TEST_TABLE_NAME . ' ( id INT AUTO_INCREMENT, value INT, PRIMARY KEY (id), ...
[ "public", "static", "function", "getRequiredPrivileges", "(", ")", "{", "return", "array", "(", "'CREATE'", "=>", "'CREATE TABLE '", ".", "self", "::", "TEST_TABLE_NAME", ".", "' (\n id INT AUTO_INCREMENT,\n value INT,\n...
Returns an array describing the database privileges required for Matomo to run. The array maps privilege names with one or more SQL queries that can be used to test if the current user has the privilege. NOTE: LOAD DATA INFILE & LOCK TABLES privileges are not **required** so they're not checked. @return array
[ "Returns", "an", "array", "describing", "the", "database", "privileges", "required", "for", "Matomo", "to", "run", ".", "The", "array", "maps", "privilege", "names", "with", "one", "or", "more", "SQL", "queries", "that", "can", "be", "used", "to", "test", ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Installation/FormDatabaseSetup.php#L258-L279
209,885
matomo-org/matomo
plugins/Login/SessionInitializer.php
SessionInitializer.getAuthCookie
protected function getAuthCookie($rememberMe) { $authCookieExpiry = $rememberMe ? time() + $this->authCookieValidTime : 0; $cookie = new Cookie($this->authCookieName, $authCookieExpiry, $this->authCookiePath); return $cookie; }
php
protected function getAuthCookie($rememberMe) { $authCookieExpiry = $rememberMe ? time() + $this->authCookieValidTime : 0; $cookie = new Cookie($this->authCookieName, $authCookieExpiry, $this->authCookiePath); return $cookie; }
[ "protected", "function", "getAuthCookie", "(", "$", "rememberMe", ")", "{", "$", "authCookieExpiry", "=", "$", "rememberMe", "?", "time", "(", ")", "+", "$", "this", "->", "authCookieValidTime", ":", "0", ";", "$", "cookie", "=", "new", "Cookie", "(", "$...
Returns a Cookie instance that manages the browser cookie used to store session information. @param bool $rememberMe Whether the authenticated session should be remembered after the browser is closed or not. @return Cookie
[ "Returns", "a", "Cookie", "instance", "that", "manages", "the", "browser", "cookie", "used", "to", "store", "session", "information", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/SessionInitializer.php#L153-L158
209,886
matomo-org/matomo
plugins/Login/SessionInitializer.php
SessionInitializer.processFailedSession
protected function processFailedSession($rememberMe) { $cookie = $this->getAuthCookie($rememberMe); $cookie->delete(); throw new Exception(Piwik::translate('Login_LoginPasswordNotCorrect')); }
php
protected function processFailedSession($rememberMe) { $cookie = $this->getAuthCookie($rememberMe); $cookie->delete(); throw new Exception(Piwik::translate('Login_LoginPasswordNotCorrect')); }
[ "protected", "function", "processFailedSession", "(", "$", "rememberMe", ")", "{", "$", "cookie", "=", "$", "this", "->", "getAuthCookie", "(", "$", "rememberMe", ")", ";", "$", "cookie", "->", "delete", "(", ")", ";", "throw", "new", "Exception", "(", "...
Executed when the session could not authenticate. @param bool $rememberMe Whether the authenticated session should be remembered after the browser is closed or not. @throws Exception always.
[ "Executed", "when", "the", "session", "could", "not", "authenticate", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/Login/SessionInitializer.php#L167-L173
209,887
matomo-org/matomo
plugins/UserCountry/LocationProvider/DefaultProvider.php
DefaultProvider.getLocation
public function getLocation($info) { $enableLanguageToCountryGuess = Config::getInstance()->Tracker['enable_language_to_country_guess']; if (empty($info['lang'])) { $info['lang'] = Common::getBrowserLanguage(); } $country = Common::getCountry($info['lang'], $enableLangua...
php
public function getLocation($info) { $enableLanguageToCountryGuess = Config::getInstance()->Tracker['enable_language_to_country_guess']; if (empty($info['lang'])) { $info['lang'] = Common::getBrowserLanguage(); } $country = Common::getCountry($info['lang'], $enableLangua...
[ "public", "function", "getLocation", "(", "$", "info", ")", "{", "$", "enableLanguageToCountryGuess", "=", "Config", "::", "getInstance", "(", ")", "->", "Tracker", "[", "'enable_language_to_country_guess'", "]", ";", "if", "(", "empty", "(", "$", "info", "[",...
Guesses a visitor's location using a visitor's browser language. @param array $info Contains 'ip' & 'lang' keys. @return array Contains the guessed country code mapped to LocationProvider::COUNTRY_CODE_KEY.
[ "Guesses", "a", "visitor", "s", "location", "using", "a", "visitor", "s", "browser", "language", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/LocationProvider/DefaultProvider.php#L32-L45
209,888
matomo-org/matomo
core/Metrics/Formatter.php
Formatter.getPrettyNumber
public function getPrettyNumber($value, $precision = 0) { if ($this->decimalPoint === null) { $locale = localeconv(); $this->decimalPoint = $locale['decimal_point']; $this->thousandsSeparator = $locale['thousands_sep']; } return number_format($value, $pr...
php
public function getPrettyNumber($value, $precision = 0) { if ($this->decimalPoint === null) { $locale = localeconv(); $this->decimalPoint = $locale['decimal_point']; $this->thousandsSeparator = $locale['thousands_sep']; } return number_format($value, $pr...
[ "public", "function", "getPrettyNumber", "(", "$", "value", ",", "$", "precision", "=", "0", ")", "{", "if", "(", "$", "this", "->", "decimalPoint", "===", "null", ")", "{", "$", "locale", "=", "localeconv", "(", ")", ";", "$", "this", "->", "decimal...
Returns a prettified string representation of a number. The result will have thousands separators and a decimal point specific to the current locale, eg, `'1,000,000.05'` or `'1.000.000,05'`. @param number $value @return string @api
[ "Returns", "a", "prettified", "string", "representation", "of", "a", "number", ".", "The", "result", "will", "have", "thousands", "separators", "and", "a", "decimal", "point", "specific", "to", "the", "current", "locale", "eg", "1", "000", "000", ".", "05", ...
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics/Formatter.php#L42-L52
209,889
matomo-org/matomo
core/Metrics/Formatter.php
Formatter.formatMetrics
public function formatMetrics(DataTable $dataTable, Report $report = null, $metricsToFormat = null, $formatAll = false) { $metrics = $this->getMetricsToFormat($dataTable, $report); if (empty($metrics) || $dataTable->getMetadata(self::PROCESSED_METRICS_FORMATTED_FLAG) ) { ...
php
public function formatMetrics(DataTable $dataTable, Report $report = null, $metricsToFormat = null, $formatAll = false) { $metrics = $this->getMetricsToFormat($dataTable, $report); if (empty($metrics) || $dataTable->getMetadata(self::PROCESSED_METRICS_FORMATTED_FLAG) ) { ...
[ "public", "function", "formatMetrics", "(", "DataTable", "$", "dataTable", ",", "Report", "$", "report", "=", "null", ",", "$", "metricsToFormat", "=", "null", ",", "$", "formatAll", "=", "false", ")", "{", "$", "metrics", "=", "$", "this", "->", "getMet...
Formats all metrics, including processed metrics, for a DataTable. Metrics to format are found through report metadata and DataTable metadata. @param DataTable $dataTable The table to format metrics for. @param Report|null $report The report the table belongs to. @param string[]|null $metricsToFormat Whitelist of name...
[ "Formats", "all", "metrics", "including", "processed", "metrics", "for", "a", "DataTable", ".", "Metrics", "to", "format", "are", "found", "through", "report", "metadata", "and", "DataTable", "metadata", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Metrics/Formatter.php#L208-L270
209,890
matomo-org/matomo
plugins/UserCountry/GeoIPAutoUpdater.php
GeoIPAutoUpdater.setUpdaterOptionsFromUrl
public static function setUpdaterOptionsFromUrl() { $options = array( 'loc' => Common::getRequestVar('loc_db', false, 'string'), 'isp' => Common::getRequestVar('isp_db', false, 'string'), 'org' => Common::getRequestVar('org_db', false, 'string'), 'per...
php
public static function setUpdaterOptionsFromUrl() { $options = array( 'loc' => Common::getRequestVar('loc_db', false, 'string'), 'isp' => Common::getRequestVar('isp_db', false, 'string'), 'org' => Common::getRequestVar('org_db', false, 'string'), 'per...
[ "public", "static", "function", "setUpdaterOptionsFromUrl", "(", ")", "{", "$", "options", "=", "array", "(", "'loc'", "=>", "Common", "::", "getRequestVar", "(", "'loc_db'", ",", "false", ",", "'string'", ")", ",", "'isp'", "=>", "Common", "::", "getRequest...
Sets the options used by this class based on query parameter values. See setUpdaterOptions for query params used.
[ "Sets", "the", "options", "used", "by", "this", "class", "based", "on", "query", "parameter", "values", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/GeoIPAutoUpdater.php#L312-L326
209,891
matomo-org/matomo
plugins/UserCountry/GeoIPAutoUpdater.php
GeoIPAutoUpdater.clearOptions
public static function clearOptions() { foreach (self::$urlOptions as $optionKey => $optionName) { Option::delete($optionName); } Option::delete(self::SCHEDULE_PERIOD_OPTION_NAME); }
php
public static function clearOptions() { foreach (self::$urlOptions as $optionKey => $optionName) { Option::delete($optionName); } Option::delete(self::SCHEDULE_PERIOD_OPTION_NAME); }
[ "public", "static", "function", "clearOptions", "(", ")", "{", "foreach", "(", "self", "::", "$", "urlOptions", "as", "$", "optionKey", "=>", "$", "optionName", ")", "{", "Option", "::", "delete", "(", "$", "optionName", ")", ";", "}", "Option", "::", ...
Removes all options to disable any configured automatic updates
[ "Removes", "all", "options", "to", "disable", "any", "configured", "automatic", "updates" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/GeoIPAutoUpdater.php#L379-L385
209,892
matomo-org/matomo
plugins/UserCountry/GeoIPAutoUpdater.php
GeoIPAutoUpdater.isUpdaterSetup
public static function isUpdaterSetup() { if (Option::get(self::LOC_URL_OPTION_NAME) !== false || Option::get(self::ISP_URL_OPTION_NAME) !== false || Option::get(self::ORG_URL_OPTION_NAME) !== false ) { return true; } return false; }
php
public static function isUpdaterSetup() { if (Option::get(self::LOC_URL_OPTION_NAME) !== false || Option::get(self::ISP_URL_OPTION_NAME) !== false || Option::get(self::ORG_URL_OPTION_NAME) !== false ) { return true; } return false; }
[ "public", "static", "function", "isUpdaterSetup", "(", ")", "{", "if", "(", "Option", "::", "get", "(", "self", "::", "LOC_URL_OPTION_NAME", ")", "!==", "false", "||", "Option", "::", "get", "(", "self", "::", "ISP_URL_OPTION_NAME", ")", "!==", "false", "|...
Returns true if the auto-updater is setup to update at least one type of database. False if otherwise. @return bool
[ "Returns", "true", "if", "the", "auto", "-", "updater", "is", "setup", "to", "update", "at", "least", "one", "type", "of", "database", ".", "False", "if", "otherwise", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/GeoIPAutoUpdater.php#L393-L403
209,893
matomo-org/matomo
plugins/UserCountry/GeoIPAutoUpdater.php
GeoIPAutoUpdater.getOldAndNewPathsForBrokenDb
private function getOldAndNewPathsForBrokenDb($possibleDbNames) { $pathToDb = GeoIp::getPathToGeoIpDatabase($possibleDbNames); $newPath = false; if ($pathToDb !== false) { $newPath = $pathToDb . ".broken"; } return array($pathToDb, $newPath); }
php
private function getOldAndNewPathsForBrokenDb($possibleDbNames) { $pathToDb = GeoIp::getPathToGeoIpDatabase($possibleDbNames); $newPath = false; if ($pathToDb !== false) { $newPath = $pathToDb . ".broken"; } return array($pathToDb, $newPath); }
[ "private", "function", "getOldAndNewPathsForBrokenDb", "(", "$", "possibleDbNames", ")", "{", "$", "pathToDb", "=", "GeoIp", "::", "getPathToGeoIpDatabase", "(", "$", "possibleDbNames", ")", ";", "$", "newPath", "=", "false", ";", "if", "(", "$", "pathToDb", "...
Returns the path to a GeoIP database and a path to rename it to if it's broken. @param array $possibleDbNames The possible names of the database. @return array Array with two elements, the path to the existing database, and the path to rename it to if it is broken. The second will end with something like .broken .
[ "Returns", "the", "path", "to", "a", "GeoIP", "database", "and", "a", "path", "to", "rename", "it", "to", "if", "it", "s", "broken", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/GeoIPAutoUpdater.php#L616-L626
209,894
matomo-org/matomo
plugins/UserCountry/GeoIPAutoUpdater.php
GeoIPAutoUpdater.catchGeoIPError
public static function catchGeoIPError($errno, $errstr, $errfile, $errline) { self::$unzipPhpError = array($errno, $errstr, $errfile, $errline); }
php
public static function catchGeoIPError($errno, $errstr, $errfile, $errline) { self::$unzipPhpError = array($errno, $errstr, $errfile, $errline); }
[ "public", "static", "function", "catchGeoIPError", "(", "$", "errno", ",", "$", "errstr", ",", "$", "errfile", ",", "$", "errline", ")", "{", "self", "::", "$", "unzipPhpError", "=", "array", "(", "$", "errno", ",", "$", "errstr", ",", "$", "errfile", ...
Custom PHP error handler used to catch any PHP errors that occur when testing a downloaded GeoIP file. If we download a file that is supposed to be a GeoIP database, we need to make sure it is one. This is done simply by attempting to use it. If this fails, it will most of the time fail as a PHP error, which we catch ...
[ "Custom", "PHP", "error", "handler", "used", "to", "catch", "any", "PHP", "errors", "that", "occur", "when", "testing", "a", "downloaded", "GeoIP", "file", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/GeoIPAutoUpdater.php#L644-L647
209,895
matomo-org/matomo
plugins/UserCountry/VisitorGeolocator.php
VisitorGeolocator.attributeExistingVisit
public function attributeExistingVisit($visit, $useClassCache = true) { if (empty($visit['idvisit'])) { $this->logger->debug('Empty idvisit field. Skipping re-attribution..'); return null; } $idVisit = $visit['idvisit']; if (empty($visit['location_ip'])) { ...
php
public function attributeExistingVisit($visit, $useClassCache = true) { if (empty($visit['idvisit'])) { $this->logger->debug('Empty idvisit field. Skipping re-attribution..'); return null; } $idVisit = $visit['idvisit']; if (empty($visit['location_ip'])) { ...
[ "public", "function", "attributeExistingVisit", "(", "$", "visit", ",", "$", "useClassCache", "=", "true", ")", "{", "if", "(", "empty", "(", "$", "visit", "[", "'idvisit'", "]", ")", ")", "{", "$", "this", "->", "logger", "->", "debug", "(", "'Empty i...
Geolcates an existing visit and then updates it if it's current attributes are different than what was geolocated. Also updates all conversions of a visit. **This method should NOT be used from within the tracker.** @param array $visit The visit information. Must contain an `"idvisit"` element and `"location_ip"` ele...
[ "Geolcates", "an", "existing", "visit", "and", "then", "updates", "it", "if", "it", "s", "current", "attributes", "are", "different", "than", "what", "was", "geolocated", ".", "Also", "updates", "all", "conversions", "of", "a", "visit", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/VisitorGeolocator.php#L169-L205
209,896
matomo-org/matomo
plugins/UserCountry/VisitorGeolocator.php
VisitorGeolocator.getVisitFieldsToUpdate
private function getVisitFieldsToUpdate(array $row, $location) { if (isset($location[LocationProvider::COUNTRY_CODE_KEY])) { $location[LocationProvider::COUNTRY_CODE_KEY] = strtolower($location[LocationProvider::COUNTRY_CODE_KEY]); } $valuesToUpdate = array(); foreach (s...
php
private function getVisitFieldsToUpdate(array $row, $location) { if (isset($location[LocationProvider::COUNTRY_CODE_KEY])) { $location[LocationProvider::COUNTRY_CODE_KEY] = strtolower($location[LocationProvider::COUNTRY_CODE_KEY]); } $valuesToUpdate = array(); foreach (s...
[ "private", "function", "getVisitFieldsToUpdate", "(", "array", "$", "row", ",", "$", "location", ")", "{", "if", "(", "isset", "(", "$", "location", "[", "LocationProvider", "::", "COUNTRY_CODE_KEY", "]", ")", ")", "{", "$", "location", "[", "LocationProvide...
Returns location log values that are different than the values currently in a log row. @param array $row The visit row. @param array $location The location information. @return array The location properties to update.
[ "Returns", "location", "log", "values", "that", "are", "different", "than", "the", "values", "currently", "in", "a", "log", "row", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/plugins/UserCountry/VisitorGeolocator.php#L214-L234
209,897
matomo-org/matomo
core/DataTable/BaseFilter.php
BaseFilter.filterSubTable
public function filterSubTable(Row $row) { if (!$this->enableRecursive) { return; } $subTable = $row->getSubtable(); if ($subTable) { $this->filter($subTable); } }
php
public function filterSubTable(Row $row) { if (!$this->enableRecursive) { return; } $subTable = $row->getSubtable(); if ($subTable) { $this->filter($subTable); } }
[ "public", "function", "filterSubTable", "(", "Row", "$", "row", ")", "{", "if", "(", "!", "$", "this", "->", "enableRecursive", ")", "{", "return", ";", "}", "$", "subTable", "=", "$", "row", "->", "getSubtable", "(", ")", ";", "if", "(", "$", "sub...
Filters a row's subtable, if one exists and is loaded in memory. @param Row $row The row whose subtable should be filter.
[ "Filters", "a", "row", "s", "subtable", "if", "one", "exists", "and", "is", "loaded", "in", "memory", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/DataTable/BaseFilter.php#L70-L79
209,898
matomo-org/matomo
core/Application/Environment.php
Environment.init
public function init() { $this->invokeBeforeContainerCreatedHook(); $this->container = $this->createContainer(); StaticContainer::push($this->container); $this->validateEnvironment(); $this->invokeEnvironmentBootstrappedHook(); Piwik::postEvent('Environment.boots...
php
public function init() { $this->invokeBeforeContainerCreatedHook(); $this->container = $this->createContainer(); StaticContainer::push($this->container); $this->validateEnvironment(); $this->invokeEnvironmentBootstrappedHook(); Piwik::postEvent('Environment.boots...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "invokeBeforeContainerCreatedHook", "(", ")", ";", "$", "this", "->", "container", "=", "$", "this", "->", "createContainer", "(", ")", ";", "StaticContainer", "::", "push", "(", "$", "this", ...
Initializes the kernel globals and DI container.
[ "Initializes", "the", "kernel", "globals", "and", "DI", "container", "." ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/Application/Environment.php#L86-L99
209,899
matomo-org/matomo
core/NumberFormatter.php
NumberFormatter.formatNumber
public function formatNumber($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { $pattern = $this->getPattern($value, 'Intl_NumberFormatNumber'); return $this->formatNumberWithPattern($pattern, $value, $maximumFractionDigits, $minimumFractionDigits); }
php
public function formatNumber($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { $pattern = $this->getPattern($value, 'Intl_NumberFormatNumber'); return $this->formatNumberWithPattern($pattern, $value, $maximumFractionDigits, $minimumFractionDigits); }
[ "public", "function", "formatNumber", "(", "$", "value", ",", "$", "maximumFractionDigits", "=", "0", ",", "$", "minimumFractionDigits", "=", "0", ")", "{", "$", "pattern", "=", "$", "this", "->", "getPattern", "(", "$", "value", ",", "'Intl_NumberFormatNumb...
Formats a given number @see \Piwik\NumberFormatter::format() @param string|int|float $value @param int $maximumFractionDigits @param int $minimumFractionDigits @return mixed|string
[ "Formats", "a", "given", "number" ]
72df150735664275a60a7861e468c6ff3b152a14
https://github.com/matomo-org/matomo/blob/72df150735664275a60a7861e468c6ff3b152a14/core/NumberFormatter.php#L73-L78