Beispiel #1
0
 /**
  * Get cache status
  *
  * @return  array
  */
 public function status()
 {
     $this->resetErrorState();
     try {
         $this->dbh->tablePrefix($this->table_prefix)->table($this->table)->keys('COUNT::name=>count');
         $count = $this->dbh->get();
         $objects = $count->getData();
     } catch (DatabaseException $de) {
         $this->raiseError("Failed to get cache status (Database), exiting gracefully", array("ERRORNO" => $de->getCode(), "ERROR" => $de->getMessage()));
         $this->setErrorState();
         return array("provider" => "database", "enabled" => false, "objects" => 0, "options" => array());
     }
     return array("provider" => "database", "enabled" => $this->isEnabled(), "objects" => intval($objects[0]['count']), "options" => array('host' => $this->dbh->getHost(), 'port' => $this->dbh->getPort(), 'name' => $this->dbh->getName(), 'user' => $this->dbh->getUser(), 'model' => $this->dbh->getModel()));
 }