Skip to content

Commit

Permalink
Updating API doc to reflect directory operations
Browse files Browse the repository at this point in the history
Given thephpleague#117, at least since 2014 the docs were missing clearer information on whether it's possible to delete/rename/move directories as well as files.
  • Loading branch information
igorsantos07 authored Nov 21, 2019
1 parent b494919 commit 38a5c0f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/usage/filesystem-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,32 +125,32 @@ param | description | type

---

## Check if a file exists
## Check if a file or directory exists

```php
$exists = $filesystem->has($path);
```

param | description | type
------------- | --------------------------------------------- | -----------
`$path` | location of a file | `string`
`$exists` | whether the file exists | `bool`
`$path` | location of a file/directory | `string`
`$exists` | whether it exists | `bool`

> This only has consistent behaviour for files, not directories. Directories
> are less important in Flysystem, they're created implicitly and often ignored because
> not every adapter (filesystem type) supports directories.
---

## Delete Files
## Delete Files or Directories

```php
$response = $filesystem->delete($path);
```

param | description | type
------------- | --------------------------------------------- | -----------
`$path` | location of a file | `string`
`$path` | location of a file/directory | `string`
`$response` | success boolean | `bool`

---
Expand All @@ -168,29 +168,29 @@ param | description | type

---

## Rename Files
## Rename Files or Directories

```php
$response = $filesystem->rename($from, $to);
```

param | description | type
------------- | --------------------------------------------- | -----------
`$from` | location of a file | `string`
`$from` | location of a file/directory | `string`
`$to` | new location | `string`
`$response` | success boolean | `bool`

---

## Copy Files
## Copy Files or Directories

```php
$response = $filesystem->copy($from, $to);
```

param | description | type
------------- | --------------------------------------------- | -----------
`$from` | location of a file | `string`
`$from` | location of a file/directory | `string`
`$to` | new location | `string`
`$response` | success boolean | `bool`

Expand Down

0 comments on commit 38a5c0f

Please sign in to comment.