| 61 | | require_once 'Zend/Db.php'; |
| 62 | | $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => $path) ); |
| 63 | | $db->setFetchMode(Zend_Db::FETCH_OBJ); |
| 64 | | $select = $db->select()->from(self::TABLENAME); |
| 65 | | if ($ref_uri !== false) { |
| 66 | | $select = $select->where('host = ?', $host)->orWhere('host = ?', '.'.$host); |
| | 62 | require_once 'Zend/Db.php'; |
| | 63 | try { |
| | 64 | $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => $path) ); |
| | 65 | $db->setFetchMode(Zend_Db::FETCH_OBJ); |
| | 66 | $select = $db->select()->from(self::TABLENAME); |
| | 67 | if ($ref_uri !== false) { |
| | 68 | $select = $select->where('host = ?', $host)->orWhere('host = ?', '.'.$host); |
| | 69 | |
| | 70 | if (is_string($use_topppp_domain)) { |
| | 71 | $select = $select->orWhere('host = ?', $use_topppp_domain); |
| | 72 | } |
| | 73 | } |
| | 74 | |
| | 75 | $fetch = $db->fetchAll($select); |
| | 76 | } catch (Zend_Db_Exception $e) { |
| | 77 | require_once 'Diggin/Http/CookieJar/Loader/Exception.php'; |
| | 78 | throw new Diggin_Http_CookieJar_Loader_Exception($e); |
| 78 | | foreach ($fetch as $result) { |
| 79 | | $cookie = new Zend_Http_Cookie($result->name, //cookie->name |
| 80 | | $result->value, //cookie->value |
| 81 | | $result->host, //cookie->domain |
| 82 | | $result->expiry, // exipry / cookie->expires |
| 83 | | $result->path, //cookie->path = null, |
| 84 | | (boolean)$result->isSecure); |
| 85 | | $cookieJar->addCookie($cookie); |
| | 88 | foreach ($fetch as $result) { |
| | 89 | if ($result->name and $result->value and $result->host) { |
| | 90 | $cookie = new Zend_Http_Cookie($result->name, //cookie->name |
| | 91 | $result->value, //cookie->value |
| | 92 | $result->host, //cookie->domain |
| | 93 | $result->expiry, // exipry / cookie->expires |
| | 94 | $result->path, //cookie->path = null, |
| | 95 | (boolean)$result->isSecure); |
| | 96 | $cookieJar->addCookie($cookie); |
| | 97 | } |