Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #448

Merged
merged 2 commits into from
Dec 13, 2019
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ e2e_php_settings_checker: docker-images fixtures/php-settings-checker/output-xde
$(BOX_COMPILE) \
| grep '\[debug\]' \
| tee fixtures/php-settings-checker/actual-output || true
$(SED) "s/Xdebug/xdebug/" fixtures/php-settings-checker/actual-output
diff fixtures/php-settings-checker/output-all-clear fixtures/php-settings-checker/actual-output

@echo "$(CCYELLOW)Xdebug enabled: restart needed$(CCEND)"
Expand All @@ -220,6 +221,7 @@ e2e_php_settings_checker: docker-images fixtures/php-settings-checker/output-xde
$(BOX_COMPILE) \
| grep '\[debug\]' \
| tee fixtures/php-settings-checker/actual-output || true
$(SED) "s/Xdebug/xdebug/" fixtures/php-settings-checker/actual-output
$(SED) "s/[0-9]* ms/100 ms/" fixtures/php-settings-checker/actual-output
diff fixtures/php-settings-checker/output-xdebug-enabled fixtures/php-settings-checker/actual-output

Expand All @@ -229,6 +231,7 @@ e2e_php_settings_checker: docker-images fixtures/php-settings-checker/output-xde
$(BOX_COMPILE) \
| grep '\[debug\]' \
| tee fixtures/php-settings-checker/actual-output || true
$(SED) "s/Xdebug/xdebug/" fixtures/php-settings-checker/actual-output
$(SED) "s/'-c' '.*' '\.\/box'/'-c' '\/tmp-file' 'bin\/box'/" fixtures/php-settings-checker/actual-output
$(SED) "s/[0-9]* ms/100 ms/" fixtures/php-settings-checker/actual-output
diff fixtures/php-settings-checker/output-pharreadonly-enabled fixtures/php-settings-checker/actual-output
Expand All @@ -239,6 +242,7 @@ e2e_php_settings_checker: docker-images fixtures/php-settings-checker/output-xde
$(BOX_COMPILE) \
| grep '\[debug\]' \
| tee fixtures/php-settings-checker/actual-output || true
$(SED) "s/Xdebug/xdebug/" fixtures/php-settings-checker/actual-output
$(SED) "s/'-c' '.*' '\.\/box'/'-c' '\/tmp-file' 'bin\/box'/" fixtures/php-settings-checker/actual-output
$(SED) "s/[0-9]* ms/100 ms/" fixtures/php-settings-checker/actual-output
diff fixtures/php-settings-checker/output-min-memory-limit fixtures/php-settings-checker/actual-output
Expand All @@ -249,6 +253,7 @@ e2e_php_settings_checker: docker-images fixtures/php-settings-checker/output-xde
$(BOX_COMPILE) \
| grep '\[debug\]' \
| tee fixtures/php-settings-checker/actual-output || true
$(SED) "s/Xdebug/xdebug/" fixtures/php-settings-checker/actual-output
$(SED) "s/'-c' '.*' '\.\/box'/'-c' '\/tmp-file' 'bin\/box'/" fixtures/php-settings-checker/actual-output
$(SED) "s/[0-9]* ms/100 ms/" fixtures/php-settings-checker/actual-output
diff fixtures/php-settings-checker/output-set-memory-limit fixtures/php-settings-checker/actual-output
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
}
},

"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.2",
"ext-phar": "*",
Expand All @@ -46,7 +48,7 @@
"composer/semver": "^1.5",
"composer/xdebug-handler": "^1.3.2",
"hoa/compiler": "^3.17",
"humbug/php-scoper": "^0.12",
"humbug/php-scoper": "^0.13",
"justinrainbow/json-schema": "^5.2.9",
"nikic/iter": "^2.0",
"nikic/php-parser": "^4.2",
Expand All @@ -68,7 +70,7 @@
"infection/infection": "^0.10",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^8.1",
"symfony/phpunit-bridge": "^4.2"
"symfony/phpunit-bridge": "^4.2 || ^5.0"
},
"suggest": {
"ext-openssl": "To accelerate private key generation."
Expand Down
38 changes: 35 additions & 3 deletions requirement-checker/expected_terminal_diff
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,43 @@
> *
> * @license MIT (c) Fabien Potencier <fabien@symfony.com>
> */
122c129
99c106
< private static function hasVt100Support(): bool
---
> private static function hasVt100Support()
101c108
< return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w'));
---
> return \function_exists('sapi_windows_vt100_support') && \sapi_windows_vt100_support(\fopen('php://stdout', 'wb'));
104,106d110
< /**
< * Initializes dimensions using the output of an stty columns line.
< */
127c131
< private static function getConsoleMode(): ?array
---
> private static function getConsoleMode()
135c139
< return [(int) $matches[2], (int) $matches[1]];
---
> return array((int) $matches[2], (int) $matches[1]);
146,149c153,156
139a144,145
> *
> * @return string|null
141c147
< private static function getSttyColumns(): ?string
---
> private static function getSttyColumns()
146c152,157
< private static function readFromProcess(string $command): ?string
---
> /**
> * @param string $command
> *
> * @return string|null
> */
> private static function readFromProcess($command)
152,155c163,166
< $descriptorspec = [
< 1 => ['pipe', 'w'],
< 2 => ['pipe', 'w'],
Expand All @@ -38,7 +70,7 @@
> 1 => array('pipe', 'w'),
> 2 => array('pipe', 'w'),
> );
151c158
157c168
< $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
---
> $process = proc_open($command, $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
12 changes: 11 additions & 1 deletion requirement-checker/src/Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ private static function initDimensions()
// or [w, h] from "wxh"
self::$width = (int) $matches[1];
self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
} elseif (self::hasSttyAvailable()) {
} elseif (!self::hasVt100Support() && self::hasSttyAvailable()) {
// only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash)
// testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT
self::initDimensionsUsingStty();
} elseif (null !== $dimensions = self::getConsoleMode()) {
// extract [w, h] from "wxh"
Expand All @@ -98,6 +100,14 @@ private static function initDimensions()
}
}

/**
* Returns whether STDOUT has vt100 support (some Windows 10+ configurations).
*/
private static function hasVt100Support()
{
return \function_exists('sapi_windows_vt100_support') && \sapi_windows_vt100_support(\fopen('php://stdout', 'wb'));
}

private static function initDimensionsUsingStty()
{
if ($sttyString = self::getSttyColumns()) {
Expand Down
6 changes: 6 additions & 0 deletions tests/Console/Command/CompileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,12 @@ private function normalizeDisplay(string $display): string
$display
);

$display = str_replace(
'Xdebug',
'xdebug',
$display
);

return DisplayNormalizer::removeTrailingSpaces($display);
}

Expand Down