<?php
+
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
-// available at http://getid3.sourceforge.net //
-// or http://www.getid3.org //
-// also https://github.com/JamesHeinrich/getID3 //
-/////////////////////////////////////////////////////////////////
+// available at https://github.com/JamesHeinrich/getID3 //
+// or https://www.getid3.org //
+// or http://getid3.sourceforge.net //
// //
// extension.cache.dbm.php - part of getID3() //
// Please see readme.txt for more information //
class getID3_cached_dbm extends getID3
{
-
- // public: constructor - see top of this file for cache type and cache_options
+ /**
+ * @var resource
+ */
+ private $dba;
+
+ /**
+ * @var resource|bool
+ */
+ private $lock;
+
+ /**
+ * @var string
+ */
+ private $cache_type;
+
+ /**
+ * @var string
+ */
+ private $dbm_filename;
+
+ /**
+ * constructor - see top of this file for cache type and cache_options
+ *
+ * @param string $cache_type
+ * @param string $dbm_filename
+ * @param string $lock_filename
+ *
+ * @throws Exception
+ * @throws getid3_exception
+ */
public function __construct($cache_type, $dbm_filename, $lock_filename) {
// Check for dba extension
- // public: destructor
+ /**
+ * destructor
+ */
public function __destruct() {
// Close dbm file
- // public: clear cache
+ /**
+ * clear cache
+ *
+ * @throws Exception
+ */
public function clear_cache() {
// Close dbm file
- // public: analyze file
- public function analyze($filename) {
+ /**
+ * clear cache
+ *
+ * @param string $filename
+ * @param int $filesize
+ * @param string $original_filename
+ *
+ * @return mixed
+ */
+ public function analyze($filename, $filesize=null, $original_filename='') {
if (file_exists($filename)) {
$result = parent::analyze($filename);
// Save result
- if (file_exists($filename)) {
+ if (isset($key) && file_exists($filename)) {
dba_insert($key, serialize($result), $this->dba);
}