Skip to content

Commit 10a76b4

Browse files
committed
patch
1 parent 635bab0 commit 10a76b4

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/Console/Command/BuiltInWebServer.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
use function sprintf;
4646
use function strtolower;
4747
use function trim;
48+
use function var_dump;
4849
use const DIRECTORY_SEPARATOR;
4950
use const PHP_BINARY;
5051
use const TD_INDEX_FILE;
@@ -498,11 +499,14 @@ protected function doProcess(
498499
)
499500
);
500501

501-
$path = escapeshellcmd($publicFile);
502-
502+
$docRoot = dirname($publicFile);
503503
$command = sprintf(
504-
"%s -S $host:$port '$path'",
505-
PHP_BINARY
504+
'%s -t %s -S %s:%d %s',
505+
PHP_BINARY,
506+
escapeshellcmd($docRoot),
507+
escapeshellcmd($host),
508+
$port,
509+
escapeshellcmd($publicFile),
506510
);
507511

508512
$output->writeln('');
@@ -534,19 +538,22 @@ protected function doProcess(
534538
$output->writeln('');
535539
if (Consolidation::isUnix()
536540
&& (
537-
!$output->isVeryVerbose()
541+
! $output->isVeryVerbose()
538542
&& ! $output->isDebug()
539543
)
540544
&& file_exists('/dev/null')
541545
) {
542-
$command .= " 2>&1 & echo $!";
543-
$command = "cd " . dirname($publicFile) . " && $command";
546+
$command = sprintf(
547+
'cd %s && %s > /dev/null 2>&1',
548+
$docRoot,
549+
$command
550+
);
544551
}
545-
546552
// point to public directory
547553
chdir(dirname($publicFile));
548554

549555
exec($command, $array, $result_code);
556+
550557
if ($result_code !== 0) {
551558
return self::FAILURE;
552559
} elseif (!empty($array[1])) {

src/Database/Events/CreateSchemaToolsEvent.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ private function getColumnDeclarationAttributeOnUpdate(
325325
) {
326326
$attribute = 'UNSIGNED ZEROFILL';
327327
}
328+
$attribute = preg_replace('~\s+~', ' ', $attribute);
328329
$allowedAttributes = [
329330
'ON UPDATE CURRENT_TIMESTAMP' => [
330331
DateTimeType::class,

0 commit comments

Comments
 (0)