TConfigurationException

Description

TSqliteCache requires SQLite PHP extension.

Source File

/usr/www/users/thilor/phundament/prado/Caching/TSqliteCache.php (114)

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

Stack Trace

#0 /usr/www/users/thilor/phundament/prado/TApplication.php(918): TSqliteCache->init(Object(TXmlElement))
#1 /usr/www/users/thilor/phundament/prado/TApplication.php(358): TApplication->initApplication()
#2 /usr/www/users/thilor/index.php(34): TApplication->run()
#3 {main}
2021-05-12 01:37 Apache PRADO/3.1.0b