Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit b366bb0

Browse files
committed
Initial publication
Imports the "xml2json" functionality from zend-json, so that it can be removed from that component.
0 parents  commit b366bb0

20 files changed

+1387
-0
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/test export-ignore
2+
/vendor export-ignore
3+
.coveralls.yml export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
.travis.yml export-ignore
7+
phpcs.xml export-ignore
8+
phpunit.xml.dist export-ignore

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.buildpath
2+
.DS_Store
3+
.idea
4+
.project
5+
.settings/
6+
.*.sw*
7+
.*.un~
8+
nbproject
9+
doc/html/
10+
tmp/
11+
vendor/
12+
zf-mkdoc-theme/
13+
14+
clover.xml
15+
composer.lock
16+
coveralls-upload.json
17+
phpunit.xml

.travis.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
sudo: false
2+
3+
language: php
4+
5+
branches:
6+
except:
7+
- /^release-.*$/
8+
- /^ghgfk-.*$/
9+
10+
cache:
11+
directories:
12+
- $HOME/.composer/cache
13+
- $HOME/.local
14+
- zf-mkdoc-theme
15+
16+
env:
17+
global:
18+
- SITE_URL=https://zendframework.github.io/zend-json-server
19+
- GH_USER_NAME="Matthew Weier O'Phinney"
20+
21+
- GH_REF=github.com/zendframework/zend-json-server.git
22+
- secure: "KvztcHanoXLkqi+yL3o5el7ypu/jcyHqKy0VtOKGB483sg2wn6wJyAuVLBJscmzgazjPzQa57MBe9an7OOpuoJNPtE5m9huk41KByK2ibzMnC4F7D8lox5CUoV0jRaohYQmpZitbj/BKPlFbYaT42d+/R2o9CEQUJ4T3nYltzAydvB3T1CJE1u7HtZ8mB/Kgkfjqcyx+/bnmvmeGlwop4rDxHmEmrfApdWSUMSKUKjJqUlZt0ASpa2fJy3HL4don6WV1ufPcKVI7bQN1dkn+zZhW5zQ7PRg0hMEMxEMC8MLyLZvDXxL4rUmt2i3I0NtK6E357QdoX13NQKJZiH47jFpJA3DFQl2vE7Vu3kEkMqsrM2fbp9xTCyN9Gg5ZHueUd+iUxVCTy5Twlqt8MqBd2Z4tbljOsgBQkRuKxRg+JkNcWGM5RIWhA169nGY25867Bah/hh25blpsj77RVsvJdeUzAqCHWm5ey+2rNcUWbJXUK2nQdlonCLNsP0LweA5344GFFw+U+93btEw/5mpADbjhaYuZKXhMOcnqJgTGghxkp0cnExb7w5p6KxAsQ+E/C5X7RDwwhaTb6LUuKrTgar4/3RVUIqujdVVUntB1161S6Qnut1TqdaRHbgGOBSlCNWAB960icfdNbN+y4mtJZf9AVgvkoN8QGlncVPF+6GI="
23+
24+
matrix:
25+
fast_finish: true
26+
include:
27+
- php: 5.5
28+
env:
29+
- EXECUTE_CS_CHECK=true
30+
- php: 5.6
31+
env:
32+
- EXECUTE_TEST_COVERALLS=true
33+
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
34+
- PATH="$HOME/.local/bin:$PATH"
35+
- php: 7
36+
- php: hhvm
37+
allow_failures:
38+
- php: hhvm
39+
40+
notifications:
41+
irc: "irc.freenode.org#zftalk.dev"
42+
email: false
43+
44+
before_install:
45+
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
46+
- travis_retry composer self-update
47+
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
48+
49+
install:
50+
- travis_retry composer install --no-interaction --ignore-platform-reqs
51+
52+
script:
53+
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer test-coverage ; fi
54+
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then composer test ; fi
55+
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs-check ; fi
56+
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi
57+
58+
after_success:
59+
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi
60+
61+
after_script:
62+
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer upload-coverage ; fi

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file, in reverse chronological order by release.
4+
5+
## 3.0.0 - TBD
6+
7+
First release as a standalone component. Previous versions were shipped as
8+
`Zend\Json\Json::toXml()` within the [zend-json](https://github.com/zendframework/zend-json)
9+
package.
10+
11+
### Added
12+
13+
- Nothing.
14+
15+
### Deprecated
16+
17+
- Nothing.
18+
19+
### Removed
20+
21+
- Nothing.
22+
23+
### Fixed
24+
25+
- Nothing.

CONDUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributor Code of Conduct
2+
3+
The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com)
4+
as its guidelines for contributor interactions.
5+
6+
## The Code Manifesto
7+
8+
We want to work in an ecosystem that empowers developers to reach their
9+
potential — one that encourages growth and effective collaboration. A space that
10+
is safe for all.
11+
12+
A space such as this benefits everyone that participates in it. It encourages
13+
new developers to enter our field. It is through discussion and collaboration
14+
that we grow, and through growth that we improve.
15+
16+
In the effort to create such a place, we hold to these values:
17+
18+
1. **Discrimination limits us.** This includes discrimination on the basis of
19+
race, gender, sexual orientation, gender identity, age, nationality, technology
20+
and any other arbitrary exclusion of a group of people.
21+
2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort
22+
levels. Remember that, and if brought to your attention, heed it.
23+
3. **We are our biggest assets.** None of us were born masters of our trade.
24+
Each of us has been helped along the way. Return that favor, when and where
25+
you can.
26+
4. **We are resources for the future.** As an extension of #3, share what you
27+
know. Make yourself a resource to help those that come after you.
28+
5. **Respect defines us.** Treat others as you wish to be treated. Make your
29+
discussions, criticisms and debates from a position of respectfulness. Ask
30+
yourself, is it true? Is it necessary? Is it constructive? Anything less is
31+
unacceptable.
32+
6. **Reactions require grace.** Angry responses are valid, but abusive language
33+
and vindictive actions are toxic. When something happens that offends you,
34+
handle it assertively, but be respectful. Escalate reasonably, and try to
35+
allow the offender an opportunity to explain themselves, and possibly correct
36+
the issue.
37+
7. **Opinions are just that: opinions.** Each and every one of us, due to our
38+
background and upbringing, have varying opinions. The fact of the matter, is
39+
that is perfectly acceptable. Remember this: if you respect your own
40+
opinions, you should respect the opinions of others.
41+
8. **To err is human.** You might not intend it, but mistakes do happen and
42+
contribute to build experience. Tolerate honest mistakes, and don't hesitate
43+
to apologize if you make one yourself.

