Delete a file

@throws BadMethodCallException if unlink is not supported.
@return boolean TRUE on success or FALSE on failure.
974114
public function unlink()
    {
        if($path = $this->getPath())
        {
            if(@unlink($path) === true)
            {
                if($this->getResource()) {
                    $this->close();
                }

                $this->_path = null;
                return true;
            }
        }
        else throw new BadMethodCallException('The stream "'.self::getName().'" does not support unlink.');

        return false;
    }
443587
public function deleteOutdated(): bool
    {
        //TODO: check the need to call
        clearstatcache();
        
        $dh = @opendir($this->cacheDir);
        if (false === $dh) {
            return false;
        }
        
        while (false !== ($entry = readdir($dh))) {
            $filePath = $this->cacheDir . '/' . $entry;
            
            //exclude '.', '..', '.htaccess'
            if (!is_file($filePath) || 0 === strpos($entry, '.')) {
                continue;
            }
            
            try {
                $packet = $this->getPacketFromFile($filePath);
                if ($packet->outdated()) {
                    unlink($filePath);
                }
            } catch (BadPacketException $e) {
                unlink($filePath);
            }
        }
        
        closedir($dh);
        
        return true;
    }
718528
public function delete()
    {
        $this->guardDeletedFile();

        $response = $this->api->request('DELETE', $this->absolutePath());

        if ($response->getStatusCode() !== 204) {
            throw new ApiRequestFailedException('Unable to delete file "'.$this->path().'".', $response->getStatusCode());
        }

        // Set deleted flag to true, so any other calls to
        // this File will result in throwing exception.

        $this->deleted = true;

        return true;
    }
626273
public function delete()
    {
        $path = $this->model->getPath('destroy');

        return $this->query->from($path)
                ->delete();
    }
1091060
public function remove($h)
	{
		$e = $this->getRawElement($h);
		if($e == null)
			return false;
		if($e[0] == self::TYPE_FILE)
			$this->removeFile($e[1]);
		unset($this->elements[$h]);
		return true;
	}
53941
public function delete($fileName)
    {
        $path = $this->getPathBase($fileName);

        if (!file_exists($path)) {
            return;
        }

        return unlink($path);
    }
338021
public function delete()
    {
        try {
            $this->getHttpClient()->request('DELETE', $this->apiUrl());
        } catch (RequestException $e) {
            $this->throwResourceException($e->getResponse(), 'delete', DeleteResourceException::class);
        }

        return true;
    }
51256
public function delete()
    {
        if ($this->files->exists($path = $this->manifestPath.'/collections.json'))
        {
            return $this->files->delete($path);
        }
        else
        {
            return false;
        }
    }
601409
public function destroy($id)
    {
        if(file_exists($this->path . DS . $id) && is_writable($this->path . DS . $id))
        {
            return unlink($this->path . DS . $id);
        }
        return false;
    }
737108
public function close()
    {
        if($this->getType() == 'temp')
        {
            if(parent::close() == true)
            {
                //Only unlink temporary files
                if($this->getType() == 'temp') {
                    $this->unlink();
                }

                return true;
            }
        }

        if($this->getType() == 'memory') {
            return $this->flush();
        }

        return false;
    }
766071
public function delete() : bool
    {
        $removed = null;

        if ($this->isDirectory()) {
            $removed = rmdir($this->realPath);
        } else {
            $removed = unlink($this->realPath);
        }

        return $removed;
    }
1187901
public function unlink()
	{
		if ($this->mysql === null)
		{
			return false;
		}

		$query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
		$query->bindValue(':id', $this->id);
		$query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');
		$query2->bindValue(':id', $this->id);

		return $query->execute() && $query2->execute();
	}
543039
public function delete() {

		if(false !== $this -> file -> getExists()) {

			if(unlink($this -> file -> getBasepath())) {
				$this -> refresh();
			}
		}

		return $this;
	}
92029
protected function _deleteFile()
    {
        if (!$this->isUploaded()) {
            return false;
        }
        $sHash = $this->oxfiles__oxstorehash->value;
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $iCount = $oDb->getOne(
            'SELECT COUNT(*) FROM `oxfiles` WHERE `OXSTOREHASH` = ' . $oDb->quote($sHash)
        );
        if (!$iCount) {
            $sPath = $this->getStoreLocation();
            unlink($sPath);
        }
    }
809498
public function delete()
    {
        if ($this->details->isDir()) {
            return @rmdir($this->details->getRealPath());
        }
        return @unlink($this->details->getRealPath());
    }
1288053
public function deleteFile()
    {
        if ($this->file) {
            if (file_exists($this->file)) {
                if (false === @unlink($this->file)) {
                    throw FileException::lastError();
                }
            }

            if (file_exists($this->file . '.pubkey')) {
                if (false === @unlink($this->file . '.pubkey')) {
                    throw FileException::lastError();
                }
            }

            $dir = dirname($this->file);

            if (file_exists($dir)) {
                if (false === @rmdir($dir)) {
                    throw FileException::lastError();
                }
            }

            $this->file = null;
        }
    }
633985
public function unlink($url)
  {
    $partition = self::getPartition($url);
    $path = self::getRelativePath($url);

    return !!$partition->deleteFile($path);
  }