Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Oct 23, 2024
1 parent 635bab0 commit 10a76b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/Console/Command/BuiltInWebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
use function sprintf;
use function strtolower;
use function trim;
use function var_dump;
use const DIRECTORY_SEPARATOR;
use const PHP_BINARY;
use const TD_INDEX_FILE;
Expand Down Expand Up @@ -498,11 +499,14 @@ protected function doProcess(
)
);

$path = escapeshellcmd($publicFile);

$docRoot = dirname($publicFile);
$command = sprintf(
"%s -S $host:$port '$path'",
PHP_BINARY
'%s -t %s -S %s:%d %s',
PHP_BINARY,
escapeshellcmd($docRoot),
escapeshellcmd($host),
$port,
escapeshellcmd($publicFile),
);

$output->writeln('');
Expand Down Expand Up @@ -534,19 +538,22 @@ protected function doProcess(
$output->writeln('');
if (Consolidation::isUnix()
&& (
!$output->isVeryVerbose()
! $output->isVeryVerbose()
&& ! $output->isDebug()
)
&& file_exists('/dev/null')
) {
$command .= " 2>&1 & echo $!";
$command = "cd " . dirname($publicFile) . " && $command";
$command = sprintf(
'cd %s && %s > /dev/null 2>&1',
$docRoot,
$command
);
}

// point to public directory
chdir(dirname($publicFile));

exec($command, $array, $result_code);

if ($result_code !== 0) {
return self::FAILURE;
} elseif (!empty($array[1])) {
Expand Down
1 change: 1 addition & 0 deletions src/Database/Events/CreateSchemaToolsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ private function getColumnDeclarationAttributeOnUpdate(
) {
$attribute = 'UNSIGNED ZEROFILL';
}
$attribute = preg_replace('~\s+~', ' ', $attribute);
$allowedAttributes = [
'ON UPDATE CURRENT_TIMESTAMP' => [
DateTimeType::class,
Expand Down

0 comments on commit 10a76b4

Please sign in to comment.