This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Zend\Log\Formatter\Xml improvement to handle extra data array #6137
Closed
dkemper
wants to merge
5
commits into
zendframework:develop
from
dkemper:formatter-xml-extra-improvement
Closed
Zend\Log\Formatter\Xml improvement to handle extra data array #6137
dkemper
wants to merge
5
commits into
zendframework:develop
from
dkemper:formatter-xml-extra-improvement
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What about nested arrays? If it's going to support arrays, may as well go the whole way! (hint: use recursion) |
I made a initial version for nested array handling. I didn't find anything in the library. So i hope this version is a least something we can discuss about. Nameing etc. |
$xml = preg_replace('/<\?xml version="1.0"( encoding="[^\"]*")?\?>\n/u', '', $xml); | ||
|
||
return $xml . PHP_EOL; | ||
} | ||
|
||
/** | ||
* Recursion function to crete a xml tree structure out of array structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an
xml, not a
xml
@dkemper can you provide a unit tests for a simple scenario (single array) and nested arrays? |
Ocramius
added a commit
that referenced
this pull request
Jul 27, 2014
Ocramius
added a commit
that referenced
this pull request
Jul 27, 2014
Ocramius
added a commit
that referenced
this pull request
Jul 27, 2014
Ocramius
added a commit
that referenced
this pull request
Jul 27, 2014
Ocramius
added a commit
that referenced
this pull request
Jul 27, 2014
Ocramius
added a commit
that referenced
this pull request
Jul 27, 2014
@dkemper manually merged @bf2d0d3308863185a1f70b8df8c3a9fddf06c5d8, thanks! |
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
…voiding writing it to a variable
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
freax
pushed a commit
to freax/zf2
that referenced
this pull request
Nov 27, 2014
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
…nerated XML, avoiding writing it to a variable
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
gianarb
pushed a commit
to zendframework/zend-log
that referenced
this pull request
May 15, 2015
…extra-improvement' into develop Close zendframework/zendframework#6137
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found out, that the \Zend\Log\Formatter\Xml doesn´t support "extra" information, when its a extra data is an array. I made an example to show my little change.
Hope its useful.
Example-Code:
before:
after: