Skip to content

Commit 72e34ae

Browse files
committed
First commit
0 parents  commit 72e34ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+6383
-0
lines changed

.dockerignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.DS_Store
2+
*.php~
3+
*.sublime-project
4+
*.sublime-workspace
5+
._*
6+
.dockerignore
7+
.editorconfig
8+
.git/
9+
.gitignore
10+
.gitmodules
11+
.travis.yml
12+
app/config/parameters.yml
13+
bin/
14+
composer.phar
15+
docker-compose.override.yml
16+
docker-compose.yml
17+
Dockerfile
18+
Thumbs.db
19+
README.md
20+
var/
21+
vendor/
22+
web/app_dev.php
23+
web/config.php
24+
web/bundles/
25+
26+
!bin/console

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/app/config/parameters.yml
2+
/build/
3+
/phpunit.xml
4+
/var/*
5+
!/var/cache
6+
/var/cache/*
7+
!var/cache/.gitkeep
8+
!/var/logs
9+
/var/logs/*
10+
!var/logs/.gitkeep
11+
!/var/sessions
12+
/var/sessions/*
13+
!var/sessions/.gitkeep
14+
!var/SymfonyRequirements.php
15+
/vendor/
16+
/web/bundles/

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo: required
2+
3+
services:
4+
- docker
5+
6+
script:
7+
- docker-compose build
8+
- docker-compose run --rm web composer install -o -n
9+
- docker-compose run --rm web bin/console security:check

CONTRIBUTING.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Contributing to API Platform
2+
3+
First of all, thank you for contributing, you're awesome!
4+
5+
To have your code integrated in the API Platform project, there is some rules to follow, but don't panic, it's easy!
6+
7+
## Reporting bugs
8+
9+
If you happen to find a bug, we kindly request you to report it. However, before submitting it, please:
10+
11+
* Check the [project documentation available online](https://api-platform.com/docs/)
12+
13+
Then, if it appears that it's a real bug, you may report it using Github by following these 3 points:
14+
15+
* Check if the bug is not already reported!
16+
* A clear title to resume the issue
17+
* A description of the workflow needed to reproduce the bug,
18+
19+
> _NOTE:_ Don’t hesitate giving as much information as you can (OS, PHP version extensions...)
20+
21+
## Pull requests
22+
23+
### Writing a Pull Request
24+
25+
First of all, you must decide on what branch your changes will be based. If the changes your are going to make are
26+
fully backward-compatible, you should base your changes on the latest stable branch (`2.0` at the moment).
27+
Otherwise, you should base your changes on the `master` branch.
28+
29+
### Matching coding standards
30+
31+
The API Platform project follows [Symfony coding standards](https://symfony.com/doc/current/contributing/code/standards.html).
32+
But don't worry, you can fix CS issues automatically using the [PHP CS Fixer](http://cs.sensiolabs.org/) tool
33+
34+
```bash
35+
php-cs-fixer.phar fix
36+
```
37+
38+
And then, add fixed file to your commit before push.
39+
Be sure to add only **your modified files**. If another files are fixed by cs tools, just revert it before commit.
40+
41+
### Sending a Pull Request
42+
43+
When you send a PR, just make sure that:
44+
45+
* You add valid test cases (Behat and PHPUnit).
46+
* Tests are green.
47+
* You make a PR on the related documentation in the [api-platform/doc](https://github.com/api-platform/doc) repository.
48+
* You make the PR on the same branch you based your changes on. If you see commits
49+
that you did not make in your PR, you're doing it wrong.
50+
* Also don't forget to add a comment when you update a PR with a ping to the maintainer (`@dunglas`, `@sroze` or `@theofidry`), so he/she will get a notification.
51+
* Squash your commits into one commit. (see the next chapter)
52+
53+
All Pull Requests must include the following header:
54+
55+
```markdown
56+
| Q | A
57+
| ------------- | ---
58+
| Bug fix? | yes/no
59+
| New feature? | yes/no
60+
| BC breaks? | no
61+
| Deprecations? | no
62+
| Tests pass? | yes
63+
| Fixed tickets | #1234, #5678
64+
| License | MIT
65+
| Doc PR | api-platform/doc#1234
66+
```
67+
68+
## Squash your commits
69+
70+
If you have 3 commits. So start with:
71+
72+
```bash
73+
git rebase -i HEAD~3
74+
```
75+
76+
An editor will be opened with your 3 commits, all prefixed by `pick`.
77+
78+
Replace all `pick` prefixes by `fixup` (or `f`) **except the first commit** of the list.
79+
80+
Save and quit the editor.
81+
82+
After that, all your commits where squashed into the first one and the commit message of the first commit.
83+
84+
If you would like to rename your commit message type:
85+
86+
```bash
87+
git commit --amend
88+
```
89+
90+
Now force push to update your PR:
91+
92+
```bash
93+
git push --force
94+
```
95+
96+
# License and copyright attribution
97+
98+
When you open a Pull Request to the API Platform project, you agree to license your code under the [MIT license](LICENSE)
99+
and to transfer the copyright on the submitted code to Kévin Dunglas.
100+
101+
Be sure to you have the right to do that (if you are a professional, ask your company)!
102+
103+
If you include code from another project, please mention it in the Pull Request description and credit the original author.

Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM php:7.1-apache
2+
3+
# PHP extensions
4+
ENV APCU_VERSION 5.1.7
5+
RUN buildDeps=" \
6+
libicu-dev \
7+
zlib1g-dev \
8+
" \
9+
&& apt-get update \
10+
&& apt-get install -y --no-install-recommends \
11+
$buildDeps \
12+
libicu52 \
13+
zlib1g \
14+
&& rm -rf /var/lib/apt/lists/* \
15+
&& docker-php-ext-install \
16+
intl \
17+
mbstring \
18+
pdo_mysql \
19+
zip \
20+
&& apt-get purge -y --auto-remove $buildDeps
21+
RUN pecl install \
22+
apcu-$APCU_VERSION \
23+
&& docker-php-ext-enable --ini-name 05-opcache.ini \
24+
opcache \
25+
&& docker-php-ext-enable --ini-name 20-apcu.ini \
26+
apcu
27+
28+
# Apache config
29+
RUN a2enmod rewrite
30+
ADD docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
31+
32+
# PHP config
33+
ADD docker/php/php.ini /usr/local/etc/php/php.ini
34+
35+
# Install Git
36+
RUN apt-get update \
37+
&& apt-get install -y --no-install-recommends \
38+
git \
39+
&& rm -rf /var/lib/apt/lists/*
40+
41+
# Add the application
42+
ADD . /app
43+
WORKDIR /app
44+
45+
# Fix permissions (useful if the host is Windows)
46+
RUN chmod +x docker/composer.sh docker/start.sh docker/apache/start_safe_perms
47+
48+
# Install composer
49+
RUN ./docker/composer.sh \
50+
&& mv composer.phar /usr/bin/composer \
51+
&& composer global require "hirak/prestissimo:^0.3"
52+
53+
RUN \
54+
# Remove var directory if it's accidentally included
55+
(rm -rf var || true) \
56+
# Create the var sub-directories
57+
&& mkdir -p var/cache var/logs var/sessions \
58+
# Install dependencies
59+
&& composer install --prefer-dist --no-scripts --no-dev --no-progress --no-suggest --optimize-autoloader --classmap-authoritative \
60+
# Fixes permissions issues in non-dev mode
61+
&& chown -R www-data . var/cache var/logs var/sessions
62+
63+
CMD ["/app/docker/start.sh"]

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2015 Kévin Dunglas
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

0 commit comments

Comments
 (0)