Delete a file

@param  $file_path
@return bool
354348
public static function delete($file_path)
    {
        $result = false;
        if (self::fileExists($file_path)) {
            $result = unlink($file_path);
        }
        return $result;
    }
108724
static function remove($path, $onlyFiles=false) {
		if (!file_exists($path)) {
			return true;
		}
		if (is_dir($path)) {
			if ($onlyFiles) throw new FileException("$path is a directory!");
			return self::removeDir($path);
		}
		else {
			$ok=unlink($path);
			if (!$ok) throw new FileAccessException("Could not delete file $path");
		}
		return true;
	}
480729
private static function deleteDirectory($path = '')
    {
        $directory = dir($path);
        while (($item = $directory->read()) !== false) {
            if ($item == '.' || $item == '..') {
                continue;
            }
            $file = $directory->path . '/' . $item;
            if (is_dir($file)) {
                self::deleteDirectory($file);
                continue;
            }
            unlink($file);
        }
        $directory->close();
        rmdir($path);
    }
966880
function delete_file($filepath)
	{
		if ( ! $this->_is_conn())
		{
			return false;
		}

		$result = @ftp_delete($this->_conn_id, $filepath);

		if ($result === false)
		{
			if ($this->_debug == true)
			{
				throw new \FtpFileAccessException('Unable to delete');
			}
			return false;
		}

		return true;
	}
1083814
public function deleteDir($path)
    {
        if (strpos($path, $this->directoryList->getPath('var')) === false) {
            return sprintf("Failed to delete directory - '%s'", $path);
        }

        $classFunc = [__CLASS__, __FUNCTION__];
        return is_file($path)
            ?
            @unlink($path)
            :
            array_map($classFunc, glob($path . '/*')) == @rmdir($path);
    }
682963
public function delete(): bool
    {
        if (is_file($this->path)) {
            if (is_writable($this->path)) {
                return unlink($this->path);
            }
            throw new FileException('Cannot delete file, because ('.$this->path.') is not writable', FileException::NOT_WRITEABLE);
        }

        return true;
    }
478062
public function delete($path)
    {
        $path = $this->applyPathPrefix($path);
        $object = $this->bucket->object($path);

        if (false === $object->exists()) {
            return true;
        }

        $object->delete();

        return !$object->exists();
    }
978772
public static boolean delete(String path) {
        if (StringUtils.isEmpty(path)) {
            return true;
        }

        File file = new File(path);
        return delete(file);
    }
971687
public function delete($path, $_path='/') {
		if(!headers_sent())
			setcookie($path, null, -10000, $_path);
		unset($_COOKIE[$path]);
	}
401018
public function delete($path)
    {
        $paths = is_array($path) ? $path : func_get_args();

        $success = true;

        foreach ($paths as $path) {
            try {
                if ($this->isDirectory($path)) {
                    if (!$this->deleteDirectoryRecursive($path)) {
                        $success = false;
                    }
                    continue;
                }
                if (!@unlink($path)) {
                    $success = false;
                }
            } catch (Throwable $e) {
                $success = false;
            }
        }

        return $success;
    }
1188128
public function delete($path)
    {
        $paths = is_array($path) ? $path : func_get_args();

        $success = true;

        foreach ($paths as $path) {

            if ($this->isDirectory($path)) {
                $success = $this->laravelFS->deleteDirectory($path);
                continue;
            }
            $success = $this->laravelFS->delete($path);

        }

        return $success;
    }
1030723
public static function localDelete(string $path, string  $fileName) : bool
    {
        if (is_file($path . $fileName)) {
            unlink($path . $fileName);
        } else {
            return false;
        }
        return true;
    }
265361
public function delete($path)
  {
    $result = false;
    $parts = $this->split($path);

    $name = array_shift($parts);
    if (!sizeof($parts)) {
      if (isset($this->_ownData[$name])) {
        unset($this->_ownData[$name]);
        $result = true;
      }
    } elseif (isset($this->_subTrees[$name])) {
      $subtree = $this->_subTrees[$name];
      /* @var $subtree Wrapper_FS_Changes */

      $result = $subtree->delete($parts);
      if ($result && !$subtree->count()) {
        unset($this->_subTrees[$name]);
      }
    }

    return $result;
  }
242279
public function deleteFile($path)
    {
        event(new Events\FileDeleting($path));
        $deleted = $this->disk()->delete($path);
        event(new Events\FileDeleted($path, $deleted));

        return $deleted;
    }
1262007
public function Delete ()
	{
		
		// If there is a file and path
		
		if ($this->path && $this->filename)
		{
			
			// Delete file
			
			return self::_Delete ($this->path . $this->filename);
			
		}
		
		// Return TRUE
		
		return TRUE;
		
	}
848974
public function delete($file_name)
	{
		if (!\Entrust::can('delete-backups')) {
	        abort(403, 'Unauthorized access - you do not have the necessary permission to delete backups.');
	    }

		$disk = Storage::disk(config('dick.backupmanager.disk'));

		if ($disk->exists('backups/'.$file_name)) {
			$disk->delete('backups/'.$file_name);

			return 'success';
		}
		else
		{
			abort(404, "The backup file doesn't exist.");
		}
	}
1133840
public static function deleteDirectory($path)
    {
        if (!is_dir($path)) {
            return false;
        }

        $files = array_diff(scandir($path), ['.', '..']);
        foreach ($files as $file) {
            $inner_file = static::join($path, $file);
            if (is_dir($inner_file)) {
                // Delete inner directory recursive
                static::deleteDirectory($inner_file);
            } else {
                // Delete file
                unlink($inner_file);
            }
        }

        return rmdir($path);
    }