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

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/   drwxr-xr-x
Free 13.37 GB of 57.97 GB (23.07%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PhpOffice\PhpSpreadsheet;

use 
PhpOffice\PhpSpreadsheet\Calculation\Category;
use 
PhpOffice\PhpSpreadsheet\Calculation\Functions;
use 
ReflectionClass;
use 
UnexpectedValueException;

class 
DocumentGenerator
{
    
/**
     * @param array[] $phpSpreadsheetFunctions
     */
    
public static function generateFunctionListByCategory(array $phpSpreadsheetFunctions): string
    
{
        
$result "# Function list by category\n";
        foreach (
self::getCategories() as $categoryConstant => $category) {
            
$result .= "\n";
            
$result .= "## {$categoryConstant}\n";
            
$result .= "\n";
            
$lengths = [2042];
            
$result .= self::tableRow($lengths, ['Excel Function''PhpSpreadsheet Function']) . "\n";
            
$result .= self::tableRow($lengthsnull) . "\n";
            foreach (
$phpSpreadsheetFunctions as $excelFunction => $functionInfo) {
                if (
$category === $functionInfo['category']) {
                    
$phpFunction self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']);
                    
$result .= self::tableRow($lengths, [$excelFunction$phpFunction]) . "\n";
                }
            }
        }

        return 
$result;
    }

    private static function 
getCategories(): array
    {
        return (new 
ReflectionClass(Category::class))->getConstants();
    }

    private static function 
tableRow(array $lengths, ?array $values null): string
    
{
        
$result '';
        foreach (
array_map(null$lengths$values ?? []) as $i => [$length$value]) {
            
$pad $value === null '-' ' ';
            if (
$i 0) {
                
$result .= '|' $pad;
            }
            
$result .= str_pad($value ?? ''$length$pad);
        }

        return 
rtrim($result' ');
    }

    private static function 
getPhpSpreadsheetFunctionText($functionCall): string
    
{
        if (
is_string($functionCall)) {
            return 
$functionCall;
        }
        if (
$functionCall === [Functions::class, 'DUMMY']) {
            return 
'**Not yet Implemented**';
        }
        if (
is_array($functionCall)) {
            return 
"\\{$functionCall[0]}::{$functionCall[1]}";
        }

        throw new 
UnexpectedValueException(
            
'$functionCall is of type ' gettype($functionCall) . '. string or array expected'
        
);
    }

    
/**
     * @param array[] $phpSpreadsheetFunctions
     */
    
public static function generateFunctionListByName(array $phpSpreadsheetFunctions): string
    
{
        
$categoryConstants array_flip(self::getCategories());
        
$result "# Function list by name\n";
        
$lastAlphabet null;
        foreach (
$phpSpreadsheetFunctions as $excelFunction => $functionInfo) {
            
$lengths = [203142];
            if (
$lastAlphabet !== $excelFunction[0]) {
                
$lastAlphabet $excelFunction[0];
                
$result .= "\n";
                
$result .= "## {$lastAlphabet}\n";
                
$result .= "\n";
                
$result .= self::tableRow($lengths, ['Excel Function''Category''PhpSpreadsheet Function']) . "\n";
                
$result .= self::tableRow($lengthsnull) . "\n";
            }
            
$category $categoryConstants[$functionInfo['category']];
            
$phpFunction self::getPhpSpreadsheetFunctionText($functionInfo['functionCall']);
            
$result .= self::tableRow($lengths, [$excelFunction$category$phpFunction]) . "\n";
        }

        return 
$result;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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