Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 1fec387a4317 |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
15:e200cb7efeb3 | 16:c2387f117808 |
---|---|
295 register_shutdown_function(function () use ($outputFile, &$deprecations) { | 295 register_shutdown_function(function () use ($outputFile, &$deprecations) { |
296 file_put_contents($outputFile, serialize($deprecations)); | 296 file_put_contents($outputFile, serialize($deprecations)); |
297 }); | 297 }); |
298 } | 298 } |
299 | 299 |
300 /** | |
301 * Returns true if STDOUT is defined and supports colorization. | |
302 * | |
303 * Reference: Composer\XdebugHandler\Process::supportsColor | |
304 * https://github.com/composer/xdebug-handler | |
305 * | |
306 * @return bool | |
307 */ | |
300 private static function hasColorSupport() | 308 private static function hasColorSupport() |
301 { | 309 { |
302 if ('\\' === DIRECTORY_SEPARATOR) { | 310 if (!defined('STDOUT')) { |
303 return | 311 return false; |
304 defined('STDOUT') && function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT) | 312 } |
305 || '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD | 313 |
314 if (DIRECTORY_SEPARATOR === '\\') { | |
315 return (function_exists('sapi_windows_vt100_support') | |
316 && sapi_windows_vt100_support(STDOUT)) | |
306 || false !== getenv('ANSICON') | 317 || false !== getenv('ANSICON') |
307 || 'ON' === getenv('ConEmuANSI') | 318 || 'ON' === getenv('ConEmuANSI') |
308 || 'xterm' === getenv('TERM'); | 319 || 'xterm' === getenv('TERM'); |
309 } | 320 } |
310 | 321 |
311 return defined('STDOUT') && function_exists('posix_isatty') && @posix_isatty(STDOUT); | 322 if (function_exists('stream_isatty')) { |
323 return stream_isatty(STDOUT); | |
324 } | |
325 | |
326 if (function_exists('posix_isatty')) { | |
327 return posix_isatty(STDOUT); | |
328 } | |
329 | |
330 $stat = fstat(STDOUT); | |
331 // Check if formatted mode is S_IFCHR | |
332 return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; | |
312 } | 333 } |
313 } | 334 } |