PHP 클래스 Codeception\Module\WPCLI

Wraps calls to the wp-cli tool.
상속: extends Codeception\Module
파일 보기 프로젝트 열기: lucatume/wp-browser

보호된 프로퍼티들

프로퍼티 타입 설명
$bootPath string
$config array
$executor tad\WPBrowser\Environment\Executor
$options array
$prettyName string
$requiredFields {
$wpCliRoot string

공개 메소드들

메소드 설명
__construct ( Codeception\Lib\ModuleContainer $moduleContainer, null | array $config, tad\WPBrowser\Environment\Executor $executor = null ) WPCLI constructor.
cli ( string $userCommand = 'core version', &$output = [] ) : integer Executes a wp-cli command.
cliToArray ( string $userCommand = 'post list --format=ids', callable $splitCallback = null ) : array Returns the output of a wp-cli command as an array.

보호된 메소드들

메소드 설명
buildCommand ( $userCommand ) : string
debugSection ( string $title, string $message )
evaluateStatus ( &$output, $status )
initPaths ( )
initWpCliPaths ( ) Initializes the wp-cli root location.
mergeCommandOptions ( string $userCommand ) : string

메소드 상세

__construct() 공개 메소드

WPCLI constructor.
public __construct ( Codeception\Lib\ModuleContainer $moduleContainer, null | array $config, tad\WPBrowser\Environment\Executor $executor = null )
$moduleContainer Codeception\Lib\ModuleContainer
$config null | array
$executor tad\WPBrowser\Environment\Executor

buildCommand() 보호된 메소드

protected buildCommand ( $userCommand ) : string
$userCommand
리턴 string

cli() 공개 메소드

The method is a wrapper around isolated calls to the wp-cli tool. The library will use its own wp-cli version to run the commands.
public cli ( string $userCommand = 'core version', &$output = [] ) : integer
$userCommand string The string of command and parameters as it would be passed to wp-cli e.g. a terminal call like `wp core version` becomes `core version` omitting the call to wp-cli script.
리턴 integer wp-cli exit value for the command

cliToArray() 공개 메소드

This method should be used in conjuction with wp-cli commands that will return lists. E.g. $inactiveThemes = $I->cliToArray('theme list --status=inactive --field=name'); The above command could return an array like ['twentyfourteen', 'twentyfifteen'] No check will be made on the command the user inserted for coherency with a split-able output.
public cliToArray ( string $userCommand = 'post list --format=ids', callable $splitCallback = null ) : array
$userCommand string
$splitCallback callable
리턴 array An array containing the output of wp-cli split into single elements.

debugSection() 보호된 메소드

protected debugSection ( string $title, string $message )
$title string
$message string

evaluateStatus() 보호된 메소드

protected evaluateStatus ( &$output, $status )
$output
$status

initPaths() 보호된 메소드

protected initPaths ( )

initWpCliPaths() 보호된 메소드

The way the location works is an ugly hack that assumes the folder structure of the code to climb the tree and find the root folder.
protected initWpCliPaths ( )

mergeCommandOptions() 보호된 메소드

protected mergeCommandOptions ( string $userCommand ) : string
$userCommand string
리턴 string

프로퍼티 상세

$bootPath 보호되어 있는 프로퍼티

protected string $bootPath
리턴 string

$config 보호되어 있는 프로퍼티

protected array $config
리턴 array

$executor 보호되어 있는 프로퍼티

protected Executor,tad\WPBrowser\Environment $executor
리턴 tad\WPBrowser\Environment\Executor

$options 보호되어 있는 프로퍼티

protected array $options
리턴 array

$prettyName 보호되어 있는 프로퍼티

protected string $prettyName
리턴 string

$requiredFields 보호되어 있는 프로퍼티

{
protected $requiredFields

$wpCliRoot 보호되어 있는 프로퍼티

protected string $wpCliRoot
리턴 string