!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/vendor/wp-cli/i18n-command/src/   drwxr-xr-x
Free 712.74 GB of 879.6 GB (81.03%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace WP_CLI\I18n;

class FileDataExtractor {
    /**
     * Retrieves metadata from a file.
     *
     * Searches for metadata in the first 8kiB of a file, such as a plugin or theme.
     * Each piece of metadata must be on its own line. Fields can not span multiple
     * lines, the value will get cut at the end of the first line.
     *
     * If the file data is not within that first 8kiB, then the author should correct
     * their plugin file and move the data headers to the top.
     *
     * @see get_file_data()
     *
     * @param string $file Path to the file.
     * @param array $headers List of headers, in the format array('HeaderKey' => 'Header Name').
     *
     * @return array Array of file headers in `HeaderKey => Header Value` format.
     */
    public static function get_file_data( $file, $headers ) {
        // We don't need to write to the file, so just open for reading.
        $fp = fopen( $file, 'rb' );

        // Pull only the first 8kiB of the file in.
        $file_data = fread( $fp, 8192 );

        // PHP will close file handle, but we are good citizens.
        fclose( $fp );

        // Make sure we catch CR-only line endings.
        $file_data = str_replace( "\r", "\n", $file_data );

        return static::get_file_data_from_string( $file_data, $headers );
    }

    /**
     * Retrieves metadata from a string.
     *
     * @param string $text String to look for metadata in.
     * @param array $headers List of headers.
     *
     * @return array Array of file headers in `HeaderKey => Header Value` format.
     */
    public static function get_file_data_from_string( $text, $headers ) {
        foreach ( $headers as $field => $regex ) {
            if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $text, $match ) && $match[1] ) {
                $headers[ $field ] = static::_cleanup_header_comment( $match[1] );
            } else {
                $headers[ $field ] = '';
            }
        }

        return $headers;
    }

    /**
     * Strip close comment and close php tags from file headers used by WP.
     *
     * @see _cleanup_header_comment()
     *
     * @param string $str Header comment to clean up.
     *
     * @return string
     */
    protected static function _cleanup_header_comment( $str ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore -- Not changing because third-party commands might use/extend.
        return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) );
    }
}

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