Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

writeLine() with console is (literally) breaking when the string is "too long"? #4051

Closed
Xunnamius opened this Issue · 4 comments

3 participants

@Xunnamius

These images are worth a thousand words; red is the code that produces the corresponding orange output:

1

2

These numbers... and I'm not in the mood to dive into the ZF2 source tonight ;)

Moreover, the workaround seems to be two consecutive write()s (or one long write()). I see it happening pretty much everywhere where the strings are too long, although it doesn't occur often enough for me to replace all of my writeLine()s with consecutive write()s.

Latest Debian Linux using the default console adapter shipped w/ ZF2.

@Thinkscape

Fixed. After merging it will work as expected, echoing the text with an EOL, unless the text matches console width - in that case no EOL will be sent to prevent empty lines.

@Xunnamius Xunnamius closed this
@Bittarman
Collaborator

Please do not close until the PR is merged

@Bittarman Bittarman reopened this
@Xunnamius

Sorry about that, meant to comment again.

Perhaps I'm simply doing it wrong, but after testing the patch locally I'm still seeing issues. Namely, newline characters seem to be getting eaten when executing code similar to the following: $console->writeLine(print_r($somearr, true));.

@Thinkscape

Thanks. I'll check it.

@ghost Unknown referenced this issue from a commit
@weierophinney weierophinney Merge branch 'hotfix/4055'
Close #4055
Fixes #4051
6111de9
@weierophinney weierophinney referenced this issue from a commit in zendframework/zend-console
@weierophinney weierophinney Merge pull request zendframework/zf2#4055 from Thinkscape/hotfix/cons…
…ole-writeline

Fix zendframework/zf2#4051 console::writeLine()
946ec8e
@weierophinney weierophinney referenced this issue from a commit in zendframework/zend-console
@weierophinney weierophinney Merge branch 'hotfix/4055' acef74d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.