Author: phpnut
Date: 4:50:40 AM, Monday, October 24, 2005
Message:
Adding comment to doc block with possible settings for the driver configuration

[1191]
Author: phpnut
Date: 4:37:46 AM, Monday, October 24, 2005
Message:
Adding configuration setting in database.php to set the type of connection you want to use.
Read the comments in the doc block to explain how to set the connection type.
doc block also has information on setting the port to connect to.
Corrected Html::tableHeaders();
Closing Ticket #98 and Ticket #26

[1190]
Author: phpnut
Date: 3:25:00 AM, Monday, October 24, 2005
Message:
Fix for Ticket #36  


git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1193 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-10-24 09:54:24 +00:00
parent 2acd3acbf6
commit e2815b4a5c
6 changed files with 32 additions and 20 deletions

View file

@ -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');
}
?>

View file

@ -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'] )

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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));
}