94 public function __construct($cache_type, $dbm_filename, $lock_filename)
97 if (!extension_loaded(
'dba')) {
98 throw new DefaultException(
'PHP is not compiled with dba support, required to use DBM style cache.');
102 if (!function_exists(
'dba_handlers') || !in_array($cache_type, dba_handlers())) {
103 throw new DefaultException(
'PHP is not compiled --with '.$cache_type.
' support, required to use DBM style cache.');
107 if (!file_exists($lock_filename)) {
108 if (!touch($lock_filename)) {
114 if (!is_writeable($lock_filename)) {
115 throw new DefaultException(
'lock file: '.$lock_filename.
' is not writable');
117 $this->lock = fopen($lock_filename,
'w');
120 flock($this->lock, LOCK_EX);
123 if (!file_exists($dbm_filename)) {
124 if (!touch($dbm_filename)) {
130 $this->dba = dba_open($dbm_filename,
'w', $cache_type);
134 $this->dba = dba_open($dbm_filename,
'n', $cache_type);
145 $this->cache_type = $cache_type;
146 $this->dbm_filename = $dbm_filename;
149 register_shutdown_function(
array($this,
'__destruct'));
156 parent::__construct();
165 dba_close($this->dba);
168 flock($this->lock, LOCK_UN);
182 dba_close($this->dba);
185 $this->dba = dba_open($this->dbm_filename,
'n', $this->cache_type);
188 throw new DefaultException(
'failed to clear cache/recreate dbm file: '.$this->dbm_filename);
195 register_shutdown_function(
array($this,
'__destruct'));
212 $result = dba_fetch($key, $this->dba);
225 dba_insert($key, serialize(
$result), $this->dba);
__construct($cache_type, $dbm_filename, $lock_filename)
public: constructor - see top of this file for cache type and cache_options
analyze($filename)
analyze file
GetId3() by James Heinrich info@getid3.org //.
Create styles array
The data for the language used.