summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2005-12-21 18:48:36 +0000
committerxue <>2005-12-21 18:48:36 +0000
commit0b8c2998bda6733d66749d1df4f59f879c5bfacb (patch)
tree4716292afbc3614f29bfea6616ff6444529e082b
parente08aa82e5e4d2bc06bb8f98654806a15bdefc994 (diff)
DbFile property is now optional.
-rw-r--r--framework/Data/TSqliteCache.php11
1 files changed, 6 insertions, 5 deletions
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);