PluginProbe
WP-Stateless – Google Cloud Storage / 3.0.2
WP-Stateless – Google Cloud Storage v3.0.2
4.4.3 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.3.0 2.3.1 2.3.2 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 All 62 releases
wp-stateless / lib / cli / class-sm-cli.php

class-sm-cli.php in WP-Stateless – Google Cloud Storage 3.0.2, at lib/cli/class-sm-cli.php

32 lines 877 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class SM_CLI {
4
5 /**
6 * Launch an external process that takes over I/O.
7 *
8 * @param string Command to call
9 * @param bool Whether to exit if the command returns an error status
10 * @param bool Whether to return an exit status (default) or detailed execution results
11 *
12 * @return int|ProcessRun The command exit status, or a ProcessRun instance
13 */
14 public static function launch( $command, $exit_on_error = true, $return_detailed = false ) {
15 if( !class_exists( 'SM_CLI_Process' ) ) {
16 require_once( dirname( __FILE__ ) . '/class-sm-cli-process.php' );
17 }
18
19 $proc = SM_CLI_Process::create( $command );
20 $results = $proc->run();
21
22 if ( $results->return_code && $exit_on_error )
23 exit( $results->return_code );
24
25 if ( $return_detailed ) {
26 return $results;
27 } else {
28 return $results->return_code;
29 }
30 }
31
32 }