/** * 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; }
/** * 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'); }
/** * Object destructor */ public function __destruct() { $this->commit(); // Free shared lock $this->_lock->unlock(); if ($this->_closeDirOnExit) { $this->_directory->close(); } }
/** * 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; }