Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Candidate 1 #57

Merged
merged 64 commits into from
Jul 24, 2022
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5d2d5c5
MessageController in sitemap-menu-index as "contactus"
b23prodtm Nov 8, 2017
3aac2e8
.
b23prodtm Apr 11, 2018
12befa4
Update README.md (#24)
b23prodtm Apr 28, 2018
0924181
Markdown-plugin composer (#26)
b23prodtm Aug 20, 2018
08767f8
push build notification
b23prodtm Aug 20, 2018
2e73cb5
composer script
b23prodtm Aug 21, 2018
6e8639b
push build notification (#29)
b23prodtm Aug 21, 2018
372f2ee
proxy
b23prodtm Aug 21, 2018
1e42b75
Merge branch 'master-2' into feature/travis-build-patch
b23prodtm Sep 22, 2018
5dbb043
Coverity code scanner
b23prodtm Sep 22, 2018
44b4ca5
Coverity scan (#31)
b23prodtm Sep 23, 2018
2276911
Coverity scan (#32)
b23prodtm Nov 10, 2018
31967b6
a commit
b23prodtm Nov 10, 2018
44afc4e
Merge branch 'feature/travis-build-patch' of https://github.com/b23pr…
b23prodtm Nov 10, 2018
c14a29c
Bootstrap shell (darwin)
b23prodtm Nov 11, 2018
497feba
/TravisCI-OSX-PHP/build/ brew php@version
b23prodtm Nov 11, 2018
c0680aa
use dev branch
b23prodtm Nov 11, 2018
f97c4f9
.
b23prodtm Nov 11, 2018
6714e3a
Merge branch 'feature/travis-build-patch' into development
b23prodtm Nov 11, 2018
4297504
Badge
b23prodtm Nov 11, 2018
247d117
Use https for gitmodules !
b23prodtm Nov 11, 2018
65082ea
Feature/travis build patch (#30)
b23prodtm Nov 19, 2018
212a987
Merge branch 'development' into issue-4-contacts
b23prodtm Nov 19, 2018
bbdc9f2
Feature/patch travis composer (#34)
b23prodtm Nov 25, 2018
410fa14
Revert "Feature/patch travis composer (#34)" (#35)
b23prodtm Nov 25, 2018
cc53c1f
Feature/patch travis composer (#36)
b23prodtm Nov 25, 2018
3bf4053
Merge branch 'issue-4-contacts' into development
b23prodtm Nov 25, 2018
3f3a0ae
travis build stats
b23prodtm Nov 25, 2018
137c01a
app/webroot/php_cms/e13/etc/: No such file or directory
b23prodtm Nov 26, 2018
e94c362
Update .travis.yml
b23prodtm Nov 27, 2018
4bbb1df
Coverity Scan analysis selected for branch development.
b23prodtm Nov 27, 2018
7c94d43
Update .travis.yml
b23prodtm Nov 28, 2018
d72f271
Coveralls + Coverity Scan
b23prodtm Nov 28, 2018
68796be
mysql Test post commit hook
b23prodtm Nov 30, 2018
a4aac33
Hotfix/s2i openshift (#38)
b23prodtm Dec 3, 2018
15f44e3
Upload working docker image to Hub (#49)
b23prodtm Apr 30, 2020
a27c71e
Update php_cms
b23prodtm May 2, 2020
514551c
Update TravisCI-OSX-PHP
b23prodtm May 2, 2020
a1eef15
Update docker-compose.yml
b23prodtm May 6, 2020
2edbcdc
Hotfix/mariadb (#50)
b23prodtm May 6, 2020
3b99049
Fixes: .env files and auth_ed25519
b23prodtm May 6, 2020
b93c4b4
Update README.md
b23prodtm May 17, 2020
9db52df
Apply cakephp to docker-compose and kubernetes (#51)
b23prodtm Jul 2, 2020
38e8c14
armhf pushed ./mysqldb
b23prodtm Jul 8, 2020
889253a
Fixes: Apache Startup and IP binding (#52)
b23prodtm Feb 2, 2021
38dbe52
Fixes: Cake PHP routing from homepage (#53)
b23prodtm Feb 7, 2021
8c05453
Global routing and services (#55)
b23prodtm Jul 11, 2021
404b988
Quickstart README.md (#58)
b23prodtm Jul 11, 2021
61f682e
feature/article-model (#27)
b23prodtm Jul 11, 2021
79ce27e
Manage site Contacts/ with MessageController => CakePhp 2 formular vi…
b23prodtm Jul 11, 2021
1bd2543
Docker hub Checks
b23prodtm Jul 14, 2021
9a39643
Docker hub apache
b23prodtm Jul 14, 2021
87891a4
Switched to balena-cloud-apps
b23prodtm Jul 24, 2022
8886d1b
Merge remote-tracking branch 'origin/master' into development
b23prodtm Jul 24, 2022
1e350f1
Moved to standard
b23prodtm Jul 24, 2022
ace300c
migrate-databases help
b23prodtm Jul 24, 2022
b54f754
Update php-cms
b23prodtm Jul 24, 2022
0da4893
Workspace
b23prodtm Jul 24, 2022
df51dde
Workspace
b23prodtm Jul 24, 2022
d5f2696
Merge branch 'development' of https://github.com/b23prodtm/acake2php …
b23prodtm Jul 24, 2022
a7786fc
ShellCheck
b23prodtm Jul 24, 2022
8efe316
Fix webroot composer
b23prodtm Jul 24, 2022
eb37c39
Shellcheck
b23prodtm Jul 24, 2022
f3d67b4
Fix compose deps restore cached
b23prodtm Jul 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hotfix/s2i openshift (#38)
* database configuration
user passwords

* autoload.php

* post-commit hook issue
lib/cake/cache/Engine/FileEngine
Cache application directory
Cache long persist
file perms

* Markdown-plugin composer

* Merge branch 'feature/b23prodtm-markdown-patch-1' into openshift-publish

* composer

* Shell Test Script

* --openshift arg

*  How to fix up 'Database connection "Mysql" is missing, or could not be created' ?

* ERROR 1044 (42000) at line 1: Access denied for user 'test'@'localhost' 
to database 'cakephp_test2'

* migrate script and socket

* dollar-star shell

* openshift: no mysql identities to import

* usage of blank password

* 'MysqlCms' in 'app/Model/Datasource/Database'

* coverity_scan branch
b23prodtm authored Dec 3, 2018
commit a4aac3336c4e67de00184509a8b5d49ad1869edd
Binary file modified .DS_Store
Binary file not shown.
20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# User specific & automatically generated files #
#################################################
/app/Config/database.php*
/app/Config/database.sql*
/app/tmp
/app/Vendor/
!/app/Vendor/autoload.php
/app/webroot/e13/nbproject/private/
/app/tmp/cache/
/app/tmp/logs/
/app/tmp/persistent/
/app/tmp/sessions/
/app/webroot/php-cms/e13/nbproject/private/
!*empty
/lib/Cake/Console/Templates/skel/tmp/
/plugins
/vendor
@@ -10,7 +20,6 @@
/tags
*.mo
/bin/composer.phar
/app/Config/identities.sql*

# IDE and editor specific files #
#################################
@@ -30,12 +39,3 @@ Icon?
ehthumbs.db
Thumbs.db
/nbproject/private/
/app/Vendor/
!/app/Vendor/autoload.php
/app/webroot/e13/nbproject/private/
/app/tmp/cache/
/app/tmp/logs/
/app/tmp/persistent/
/app/tmp/sessions/
/app/webroot/php-cms/e13/nbproject/private/
!*empty
31 changes: 9 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -7,25 +7,19 @@ env:
matrix:
- DB=Mysql
global:
- TEST_MYSQL_SERVICE_HOST=127.0.0.1
- TEST_MYSQL_SERVICE_PORT=3306
- TEST_DATABASE_NAME=cakephp_test
- TEST_DATABASE_USER=root
- TEST_DATABASE_PASSWORD=
- PHPUNIT=4
- PHPCS=3
- COLLECT_COVERAGE=true
# The next declaration is the encrypted OC_SECRET, created
# via the "travis encrypt" command using the project repo's public key
- secure: "O+HejqZgXZFf0eD3GdvUwL2dsJsW+5biztfWYKHNfzv5u9j6Nn8JSoLdIp+Bg6Kct6kCJebM7oWHCh1fhyEm3AluusmqKHN8VKwQuINEZKAxPRFGl3NKkEU/Y95tHR3JIubZbZ0oZYmnl7z+YgVvM4LvmfvAwdpXzRt4SWOzGRWiL8uRaovOwW10HUB6qcO70Rn9XIHz4gUAoAEWQgSlJ4aNftu/lpuYs4P1r0+6fI/nfRRBMOogBQLEMqw6enPP+RrWx2pLwuxaQqChtk2td5PJdLiifW7C8SiAsljSgIRiaytAOgIs5KJsLGUdAPNXIMqUYFJ776J3L+ln8/nM/H8ARGB2P3smY5HM34/NrzUat2X/B6Uqg1F0Fs/794aomhaeqgh4b2MRI5srjQ/grNK61H1AftdR6JSLVjm6AUg743GQJF7sgNfK60n28EEZApAEzDS0v1PyU7U/HAZIalqWnttO0ycQyj2rf1XC++6BuTcRdmxx4dZoqZIn7xHzBQvi99ljv4JuwUgrNYXvcSEkXu6Y5GqMl2rtjxrdaGATpePuk1ju1kfB/7fQsR3ZZOaxULOSlQRcArsyseOtmEqQ1h5BVSmOGV+yoEboNm2FDZH/gD9ZZ7kTi+bk4bvHRZSD06JiDZ12W/JGsmU77phVIIWuUcXghEZf/WRjTe4="
- COLLECT_COVERAGE=false
- WEBHOOK_URL=https://discordapp.com/api/webhooks/479745392880386058/YOO7Nnn1IFWUtXX0n0qAZYeMDeV-SLa0lSzjGpNnKGTzG-xA0T3dplVGzSM4ObKLeMWg
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "4rmDT/vKTSi8AqI3afVUylayJ+SQbxblwlz/z81No4nLYWoy0dT61R/ZXq2Y29BE/HGEwx6r8Fl5RU6DxnmD7KhLC/3swHifzed690VDWyLii7cK8QkXVfLVVo8p+ozIwUrirnYFEkAcTfmkwJbmZN6DUuHJCl4x14NolR82VlJtFOVoWs63r+2NVJ5aM+63bkljkcW2U4xTt/8aOrCU/UapwqxC1GA0xPpwte6jPhzUjKXWbiknY+noUakM13x8SOkSRs3MTEf8J2va2T6DbVY3wy3x2Ytp4/KDwVNUrn/GKgBDRysP3jefO2d6XZJlb8OktJsrHdtWIZ+oYVwoy0PRV3vmdHs1NFUmYdQEe5UpiUKKyxWMsM+31to5ZUtJtn4kIlgzyo+xZu+LCgbOusJs33uPZODOON5fHcAoMp3AdAM0ResBfJdjzYEiewlcGYAcOoMX6DtopoJCoz+JxktdzXnjz89imNKMB2tjsRXuZMdE0WL3V2TSuOS5r8BwuuXXeul5vvE2EKHoIHgrP2nehz+q7dyC71m6jNrQX7x+xVg988vh0Fg8hyghLUzt9Myv4pvtQ/zQDbabKGtsakiHSvPTeHcb8mDhs62h5aIWUar8oXNuOWlk+hnyqZLmnbUPDcg54o567NursWYSWemAnPkPvSTfX0DQF1hDvSo="
# via the "travis encrypt" command using the project repo's public key
- secure: "C39DQ1zYpSAOy33Sb8NP89o6k4HUnjHnQ+bQkgbo3WH7WtiN76dGeO9jm1DjMn5np6oKbDi41/fxonaTUIjb9YMksG2YB+NBDYXHyV1H7/xAeC6uTxwUObrLXh8aOUwiiuLPllMdtOLX8JSPxl1Ixc6KyeFywPiMvwuOe4QZW6sVG4sqhZC/UUycYKRSMaOthtuTDPYKjBLaDPiEzkUmdBIo9IhAsidEFAHj4jEmw9gBtac0B2x7GbvvoDivdH3KdNSoPt2SkD0RLX51Qf7AYeAV4fw65cuCp/Aat/uk55x3lN5g18Ww9khY/cFSwPC0JXGQnnJvdcDP2diZNkqE41Yc/Mw3xwfrvp3/v8js3VIBzsGINKiSdXZ/yXqI9iRzvzlfmXRHvd4sFXRzUpi8ZB4PXaboMndbNRoh4PcoRNFtXhyebQCEgZv2x3oiKXw38WT5cga03uMH4E5z5afS3n7NP1tsuiNWd499dJzAkW8OPeLDPqY3a/b5qLeZIK1bo23mvCjPtbm+B2g2QocKcd1oQ+XANCyuT3M/+AIypdMabGOSon2fDKrUUN+SqIX4FcYaHi1sG3qUp23870u9YcT4hK2LCKBcBPkFpxqEZLwdHbJmjHPo6uRyAKOD7r/k1DtIRqkcJ+5BpU4emo6rM9rdh5mWjLtK7vdY8Y/tvP8="

addons:
coverity_scan:
project:
name: "b23prodtm/myphpcms"
description: "This PHP CMS is featuring well-known functionalities as cool as posting some web contents with pictures stored in a database. Developer Note : This is the Cake PHP cartridge repository. A submodule is included in app/webroot."
notification_email: b23prodtm@users.sourceforge.net
build_command_prepend: ./configure.sh "-c" "-h" "-p" "pass" "-s" "word" "--mig-database" "-y" && .travis/configure.sh
build_command: ./test-cake.sh --cov | grep Test
@@ -97,14 +91,7 @@ script:
after_script:
- if [[ ("${COLLECT_COVERAGE}" == "true") && ("${COVERITY_SCAN_BRANCH}" != 1) ]]; then travis_retry php app/vendor/bin/php-coveralls -v -r ./app/; fi

# Openshift webhook notifies that a new build version is available
# $OC_SECRET is obtained from an Openshift Console and set secret environment variable
notifications:
email: false
webhooks:
urls:
- http://api.starter-us-west-1.openshift.com:443/oapi/v1/namespaces/e14/buildconfigs/cakephp-mysql-persistent/webhooks/$OC_SECRET/generic
- https://webhook-proxy-e14.a3c1.starter-us-west-1.openshiftapps.com/travis-ci/api.starter-us-west-1.openshift.com:443/e14/cakephp-mysql-persistent/webhooks/$OC_SECRET/generic
on_success: always
on_failure: never
on_start: never # default: always
after_success:
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
45 changes: 28 additions & 17 deletions .travis/configure.sh
Original file line number Diff line number Diff line change
@@ -2,18 +2,29 @@
echo -e "
Set of default environment
==========================
Find exports for local development phase only in './Scripts/bootargs.sh')
Find exports for local development phase (testing) only in './Scripts/bootargs.sh')
";
echo -e "
Documented VARIABLES
TRAVIS_OS_NAME: os: ['osx','linux'] in .travis.yml
TRAVIS_PHP_VERSION : php: <version> in .travis.yml
Documented VARIABLES in .travis.yml
TRAVIS_OS_NAME: os: ['osx','linux']
TRAVIS_PHP_VERSION : php: <version>
DB=['Mysql', 'Pgsql', 'Sqlite']

optional environment VARIABLES
Required VARIABLES in .travis.yml or Pod environment
DATABASE_USER: <rw-user>
DATABASE_PASSWORD: <user-password>
TEST_DATABASE_USER: <database-rw-user>
TEST_DATABASE_PASSWORD: <user-password>
if [ DB='Mysql' ]; then
TEST_MYSQL_SERVICE_HOST: <mysql-host>
else if [ DB='pgsql' ]; then
TEST_POSTGRES_SERVICE_HOST: <postgres-host>
fi
optional environment VARIABLES in .travis.yml
ADDITIONAL_PHP_INI='path to a php.ini settings file'
==========================
";
[ ! -z $TEST_DATABASE_USER ] && [ ! -z $TEST_DATABASE_PASSWORD ] && [[ (! -z $TEST_MYSQL_SERVICE_HOST) || (! -z $TEST_POSTGRES_SERVICE_HOST) ]] || echo "Missing VARIABLES. Please review your settings !"
php bin/composer.phar install --no-interaction
if [ ! -z "${ADDITIONAL_PHP_INI}" ]; then /usr/bin/env bash .travis/TravisCI-OSX-PHP/build/custom_php_ini.sh; fi
mkdir -p build/logs
@@ -25,9 +36,9 @@ if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
sudo locale-gen de_DE
sudo locale-gen es_ES
fi
if [[ ${DB} == 'Mysql' ]]; then mysql -e 'CREATE DATABASE IF NOT EXISTS cakephp_test;' -u $TEST_DATABASE_USER --password=$TEST_DATABASE_PASSWORD; fi
if [[ ${DB} == 'Mysql' ]]; then mysql -e 'CREATE DATABASE IF NOT EXISTS cakephp_test2;' -u $TEST_DATABASE_USER --password=$TEST_DATABASE_PASSWORD; fi
if [[ ${DB} == 'Mysql' ]]; then mysql -e 'CREATE DATABASE IF NOT EXISTS cakephp_test3;' -u $TEST_DATABASE_USER --password=$TEST_DATABASE_PASSWORD; fi
if [[ ${DB} == 'Mysql' ]]; then mysql -v -e 'CREATE DATABASE IF NOT EXISTS cakephp_test;' -u ${DATABASE_USER} --password=${DATABASE_PASSWORD}; fi
if [[ ${DB} == 'Mysql' ]]; then mysql -v -e 'CREATE DATABASE IF NOT EXISTS cakephp_test2;' -u ${DATABASE_USER} --password=${DATABASE_PASSWORD}; fi
if [[ ${DB} == 'Mysql' ]]; then mysql -v -e 'CREATE DATABASE IF NOT EXISTS cakephp_test3;' -u ${DATABASE_USER} --password=${DATABASE_PASSWORD}; fi
if [[ ${DB} == 'Pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
if [[ ${DB} == 'Pgsql' ]]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi
if [[ ${DB} == 'Pgsql' ]]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi
@@ -46,15 +57,15 @@ echo "<?php
class DATABASE_CONFIG {
private \$identities = array(
'Mysql' => array(
'datasource' => 'Database/Mysql',
'host' => '127.0.0.1',
'login' => 'root',
'password' => '${SQL_PASSWORD}'
'datasource' => 'Database/MysqlCms',
'host' => '${TEST_MYSQL_SERVICE_HOST}',
'login' => '${TEST_DATABASE_USER}',
'password' => '${TEST_DATABASE_PASSWORD}'
),
'Pgsql' => array(
'datasource' => 'Database/Postgres',
'host' => '127.0.0.1',
'login' => 'postgres',
'datasource' => 'Database/PostgresCms',
'host' => '${TEST_POSTGRES_SERVICE_HOST}',
'login' => '${TEST_DATABASE_USER}',
'database' => 'cakephp_test',
'schema' => array(
'default' => 'public',
@@ -64,7 +75,7 @@ echo "<?php
)
),
'Sqlite' => array(
'datasource' => 'Database/Sqlite',
'datasource' => 'Database/SqliteCms',
'database' => array(
'default' => ':memory:',
'test' => ':memory:',
@@ -122,4 +133,4 @@ echo "<?php
}
}
}" > app/Config/database.php
echo -e "{green}Unit Test was set up in app/Config/database.php{nc}"
echo -e "${green}Unit Test was set up in app/Config/database.php${nc}"
119 changes: 90 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -49,17 +49,49 @@ This repository is compatible with PHP 5.6 and higher, excluding any alpha or be

Open a Terminal window:

./start_cake.sh
./start_cake.sh <options>

>Ctrl-click the URLs to open them in the browser.
### PHP Unit Test

Open a Terminal window:

./test_cake.sh -p <sql-password>
./test-cake.sh -p=<sql-password>

See [below](#common-issues) to allow access on the built-in local server.

### Server-side environment

When deployment happens on server-side or is triggered by a git push event, 'source-to-image (s2i)', the httpd-server or pod needs proper environment variables to be set ready. Otherwise the scripts will fail with an error state, unable to connect to the database

The following variables must be set up as server environment, provided by your **database administrator**:

# Sqlite_cms, Postgres_cms
DATABASE_ENGINE:Mysql_cms
DATABASE_NAME:default
DATABASE_SERVICE_NAME:mysql
# a host alias or IP address
MYSQL_SERVICE_HOST:mysql

>Note: Prefixed with *TEST_* they are used by the index.php?test=1 URLs and ./test-cake.sh (also in post git commit to test)

The following additional variables must be set up as server secrets environment, provided by your database administrator:

#(optional)
WEBHOOK_URL:<discordapp-url>
# Persistent connection credentials
DATABASE_USER:<provided-user>
DATABASE_PASSWORD:<provided-password>
# Just add TEST_DATABASE_USER and TEST_DATABASE_PASSWORD
TEST_DATABASE_USER:<test-user>
TEST_DATABASE_PASSWORD:<test-password>
# CakePHP generated
CAKEPHP_SECRET_TOKEN:<secret-token>
CAKEPHP_SECRET_SQLT:<secret-salt>
CAKEPHP_SECURITY_CIPHER_SEED:<cipher-seed>
# Generated by ./configure.sh -h
GET_HASH_PASSWORD:<hashed-password>

### Common Issues

1. How to fix the following error?
@@ -74,7 +106,7 @@ Try the following to migrate (update) all database tables, answer 'y' when promp

./migrate-database.sh -u

2. ACCESS DENIED to user appears with other information complaining about database connection, what does that mean ?
2. ACCESS DENIED appears with other information complaining about database connection, what does that mean ?

You probably have modified user privileges on your server:

@@ -87,7 +119,13 @@ You probably have modified user privileges on your server:
This will reset the connection profile in ..etc/ properties file with the template.
More about environment variables are located in the remote pod (OpenShift) settings and locally in ./Scripts/bootargs.sh.

3. ACCESS DENIED for root@'127.0.0.1' appears with other information complaining about database connection, what does that mean ?
>Note:

./configure.sh --mig-database -i -p -t

to do a reset with environment root and user password.

3. ACCESS DENIED for root@'127.0.0.1' or root@'localhost' appears with other information complaining about database connection, what does that mean ?

This looks like a first installation of mysql. You have to secure or reset your mysql root access:

@@ -97,8 +135,8 @@ This looks like a first installation of mysql. You have to secure or reset your
[Note] A temporary password is generated for root@localhost. Now import identities.

brew services restart mysql@5.7
./migrate-database.sh -Y -i
<temporary password>
./migrate-database.sh -y -i -p=<root-password>
./test-cake.sh -t=<test-password>

4. My mysql server's upgraded to another version, what should I do ?

@@ -116,18 +154,17 @@ Answer 'y' when prompted.

5. How to fix up 'Database connection "Mysql" is missing, or could not be created' ?

Check your environment variable (./Scripts/bootargs.sh or Docker/Pod settings), case-sensitive !:
Log in with root privileges should work:

TEST_DATABASE_NAME=cakephp_test
TEST_DATABASE_USER=test
TEST_DATABASE_PASSWORD=<password>
TEST_DATABASE_SERVICE_NAME=Mysql
TEST_DATABASE_Mysql_HOST=localhost or mysql on OpenShift
TEST_DATABASE_Mysql_PORT=3306
mysql -u root --password=<password> cakephp_test

Log in with authorized privileges from a shell prompt:
Check your environment variable (./Scripts/bootargs.sh or Docker/Pod settings)

mysql -u root --password=<password> cakephp_test
MYSQL_SERVICE_HOST=localhost
or
MYSQL_SERVICE_HOST=127.0.0.1

Use one or the other, and see which works for you.

6. How to fix up ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) ?

@@ -147,25 +184,49 @@ Answer 'y' when prompted.

8. I cannot upload any picture, why ?

The Mysql.php Datasource must define binary and mediumbinary storage types. Please check the file __lib/Cake/Model/Datasource/Mysql.php__, if you experienced the following error:
The Mysql.php Datasource must define binary and mediumbinary storage types. Please look at the file __app/Model/Datasource/Mysql_cms.php__ if it exists and if you experienced the following error:

errno : 1054
sqlstate : 42S22
error : Unknown column 'image' in 'field list'

Add the *__mediumbinary__* storage:

>public $columns = array(...)

'mediumbinary' => array('name' => 'mediumblob'),

>public function column($real){...}, at line 814:

if (strpos($col, 'mediumblob') !== false || $col === 'mediumbinary') {
return 'mediumbinary';
}

Update database schema:
Add the *__mediumbinary__* storage, extending the original Datasource class:

```<?php
App::uses('Mysql', 'Model/Datasource/Database');

class Mysql_cms extends Mysql
{
public function __construct()
{
parent::__construct();
$this->columns['mediumbinary'] = array('name' => 'mediumblob');
}

/**
* Converts database-layer column types to basic types
*
* @param string $real Real database-layer column type (i.e. "varchar(255)")
* @return string Abstract column type (i.e. "string")
*/
public function column($real) {
$s = parent::column($real);
if($s === "text") {
$col = str_replace(')', '', $real);
$limit = $this->length($real);
if (strpos($col, '(') !== false) {
list($col, $vals) = explode('(', $col);
}
if (strpos($col, 'mediumblob') !== false || $col === 'mediumbinary') {
return 'mediumbinary';
}
}
return $s;
}
}
?>
```
Ensure it is set as DATABASE_ENGINE in __app/Config/database.cms.php__, __./Scripts/bootargs.sh__, __.travis.yml__ and update the database schema:

./migrate-database.sh -u

Loading