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


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

namespace WP_CLI\Tests\Context;

use WP_CLI\Process;
use Exception;

trait WhenStepDefinitions {

    public function wpcli_tests_invoke_proc( $proc, $mode ) {
        $map    = array(
            'run' => 'run_check_stderr',
            'try' => 'run',
        );
        $method = $map[ $mode ];

        return $proc->$method();
    }

    public function wpcli_tests_capture_email_sends( $stdout ) {
        $stdout = preg_replace( '#WP-CLI test suite: Sent email to.+\n?#', '', $stdout, -1, $email_sends );

        return array( $stdout, $email_sends );
    }

    /**
     * Launch a given command in the background.
     *
     * ```
     * Scenario: My example scenario
     *   Given a WP install
     *   And I launch in the background `wp server --host=localhost --port=8181`
     *   ...
     * ```
     *
     * @access public
     *
     * @When /^I launch in the background `([^`]+)`$/
     */
    public function when_i_launch_in_the_background( $cmd ) {
        $this->background_proc( $cmd );
    }

    /**
     * Run or try a given command.
     *
     * `run` expects an exit code 0, whereas `try` allows for non-zero exit codes.
     *
     * So if using `run` and the command errors, the step will fail.
     *
     * ```
     * Scenario: My example scenario
     *   When I run `wp core version`
     *   Then STDOUT should contain:
     *     """
     *     6.8
     *     """
     *
     * Scenario: My other scenario
     *   When I try `wp i18n make-pot foo bar/baz.pot`
     *   Then STDERR should contain:
     *     """
     *     Error: Not a valid source directory.
     *     """
     *   And the return code should be 1
     * ```
     *
     * @access public
     *
     * @When /^I (run|try) `([^`]+)`$/
     */
    public function when_i_run( $mode, $cmd ) {
        $cmd          = $this->replace_variables( $cmd );
        $this->result = $this->wpcli_tests_invoke_proc( $this->proc( $cmd ), $mode );
        list( $this->result->stdout, $this->email_sends ) = $this->wpcli_tests_capture_email_sends( $this->result->stdout );
    }

    /**
     * Run or try a given command in a subdirectory.
     *
     * `run` expects an exit code 0, whereas `try` allows for non-zero exit codes.
     *
     * ```
     * Scenario: My example scenario
     *   When I run `wp core is-installed`
     *   Then STDOUT should be empty
     *
     *   When I run `wp core is-installed` from 'foo/wp-content'
     *   Then STDOUT should be empty
     * ```
     *
     * @access public
     *
     * @When /^I (run|try) `([^`]+)` from '([^\s]+)'$/
     */
    public function when_i_run_from_a_subfolder( $mode, $cmd, $subdir ) {
        $cmd          = $this->replace_variables( $cmd );
        $this->result = $this->wpcli_tests_invoke_proc( $this->proc( $cmd, array(), $subdir ), $mode );
        list( $this->result->stdout, $this->email_sends ) = $this->wpcli_tests_capture_email_sends( $this->result->stdout );
    }

    /**
     * Run or try the previous command again.
     *
     * `run` expects an exit code 0, whereas `try` allows for non-zero exit codes.
     *
     * ```
     * Scenario: My example scenario
     *   When I run `wp site option update admin_user_id 1`
     *   Then STDOUT should contain:
     *     """
     *     Success: Updated 'admin_user_id' site option.
     *     """
     *
     *   When I run the previous command again
     *   Then STDOUT should contain:
     *     """
     *     Success: Value passed for 'admin_user_id' site option is unchanged.
     *     """
     * ```
     *
     * @access public
     *
     * @When /^I (run|try) the previous command again$/
     */
    public function when_i_run_the_previous_command_again( $mode ) {
        if ( ! isset( $this->result ) ) {
            throw new Exception( 'No previous command.' );
        }

        $proc         = Process::create( $this->result->command, $this->result->cwd, $this->result->env );
        $this->result = $this->wpcli_tests_invoke_proc( $proc, $mode );
        list( $this->result->stdout, $this->email_sends ) = $this->wpcli_tests_capture_email_sends( $this->result->stdout );
    }
}

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