!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/   drwxr-xr-x
Free 26.13 GB of 117.98 GB (22.15%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Mpdf;

use 
Psr\Log\LoggerInterface;
use 
Mpdf\Log\Context as LogContext;

class 
SizeConverter implements \Psr\Log\LoggerAwareInterface
{

    private 
$dpi;

    private 
$defaultFontSize;

    
/**
     * @var \Mpdf\Mpdf
     */
    
private $mpdf;

    
/**
     * @var \Psr\Log\LoggerInterface
     */
    
private $logger;

    public function 
__construct($dpi$defaultFontSizeMpdf $mpdfLoggerInterface $logger)
    {
        
$this->dpi $dpi;
        
$this->defaultFontSize $defaultFontSize;
        
$this->mpdf $mpdf;
        
$this->logger $logger;
    }

    public function 
setLogger(LoggerInterface $logger)
    {
        
$this->logger $logger;
    }

    
/**
     * Depends of maxsize value to make % work properly. Usually maxsize == pagewidth
     * For text $maxsize = $fontsize
     * Setting e.g. margin % will use maxsize (pagewidth) and em will use fontsize
     *
     * @param mixed $size
     * @param mixed $maxsize
     * @param mixed $fontsize
     * @param mixed $usefontsize Set false for e.g. margins - will ignore fontsize for % values
     *
     * @return float Final size in mm
     */
    
public function convert($size 5$maxsize 0$fontsize false$usefontsize true)
    {
        
$size trim(strtolower($size));
        
$res preg_match('/^(?P<size>[-0-9.,]+([eE]\-?[0-9]+)?)?(?P<unit>[%a-z-]+)?$/'$size$parts);
        if (!
$res) {
            
// ignore definition
            
$this->logger->warning(sprintf('Invalid size representation "%s"'$size), ['context' => LogContext::CSS_SIZE_CONVERSION]);
        }

        
$unit = !empty($parts['unit']) ? $parts['unit'] : null;
        
$size = !empty($parts['size']) ? (float) $parts['size'] : 0.0;

        switch (
$unit) {
            case 
'mm':
                
// do nothing
                
break;

            case 
'cm':
                
$size *= 10;
                break;

            case 
'pt':
                
$size *= Mpdf::SCALE;
                break;

            case 
'rem':
                
$size *= $this->mpdf->default_font_size Mpdf::SCALE;
                break;

            case 
'%':
                if (
$fontsize && $usefontsize) {
                    
$size *= $fontsize 100;
                } else {
                    
$size *= $maxsize 100;
                }
                break;

            case 
'in':
                
// mm in an inch
                
$size *= 25.4;
                break;

            case 
'pc':
                
// PostScript picas
                
$size *= 38.1 9;
                break;

            case 
'ex':
                
// Approximates "ex" as half of font height
                
$size *= $this->multiplyFontSize($fontsize$maxsize0.5);
                break;

            case 
'em':
                
$size *= $this->multiplyFontSize($fontsize$maxsize1);
                break;

            case 
'thin':
                
$size * (25.4 $this->dpi);
                break;

            case 
'medium':
                
$size * (25.4 $this->dpi);
                
// Commented-out dead code from legacy method
                // $size *= $this->multiplyFontSize($fontsize, $maxsize, 1);
                
break;

            case 
'thick':
                
$size * (25.4 $this->dpi); // 5 pixel width for table borders
                
break;

            case 
'xx-small':
                
$size *= $this->multiplyFontSize($fontsize$maxsize0.7);
                break;

            case 
'x-small':
                
$size *= $this->multiplyFontSize($fontsize$maxsize0.77);
                break;

            case 
'small':
                
$size *= $this->multiplyFontSize($fontsize$maxsize0.86);
                break;

            case 
'large':
                
$size *= $this->multiplyFontSize($fontsize$maxsize1.2);
                break;

            case 
'x-large':
                
$size *= $this->multiplyFontSize($fontsize$maxsize1.5);
                break;

            case 
'xx-large':
                
$size *= $this->multiplyFontSize($fontsize$maxsize2);
                break;

            case 
'px':
            default:
                
$size *= (25.4 $this->dpi);
                break;
        }

        return 
$size;
    }

    private function 
multiplyFontSize($fontsize$maxsize$ratio)
    {
        if (
$fontsize) {
            return 
$fontsize $ratio;
        }

        return 
$maxsize $ratio;
    }
}

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