CONTRIBUTING.md

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
# CONTRIBUTING
2+
3+
## RESOURCES
4+
5+
If you wish to contribute to Zend Framework, please be sure to
6+
read/subscribe to the following resources:
7+
8+
- [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards)
9+
- [Contributor's Guide](http://framework.zend.com/participate/contributor-guide)
10+
- ZF Contributor's mailing list:
11+
Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html
12+
Subscribe: [email protected]
13+
- ZF Contributor's IRC channel:
14+
#zftalk.dev on Freenode.net
15+
16+
If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-xml2json/issues/new).
17+
18+
## Reporting Potential Security Issues
19+
20+
If you have encountered a potential security vulnerability, please **DO NOT** report it on the public
21+
issue tracker: send it to us at [[email protected]](mailto:[email protected]) instead.
22+
We will work with you to verify the vulnerability and patch it as soon as possible.
23+
24+
When reporting issues, please provide the following information:
25+
26+
- Component(s) affected
27+
- A description indicating how to reproduce the issue
28+
- A summary of the security vulnerability and impact
29+
30+
We request that you contact us via the email address above and give the project
31+
contributors a chance to resolve the vulnerability and issue a new release prior
32+
to any public exposure; this helps protect users and provides them with a chance
33+
to upgrade and/or update in order to protect their applications.
34+
35+
For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).
36+
37+
## RUNNING TESTS
38+
39+
> ### Note: testing versions prior to 2.4
40+
>
41+
> This component originates with Zend Framework 2. During the lifetime of ZF2,
42+
> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no
43+
> changes were necessary. However, due to the migration, tests may not run on
44+
> versions < 2.4. As such, you may need to change the PHPUnit dependency if
45+
> attempting a fix on such a version.
46+
47+
To run tests:
48+
49+
- Clone the repository:
50+
51+
```console
52+
$ git clone [email protected]:zendframework/zend-xml2json.git
53+
$ cd
54+
```
55+
56+
- Install dependencies via composer:
57+
58+
```console
59+
$ curl -sS https://getcomposer.org/installer | php --
60+
$ ./composer.phar install
61+
```
62+
63+
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
64+
65+
- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
66+
67+
```console
68+
$ ./vendor/bin/phpunit
69+
```
70+
71+
You can turn on conditional tests with the phpunit.xml file.
72+
To do so:
73+
74+
- Copy `phpunit.xml.dist` file to `phpunit.xml`
75+
- Edit `phpunit.xml` to enable any specific functionality you
76+
want to test, as well as to provide test values to utilize.
77+
78+
## Running Coding Standards Checks
79+
80+
This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding
81+
standards checks, and provides configuration for our selected checks.
82+
`php-cs-fixer` is installed by default via Composer.
83+
84+
To run checks only:
85+
86+
```console
87+
$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs
88+
```
89+
90+
To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run`
91+
flag:
92+
93+
```console
94+
$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs
95+
```
96+
97+
If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure
98+
they pass, and make sure you add and commit the changes after verification.
99+
100+
## Recommended Workflow for Contributions
101+
102+
Your first step is to establish a public repository from which we can
103+
pull your work into the master repository. We recommend using
104+
[GitHub](https://github.com), as that is where the component is already hosted.
105+
106+
1. Setup a [GitHub account](http://github.com/), if you haven't yet
107+
2. Fork the repository (http://github.com/zendframework/zend-xml2json)
108+
3. Clone the canonical repository locally and enter it.
109+
110+
```console
111+
$ git clone git://github.com:zendframework/zend-xml2json.git
112+
$ cd zend-xml2json
113+
```
114+
115+
4. Add a remote to your fork; substitute your GitHub username in the command
116+
below.
117+
118+
```console
119+
$ git remote add {username} [email protected]:{username}/zend-xml2json.git
120+
$ git fetch {username}
121+
```
122+
123+
### Keeping Up-to-Date
124+
125+
Periodically, you should update your fork or personal repository to
126+
match the canonical ZF repository. Assuming you have setup your local repository
127+
per the instructions above, you can do the following:
128+
129+
130+
```console
131+
$ git checkout master
132+
$ git fetch origin
133+
$ git rebase origin/master
134+
# OPTIONALLY, to keep your remote up-to-date -
135+
$ git push {username} master:master
136+
```
137+
138+
If you're tracking other branches -- for example, the "develop" branch, where
139+
new feature development occurs -- you'll want to do the same operations for that
140+
branch; simply substitute "develop" for "master".
141+
142+
### Working on a patch
143+
144+
We recommend you do each new feature or bugfix in a new branch. This simplifies
145+
the task of code review as well as the task of merging your changes into the
146+
canonical repository.
147+
148+
A typical workflow will then consist of the following:
149+
150+
1. Create a new local branch based off either your master or develop branch.
151+
2. Switch to your new local branch. (This step can be combined with the
152+
previous step with the use of `git checkout -b`.)
153+
3. Do some work, commit, repeat as necessary.
154+
4. Push the local branch to your remote repository.
155+
5. Send a pull request.
156+
157+
The mechanics of this process are actually quite trivial. Below, we will
158+
create a branch for fixing an issue in the tracker.
159+
160+
```console
161+
$ git checkout -b hotfix/9295
162+
Switched to a new branch 'hotfix/9295'
163+
```
164+
165+
... do some work ...
166+
167+
168+
```console
169+
$ git commit
170+
```
171+
172+
... write your log message ...
173+
174+
175+
```console
176+
$ git push {username} hotfix/9295:hotfix/9295
177+
Counting objects: 38, done.
178+
Delta compression using up to 2 threads.
179+
Compression objects: 100% (18/18), done.
180+
Writing objects: 100% (20/20), 8.19KiB, done.
181+
Total 20 (delta 12), reused 0 (delta 0)
182+
To ssh://[email protected]/{username}/zend-xml2json.git
183+
b5583aa..4f51698 HEAD -> master
184+
```
185+
186+
To send a pull request, you have two options.
187+
188+
If using GitHub, you can do the pull request from there. Navigate to
189+
your repository, select the branch you just created, and then select the
190+
"Pull Request" button in the upper right. Select the user/organization
191+
"zendframework" as the recipient.
192+
193+
If using your own repository - or even if using GitHub - you can use `git
194+
format-patch` to create a patchset for us to apply; in fact, this is
195+
**recommended** for security-related patches. If you use `format-patch`, please
196+
send the patches as attachments to:
197+
198+
- [email protected] for patches without security implications
199+
- [email protected] for security patches
200+
201+
#### What branch to issue the pull request against?
202+
203+
Which branch should you issue a pull request against?
204+
205+
- For fixes against the stable release, issue the pull request against the
206+
"master" branch.
207+
- For new features, or fixes that introduce new elements to the public API (such
208+
as new public methods or properties), issue the pull request against the
209+
"develop" branch.
210+
211+
### Branch Cleanup
212+
213+
As you might imagine, if you are a frequent contributor, you'll start to
214+
get a ton of branches both locally and on your remote.
215+
216+
Once you know that your changes have been accepted to the master
217+
repository, we suggest doing some cleanup of these branches.
218+
219+
- Local branch cleanup
220+
221+
```console
222+
$ git branch -d <branchname>
223+
```
224+
225+
- Remote branch removal
226+
227+
```console
228+
$ git push {username} :<branchname>
229+
```
230+
231+
232+
## Conduct
233+
234+
Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project.

0 commit comments

Comments
 (0)