Esempio n. 1
0
 /**
  * 
  * Returns an array describing table indexes from the cache; if the cache
  * entry is not available, queries the database for the index information.
  * 
  * @param string $table The table name to fetch indexes for.
  * 
  * @return array An array of table indexes.
  * 
  */
 public function fetchIndexInfo($table)
 {
     $key = $this->_getCacheKey("table/{$table}/index");
     $result = $this->_cache->fetch($key);
     if (!$result) {
         $result = $this->_fetchIndexInfo($table);
         $this->_cache->add($key, $result);
     }
     return $result;
 }
Esempio n. 2
0
 /**
  * 
  * Returns an array describing table indexes from the cache; if the cache
  * entry is not available, queries the database for the index information.
  * 
  * @param string $spec The table or schema.table name to fetch indexes
  * for.
  * 
  * @return array An array of table indexes.
  * 
  */
 public function fetchIndexInfo($spec)
 {
     $key = $this->_getCacheKey("table/{$spec}/index");
     $result = $this->_cache->fetch($key);
     if (!$result) {
         list($schema, $table) = $this->_splitSchemaIdent($spec);
         $result = $this->_fetchIndexInfo($table, $schema);
         $this->_cache->add($key, $result);
     }
     return $result;
 }
Esempio n. 3
0
 /**
  * 
  * Adds data to the cache under a specified key.  Note that this is a
  * race-condition safe add, not a save.
  * 
  * @param string $key The cache entry key.
  * 
  * @param mixed $data The data to add to the cache.
  * 
  * @return bool True on success, false on failure.
  * 
  * @see Solar_Cache_Adapter::add()
  * 
  */
 public function add($key, $data)
 {
     return $this->_cache->add($key, $data);
 }