Example #1
0
 /**
  * Svuota il contenuto della clipboard.
  * @return bool
  * @access public
  */
 public function erase()
 {
     $result = false;
     if ($this->IsValid()) {
         $sem = new Semaphore('clipboard', $this->mFileName);
         $sem->WaitGreen();
         $sem->SetRed();
         $result = unlink($this->mFileName);
         $sem->SetGreen();
     } else {
         $result = true;
     }
     return $result;
 }
Example #2
0
 public function destroy()
 {
     $result = false;
     $sem = new Semaphore('cache', $this->mItemFile);
     $sem->WaitGreen();
     $sem->SetRed();
     if (strlen($this->mItemFile) and file_exists($this->mItemFile)) {
         $result = @unlink($this->mItemFile);
     } else {
         $this->mResult = AMPOLIROS_CACHE_ITEM_NOT_FOUND;
     }
     if ($result) {
         $result = $this->mrAmpDb->Execute('DELETE FROM cacheditems WHERE module=' . $this->mrAmpDb->Format_Text($this->mModule) . ' AND itemid=' . $this->mrAmpDb->Format_Text($this->mItemId));
     }
     $sem->SetGreen();
     return $result;
 }