!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)

/var/www/html/main_file/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef/   drwxr-xr-x
Free 13.15 GB of 57.97 GB (22.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef;

use 
PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
use 
PhpOffice\PhpSpreadsheet\Calculation\Exception;
use 
PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;

class 
Matrix
{
    use 
ArrayEnabled;

    
/**
     * Helper function; NOT an implementation of any Excel Function.
     */
    
public static function isColumnVector(array $values): bool
    
{
        return 
count($valuesCOUNT_RECURSIVE) === (count($valuesCOUNT_NORMAL) * 2);
    }

    
/**
     * Helper function; NOT an implementation of any Excel Function.
     */
    
public static function isRowVector(array $values): bool
    
{
        return 
count($valuesCOUNT_RECURSIVE) > &&
            (
count($valuesCOUNT_NORMAL) === || count($valuesCOUNT_RECURSIVE) === count($valuesCOUNT_NORMAL));
    }

    
/**
     * TRANSPOSE.
     *
     * @param array|mixed $matrixData A matrix of values
     *
     * @return array
     */
    
public static function transpose($matrixData)
    {
        
$returnMatrix = [];
        if (!
is_array($matrixData)) {
            
$matrixData = [[$matrixData]];
        }

        
$column 0;
        foreach (
$matrixData as $matrixRow) {
            
$row 0;
            foreach (
$matrixRow as $matrixCell) {
                
$returnMatrix[$row][$column] = $matrixCell;
                ++
$row;
            }
            ++
$column;
        }

        return 
$returnMatrix;
    }

    
/**
     * INDEX.
     *
     * Uses an index to choose a value from a reference or array
     *
     * Excel Function:
     *        =INDEX(range_array, row_num, [column_num], [area_num])
     *
     * @param mixed $matrix A range of cells or an array constant
     * @param mixed $rowNum The row in the array or range from which to return a value.
     *                          If row_num is omitted, column_num is required.
     *                      Or can be an array of values
     * @param mixed $columnNum The column in the array or range from which to return a value.
     *                          If column_num is omitted, row_num is required.
     *                      Or can be an array of values
     *
     * TODO Provide support for area_num, currently not supported
     *
     * @return mixed the value of a specified cell or array of cells
     *         If an array of values is passed as the $rowNum and/or $columnNum arguments, then the returned result
     *            will also be an array with the same dimensions
     */
    
public static function index($matrix$rowNum 0$columnNum null)
    {
        if (
is_array($rowNum) || is_array($columnNum)) {
            return 
self::evaluateArrayArgumentsSubsetFrom([self::class, __FUNCTION__], 1$matrix$rowNum$columnNum);
        }

        
$rowNum $rowNum ?? 0;
        
$originalColumnNum $columnNum;
        
$columnNum $columnNum ?? 0;

        try {
            
$rowNum LookupRefValidations::validatePositiveInt($rowNum);
            
$columnNum LookupRefValidations::validatePositiveInt($columnNum);
        } catch (
Exception $e) {
            return 
$e->getMessage();
        }

        if (!
is_array($matrix) || ($rowNum count($matrix))) {
            return 
ExcelError::REF();
        }

        
$rowKeys array_keys($matrix);
        
$columnKeys = @array_keys($matrix[$rowKeys[0]]);

        if (
$columnNum count($columnKeys)) {
            return 
ExcelError::REF();
        }
        if (
$originalColumnNum === null && count($columnKeys)) {
            return 
ExcelError::REF();
        }

        if (
$columnNum === 0) {
            return 
self::extractRowValue($matrix$rowKeys$rowNum);
        }

        
$columnNum $columnKeys[--$columnNum];
        if (
$rowNum === 0) {
            return 
array_map(
                function (
$value) {
                    return [
$value];
                },
                
array_column($matrix$columnNum)
            );
        }
        
$rowNum $rowKeys[--$rowNum];

        return 
$matrix[$rowNum][$columnNum];
    }

    
/** @return mixed */
    
private static function extractRowValue(array $matrix, array $rowKeysint $rowNum)
    {
        if (
$rowNum === 0) {
            return 
$matrix;
        }

        
$rowNum $rowKeys[--$rowNum];
        
$row $matrix[$rowNum];
        if (
is_array($row)) {
            return [
$rowNum => $row];
        }

        return 
$row;
    }
}

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