Db
1 year ago
Handler
2 years ago
Visit
1 year ago
Action.php
1 year ago
ActionPageview.php
2 years ago
Cache.php
1 year ago
Db.php
1 year ago
Failures.php
1 year ago
FingerprintSalt.php
1 year ago
GoalManager.php
1 year ago
Handler.php
2 years ago
IgnoreCookie.php
1 year ago
LogTable.php
1 year ago
Model.php
1 year ago
PageUrl.php
1 year ago
Request.php
1 year ago
RequestProcessor.php
1 year ago
RequestSet.php
1 year ago
Response.php
1 year ago
ScheduledTasksRunner.php
1 year ago
Settings.php
1 year ago
TableLogAction.php
1 year ago
TrackerCodeGenerator.php
1 year ago
TrackerConfig.php
2 years ago
Visit.php
1 year ago
VisitExcluded.php
1 year ago
VisitInterface.php
2 years ago
Visitor.php
1 year ago
VisitorNotFoundInDb.php
2 years ago
VisitorRecognizer.php
1 year ago
TrackerConfig.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\Tracker; |
| 10 | |
| 11 | use Piwik\Config; |
| 12 | class TrackerConfig |
| 13 | { |
| 14 | /** |
| 15 | * Update Tracker config |
| 16 | * |
| 17 | * @param string $name Setting name |
| 18 | * @param mixed $value Value |
| 19 | */ |
| 20 | public static function setConfigValue($name, $value) |
| 21 | { |
| 22 | $section = self::getConfig(); |
| 23 | $section[$name] = $value; |
| 24 | Config::getInstance()->Tracker = $section; |
| 25 | } |
| 26 | public static function getConfigValue($name, $idSite = null) |
| 27 | { |
| 28 | $config = self::getConfig(); |
| 29 | if (!empty($idSite)) { |
| 30 | $siteSpecificConfig = self::getSiteSpecificConfig($idSite); |
| 31 | $config = array_merge($config, $siteSpecificConfig); |
| 32 | } |
| 33 | return $config[$name] ?? null; |
| 34 | } |
| 35 | private static function getConfig() |
| 36 | { |
| 37 | return Config::getInstance()->Tracker; |
| 38 | } |
| 39 | private static function getSiteSpecificConfig($idSite) |
| 40 | { |
| 41 | $key = 'Tracker_' . $idSite; |
| 42 | return Config::getInstance()->{$key}; |
| 43 | } |
| 44 | } |
| 45 |