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

Software: Apache. PHP/8.3.27 

uname -a: Linux pdx1-shared-a4-04 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64 

uid=6659440(dh_z2jmpm) gid=2086089(pg10499364) groups=2086089(pg10499364)  

Safe-mode: OFF (not secure)

/usr/local/wp/php/WP_CLI/Iterators/   drwxr-xr-x
Free 674.98 GB of 879.6 GB (76.74%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace WP_CLI\Iterators;

use Countable;
use Iterator;
use ReturnTypeWillChange;
use SplFileObject;
use WP_CLI;

/**
 * Allows incrementally reading and parsing lines from a CSV file.
 */
class CSV implements Countable, Iterator {

    const ROW_SIZE = 4096;

    private $filename;
    private $file_pointer;

    private $delimiter;
    private $columns;

    private $current_index;
    private $current_element;

    public function __construct( $filename, $delimiter = ',' ) {
        $this->filename     = $filename;
        $this->file_pointer = fopen( $filename, 'rb' );
        if ( ! $this->file_pointer ) {
            WP_CLI::error( sprintf( 'Could not open file: %s', $filename ) );
        }

        $this->delimiter = $delimiter;
    }

    #[ReturnTypeWillChange]
    public function rewind() {
        rewind( $this->file_pointer );

        $this->columns = fgetcsv( $this->file_pointer, self::ROW_SIZE, $this->delimiter, '"', '\\' );

        $this->current_index = -1;
        $this->next();
    }

    #[ReturnTypeWillChange]
    public function current() {
        return $this->current_element;
    }

    #[ReturnTypeWillChange]
    public function key() {
        return $this->current_index;
    }

    #[ReturnTypeWillChange]
    public function next() {
        $this->current_element = false;

        while ( true ) {
            $row = fgetcsv( $this->file_pointer, self::ROW_SIZE, $this->delimiter, '"', '\\' );

            if ( false === $row ) {
                break;
            }

            $element = [];
            foreach ( $this->columns as $i => $key ) {
                if ( isset( $row[ $i ] ) ) {
                    $element[ $key ] = $row[ $i ];
                }
            }

            if ( ! empty( $element ) ) {
                $this->current_element = $element;
                ++$this->current_index;

                break;
            }
        }
    }

    #[ReturnTypeWillChange]
    public function count() {
        $file = new SplFileObject( $this->filename, 'r' );
        $file->seek( PHP_INT_MAX );
        return $file->key() + 1;
    }

    #[ReturnTypeWillChange]
    public function valid() {
        return is_array( $this->current_element );
    }
}

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