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


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

namespace PhpOffice\PhpSpreadsheet;

use 
PhpOffice\PhpSpreadsheet\Cell\AddressRange;
use 
PhpOffice\PhpSpreadsheet\Cell\Coordinate;

class 
CellReferenceHelper
{
    
/**
     * @var string
     */
    
protected $beforeCellAddress;

    
/**
     * @var int
     */
    
protected $beforeColumn;

    
/**
     * @var int
     */
    
protected $beforeRow;

    
/**
     * @var int
     */
    
protected $numberOfColumns;

    
/**
     * @var int
     */
    
protected $numberOfRows;

    public function 
__construct(string $beforeCellAddress 'A1'int $numberOfColumns 0int $numberOfRows 0)
    {
        
$this->beforeCellAddress str_replace('$'''$beforeCellAddress);
        
$this->numberOfColumns $numberOfColumns;
        
$this->numberOfRows $numberOfRows;

        
// Get coordinate of $beforeCellAddress
        
[$beforeColumn$beforeRow] = Coordinate::coordinateFromString($beforeCellAddress);
        
$this->beforeColumn = (int) Coordinate::columnIndexFromString($beforeColumn);
        
$this->beforeRow = (int) $beforeRow;
    }

    public function 
beforeCellAddress(): string
    
{
        return 
$this->beforeCellAddress;
    }

    public function 
refreshRequired(string $beforeCellAddressint $numberOfColumnsint $numberOfRows): bool
    
{
        return 
$this->beforeCellAddress !== $beforeCellAddress ||
            
$this->numberOfColumns !== $numberOfColumns ||
            
$this->numberOfRows !== $numberOfRows;
    }

    public function 
updateCellReference(string $cellReference 'A1'bool $includeAbsoluteReferences false): string
    
{
        if (
Coordinate::coordinateIsRange($cellReference)) {
            throw new 
Exception('Only single cell references may be passed to this method.');
        }

        
// Get coordinate of $cellReference
        
[$newColumn$newRow] = Coordinate::coordinateFromString($cellReference);
        
$newColumnIndex = (int) Coordinate::columnIndexFromString(str_replace('$'''$newColumn));
        
$newRowIndex = (int) str_replace('$'''$newRow);

        
$absoluteColumn $newColumn[0] === '$' '$' '';
        
$absoluteRow $newRow[0] === '$' '$' '';
        
// Verify which parts should be updated
        
if ($includeAbsoluteReferences === false) {
            
$updateColumn = (($absoluteColumn !== '$') && $newColumnIndex >= $this->beforeColumn);
            
$updateRow = (($absoluteRow !== '$') && $newRowIndex >= $this->beforeRow);
        } else {
            
$updateColumn = ($newColumnIndex >= $this->beforeColumn);
            
$updateRow = ($newRowIndex >= $this->beforeRow);
        }

        
// Create new column reference
        
if ($updateColumn) {
            
$newColumn $this->updateColumnReference($newColumnIndex$absoluteColumn);
        }

        
// Create new row reference
        
if ($updateRow) {
            
$newRow $this->updateRowReference($newRowIndex$absoluteRow);
        }

        
// Return new reference
        
return "{$newColumn}{$newRow}";
    }

    public function 
cellAddressInDeleteRange(string $cellAddress): bool
    
{
        [
$cellColumn$cellRow] = Coordinate::coordinateFromString($cellAddress);
        
$cellColumnIndex Coordinate::columnIndexFromString($cellColumn);
        
//    Is cell within the range of rows/columns if we're deleting
        
if (
            
$this->numberOfRows &&
            (
$cellRow >= ($this->beforeRow $this->numberOfRows)) &&
            (
$cellRow $this->beforeRow)
        ) {
            return 
true;
        } elseif (
            
$this->numberOfColumns &&
            (
$cellColumnIndex >= ($this->beforeColumn $this->numberOfColumns)) &&
            (
$cellColumnIndex $this->beforeColumn)
        ) {
            return 
true;
        }

        return 
false;
    }

    protected function 
updateColumnReference(int $newColumnIndexstring $absoluteColumn): string
    
{
        
$newColumn Coordinate::stringFromColumnIndex(min($newColumnIndex $this->numberOfColumnsAddressRange::MAX_COLUMN_INT));

        return 
$absoluteColumn $newColumn;
    }

    protected function 
updateRowReference(int $newRowIndexstring $absoluteRow): string
    
{
        
$newRow $newRowIndex $this->numberOfRows;
        
$newRow = ($newRow AddressRange::MAX_ROW) ? AddressRange::MAX_ROW $newRow;

        return 
$absoluteRow . (string) $newRow;
    }
}

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