Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"homepage": "https://wp-cli.org",
"license": "MIT",
"require": {
"php": "^5.4 || ^7.0",
"php": "^5.6 || ^7.0",
"ext-curl": "*",
"mustache/mustache": "~2.13",
"rmccue/requests": "~1.6",
Expand All @@ -30,7 +30,7 @@
},
"config": {
"platform": {
"php": "5.4"
"php": "5.6"
},
"process-timeout": 7200,
"sort-packages": true
Expand Down
3 changes: 1 addition & 2 deletions php/WP_CLI/Loggers/Execution.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ protected function write( $handle, $str ) {
* Starts output buffering, using a callback to capture output from `echo`, `print`, `printf` (which write to the output buffer 'php://output' rather than STDOUT).
*/
public function ob_start() {
// To ensure sequential output, give a chunk size of 1 (or 2 if PHP < 5.4 as 1 was a special value meaning a 4KB chunk) to `ob_start()`, so that each write gets flushed immediately.
ob_start( array( $this, 'ob_start_callback' ), version_compare( PHP_VERSION, '5.4.0', '<' ) ? 2 : 1 );
ob_start( array( $this, 'ob_start_callback' ), 1 );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions php/boot-fs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
die( -1 );
}

if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) {
printf( "Error: WP-CLI requires PHP %s or newer. You are running version %s.\n", '5.4.0', PHP_VERSION );
if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
printf( "Error: WP-CLI requires PHP %s or newer. You are running version %s.\n", '5.6.0', PHP_VERSION );
die( -1 );
}

Expand Down
15 changes: 1 addition & 14 deletions php/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1443,20 +1443,7 @@ function get_php_binary() {
return $wp_cli_php;
}

// Available since PHP 5.4.
if ( defined( 'PHP_BINARY' ) ) {
return PHP_BINARY;
}

if ( @is_executable( PHP_BINDIR . '/php' ) ) {
return PHP_BINDIR . '/php';
}

if ( is_windows() && @is_executable( PHP_BINDIR . '/php.exe' ) ) {
return PHP_BINDIR . '/php.exe';
}

return 'php';
return PHP_BINARY;
}

/**
Expand Down