Exemplo n.º 1
0
    /**
     * Close current index and free resources
     */
    private function _close()
    {
        if ($this->_closed) {
            // index is already closed and resources are cleaned up
            return;
        }

        $this->commit();

        // Free shared lock
        $this->_lock->unlock();

        if ($this->_closeDirOnExit) {
            $this->_directory->close();
        }

        $this->_directory    = null;
        $this->_writer       = null;
        $this->_segmentInfos = null;

        $this->_closed = true;
    }
Exemplo n.º 2
0
 /**
  * Free exclusive write lock on the index
  * 
  * @param Zend_Search_Lucene_Storage_Directory $defaultLockDirectory
  * @param Zend_Search_Lucene_Storage_File      $lock
  */
 public static function releaseWriteLock(Zend_Search_Lucene_Storage_Directory $defaultLockDirectory, Zend_Search_Lucene_Storage_File $lock)
 {
     $lock->unlock();
     unset($lock);
     $defaultLockDirectory->deleteFile('write.lock');
 }
Exemplo n.º 3
0
 /**
  * Object destructor
  */
 public function __destruct()
 {
     $this->commit();
     // Free shared lock
     $this->_lock->unlock();
     if ($this->_closeDirOnExit) {
         $this->_directory->close();
     }
 }
Exemplo n.º 4
0
 /**
  * Close current index and free resources
  *
  * @internal
  */
 public function close()
 {
     $this->commit();
     // Free shared lock
     $this->_lock->unlock();
     if ($this->_closeDirOnExit) {
         $this->_directory->close();
     }
     $this->_directory = null;
     $this->_writer = null;
     $this->_segmentInfos = null;
 }