Update of /var/cvs/Geeklog-2.x/Geeklog-2.x/system/DataAccess
In directory
iowaoutdoors:/tmp/cvs-serv18508/system/DataAccess
Modified Files:
PropelDAO.php
Log Message:
Fixed how we reference database so that the database name
can be change freely now.
Index: PropelDAO.php
============================================================
=======
RCS file:
/var/cvs/Geeklog-2.x/Geeklog-2.x/system/DataAccess/PropelDAO
.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PropelDAO.php 30 Apr 2006 03:52:03 -0000 1.5
--- PropelDAO.php 6 Jul 2006 14:53:57 -0000 1.6
***************
*** 13,17 ****
* Data Access Object
*/
! require_once 'system/DataAccess/DAOInterface.php';
/**
--- 13,17 ----
* Data Access Object
*/
! require $glConf['path_system'] .
'DataAccess/DAOInterface.php';
/**
***************
*** 44,52 ****
/**
! * Name of the database we are using
* var string
* access private
*/
! private $databaseName = null;
/**
--- 44,52 ----
/**
! * Name of the datasource we are using
* var string
* access private
*/
! private $datasourceName = 'Geeklog_2';
/**
***************
*** 87,97 ****
if (!empty($options['namedQueryFile'])) {
if (!file_exists($options['namedQueryFile'])) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('Invalid Named
Query File Given. Got: '
. $options['namedQueryFile']);
}
}
$this->namedQueryFile =
$options['namedQueryFile'];
- $this->databaseName = $options['databaseName'];
$this->domainObjectsPath =
$options['pathDomainObjects'];
}
--- 87,95 ----
if (!empty($options['namedQueryFile'])) {
if (!file_exists($options['namedQueryFile'])) {
! throw new Exception('Invalid Named Query
File Given. Got: '
. $options['namedQueryFile']);
}
}
$this->namedQueryFile =
$options['namedQueryFile'];
$this->domainObjectsPath =
$options['pathDomainObjects'];
}
***************
*** 107,113 ****
*
*/
! private function getDatabaseName()
{
! return $this->databaseName;
}
--- 105,111 ----
*
*/
! private function getDatasourceName()
{
! return $this->datasourceName;
}
***************
*** 127,131 ****
public function getConnection()
{
! $this->con =
Propel::getConnection($this->getDatabaseName());
return $this->con;
}
--- 125,129 ----
public function getConnection()
{
! $this->con =
Propel::getConnection($this->getDatasourceName());
return $this->con;
}
***************
*** 239,244 ****
{
if (!is_object($objToDelete)) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('You must provide a
valid Propel domain object');
}
--- 237,241 ----
{
if (!is_object($objToDelete)) {
! throw new Exception('You must provide a valid
Propel domain object');
}
***************
*** 278,283 ****
// Make sure we found the query
if (empty($this->queries[$queryName])) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception("Query name,
$queryName, not found in named query file,
$this->namedQueryFile");
}
--- 275,279 ----
// Make sure we found the query
if (empty($this->queries[$queryName])) {
! throw new Exception("Query name,
$queryName, not found in named query file,
$this->namedQueryFile");
}
***************
*** 342,347 ****
// Ensure arguments are in the right format
if (!empty($args) AND !is_array($args)) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('The find() method on the
DAO layer expects all SQL arguments
be wrapped up in an array');
}
--- 338,342 ----
// Ensure arguments are in the right format
if (!empty($args) AND !is_array($args)) {
! throw new Exception('The find() method on the DAO
layer expects all SQL arguments
be wrapped up in an array');
}
***************
*** 352,357 ****
// Make sure we found the query
if (empty($this->queries[$queryName])) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception("Query name,
$queryName, not found in named query file,
$this->namedQueryFile");
}
--- 347,351 ----
// Make sure we found the query
if (empty($this->queries[$queryName])) {
! throw new Exception("Query name,
$queryName, not found in named query file,
$this->namedQueryFile");
}
***************
*** 362,367 ****
// Ensure we got a valid Propel Peer name
if (!strstr($propelPeer,'Peer') and
empty($this->queries[$queryName]['columnArray'])) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('Invalid Propel Peer
name given. Please double check the named query file');
}
--- 356,360 ----
// Ensure we got a valid Propel Peer name
if (!strstr($propelPeer,'Peer') and
empty($this->queries[$queryName]['columnArray'])) {
! throw new Exception('Invalid Propel Peer name
given. Please double check the named query file');
}
***************
*** 369,374 ****
if ($propelPeer AND !class_exists($propelPeer)) {
$classToInclude =
str_replace('Peer','',$propelPeer);
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception("Commands or views
using PropelDAO are responsible for
including the classes they need. You forgot
to include $classToInclude");
}
--- 362,366 ----
if ($propelPeer AND !class_exists($propelPeer)) {
$classToInclude =
str_replace('Peer','',$propelPeer);
! throw new Exception("Commands or views
using PropelDAO are responsible for
including the classes they need. You forgot
to include $classToInclude");
}
***************
*** 446,451 ****
// Make sure we got something in the WHERE clause
if (count($whereArray) == 0) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('You did not pass
strictParams or looseParms. One of them
is required in order to run your
search');
}
--- 438,442 ----
// Make sure we got something in the WHERE clause
if (count($whereArray) == 0) {
! throw new Exception('You did not pass
strictParams or looseParms. One of them
is required in order to run your
search');
}
***************
*** 469,474 ****
// Make sure we found the query
if (empty($this->queries[$queryName])) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('Query name not
found in named query file');
}
--- 460,464 ----
// Make sure we found the query
if (empty($this->queries[$queryName])) {
! throw new Exception('Query name not found in
named query file');
}
***************
*** 478,483 ****
// Ensure we got a valid Propel Peer name
if (!strstr($propelPeer,'Peer') and
empty($this->queries[$queryName]['columnArray'])) {
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception('Invalid Propel Peer
name given. Please double check the named query file');
}
--- 468,472 ----
// Ensure we got a valid Propel Peer name
if (!strstr($propelPeer,'Peer') and
empty($this->queries[$queryName]['columnArray'])) {
! throw new Exception('Invalid Propel Peer name
given. Please double check the named query file');
}
***************
*** 485,490 ****
if ($propelPeer AND !class_exists($propelPeer)) {
$classToInclude =
str_replace('Peer','',$propelPeer);
! require_once 'PEAR/Exception.php';
! throw new PEAR_Exception("Commands or views
using PropelDAO are responsible for
including the classes they need. You forgot
to include $classToInclude");
}
--- 474,478 ----
if ($propelPeer AND !class_exists($propelPeer)) {
$classToInclude =
str_replace('Peer','',$propelPeer);
! throw new Exception("Commands or views
using PropelDAO are responsible for
including the classes they need. You forgot
to include $classToInclude");
}
_______________________________________________
geeklog2-cvs mailing list
geeklog2-cvs lists.geeklog.net
http://lists.geeklog.net/mailman/listinfo/geeklog2-cvs
|