TConfigurationException

Description

TSqliteCache requires SQLite PHP extension.

Source File

/framework/Caching/TSqliteCache.php (119)

0108:      * This method is required by the IModule interface. It checks if the DbFile
0109:      * property is set, and creates a SQLiteDatabase instance for it.
0110:      * The database or the cache table does not exist, they will be created.
0111:      * Expired values are also deleted.
0112:      * @param TXmlElement configuration for this module, can be null
0113:      * @throws TConfigurationException if sqlite extension is not installed,
0114:      *         DbFile is set invalid, or any error happens during creating database or cache table.
0115:      */
0116:     public function init($config)
0117:     {
0118:         if(!function_exists('sqlite_open'))
0119: throw new TConfigurationException('sqlitecache_extension_required');
0120: if($this->_file===null) 0121: $this->_file=$this->getApplication()->getRuntimePath().'/sqlite.cache'; 0122: $error=''; 0123: if(($this->_db=new SQLiteDatabase($this->_file,0666,$error))===false) 0124: throw new TConfigurationException('sqlitecache_connection_failed',$error); 0125: if(@$this->_db->query('DELETE FROM '.self::CACHE_TABLE.' WHERE expire<>0 AND expire<'.time())===false) 0126: { 0127: if($this->_db->query('CREATE TABLE '.self::CACHE_TABLE.' (key CHAR(128) PRIMARY KEY, value BLOB, expire INT)')===false) 0128: throw new TConfigurationException('sqlitecache_table_creation_failed',sqlite_error_string(sqlite_last_error())); 0129: } 0130: $this->_initialized=true; 0131: parent::init($config);

Stack Trace

#0 /framework/pradolite.php(9194): TSqliteCache->init(Object(TXmlElement))
#1 /framework/pradolite.php(9224): TApplication->applyConfiguration(Object(TApplicationConfiguration), false)
#2 /framework/pradolite.php(8888): TApplication->initApplication()
#3 /index.php(28): TApplication->run()
#4 {main}
2021-12-04 20:47 IdeaWebServer/3.0.1 (like Apache) PRADO/3.1.10