Some SQLite cleanups.

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@262 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
brego 2005-06-21 17:06:54 +00:00
parent 34a4490f74
commit 5f0e5a1c59

View file

@ -45,7 +45,7 @@ class DBO_SQLite extends DBO
{
/**
* Connects to the database using config['host'] as a filename.
* Connects to the database using config['file'] as a filename.
*
* @param array $config Configuration array for connecting
* @return mixed
@ -55,15 +55,19 @@ class DBO_SQLite extends DBO
if ($config)
{
$this->config = $config;
$this->_conn = sqlite_open($config['host']);
$this->_conn = sqlite_open($config['file']);
}
$this->connected = $this->_conn? true: false;
if($this->connected)
{
return $this->_conn;
}
else
{
die('Could not connect to DB.');
}
}
/**
* Disconnects from database.
@ -133,7 +137,9 @@ class DBO_SQLite extends DBO
$cols = sqlite_fetch_column_types($table_name, $this->_conn, SQLITE_ASSOC);
foreach ($cols as $column => $type)
{
$fields[] = array('name'=>$column, 'type'=>$type);
}
return $fields;
}