forked from Insolita/yii2-fractal
-
Notifications
You must be signed in to change notification settings - Fork 1
Resolve: Multiple issues #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b4e5ef9
Initial commit to create PR
SOHELAHMED7 2a40560
Fix issues faced during local setup
SOHELAHMED7 b69885a
Add docs - WIP
SOHELAHMED7 30b0107
Make enhancements
SOHELAHMED7 11bcb4c
Fix issues related to dependencies
SOHELAHMED7 dccb6ce
Fix few failing tests
SOHELAHMED7 fd50e64
Fix failing test ApiUserCest.php:testMyPostsListAction WIP
SOHELAHMED7 b0c39cb
WIP 2
SOHELAHMED7 f31158e
Fix bug and fix failing test
SOHELAHMED7 f5d6084
Fix bug + Fix other failing tests
SOHELAHMED7 ea963f9
Refactor
SOHELAHMED7 1e7ba89
Enable development for multiple PHP version
SOHELAHMED7 2f53d08
Modify docs
SOHELAHMED7 f0d08c6
Apply suggestions from code review
cebe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 @@ | ||
PHP_VERSION=8.0 |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
/composer.lock | ||
/phpunit.xml | ||
/.php_cs.cache | ||
|
||
/.env | ||
/.phpunit.result.cache |
This file contains hidden or 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,65 @@ | ||
Contribute to yii2-fractal library | ||
================================== | ||
|
||
### Local setup | ||
|
||
[Docker](https://docs.docker.com/engine/install/) is required | ||
|
||
```bash | ||
git clone [email protected]:php-openapi/yii2-fractal.git | ||
cd yii2-fractal | ||
make up | ||
make installdocker # only once during initiation | ||
``` | ||
|
||
### Test | ||
|
||
Ensure you followed steps mentioned in Local setup, then | ||
|
||
```bash | ||
make cli | ||
make test | ||
``` | ||
|
||
### Switching PHP versions | ||
|
||
While development, you might need to support multiple versions of PHP. You can run tests locally in a Docker container in a different PHP version. | ||
|
||
You can switch the PHP version of the docker runtime by changing the `PHP_VERSION` environment variable in the `.env` file. | ||
|
||
If you have no `.env` file yet, create it by copying `.env.dist` to `.env`. | ||
|
||
After changing the PHP Version you need to run `make clean_all up cli` or `make down up cli` to start the new container with new version. | ||
|
||
Example: | ||
|
||
``` | ||
$ echo "PHP_VERSION=8.2" > .env | ||
$ make down up cli | ||
docker-compose down --remove-orphans | ||
Stopping yii2-fractal_php_1 ... done | ||
Stopping yii2-fractal_pgsql_1 ... done | ||
Removing yii2-fractal_php_1 ... done | ||
Removing yii2-fractal_pgsql_1 ... done | ||
Removing network yii2-fractal_default | ||
docker-compose build | ||
... | ||
... | ||
... | ||
docker-compose up -d | ||
... | ||
... | ||
... | ||
docker-compose exec php bash | ||
_ _ __ _ | ||
(_|_)/ _| | | | ||
_ _ _ _| |_ _ __ __ _ _ __ ___ _____ _____ _ __| | __ | ||
| | | | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / | ||
| |_| | | | | | | | (_| | | | | | | __/\ V V / (_) | | | < | ||
\__, |_|_|_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_\ | ||
__/ | | ||
|___/ | ||
|
||
PHP version: 8.2.20 | ||
root@713d31b5ed8c:/app# | ||
``` |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
FROM yiisoftware/yii2-php:7.1-apache | ||
ARG BUILD_PHP_VERSION | ||
|
||
FROM yiisoftware/yii2-php:${BUILD_PHP_VERSION}-apache | ||
|
||
ARG BUILD_PHP_VERSION | ||
|
||
ENV INSIDE_DOCKER=1 | ||
|
||
COPY apache.conf /etc/apache2/sites-enabled/000-default.conf | ||
|
||
# enable xdebug | ||
RUN docker-php-ext-enable xdebug | ||
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini | ||
COPY xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini |
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
xdebug.remote_enable=1 | ||
xdebug.remote_autostart=1 | ||
xdebug.remote_connect_back=1 | ||
xdebug.mode=debug | ||
xdebug.start_with_request=yes | ||
xdebug.discover_client_host=1 | ||
;xdebug.remote_host=host.docker.internal | ||
xdebug.remote_port=9000 | ||
cebe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
xdebug.client_port=9000 | ||
xdebug.idekey=PHPSTORM | ||
xdebug.remote_timeout = 10 | ||
xdebug.connect_timeout_ms = 10 | ||
;https://stackoverflow.com/a/68605372 | ||
xdebug.log_level=0 |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.