This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier 26aa49e295 merged branch johnkary/os400ConsoleBugFix (PR #4152)
Commits
-------

5b92b9e [Console] Selectively output to STDOUT or OUTPUT stream

Discussion
----------

[Console] Selectively output to STDOUT or OUTPUT stream

Originally opened in this PR targeting master, but asked to target 2.0 instead: https://github.com/symfony/symfony/pull/4148

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #1434
Todo: -

As noted in the ticket discussion and linked discussion threads, IBM i5 Series has issues with writing output to STDOUT when viewed via their QP2TERM console. The output is likely not being converted to the correct character-encoding on the system level.

This PR changes the default output stream from `php://stdout` to `php://output` for OS400 environments, which does not exhibit this issue.

I'm using `php_uname('s')` to check for the presence of "OS400", which is at least one of the IBM OS's exhibiting this issue. This check is only done once when executing a Console task and shouldn't see any adverse affects in speed on the 99% other platforms using Symfony.

I'm not a native to the OS400 platform so I can't really anticipate any other possible regressions that might occur from switching output streams for that platform. On my Mac, this change would strip all color output, but the PR code only changes output for OS400 environment. To my knowledge the QP2TERM console doesn't even support color, so no loss there.

I think this change is best to make the Console component at least usable out of the box for anyone else trying to build CLI applications for use on OS400.

---------------------------------------------------------------------------

by igorw at 2012-04-29T19:41:21Z

#4146 might also need a fix for this.

---------------------------------------------------------------------------

by johnkary at 2012-04-29T20:21:39Z

@igorw Hmm. In this case for #4152 when creating a CLI application, `Symfony\Component\Console\Output\ConsoleOutput` is the [default implementation](5b92b9ed43/src/Symfony/Component/Console/Application.php (L113)) used by `Symfony\Component\Console\Application` when not specifying your own `OutputInterface`. Our hard-coded defaults were causing problems out of the box.

I haven't looked too closely at the PRs surrounding the additions of `StreamingResponse` and your recent `OutputStream` but are we assuming anywhere that `php://stdout` is the default stream used when creating a streaming response? If so it MAY require a check similar to what I implemented for Console. My addition was only necessary because the output was being sent to a CLI console. If output is sent to a browser, I don't believe this would be an issue.

If you have something that needs testing on OS400 just ping me.
2012-04-30 15:13:32 +02:00
src/Symfony [Console] Selectively output to STDOUT or OUTPUT stream 2012-04-29 14:28:50 -05:00
tests Fixed tests 2012-04-30 14:41:37 +02:00
.gitignore Added vendor directory to .gitignore 2010-06-24 10:44:28 +02:00
.travis.yml also test PHP 5.3.2, since this is the official lowest supported PHP version 2011-12-26 01:15:21 +01:00
autoload.php.dist Allow autoload to run without vendors being cloned 2012-03-06 13:36:48 +01:00
CHANGELOG-2.0.md updated CHANGELOG for 2.0.12 2012-03-19 00:56:33 +01:00
check_cs [Check CS] don't replace 'else if' on twig files (closes #2961) 2011-12-27 16:10:32 +01:00
composer.json Bump monolog version 2012-04-25 10:00:53 +02:00
CONTRIBUTORS.md update CONTRIBUTORS for 2.0.12 2012-03-19 00:57:27 +01:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
phpunit.xml.dist [Security] cleaned up opt-in to benchmark test 2011-03-06 20:06:13 +01:00
README.md point the status icon to 2.0 2011-11-22 20:15:25 +01:00
UPDATE.ja.md updated translation of UPDATE file (Japanese RC5 added) 2011-07-30 02:08:25 +09:00
UPDATE.md UPDATE.md: trivial markdown syntax fix 2011-11-15 10:19:29 -08:00
vendors.php updated vendors for 2.0.12 2012-03-19 00:53:37 +01:00

README

Build Status

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.2 and up.

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.

Contributing

Symfony2 is an open source, community-driven project. If you'd like to contribute, please read the Contributing Code part of the documentation. If you're submitting a pull request, please follow the guidelines in the Submitting a Patch section.