Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify error control; stop displaying two exceptions on bad connection
  • Loading branch information
pjcdawkins committed Mar 26, 2017
1 parent 0fe0fd8 commit c156730
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions bin/platform
@@ -1,10 +1,6 @@
#!/usr/bin/env php
<?php

// Ensure that errors are only reported once.
ini_set('display_errors', 1);
ini_set('log_errors', 0);

if (version_compare(PHP_VERSION, '5.5.9', '<')) {
printf("This tool requires at least PHP 5.5.9. You currently have %s installed. Please upgrade your PHP version.\n", PHP_VERSION);
exit(1);
Expand Down
3 changes: 3 additions & 0 deletions src/Command/CommandBase.php
Expand Up @@ -117,8 +117,11 @@ protected function initialize(InputInterface $input, OutputInterface $output)
}

// Tune error reporting based on the output verbosity.
ini_set('log_errors', 0);
ini_set('display_errors', 0);
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
} elseif ($output->getVerbosity() === OutputInterface::VERBOSITY_QUIET) {
error_reporting(false);
} else {
Expand Down

0 comments on commit c156730

Please sign in to comment.