diff --git a/app/config/database.php.default b/app/config/database.php.default index 0aaa75939..d65e246de 100644 --- a/app/config/database.php.default +++ b/app/config/database.php.default @@ -38,27 +38,40 @@ * @subpackage cake.config */ + /** * Database configuration class. * You can specify multiple configurations for production, development and testing. + * + * driver => + * mysql, postgres, sqlite, adodb-drivername, pear-drivername + * + * connect => + * MySQL set the connect to either mysql_pconnect of mysql_connect + * PostgreSQL set the connect to either pg_pconnect of pg_connect + * SQLite set the connect to sqlite_popen sqlite_open + * + * host => + * the host you connect to the database + * MySQL 'localhost' to add a port number use 'localhost:port#' + * PostgreSQL 'localhost' to add a port number use 'localhost port=5432' + * */ class DATABASE_CONFIG { - var $default = array( - 'driver' => 'mysql', - 'host' => 'localhost', - 'login' => 'www', - 'password' => '', - 'database' => 'project_name' - ); + var $default = array('driver' => 'mysql', + 'connect' => 'mysql_pconnect', + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'project_name' ); - var $test = array( - 'driver' => 'mysql', - 'host' => 'localhost', - 'login' => 'www-test', - 'password' => '', - 'database' => 'project_name-test' - ); + var $test = array('driver' => 'mysql', + 'connect' => 'mysql_pconnect', + 'host' => 'localhost', + 'login' => 'user', + 'password' => 'password', + 'database' => 'project_name-test'); } ?> \ No newline at end of file diff --git a/cake/libs/controller/scaffold.php b/cake/libs/controller/scaffold.php index be47961a0..0ad8f4afb 100644 --- a/cake/libs/controller/scaffold.php +++ b/cake/libs/controller/scaffold.php @@ -387,7 +387,7 @@ class Scaffold extends Object { $this->controllerClass->params['data'][$modelKey][$field['name'].'_month'], $this->controllerClass->params['data'][$modelKey][$field['name'].'_day'], $this->controllerClass->params['data'][$modelKey][$field['name'].'_year'] ); - $newDate = date( 'Y-m-d', $newDate ); + $newDate = date( 'Y-m-d H:i:s', $newDate ); $this->controllerClass->params['data'][$modelKey][$field['name']] = $newDate; } else if( 'tinyint(1)' == $field['type'] ) diff --git a/cake/libs/model/dbo/dbo_mysql.php b/cake/libs/model/dbo/dbo_mysql.php index ed10bbe91..fe86d52d7 100644 --- a/cake/libs/model/dbo/dbo_mysql.php +++ b/cake/libs/model/dbo/dbo_mysql.php @@ -60,7 +60,7 @@ class DBO_MySQL extends DBO if ($config) { $this->config = $config; - $this->_conn = mysql_pconnect($config['host'],$config['login'],$config['password']); + $this->_conn = $config['connect']($config['host'],$config['login'],$config['password']); } $this->connected = $this->_conn? true: false; diff --git a/cake/libs/model/dbo/dbo_postgres.php b/cake/libs/model/dbo/dbo_postgres.php index 6ce38ef9f..cbcf62d60 100644 --- a/cake/libs/model/dbo/dbo_postgres.php +++ b/cake/libs/model/dbo/dbo_postgres.php @@ -59,7 +59,7 @@ class DBO_Postgres extends DBO if ($config) { $this->config = $config; - $this->_conn = pg_pconnect("host={$config['host']} dbname={$config['database']} user={$config['login']} password={$config['password']}"); + $this->_conn = $config['connect']("host={$config['host']} dbname={$config['database']} user={$config['login']} password={$config['password']}"); } $this->connected = $this->_conn? true: false; diff --git a/cake/libs/model/dbo/dbo_sqlite.php b/cake/libs/model/dbo/dbo_sqlite.php index 75fed5882..b800c9700 100644 --- a/cake/libs/model/dbo/dbo_sqlite.php +++ b/cake/libs/model/dbo/dbo_sqlite.php @@ -59,7 +59,7 @@ class DBO_SQLite extends DBO if ($config) { $this->config = $config; - $this->_conn = sqlite_open($config['file']); + $this->_conn = $config['connect']($config['file']); } $this->connected = $this->_conn? true: false; diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php index 5232c609e..ae97d1b11 100644 --- a/cake/libs/view/helpers/html.php +++ b/cake/libs/view/helpers/html.php @@ -504,8 +504,7 @@ class HtmlHelper extends Helper { $out[] = sprintf($this->tags['tableheader'], $this->parseHtmlOptions($th_options), $arg); } - - return sprintf($this->tags['tableheader'], $this->parseHtmlOptions($tr_options), join(' ', $out)); + return sprintf($this->tags['tablerow'], $this->parseHtmlOptions($tr_options), join(' ', $out)); }