Skip to content

Commit

Permalink
'MysqlCms' in 'app/Model/Datasource/Database'
Browse files Browse the repository at this point in the history
  • Loading branch information
b23prodtm committed Dec 2, 2018
1 parent e459e2a commit aa8a1cb
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .travis/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ echo "<?php
class DATABASE_CONFIG {
private \$identities = array(
'Mysql' => array(
'datasource' => 'Database/Mysql',
'datasource' => 'Database/MysqlCms',
'host' => '${TEST_MYSQL_SERVICE_HOST}',
'login' => '${TEST_DATABASE_USER}',
'password' => '${TEST_DATABASE_PASSWORD}'
),
'Pgsql' => array(
'datasource' => 'Database/Postgres',
'datasource' => 'Database/PostgresCms',
'host' => '${TEST_POSTGRES_SERVICE_HOST}',
'login' => '${TEST_DATABASE_USER}',
'database' => 'cakephp_test',
Expand All @@ -75,7 +75,7 @@ echo "<?php
)
),
'Sqlite' => array(
'datasource' => 'Database/Sqlite',
'datasource' => 'Database/SqliteCms',
'database' => array(
'default' => ':memory:',
'test' => ':memory:',
Expand Down
3 changes: 1 addition & 2 deletions app/Config/boot_profile.cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
and is even quicker than a semantically equal self-defined autoload function like this one
*/
App::build(array(
'Cms' => array(WWW_ROOT . 'php_cms' . DS . 'e13' . DS . 'include' . DS),
'Model/Datasource/Database' => array(APP . 'Model' . DS . 'Datasource' . DS . 'Database')
'Cms' => array(WWW_ROOT . 'php_cms' . DS . 'e13' . DS . 'include' . DS)
), App::REGISTER);
/**
* Load DebugKit plugin
Expand Down
4 changes: 2 additions & 2 deletions app/Config/database.cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class DATABASE_CONFIG {

public $default = array(
# this is an extended Mysql database (providing blob-binary storage)
'datasource' => 'Database/Mysql_cms',
'datasource' => 'Database/MysqlCms',
'persistent' => false,
//'host' => 'localhost',
'host' => '127.0.0.1',
Expand All @@ -81,7 +81,7 @@ class DATABASE_CONFIG {
'encoding' => 'utf8',
);
public $test = array(
'datasource' => 'Database/Mysql_cms',
'datasource' => 'Database/MysqlCms',
'persistent' => false,
//'host' => 'localhost',
'host' => '127.0.0.1',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
App::uses('Mysql', 'Model/Datasource/Database');

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

Expand Down
11 changes: 11 additions & 0 deletions app/Model/Datasource/Database/PostgresCms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
App::uses('Postgres', 'Model/Datasource/Database');

class PostgresCms extends Postgres
{
public function __construct($config = null, $autoConnect = true) {
parent::__construct($config, $autoConnect);
$this->columns['mediumbinary'] = array('name' => 'bytea');
}
}
?>
12 changes: 0 additions & 12 deletions app/Model/Datasource/Database/Postgres_cms.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php
App::uses('Postgresql', 'Model/Datasource/Database');

class Sqlite_cms extends Sqlite
class SqliteCms extends Sqlite
{
public function __construct()
{
parent::__construct();
public function __construct($config = null, $autoConnect = true) {
parent::__construct($config, $autoConnect);
$this->columns['mediumbinary'] = array('name' => 'bytea');
}

Expand Down
15 changes: 0 additions & 15 deletions migrate-database.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
#!/bin/bash
# HOWTO: connect to the database, a mysql56+ server (must match remote server version)
# must be reachable locally. If it's the 1st time you use this connection,
# Configure it by logging in with shell:$ mysql -u root
# Then execute this SQL statements : create database DATABASE_NAME; # NO QUOTES ''
# use database DATABASE_NAME;
# create user 'DATABASE_USER'@'localhost'
# identified by 'DATABASE_PASSWORD';
# The values of CakePHP DB VARIABLES available at app/Config/database.php.
# Don't forget to grant all privileges to 'DATABASE_USER'@'localhost' e.g.:
# GRANT ALL ON phpcms.* to 'test'@'localhost' identified by 'mypassword';
#;
#; Pass as arguments values "[-y|n|u]" to override user prompt, if you're in "nutshell".
#; y fixup socket
#; u fixup socket and update schema (must connect successsfully)
#;
set -e
source ./Scripts/lib/shell_prompt.sh
source ./Scripts/lib/parsing.sh
Expand Down
2 changes: 1 addition & 1 deletion test-cake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ while [[ "$#" > 0 ]]; do case $1 in
export TRAVIS_PHP_VERSION=$(php -v | grep -E "[5-7]\.\\d+\.\\d+" | cut -d " " -f 2 | cut -c 1-3
)
# remote servers CI don't need (-i) identities but the socket: use configure.sh --mig-database --openshift
notice="\n${cyan}Notice:${nc}The test script is about to modify the root and test users password to, resp. ${orange}'proot'${nc} and ${cyan}'ptest'${nc}\n"
notice="\n${cyan}Notice:${nc}The test script is about to modify the root and test users password into resp. ${orange}'proot'${nc} and ${cyan}'ptest'${nc}\n"
echo -e $notice
source ./configure.sh "--mig-database" "-p" "-t" "-i" "-p=proot" "-t=ptest"
echo -e $notice
Expand Down

0 comments on commit aa8a1cb

Please sign in to comment.