From 0b8c2998bda6733d66749d1df4f59f879c5bfacb Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 21 Dec 2005 18:48:36 +0000 Subject: DbFile property is now optional. --- framework/Data/TSqliteCache.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'framework/Data') diff --git a/framework/Data/TSqliteCache.php b/framework/Data/TSqliteCache.php index 2abffa78..8425ccf1 100644 --- a/framework/Data/TSqliteCache.php +++ b/framework/Data/TSqliteCache.php @@ -15,10 +15,11 @@ * * TSqliteCache implements a cache application module based on SQLite database. * - * The database file is specified by the DbFile property. This property must - * be set before {@link init} is invoked. If the specified database file does not - * exist, it will be created automatically. Make sure the directory containing - * the specified DB file and the file itself must be writable by the Web server process. + * The database file is specified by the {@link setDbFile DbFile} property. + * If not set, the database file will be created under the system state path. + * If the specified database file does not exist, it will be created automatically. + * Make sure the directory containing the specified DB file and the file itself is + * writable by the Web server process. * * The following basic cache operations are implemented: * - {@link get} : retrieve the value with a key (if any) from cache @@ -120,7 +121,7 @@ class TSqliteCache extends TModule implements ICache if(!function_exists('sqlite_open')) throw new TConfigurationException('sqlitecache_extension_required'); if($this->_file===null) - throw new TConfigurationException('sqlitecache_dbfile_required'); + $this->_file=$application->getStatePath().'/sqlite.cache'; $error=''; if(($this->_db=new SQLiteDatabase($this->_file,0666,$error))===false) throw new TConfigurationException('sqlitecache_connection_failed',$error); -- cgit v1.2.3