Jarves\Filesystem\Filesystem::delete PHP Method

delete() public method

public delete ( string $path ) : boolean
$path string
return boolean
    public function delete($path)
    {
        $fs = $this->getAdapter($path);
        return $fs->delete($this->normalizePath($path));
    }

Usage Example

コード例 #1
0
    /**
     * @param Bundle $bundle
     * @param $property
     * @return bool
     */
    public function saveFileBased(Bundle $bundle, $property)
    {
        $xml = $bundle->exportFileBased($property);
        $xmlFile = $bundle->getPropertyFilePath($property);
        $emptyXml = '<config>
  <bundle/>
</config>';
        if ($xml == $emptyXml) {
            if ($this->localFilesystem->has($xmlFile)) {
                return $this->localFilesystem->delete($xmlFile);
            } else {
                return true;
            }
        } else {
            return $this->localFilesystem->write($xmlFile, $xml);
        }
    }
All Usage Examples Of Jarves\Filesystem\Filesystem::delete