Skip to content

Commit

Permalink
Check for proc_close as well as proc_open
Browse files Browse the repository at this point in the history
Fixes #1049
  • Loading branch information
willmot committed Apr 3, 2016
1 parent 4780566 commit a2493d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/backup/class-backup-engine-database-mysqldump.php
Expand Up @@ -86,7 +86,7 @@ public function get_mysqldump_executable_path() {
*/
public function check_user_can_connect_to_database_via_cli() {

if ( ! function_exists( 'proc_open' ) ) {
if ( ! function_exists( 'proc_open' ) || ! function_exists( 'proc_close' ) ) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/backup/class-backup-utilities.php
Expand Up @@ -39,7 +39,7 @@ public static function is_safe_mode_on( $ini_get_callback = 'ini_get' ) {
*/
public static function get_executable_path( $paths ) {

if ( ! function_exists( 'proc_open' ) ) {
if ( ! function_exists( 'proc_open' ) || ! function_exists( 'proc_close' ) ) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion classes/class-requirement.php
Expand Up @@ -748,7 +748,7 @@ class Requirement_Proc_Open extends Requirement {
* @return bool
*/
public static function test() {
return function_exists( 'proc_open' );
return function_exists( 'proc_open' ) && function_exists( 'proc_close' );
}
}
Requirements::register( 'HM\BackUpWordPress\Requirement_Proc_Open', 'PHP' );
2 changes: 1 addition & 1 deletion tests/class-backup-utilities/test-get-executable-path.php
Expand Up @@ -15,7 +15,7 @@ public function setUp() {

$this->paths = array_combine( $paths, $paths );

if ( ! function_exists( 'proc_open' ) ) {
if ( ! function_exists( 'proc_open' ) || ! function_exists( 'proc_close' ) ) {
$this->markTestSkipped( 'proc_open is disabled' );
}

Expand Down

0 comments on commit a2493d9

Please sign in to comment.