From 518b705fe886259bb0e4b597b64a3843f2c0ece5 Mon Sep 17 00:00:00 2001 From: Arel Sirin Date: Fri, 9 Oct 2020 09:01:51 -0500 Subject: [PATCH] docs: XAMPP documentation update and db configuration enhancement --- .env.example | 1 + config/database.php | 1 + config/ohanzee-db.php | 1 + docs/development-and-code/setup_alternatives/xampp.md | 5 +++++ phinx.php | 1 + 5 files changed, 9 insertions(+) diff --git a/.env.example b/.env.example index eede7aed6b..a7ba362834 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,7 @@ DB_PORT=3306 DB_DATABASE=ushahidi DB_USERNAME=homestead DB_PASSWORD=secret +DB_SOCKET= CACHE_DRIVER=memcached QUEUE_DRIVER=sync diff --git a/config/database.php b/config/database.php index 64a25cd58a..65a8266425 100644 --- a/config/database.php +++ b/config/database.php @@ -75,6 +75,7 @@ 'prefix' => env('DB_PREFIX', ''), 'timezone' => env('DB_TIMEZONE', '+00:00'), 'strict' => env('DB_STRICT_MODE', true), + 'socket' => env('DB_SOCKET', '') ], 'pgsql' => [ diff --git a/config/ohanzee-db.php b/config/ohanzee-db.php index b06f8d5fd9..8cacc09df6 100644 --- a/config/ohanzee-db.php +++ b/config/ohanzee-db.php @@ -27,6 +27,7 @@ 'database' => getenv('DB_DATABASE'), 'username' => getenv('DB_USERNAME'), 'password' => getenv('DB_PASSWORD'), + 'port' => getenv('DB_PORT'), 'persistent' => false, ], 'table_prefix' => '', diff --git a/docs/development-and-code/setup_alternatives/xampp.md b/docs/development-and-code/setup_alternatives/xampp.md index c5fba0e08b..e02a889b6f 100644 --- a/docs/development-and-code/setup_alternatives/xampp.md +++ b/docs/development-and-code/setup_alternatives/xampp.md @@ -148,6 +148,11 @@ On Windows File Explorer, the default is to hide the extension of the files \(th * Change the `DB_USER` to `root` * Change the `DB_PASSWORD` to be empty, so literally: `DB_PASSWORD=` * Change the `DB_DATABASE` to `platform` + +{% hint style="info" %} +Hint: If you are running MySQL in a non-default port (different to 3306, the default one), you may also want to change `DB_PORT` to the port you are using. Also, if you need to specify a certain socket for db connection, you can do it by adding `DB_SOCKET` with the corresponding socket path. +{% endhint %} + * Run `composer install`. Wait while composer installs all the dependencies * Run `composer migrate` to run the database migrations. * This will create all the necessary tables and a default `admin` user with password `administrator` diff --git a/phinx.php b/phinx.php index 62a7fa5da1..4840be378e 100644 --- a/phinx.php +++ b/phinx.php @@ -22,6 +22,7 @@ 'name' => getenv('DB_DATABASE'), 'user' => getenv('DB_USERNAME'), 'pass' => getenv('DB_PASSWORD'), + 'unix_socket' => getenv('DB_SOCKET'), 'charset' => 'utf8', ], ]