Skip to content

Commit

Permalink
Merge branch '2.x' into 2.next
Browse files Browse the repository at this point in the history
# Conflicts:
#	.phive/phars.xml
  • Loading branch information
LordSimal committed Nov 17, 2024
2 parents 0efcee1 + ebd96a5 commit 103e913
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="2.0.1" installed="2.0.1" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.25.0" installed="5.25.0" location="./tools/psalm" copy="false"/>
<phar name="psalm" version="5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
</phive>
2 changes: 1 addition & 1 deletion src/Command/DumpSqlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function execute(Arguments $args, ConsoleIo $io): int
if ($gzip) {
if (function_exists('gzencode')) {
$result = gzencode($result, 9);
if (!$result) {
if ($result === false) {
$io->err('Failed to gzip the dump!');

return self::CODE_ERROR;
Expand Down
6 changes: 5 additions & 1 deletion src/Sql/SqlBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ protected function checkBinary(string $command): bool
{
$windows = str_starts_with(PHP_OS, 'WIN');
$test = $windows ? 'where' : 'command -v';
$commandResult = shell_exec("$test $command");
if ($commandResult === null || $commandResult === false) {
return false;
}

return is_executable(trim(shell_exec("$test $command") ?: ''));
return is_executable(trim($commandResult));
}
}

0 comments on commit 103e913

Please sign in to comment.