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


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

namespace WP_CLI\Doctor\Check;

use WP_CLI;
use WP_CLI\Doctor\Check;
use SplFileInfo;

/**
 * Checks files on the filesystem for regex pattern `%regex%`.
 */
class File_Contents extends File {

    /**
     * Regex pattern to check against each file’s contents.
     *
     * @var string
     */
    protected $regex;

    /**
     * Assert existence or absence of the regex pattern.
     *
     * Asserting existence of regex pattern requires match to be found. Asserting absense requires
     * match to not be found.
     *
     * @var bool
     */
    protected $exists = false;

    public function run() {

        if ( isset( $this->regex ) ) {
            if ( ! empty( $this->_matches ) ) {
                //if matches are found
                if ( $this->exists ) {
                    //$exists set to true so we should report true if something is found
                    $this->set_status( 'success' );
                    $count   = count( $this->_matches );
                    $message = 1 === $count ? "1 '{$this->extension}' file" : "{$count} '{$this->extension}' files";
                    $this->set_message( "{$message} passed check for '{$this->regex}'." );
                } else {
                    //$exists is not set to true so we should report error if something is found
                    $this->set_status( 'error' );
                    $count   = count( $this->_matches );
                    $message = 1 === $count ? "1 '{$this->extension}' file" : "{$count} '{$this->extension}' files";
                    $this->set_message( "{$message} failed check for '{$this->regex}'." );
                }
            } elseif ( $this->exists ) {
                //$exists set to true so we should report error if regex is not found
                $this->set_status( 'error' );
                $this->set_message( "0 '{$this->extension}' files passed check for '{$this->regex}'." );
            } else {
                //$exists is not set to true so we should report success if regex is not found
                $this->set_status( 'success' );
                $this->set_message( "All '{$this->extension}' files passed check for '{$this->regex}'." );
            }
        }
    }

    public function check_file( SplFileInfo $file ) {
        if ( $file->isDir() || ! isset( $this->regex ) ) {
            return;
        }

        $contents = file_get_contents( $file->getPathname() );

        if ( preg_match( '#' . $this->regex . '#i', $contents ) ) {
            $this->_matches[] = $file;
        }
    }
}

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