From 6f09dcf264d86fcffa3fd3f87c129b0af29c2bf0 Mon Sep 17 00:00:00 2001 From: GotPPay Date: Mon, 25 Jun 2018 14:45:13 +0200 Subject: [PATCH] install and config phinx for migrations --- api-wiaas/composer.json | 3 +- api-wiaas/composer.lock | 743 +++++++++++++++++++++++++++++++++++++++- api-wiaas/config.php | 1 - api-wiaas/phinx.php | 41 +++ php.dockerfile | 25 ++ 5 files changed, 799 insertions(+), 14 deletions(-) create mode 100644 api-wiaas/phinx.php diff --git a/api-wiaas/composer.json b/api-wiaas/composer.json index c50946a..c47ccf0 100644 --- a/api-wiaas/composer.json +++ b/api-wiaas/composer.json @@ -3,6 +3,7 @@ "sendgrid/sendgrid": "~5.1", "phpoffice/phpexcel": "^1.8", "firebase/php-jwt": "^5.0", - "cloudinary/cloudinary_php": "dev-master" + "cloudinary/cloudinary_php": "dev-master", + "robmorgan/phinx": "^0.10" } } diff --git a/api-wiaas/composer.lock b/api-wiaas/composer.lock index dde89d5..084d888 100644 --- a/api-wiaas/composer.lock +++ b/api-wiaas/composer.lock @@ -4,20 +4,311 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "43b2e4e398624aacad266d3c9a1124d0", + "content-hash": "9f0b9ff3a219f8bf0181a900d221af66", "packages": [ + { + "name": "cakephp/cache", + "version": "3.6.6", + "source": { + "type": "git", + "url": "https://github.com/cakephp/cache.git", + "reference": "44cb339902344bf4bd866645047b533057b9df8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/cache/zipball/44cb339902344bf4bd866645047b533057b9df8a", + "reference": "44cb339902344bf4bd866645047b533057b9df8a", + "shasum": "" + }, + "require": { + "cakephp/core": "^3.6.0", + "php": ">=5.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Cache\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/cache/graphs/contributors" + } + ], + "description": "Easy to use Caching library with support for multiple caching backends", + "homepage": "https://cakephp.org", + "keywords": [ + "cache", + "caching", + "cakephp" + ], + "time": "2018-04-24T11:15:51+00:00" + }, + { + "name": "cakephp/collection", + "version": "3.6.6", + "source": { + "type": "git", + "url": "https://github.com/cakephp/collection.git", + "reference": "c3cce01e8c76a98cb6149f958e9b7acae5e1aa74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/collection/zipball/c3cce01e8c76a98cb6149f958e9b7acae5e1aa74", + "reference": "c3cce01e8c76a98cb6149f958e9b7acae5e1aa74", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Collection\\": "." + }, + "files": [ + "functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/collection/graphs/contributors" + } + ], + "description": "Work easily with arrays and iterators by having a battery of utility traversal methods", + "homepage": "https://cakephp.org", + "keywords": [ + "arrays", + "cakephp", + "collections", + "iterators" + ], + "time": "2018-06-10T19:23:43+00:00" + }, + { + "name": "cakephp/core", + "version": "3.6.6", + "source": { + "type": "git", + "url": "https://github.com/cakephp/core.git", + "reference": "ad1ddaf85c88332392d999db4993ff1fb5429bea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/core/zipball/ad1ddaf85c88332392d999db4993ff1fb5429bea", + "reference": "ad1ddaf85c88332392d999db4993ff1fb5429bea", + "shasum": "" + }, + "require": { + "cakephp/utility": "^3.6.0", + "php": ">=5.6.0" + }, + "suggest": { + "cakephp/event": "To use PluginApplicationInterface or plugin applications." + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Core\\": "." + }, + "files": [ + "functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/core/graphs/contributors" + } + ], + "description": "CakePHP Framework Core classes", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "core", + "framework" + ], + "time": "2018-06-21T02:41:27+00:00" + }, + { + "name": "cakephp/database", + "version": "3.6.6", + "source": { + "type": "git", + "url": "https://github.com/cakephp/database.git", + "reference": "a7200722b2fbf22502700b9d8515581007616a77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/database/zipball/a7200722b2fbf22502700b9d8515581007616a77", + "reference": "a7200722b2fbf22502700b9d8515581007616a77", + "shasum": "" + }, + "require": { + "cakephp/cache": "^3.6.0", + "cakephp/core": "^3.6.0", + "cakephp/datasource": "^3.6.0", + "php": ">=5.6.0" + }, + "suggest": { + "cakephp/log": "Require this if you want to use the built-in query logger" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Database\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/database/graphs/contributors" + } + ], + "description": "Flexible and powerful Database abstraction library with a familiar PDO-like API", + "homepage": "https://cakephp.org", + "keywords": [ + "abstraction", + "cakephp", + "database", + "database abstraction", + "pdo" + ], + "time": "2018-06-13T23:11:10+00:00" + }, + { + "name": "cakephp/datasource", + "version": "3.6.6", + "source": { + "type": "git", + "url": "https://github.com/cakephp/datasource.git", + "reference": "8ac1cd771b67bca472df53aa4f4105924419d8c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/datasource/zipball/8ac1cd771b67bca472df53aa4f4105924419d8c8", + "reference": "8ac1cd771b67bca472df53aa4f4105924419d8c8", + "shasum": "" + }, + "require": { + "cakephp/core": "^3.6.0", + "php": ">=5.6.0" + }, + "suggest": { + "cakephp/cache": "If you decide to use Query caching.", + "cakephp/collection": "If you decide to use ResultSetInterface.", + "cakephp/utility": "If you decide to use EntityTrait." + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Datasource\\": "." + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/datasource/graphs/contributors" + } + ], + "description": "Provides connection managing and traits for Entities and Queries that can be reused for different datastores", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "connection management", + "datasource", + "entity", + "query" + ], + "time": "2018-06-20T18:56:54+00:00" + }, + { + "name": "cakephp/utility", + "version": "3.6.6", + "source": { + "type": "git", + "url": "https://github.com/cakephp/utility.git", + "reference": "3478eba87128cca4755ea16b469e59d1155650cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cakephp/utility/zipball/3478eba87128cca4755ea16b469e59d1155650cd", + "reference": "3478eba87128cca4755ea16b469e59d1155650cd", + "shasum": "" + }, + "require": { + "cakephp/core": "^3.6.0", + "php": ">=5.6.0" + }, + "suggest": { + "ext-intl": "To use Text::transliterate() or Text::slug()", + "lib-ICU": "To use Text::transliterate() or Text::slug()" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cake\\Utility\\": "." + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/utility/graphs/contributors" + } + ], + "description": "CakePHP Utility classes such as Inflector, String, Hash, and Security", + "homepage": "https://cakephp.org", + "keywords": [ + "cakephp", + "hash", + "inflector", + "security", + "string", + "utility" + ], + "time": "2018-05-31T20:11:56+00:00" + }, { "name": "cloudinary/cloudinary_php", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/cloudinary/cloudinary_php.git", - "reference": "40190b47bf596020ae79608eeec47b9c5f86bb26" + "reference": "724eb4cc488c7b532af056dd165b6633b74b682c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/40190b47bf596020ae79608eeec47b9c5f86bb26", - "reference": "40190b47bf596020ae79608eeec47b9c5f86bb26", + "url": "https://api.github.com/repos/cloudinary/cloudinary_php/zipball/724eb4cc488c7b532af056dd165b6633b74b682c", + "reference": "724eb4cc488c7b532af056dd165b6633b74b682c", "shasum": "" }, "require": { @@ -56,7 +347,7 @@ "image management", "sdk" ], - "time": "2018-03-27 11:49:00" + "time": "2018-06-11T17:07:23+00:00" }, { "name": "firebase/php-jwt", @@ -163,17 +454,91 @@ "time": "2015-05-01T07:00:55+00:00" }, { - "name": "sendgrid/php-http-client", - "version": "3.9.5", + "name": "robmorgan/phinx", + "version": "0.10.3", "source": { "type": "git", - "url": "https://github.com/sendgrid/php-http-client.git", - "reference": "dc5cc8d7f06ee94f634a856d39b88ccfc31a2f9c" + "url": "https://github.com/cakephp/phinx.git", + "reference": "25c5197af1b49fb1a4029fe943858a9e63b3c335" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sendgrid/php-http-client/zipball/dc5cc8d7f06ee94f634a856d39b88ccfc31a2f9c", - "reference": "dc5cc8d7f06ee94f634a856d39b88ccfc31a2f9c", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/25c5197af1b49fb1a4029fe943858a9e63b3c335", + "reference": "25c5197af1b49fb1a4029fe943858a9e63b3c335", + "shasum": "" + }, + "require": { + "cakephp/collection": "^3.6", + "cakephp/database": "^3.6", + "php": ">=5.6", + "symfony/config": "^2.8|^3.0|^4.0", + "symfony/console": "^2.8|^3.0|^4.0", + "symfony/yaml": "^2.8|^3.0|^4.0" + }, + "require-dev": { + "cakephp/cakephp-codesniffer": "^3.0", + "phpunit/phpunit": ">=5.7", + "sebastian/comparator": ">=1.2.3" + }, + "bin": [ + "bin/phinx" + ], + "type": "library", + "autoload": { + "psr-4": { + "Phinx\\": "src/Phinx/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com", + "homepage": "http://shadowhand.me", + "role": "Developer" + }, + { + "name": "Rob Morgan", + "email": "robbym@gmail.com", + "homepage": "https://robmorgan.id.au", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Developer" + }, + { + "name": "CakePHP Community", + "homepage": "https://github.com/cakephp/phinx/graphs/contributors" + } + ], + "description": "Phinx makes it ridiculously easy to manage the database migrations for your PHP app.", + "homepage": "https://phinx.org", + "keywords": [ + "database", + "database migrations", + "db", + "migrations", + "phinx" + ], + "time": "2018-06-22T12:02:01+00:00" + }, + { + "name": "sendgrid/php-http-client", + "version": "3.9.6", + "source": { + "type": "git", + "url": "https://github.com/sendgrid/php-http-client.git", + "reference": "e9a04d949ee2d19938ab83dc100933a3b41a8ec7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sendgrid/php-http-client/zipball/e9a04d949ee2d19938ab83dc100933a3b41a8ec7", + "reference": "e9a04d949ee2d19938ab83dc100933a3b41a8ec7", "shasum": "" }, "require": { @@ -212,7 +577,7 @@ "rest", "sendgrid" ], - "time": "2018-03-27T01:24:17+00:00" + "time": "2018-04-10T18:06:08+00:00" }, { "name": "sendgrid/sendgrid", @@ -259,6 +624,360 @@ "sendgrid" ], "time": "2017-06-30T04:48:44+00:00" + }, + { + "name": "symfony/config", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "5ceefc256caecc3e25147c4e5b933de71d0020c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/5ceefc256caecc3e25147c4e5b933de71d0020c4", + "reference": "5ceefc256caecc3e25147c4e5b933de71d0020c4", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/filesystem": "~3.4|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/finder": "<3.4" + }, + "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "time": "2018-05-16T14:33:22+00:00" + }, + { + "name": "symfony/console", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "2d5d973bf9933d46802b01010bd25c800c87c242" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/2d5d973bf9933d46802b01010bd25c800c87c242", + "reference": "2d5d973bf9933d46802b01010bd25c800c87c242", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2018-05-30T07:26:09+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", + "reference": "562bf7005b55fd80d26b582d28e3e10f2dd5ae9c", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2018-05-30T07:26:09+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30T19:57:29+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "3296adf6a6454a050679cde90f95350ad604b171" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "symfony/yaml", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/80e4bfa9685fc4a09acc4a857ec16974a9cd944e", + "reference": "80e4bfa9685fc4a09acc4a857ec16974a9cd944e", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2018-05-30T07:26:09+00:00" } ], "packages-dev": [], diff --git a/api-wiaas/config.php b/api-wiaas/config.php index a2b2e4b..78e4235 100644 --- a/api-wiaas/config.php +++ b/api-wiaas/config.php @@ -156,7 +156,6 @@ if (!defined('WIAAS_URL')){ getenv('WIAAS_URL') ? define('WIAAS_URL', $_ENV['WIAAS_URL']) : define('WIAAS_URL', 'http://localhost:8000'); } -const WIAAS_URL = APPLICATION_MODE === 'PROD' ? 'http://localhost:8000' : 'http://localhost:8000'; const WORKING_DAYS_KEY = 'you@gmail.com'; const JWT_API_SECRET_KEY = 'W11A$_AP1_S3CR3T'; const JWT_ALGORITHM ='HS512'; diff --git a/api-wiaas/phinx.php b/api-wiaas/phinx.php new file mode 100644 index 0000000..6f8b376 --- /dev/null +++ b/api-wiaas/phinx.php @@ -0,0 +1,41 @@ + [ + 'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations', + 'seeds' => '%%PHINX_CONFIG_DIR%%/db/seeds' + ], + 'environments' => [ + 'default_migration_table' => 'phinxlog', + 'default_database' => 'development', + 'production' => [ + 'adapter' => 'mysql', + 'host' => $_ENV['PROD_DB_HOST'], + 'name' => $_ENV['PROD_DB_NAME'], + 'user' => $_ENV['PROD_DB_USER'], + 'pass' => $_ENV['PROD_DB_PASS'], + 'port' => $_ENV['PROD_DB_PORT'], + 'charset' => 'utf8', + ], + 'development' => [ + 'adapter' => 'mysql', + 'host' => $_ENV['DEV_DB_HOST'], + 'name' => $_ENV['DEV_DB_NAME'], + 'user' => $_ENV['DEV_DB_USER'], + 'pass' => $_ENV['DEV_DB_PASS'], + 'port' => $_ENV['DEV_DB_PORT'], + 'charset' => 'utf8', + ], + 'testing' => [ + 'adapter' => 'mysql', + 'host' => $_ENV['TEST_DB_HOST'], + 'name' => $_ENV['TEST_DB_NAME'], + 'user' => $_ENV['TEST_DB_USER'], + 'pass' => $_ENV['TEST_DB_PASS'], + 'port' => $_ENV['TEST_DB_PORT'], + 'charset' => 'utf8', + ] + ], + 'version_order' => 'creation' +]; \ No newline at end of file diff --git a/php.dockerfile b/php.dockerfile index f854fc8..5243277 100644 --- a/php.dockerfile +++ b/php.dockerfile @@ -1,9 +1,34 @@ FROM php:7.0-apache +#for frontend config ENV REACT_APP_TEST_URL=http://localhost:8000/api-wiaas \ REACT_APP_PROD_URL=http://localhost:8000/api-wiaas \ REACT_APP_DEV_URL=http://legacy.wiaas.saburly.com/api-wiaas +#for api-wiaas config +ENV WIAAS_URL=http://legacy.wiaas.saburly.com + +ENV DB_SERVER=db \ + DB_NAME=ricoh_dash \ + DB_USER=developer \ + DB_PASS=developer + +#for phinx config +ENV DEV_DB_HOST=db \ + DEV_DB_NAME=ricoh_dash \ + DEV_DB_USER=developer \ + DEV_DB_PASS=developer + +ENV PROD_DB_HOST=db \ + PROD_DB_NAME=ricoh_dash \ + PROD_DB_USER=developer \ + PROD_DB_PASS=developer + +ENV TEST_DB_HOST=db \ + TEST_DB_NAME=ricoh_dash \ + TEST_DB_USER=developer \ + TEST_DB_PASS=developer + RUN apt-get update && apt-get install -y git unzip gnupg RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - RUN apt-get install -y nodejs