Skip to content

Commit b69885a

Browse files
committed
Add docs - WIP
1 parent 2a40560 commit b69885a

File tree

3 files changed

+83
-7
lines changed

3 files changed

+83
-7
lines changed

.env.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PHP_VERSION=7.4

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Contribute to yii2-fractal library
2+
==================================
3+
4+
### Local setup
5+
6+
[Docker](https://docs.docker.com/engine/install/) is required
7+
8+
```bash
9+
git clone git@github.com:php-openapi/yii2-fractal.git
10+
cd yii2-fractal
11+
make up
12+
make installdocker # only once during initiation
13+
```
14+
15+
### Test
16+
17+
Ensure you followed steps mentioned in Local setup, then
18+
19+
```bash
20+
make cli
21+
make test
22+
```
23+
24+
### Switching PHP versions
25+
26+
27+
You can switch the PHP version of the docker runtime by changing the `PHP_VERSION` environment variable in the `.env` file.
28+
29+
If you have no `.env` file yet, create it by copying `.env.dist` to `.env`.
30+
31+
After changing the PHP Version you need to run `make clean_all up` to start the new container with new version.
32+
33+
Example:
34+
35+
```
36+
$ echo "PHP_VERSION=7.4" > .env
37+
$ make clean_all up cli
38+
Stopping yii2-openapi_php_1 ... done # TODO
39+
Stopping yii2-openapi_maria_1 ... done
40+
Stopping yii2-openapi_postgres_1 ... done
41+
Stopping yii2-openapi_mysql_1 ... done
42+
Removing yii2-openapi_php_1 ... done
43+
Removing yii2-openapi_maria_1 ... done
44+
Removing yii2-openapi_postgres_1 ... done
45+
Removing yii2-openapi_mysql_1 ... done
46+
Removing network yii2-openapi_default
47+
Creating network "yii2-openapi_default" with driver "bridge"
48+
Creating yii2-openapi_maria_1 ... done
49+
Creating yii2-openapi_mysql_1 ... done
50+
Creating yii2-openapi_postgres_1 ... done
51+
Creating yii2-openapi_php_1 ... done
52+
docker-compose exec php bash
53+
54+
root@f9928598f841:/app# php -v
55+
56+
PHP 7.4.27 (cli) (built: Jan 26 2022 18:08:44) ( NTS )
57+
Copyright (c) The PHP Group
58+
Zend Engine v3.4.0, Copyright (c) Zend Technologies
59+
with Zend OPcache v7.4.27, Copyright (c), by Zend Technologies
60+
with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
61+
```
62+
63+
64+
65+
66+
### Testing # todo remove
67+
68+
- Clone project
69+
- Run `make up`
70+
- Run once `make installdocker`
71+
- Run `make testdocker` or `make cli` and inside docker env `make test`

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![yii2-fractal](https://github.com/php-openapi/yii2-fractal/workflows/yii2-fractal/badge.svg)
44

5-
The set of utils and actions for prepare Rest API accordingly JSON:Api https://jsonapi.org/format/
5+
The set of utils and actions for prepare Rest API accordingly JSON:API https://jsonapi.org/format/
66
With https://fractal.thephpleague.com
77

88
### Installation
@@ -21,9 +21,13 @@ With https://fractal.thephpleague.com
2121

2222
['bootstrap' section]: https://www.yiiframework.com/doc/guide/2.0/en/runtime-bootstrapping
2323

24-
### Testing
25-
26-
- Clone project
27-
- Run `make up`
28-
- Run once `make installdocker`
29-
- Run `make testdocker` or `make cli` and inside docker env `make test`
24+
25+
26+
### Contributing / Local Development / Testing
27+
28+
See [CONTRIBUTING.md](CONTRIBUTING.md) file
29+
30+
31+
### License
32+
33+
See [LICENSE](LICENSE) file

0 commit comments

Comments
 (0)