From 4416943e5d682c212b7a15b2f71d9b6c5d3f3e1f Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 23 Feb 2006 06:14:27 +0000 Subject: Fixing #65 --- framework/DataAccess/TAdodbProvider.php | 9 +++++---- framework/Web/UI/WebControls/TDatePicker.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'framework') diff --git a/framework/DataAccess/TAdodbProvider.php b/framework/DataAccess/TAdodbProvider.php index 9c63b20b..d4b6cf30 100644 --- a/framework/DataAccess/TAdodbProvider.php +++ b/framework/DataAccess/TAdodbProvider.php @@ -30,7 +30,7 @@ class TAdodbProvider extends TDatabaseProvider private $_cachedir=''; private $_fetchMode = 'associative'; - private $_hasImported=false; + private static $_hasImported=false; private $_adodbLibrary=''; @@ -62,16 +62,16 @@ class TAdodbProvider extends TDatabaseProvider public function setAdodbLibrary($path) { - $this->_adodbLibrary = $path; + $this->_adodbLibrary = Prado::getPathOfNamespace($path); } public function importAdodbLibrary() { - if(!$this->_hasImported || !class_exists('ADONewConnection')) + if(!self::$_hasImported) { require($this->getAdodbLibrary().'/adodb-exceptions.inc.php'); require($this->getAdodbLibrary().'/adodb.inc.php'); - $this->_hasImported = true; + self::$_hasImported = true; } } @@ -250,6 +250,7 @@ class TAdodbConnection extends TDbConnection if($this->getIsClosed()) { $provider = $this->getProvider(); + $provider->importAdodbLibrary(); if(strlen($provider->getConnectionString()) < 1) { if(strlen($provider->getDriver()) < 1) diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 8d4de13e..929ee297 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -224,7 +224,7 @@ class TDatePicker extends TTextBox */ public function setUpToYear($value) { - $this-setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))+10); + $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))+10); } /** -- cgit v1.2.3