PHP code example of grigor / yii2-rest-demo
1. Go to this page and download the library: Download grigor/yii2-rest-demo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
grigor / yii2-rest-demo example snippets
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=your_database',
'username' => 'root',
'password' => 'secret',
'charset' => 'utf8',
],
...
],
];
shell
php init
shell
php yii migrate
php yii migrate --migrationPath=@yii/rbac/migrations
php yii migrate --migrationPath=@grigor/blog/etc/migrations
php yii migrate --migrationPath=@grigor/userManagement/etc/migrations
php yii migrate --migrationPath=@grigor/signup/etc/migrations
yaml
### NGINX Server #########################################
nginx:
build:
context: ./nginx
args:
- CHANGE_SOURCE=${CHANGE_SOURCE}
- PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
- http_proxy
- https_proxy
- no_proxy
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
- ${NGINX_SSL_PATH}:/etc/nginx/ssl
ports:
- "${NGINX_HOST_HTTP_PORT}:80"
- "${NGINX_HOST_HTTPS_PORT}:443"
- "${VARNISH_BACKEND_PORT}:81"
depends_on:
- php-fpm
networks:
frontend:
aliases:
- вашдомен.ru
backend:
aliases:
- вашдомен.ru
sh
docker-compose build --no-cache php-fpm workspace