예제 #1
0
파일: Collection.php 프로젝트: kmfk/slowdb
 /**
  * Sets the Key/Value pair in the database
  *
  * @param mixed $key   The key to store
  * @param mixed $value The value to store
  *
  * @return bool
  */
 public function set($key, $value)
 {
     $position = $this->getPosition($key);
     if (false !== $position) {
         $this->file->update($position, $key, $value);
         $this->rebuildIndex();
     } else {
         $pos = $this->file->insert($key, $value);
         $this->index->set($key, $pos);
     }
     return true;
 }