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


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

namespace Mpdf;

use 
Mpdf\Color\ColorConverter;
use 
Mpdf\Css\TextVars;

class 
DirectWrite
{

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

    
/**
     * @var \Mpdf\Otl
     */
    
private $otl;

    
/**
     * @var \Mpdf\SizeConverter
     */
    
private $sizeConverter;

    
/**
     * @var \Mpdf\Color\ColorConverter
     */
    
private $colorConverter;

    public function 
__construct(Mpdf $mpdfOtl $otlSizeConverter $sizeConverterColorConverter $colorConverter)
    {
        
$this->mpdf $mpdf;
        
$this->otl $otl;
        
$this->sizeConverter $sizeConverter;
        
$this->colorConverter $colorConverter;
    }

    function 
Write($h$txt$currentx 0$link ''$directionality 'ltr'$align ''$fill 0)
    {
        if (!
$align) {
            if (
$directionality === 'rtl') {
                
$align 'R';
            } else {
                
$align 'L';
            }
        }
        if (
$h == 0) {
            
$this->mpdf->SetLineHeight();
            
$h $this->mpdf->lineheight;
        }
        
//Output text in flowing mode
        
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;

        
$wmax = ($w - ($this->mpdf->cMarginL $this->mpdf->cMarginR));
        
$s str_replace("\r"''$txt);
        if (
$this->mpdf->usingCoreFont) {
            
$nb strlen($s);
        } else {
            
$nb mb_strlen($s$this->mpdf->mb_enc);
            
// handle single space character
            
if (($nb === 1) && $s === ' ') {
                
$this->mpdf->+= $this->mpdf->GetStringWidth($s);
                return;
            }
        }
        
$sep = -1;
        
$i 0;
        
$j 0;
        
$l 0;
        
$nl 1;
        if (!
$this->mpdf->usingCoreFont) {
            if (
preg_match('/([' $this->mpdf->pregRTLchars '])/u'$txt)) {
                
$this->mpdf->biDirectional true;
            } 
// *RTL*
            
while ($i $nb) {
                
//Get next character
                
$c mb_substr($s$i1$this->mpdf->mb_enc);
                if (
$c === "\n") {
                    
// WORD SPACING
                    
$this->mpdf->ResetSpacing();
                    
//Explicit line break
                    
$tmp rtrim(mb_substr($s$j$i $j$this->mpdf->mb_enc));
                    
$this->mpdf->Cell($w$h$tmp02$align$fill$link);
                    
$i++;
                    
$sep = -1;
                    
$j $i;
                    
$l 0;
                    if (
$nl === 1) {
                        if (
$currentx != 0) {
                            
$this->mpdf->$currentx;
                        } else {
                            
$this->mpdf->$this->mpdf->lMargin;
                        }
                        
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;
                        
$wmax = ($w - ($this->mpdf->cMarginL $this->mpdf->cMarginR));
                    }
                    
$nl++;
                    continue;
                }
                if (
$c === ' ') {
                    
$sep $i;
                }
                
$l += $this->mpdf->GetCharWidthNonCore($c); // mPDF 5.3.04
                
if ($l $wmax) {
                    
//Automatic line break (word wrapping)
                    
if ($sep == -1) {
                        
// WORD SPACING
                        
$this->mpdf->ResetSpacing();
                        if (
$this->mpdf->$this->mpdf->lMargin) {
                            
//Move to next line
                            
if ($currentx != 0) {
                                
$this->mpdf->$currentx;
                            } else {
                                
$this->mpdf->$this->mpdf->lMargin;
                            }
                            
$this->mpdf->y+=$h;
                            
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;
                            
$wmax = ($w - ($this->mpdf->cMarginL $this->mpdf->cMarginR));
                            
$i++;
                            
$nl++;
                            continue;
                        }
                        if (
$i == $j) {
                            
$i++;
                        }
                        
$tmp rtrim(mb_substr($s$j$i $j$this->mpdf->mb_enc));
                        
$this->mpdf->Cell($w$h$tmp02$align$fill$link);
                    } else {
                        
$tmp rtrim(mb_substr($s$j$sep $j$this->mpdf->mb_enc));

                        if (
$align === 'J') {
                            
//////////////////////////////////////////
                            // JUSTIFY J using Unicode fonts (Word spacing doesn't work)
                            // WORD SPACING
                            // Change NON_BREAKING SPACE to spaces so they are 'spaced' properly
                            
$tmp str_replace(chr(194) . chr(160), chr(32), $tmp);
                            
$len_ligne $this->mpdf->GetStringWidth($tmp);
                            
$nb_carac mb_strlen($tmp$this->mpdf->mb_enc);
                            
$nb_spaces mb_substr_count($tmp' '$this->mpdf->mb_enc);
                            
$inclCursive false;
                            if (!empty(
$this->mpdf->CurrentFont['useOTL']) && preg_match('/([' $this->mpdf->pregCURSchars '])/u'$tmp)) {
                                
$inclCursive true;
                            }
                            list(
$charspacing$ws) = $this->mpdf->GetJspacing($nb_carac$nb_spaces, (($w 2) - $len_ligne) * Mpdf::SCALE$inclCursive);
                            
$this->mpdf->SetSpacing($charspacing$ws);
                            
//////////////////////////////////////////
                        
}
                        
$this->mpdf->Cell($w$h$tmp02$align$fill$link);
                        
$i $sep 1;
                    }
                    
$sep = -1;
                    
$j $i;
                    
$l 0;
                    if (
$nl === 1) {
                        if (
$currentx != 0) {
                            
$this->mpdf->$currentx;
                        } else {
                            
$this->mpdf->$this->mpdf->lMargin;
                        }
                        
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;
                        
$wmax = ($w - ($this->mpdf->cMarginL $this->mpdf->cMarginR));
                    }
                    
$nl++;
                } else {
                    
$i++;
                }
            }
            
//Last chunk
            // WORD SPACING
            
$this->mpdf->ResetSpacing();
        } else {
            while (
$i $nb) {
                
//Get next character
                
$c $s[$i];
                if (
$c === "\n") {
                    
//Explicit line break
                    // WORD SPACING
                    
$this->mpdf->ResetSpacing();
                    
$this->mpdf->Cell($w$hsubstr($s$j$i $j), 02$align$fill$link);
                    
$i++;
                    
$sep = -1;
                    
$j $i;
                    
$l 0;
                    if (
$nl === 1) {
                        if (
$currentx != 0) {
                            
$this->mpdf->$currentx;
                        } else {
                            
$this->mpdf->$this->mpdf->lMargin;
                        }
                        
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;
                        
$wmax $w - ($this->mpdf->cMarginL $this->mpdf->cMarginR);
                    }
                    
$nl++;
                    continue;
                }
                if (
$c === ' ') {
                    
$sep $i;
                }
                
$l += $this->mpdf->GetCharWidthCore($c); // mPDF 5.3.04
                
if ($l $wmax) {
                    
//Automatic line break (word wrapping)
                    
if ($sep == -1) {
                        
// WORD SPACING
                        
$this->mpdf->ResetSpacing();
                        if (
$this->mpdf->$this->mpdf->lMargin) {
                            
//Move to next line
                            
if ($currentx != 0) {
                                
$this->mpdf->$currentx;
                            } else {
                                
$this->mpdf->$this->mpdf->lMargin;
                            }
                            
$this->mpdf->y+=$h;
                            
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;
                            
$wmax $w - ($this->mpdf->cMarginL $this->mpdf->cMarginR);
                            
$i++;
                            
$nl++;
                            continue;
                        }
                        if (
$i == $j) {
                            
$i++;
                        }
                        
$this->mpdf->Cell($w$hsubstr($s$j$i $j), 02$align$fill$link);
                    } else {
                        
$tmp substr($s$j$sep $j);
                        if (
$align === 'J') {
                            
//////////////////////////////////////////
                            // JUSTIFY J using Unicode fonts
                            // WORD SPACING is not fully supported for complex scripts
                            // Change NON_BREAKING SPACE to spaces so they are 'spaced' properly
                            
$tmp str_replace(chr(160), chr(32), $tmp);
                            
$len_ligne $this->mpdf->GetStringWidth($tmp);
                            
$nb_carac strlen($tmp);
                            
$nb_spaces substr_count($tmp' ');
                            list(
$charspacing$ws) = $this->mpdf->GetJspacing($nb_carac$nb_spaces, (($w 2) - $len_ligne) * Mpdf::SCALE$false);
                            
$this->mpdf->SetSpacing($charspacing$ws);
                            
//////////////////////////////////////////
                        
}
                        
$this->mpdf->Cell($w$h$tmp02$align$fill$link);
                        
$i $sep 1;
                    }
                    
$sep = -1;
                    
$j $i;
                    
$l 0;
                    if (
$nl === 1) {
                        if (
$currentx != 0) {
                            
$this->mpdf->$currentx;
                        } else {
                            
$this->mpdf->$this->mpdf->lMargin;
                        }
                        
$w $this->mpdf->$this->mpdf->rMargin $this->mpdf->x;
                        
$wmax $w - ($this->mpdf->cMarginL $this->mpdf->cMarginR);
                    }
                    
$nl++;
                } else {
                    
$i++;
                }
            }
            
// WORD SPACING
            
$this->mpdf->ResetSpacing();
        }
        
//Last chunk
        
if ($i != $j) {
            if (
$currentx != 0) {
                
$this->mpdf->$currentx;
            } else {
                
$this->mpdf->$this->mpdf->lMargin;
            }
            if (
$this->mpdf->usingCoreFont) {
                
$tmp substr($s$j$i $j);
            } else {
                
$tmp mb_substr($s$j$i $j$this->mpdf->mb_enc);
            }
            
$this->mpdf->Cell($w$h$tmp00$align$fill$link);
        }
    }

    function 
CircularText($x$y$r$text$align 'top'$fontfamily ''$fontsizePt 0$fontstyle ''$kerning 120$fontwidth 100$divider '')
    {
        if (
$fontfamily || $fontstyle || $fontsizePt) {
            
$this->mpdf->SetFont($fontfamily$fontstyle$fontsizePt);
        }

        
$kerning /= 100;
        
$fontwidth /= 100;

        if (
$kerning == 0) {
            throw new 
\Mpdf\MpdfException('Please use values unequal to zero for kerning (CircularText)');
        }

        if (
$fontwidth == 0) {
            throw new 
\Mpdf\MpdfException('Please use values unequal to zero for font width (CircularText)');
        }

        
$text str_replace("\r"''$text);

        
// circumference
        
$u = ($r 2) * M_PI;
        
$checking true;
        
$autoset false;

        while (
$checking) {
            
$t 0;
            
$w = [];
            if (
$this->mpdf->usingCoreFont) {
                
$nb strlen($text);
                for (
$i 0$i $nb$i++) {
                    
$w[$i] = $this->mpdf->GetStringWidth($text[$i]);
                    
$w[$i]*=$kerning $fontwidth;
                    
$t+=$w[$i];
                }
            } else {
                
$nb mb_strlen($text$this->mpdf->mb_enc);
                
$lastchar '';
                
$unicode $this->mpdf->UTF8StringToArray($text);
                for (
$i 0$i $nb$i++) {
                    
$c mb_substr($text$i1$this->mpdf->mb_enc);
                    
$w[$i] = $this->mpdf->GetStringWidth($c);
                    
$w[$i]*=$kerning $fontwidth;
                    
$char $unicode[$i];
                    if (
$this->mpdf->useKerning && $lastchar && isset($this->mpdf->CurrentFont['kerninfo'][$lastchar][$char])) {
                        
$tk $this->mpdf->CurrentFont['kerninfo'][$lastchar][$char] * ($this->mpdf->FontSize 1000) * $kerning $fontwidth;
                        
$w[$i] += $tk 2;
                        
$w[$i 1] += $tk 2;
                        
$t+=$tk;
                    }
                    
$lastchar $char;
                    
$t+=$w[$i];
                }
            }
            if (
$fontsizePt >= || $autoset) {
                
$checking false;
            } else {
                
$t+=$this->mpdf->GetStringWidth('  ');
                if (
$divider) {
                    
$t+=$this->mpdf->GetStringWidth('  ');
                }
                if (
$fontsizePt == -2) {
                    
$fontsizePt $this->mpdf->FontSizePt 0.5 $u $t;
                } else {
                    
$fontsizePt $this->mpdf->FontSizePt $u $t;
                }
                
$this->mpdf->SetFontSize($fontsizePt);
                
$autoset true;
            }
        }

        
// total width of string in degrees
        
$d = ($t $u) * 360;

        
$this->mpdf->StartTransform();

        
// rotate matrix for the first letter to center the text
        // (half of total degrees)
        
if ($align === 'top') {
            
$this->mpdf->transformRotate(-$d 2$x$y);
        } else {
            
$this->mpdf->transformRotate($d 2$x$y);
        }

        
// run through the string
        
for ($i 0$i $nb$i++) {

            if (
$align === 'top') {

                
// rotate matrix half of the width of current letter + half of the width of preceding letter
                
if ($i === 0) {
                    
$this->mpdf->transformRotate((($w[$i] / 2) / $u) * 360$x$y);
                } else {
                    
$this->mpdf->transformRotate((($w[$i] / $w[$i 1] / 2) / $u) * 360$x$y);
                }

                if (
$fontwidth !== 1) {
                    
$this->mpdf->StartTransform();
                    
$this->mpdf->transformScale($fontwidth 100100$x$y);
                }

                
$this->mpdf->SetXY($x $w[$i] / 2$y $r);

            } else {

                
// rotate matrix half of the width of current letter + half of the width of preceding letter
                
if ($i === 0) {
                    
$this->mpdf->transformRotate(-(($w[$i] / 2) / $u) * 360$x$y);
                } else {
                    
$this->mpdf->transformRotate(-(($w[$i] / $w[$i 1] / 2) / $u) * 360$x$y);
                }

                if (
$fontwidth !== 1) {
                    
$this->mpdf->StartTransform();
                    
$this->mpdf->transformScale($fontwidth 100100$x$y);
                }
                
$this->mpdf->SetXY($x $w[$i] / 2$y $r $this->mpdf->FontSize);
            }

            if (
$this->mpdf->usingCoreFont) {
                
$c $text[$i];
            } else {
                
$c mb_substr($text$i1$this->mpdf->mb_enc);
            }

            
$this->mpdf->Cell($w[$i], $this->mpdf->FontSize$c00'C'); // mPDF 5.3.53

            
if ($fontwidth !== 1) {
                
$this->mpdf->StopTransform();
            }
        }

        
$this->mpdf->StopTransform();

        
// mPDF 5.5.23
        
if ($align === 'top' && $divider != '') {
            
$wc $this->mpdf->GetStringWidth($divider);
            
$wc *= $kerning $fontwidth;

            
$this->mpdf->StartTransform();
            
$this->mpdf->transformRotate(90$x$y);
            
$this->mpdf->SetXY($x $wc 2$y $r);
            
$this->mpdf->Cell($wc$this->mpdf->FontSize$divider00'C');
            
$this->mpdf->StopTransform();

            
$this->mpdf->StartTransform();
            
$this->mpdf->transformRotate(-90$x$y);
            
$this->mpdf->SetXY($x $wc 2$y $r);
            
$this->mpdf->Cell($wc$this->mpdf->FontSize$divider00'C');
            
$this->mpdf->StopTransform();
        }
    }

    function 
Shaded_box($text$font ''$fontstyle 'B'$szfont ''$width '70%'$style 'DF'$radius 2.5$fill '#FFFFFF'$color '#000000'$pad 2)
    {
        
// F (shading - no line),S (line, no shading),DF (both)
        
if (!$font) {
            
$font $this->mpdf->default_font;
        }
        if (!
$szfont) {
            
$szfont $this->mpdf->default_font_size 1.8;
        }

        
$text ' ' $text ' ';
        
$this->mpdf->SetFont($font$fontstyle$szfontfalse);

        
$text $this->mpdf->purify_utf8_text($text);

        if (
$this->mpdf->text_input_as_HTML) {
            
$text $this->mpdf->all_entities_to_utf8($text);
        }

        if (
$this->mpdf->usingCoreFont) {
            
$text mb_convert_encoding($text$this->mpdf->mb_enc'UTF-8');
        }


        
// DIRECTIONALITY
        
if (preg_match('/([' $this->mpdf->pregRTLchars '])/u'$text)) {
            
$this->mpdf->biDirectional true;
        } 
// *RTL*

        
$textvar 0;
        
$save_OTLtags $this->mpdf->OTLtags;
        
$this->mpdf->OTLtags = [];

        if (
$this->mpdf->useKerning) {
            if (
$this->mpdf->CurrentFont['haskernGPOS']) {
                
$this->mpdf->OTLtags['Plus'] .= ' kern';
            } else {
                
$textvar |= TextVars::FC_KERNING;
            }
        }
        
// Use OTL OpenType Table Layout - GSUB & GPOS
        
if (!empty($this->mpdf->CurrentFont['useOTL'])) {
            
$text $this->otl->applyOTL($text$this->mpdf->CurrentFont['useOTL']);
            
$OTLdata $this->otl->OTLdata;
        }
        
$this->mpdf->OTLtags $save_OTLtags;

        
$this->mpdf->magic_reverse_dir($text$this->mpdf->directionality$OTLdata);

        if (!
$width) {
            
$width $this->mpdf->pgwidth;
        } else {
            
$width $this->sizeConverter->convert($width$this->mpdf->pgwidth);
        }
        
$midpt $this->mpdf->lMargin + ($this->mpdf->pgwidth 2);
        
$r1 $midpt - ($width 2); //($this->mpdf->w / 2) - 40;
        
$r2 $r1 $width;   //$r1 + 80;
        
$y1 $this->mpdf->y;

        
$loop 0;

        while (
$loop === 0) {
            
$this->mpdf->SetFont($font$fontstyle$szfontfalse);
            
$sz $this->mpdf->GetStringWidth($texttrue$OTLdata$textvar);
            if ((
$r1 $sz) > $r2) {
                
$szfont --;
            } else {
                
$loop ++;
            }
        }
        
$this->mpdf->SetFont($font$fontstyle$szfonttruetrue);

        
$y2 $this->mpdf->FontSize + ($pad 2);

        
$this->mpdf->SetLineWidth(0.1);
        
$fc $this->colorConverter->convert($fill$this->mpdf->PDFAXwarnings);
        
$tc $this->colorConverter->convert($color$this->mpdf->PDFAXwarnings);
        
$this->mpdf->SetFColor($fc);
        
$this->mpdf->SetTColor($tc);
        
$this->mpdf->RoundedRect($r1$y1$r2 $r1$y2$radius$style);
        
$this->mpdf->SetX($r1);
        
$this->mpdf->Cell($r2 $r1$y2$text01'C'0''000'M'0false$OTLdata$textvar);
        
$this->mpdf->SetY($y1 $y2 2); // +2 = mm margin below shaded box
        
$this->mpdf->Reset();
    }
}

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