-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from utopia-php/dev
First Implementation
- Loading branch information
Showing
30 changed files
with
2,080 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
vendor | ||
composer.lock | ||
.phpunit.result.cache |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
dist: focal | ||
|
||
arch: | ||
- amd64 | ||
|
||
os: linux | ||
|
||
language: shell | ||
|
||
notifications: | ||
email: | ||
- team@appwrite.io | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- curl -fsSL https://get.docker.com | sh | ||
- echo '{"experimental":"enabled"}' | sudo tee /etc/docker/daemon.json | ||
- mkdir -p $HOME/.docker | ||
- echo '{"experimental":"enabled"}' | sudo tee $HOME/.docker/config.json | ||
- sudo service docker start | ||
- > | ||
if [ ! -z "${DOCKERHUB_PULL_USERNAME:-}" ]; then | ||
echo "${DOCKERHUB_PULL_PASSWORD}" | docker login --username "${DOCKERHUB_PULL_USERNAME}" --password-stdin | ||
fi | ||
- docker --version | ||
|
||
install: | ||
- docker-compose up -d | ||
- sleep 10 | ||
|
||
script: | ||
- docker ps -a | ||
- docker-compose exec web vendor/bin/phpunit --configuration phpunit.xml | ||
- docker-compose exec web vendor/bin/phpcs -p |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, religion, or sexual identity | ||
and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the | ||
overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or | ||
advances of any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email | ||
address, without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at | ||
team@appwrite.io.. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining | ||
the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed | ||
unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing | ||
clarity around the nature of the violation and an explanation of why the | ||
behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series | ||
of actions. | ||
|
||
**Consequence**: A warning with consequences for continued behavior. No | ||
interaction with the people involved, including unsolicited interaction with | ||
those enforcing the Code of Conduct, for a specified period of time. This | ||
includes avoiding interactions in community spaces as well as external channels | ||
like social media. Violating these terms may lead to a temporary or | ||
permanent ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including | ||
sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public | ||
communication with the community for a specified period of time. No public or | ||
private interaction with the people involved, including unsolicited interaction | ||
with those enforcing the Code of Conduct, is allowed during this period. | ||
Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community | ||
standards, including sustained inappropriate behavior, harassment of an | ||
individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within | ||
the community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.0, available at | ||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. | ||
|
||
Community Impact Guidelines were inspired by [Mozilla's code of conduct | ||
enforcement ladder](https://github.com/mozilla/diversity). | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see the FAQ at | ||
https://www.contributor-covenant.org/faq. Translations are available at | ||
https://www.contributor-covenant.org/translations. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Contributing | ||
|
||
We would ❤️ for you to contribute to Platform and help make it better! We want contributing to Platform to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, new docs as well as updates and tweaks, blog posts, workshops, and more. | ||
|
||
## How to Start? | ||
|
||
If you are worried or don’t know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Eldad Fux (@eldadfux)](https://twitter.com/eldadfux) or [@appwrite_io](https://twitter.com/appwrite_io) on Twitter, and anyone from the [Appwrite team on Discord](https://discord.gg/GSeTUeA). You can also submit an issue, and a maintainer can guide you! | ||
|
||
## Code of Conduct | ||
|
||
Help us keep framework open and inclusive. Please read and follow our [Code of Conduct](/CODE_OF_CONDUCT.md). | ||
|
||
## Submit a Pull Request 🚀 | ||
|
||
Branch naming convention is as following | ||
|
||
`TYPE-ISSUE_ID-DESCRIPTION` | ||
|
||
example: | ||
|
||
``` | ||
doc-548-submit-a-pull-request-section-to-contribution-guide | ||
``` | ||
|
||
When `TYPE` can be: | ||
|
||
- **feat** - is a new feature | ||
- **doc** - documentation only changes | ||
- **cicd** - changes related to CI/CD system | ||
- **fix** - a bug fix | ||
- **refactor** - code change that neither fixes a bug nor adds a feature | ||
|
||
**All PRs must include a commit message with the changes description!** | ||
|
||
For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to: | ||
|
||
1. `git pull`, before creating a new branch, pull the changes from upstream. Your master needs to be up to date. | ||
|
||
``` | ||
$ git pull | ||
``` | ||
|
||
2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`<br/> | ||
|
||
``` | ||
$ git checkout -b [name_of_your_new_branch] | ||
``` | ||
|
||
3. Work - commit - repeat ( be sure to be in your branch ) | ||
|
||
4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. You can easily do this by running the formatter. | ||
|
||
```bash | ||
composer format <your file path> | ||
``` | ||
|
||
Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix. | ||
|
||
```bash | ||
composer lint <your file path> | ||
``` | ||
|
||
This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues. | ||
|
||
```bash | ||
composer lint --report=diff <your file path> | ||
``` | ||
|
||
5. Push changes to GitHub | ||
|
||
``` | ||
$ git push origin [name_of_your_new_branch] | ||
``` | ||
|
||
6. Submit your changes for review | ||
If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. | ||
7. Start a Pull Request | ||
Now submit the pull request and click on `Create pull request`. | ||
8. Get a code review approval/reject | ||
9. After approval, merge your PR | ||
10. GitHub will automatically delete the branch after the merge is done. (they can still be restored). | ||
|
||
## Introducing New Features | ||
|
||
We would 💖 you to contribute to Framework, but we would also like to make sure Framework is as great as possible and loyal to its vision and mission statement 🙏. | ||
|
||
For us to find the right balance, please open an issue explaining your ideas before introducing a new pull request. | ||
|
||
This will allow the Framework community to have sufficient discussion about the new feature value and how it fits in the product roadmap and vision. | ||
|
||
This is also important for the Framework lead developers to be able to give technical input and different emphasis regarding the feature design and architecture. Some bigger features might need to go through our [RFC process](https://github.com/appwrite/rfc). | ||
|
||
## Other Ways to Help | ||
|
||
Pull requests are great, but there are many other areas where you can help Framework | ||
|
||
### Blogging & Speaking | ||
|
||
Blogging, speaking about, or creating tutorials about one of Framework's many features is great way to contribute and help our project grow. | ||
|
||
### Presenting at Meetups | ||
|
||
Presenting at meetups and conferences about your Framework projects. Your unique challenges and successes in building things with Framework can provide great speaking material. We’d love to review your talk abstract/CFP, so get in touch with us if you’d like some help! | ||
|
||
### Sending Feedbacks & Reporting Bugs | ||
|
||
Sending feedback is a great way for us to understand your different use cases of Framework better. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA). | ||
|
||
### Submitting New Ideas | ||
|
||
If you think Framework could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and it's implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature. | ||
|
||
### Improving Documentation | ||
|
||
Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated. | ||
|
||
### Helping Someone | ||
|
||
Searching for Framework on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Framework's repo! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
FROM composer:2.0 AS step0 | ||
|
||
|
||
ARG TESTING=true | ||
|
||
ENV TESTING=$TESTING | ||
|
||
WORKDIR /usr/local/src/ | ||
|
||
COPY composer.* /usr/local/src/ | ||
|
||
RUN composer update --ignore-platform-reqs --optimize-autoloader \ | ||
--no-plugins --no-scripts --prefer-dist \ | ||
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi` | ||
|
||
FROM php:8.0-cli-alpine as final | ||
LABEL maintainer="team@appwrite.io" | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive \ | ||
PHP_VERSION=8 | ||
|
||
RUN \ | ||
apk add --no-cache --virtual .deps \ | ||
supervisor php$PHP_VERSION php$PHP_VERSION-fpm nginx bash | ||
|
||
|
||
# Nginx Configuration (with self-signed ssl certificates) | ||
COPY ./tests/docker/nginx.conf /etc/nginx/nginx.conf | ||
|
||
# PHP Configuration | ||
RUN mkdir -p /var/run/php | ||
COPY ./tests/docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf | ||
|
||
# Script | ||
COPY ./tests/docker/start /usr/local/bin/start | ||
|
||
# Add PHP Source Code | ||
COPY ./src /usr/share/nginx/html/src | ||
COPY ./tests /usr/share/nginx/html/tests | ||
COPY ./phpunit.xml /usr/share/nginx/html/phpunit.xml | ||
COPY ./phpcs.xml /usr/share/nginx/html/phpcs.xml | ||
COPY --from=step0 /usr/local/src/vendor /usr/share/nginx/html/vendor | ||
|
||
# Supervisord Conf | ||
COPY ./tests/docker/supervisord.conf /etc/supervisord.conf | ||
|
||
# Executables | ||
RUN chmod +x /usr/local/bin/start | ||
|
||
EXPOSE 80 | ||
|
||
WORKDIR /usr/share/nginx/html | ||
|
||
CMD ["/bin/bash", "/usr/local/bin/start"] |
Oops, something went wrong.