forked from Insolita/yii2-fractal
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #5 from php-openapi/4-fix-ci-to-work-with-php-74-a…
…nd-8x Resolve: Multiple issues
- Loading branch information
Showing
24 changed files
with
160 additions
and
58 deletions.
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 @@ | ||
PHP_VERSION=8.0 |
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
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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
/composer.lock | ||
/phpunit.xml | ||
/.php_cs.cache | ||
|
||
/.env | ||
/.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,65 @@ | ||
Contribute to yii2-fractal library | ||
================================== | ||
|
||
### Local setup | ||
|
||
[Docker](https://docs.docker.com/engine/install/) is required | ||
|
||
```bash | ||
git clone git@github.com: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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.remote_host=host.docker.internal | ||
xdebug.remote_port=9000 | ||
xdebug.mode=debug | ||
xdebug.start_with_request=yes | ||
xdebug.discover_client_host=1 | ||
;xdebug.client_host=host.docker.internal | ||
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 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 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 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.