[Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[149] trunk/0.3/cs_authToken.class.php
Status: Beta
Brought to you by:
crazedsanity
|
From: <cra...@us...> - 2009-09-10 17:39:14
|
Revision: 149
http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=149&view=rev
Author: crazedsanity
Date: 2009-09-10 17:39:07 +0000 (Thu, 10 Sep 2009)
Log Message:
-----------
If cs_authToken doesn't get a database object, throw an exception about it.
Modified Paths:
--------------
trunk/0.3/cs_authToken.class.php
Modified: trunk/0.3/cs_authToken.class.php
===================================================================
--- trunk/0.3/cs_authToken.class.php 2009-09-09 15:30:37 UTC (rev 148)
+++ trunk/0.3/cs_authToken.class.php 2009-09-10 17:39:07 UTC (rev 149)
@@ -32,16 +32,21 @@
*/
public function __construct(cs_phpDB $db) {
- if($db->is_connected()) {
- $this->db = $db;
+ if(is_object($db)) {
+ if($db->is_connected()) {
+ $this->db = $db;
+ }
+ else {
+ throw new exception(__METHOD__ .": database object not connected");
+ }
+ parent::__construct(true);
+
+ $upg = new cs_webdbupgrade(dirname(__FILE__) .'/VERSION', dirname(__FILE__) .'/upgrades/upgrade.xml');
+ $upg->check_versions(true);
}
else {
- throw new exception(__METHOD__ .": database object not connected");
+ throw new exception(__METHOD__ .": invalid database object (". $db .")");
}
- parent::__construct(true);
-
- $upg = new cs_webdbupgrade(dirname(__FILE__) .'/VERSION', dirname(__FILE__) .'/upgrades/upgrade.xml');
- $upg->check_versions(true);
}//end __construct()
//=========================================================================
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|