Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
LikeAJohny committed Nov 23, 2023
1 parent 2b05195 commit 1aae0da
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 15 deletions.
57 changes: 43 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# PHP FS (Filesystem Helpers)

Very basic tools to help you get around the filesystem with PHP.

This package is far from feature complete and only provides the most basic stuff regarding directory & file operations.
It is under active development, though. Definitely expect more possibilities in the near future.
This package is under active development.
If you have any problems, suggestions or wishes, feel free to create an issue to let me know!

## Install

Expand All @@ -12,42 +12,71 @@ composer require likeajohny/php-fs
```


## Features
## Functions

- Directory
- create
- exists
- remove
- empty
- copy
- move
- copy
- list
- File
- create
- exists
- write
- append
- prepend
- read
- remove
- copy
- move


## Usage Examples
## File Usage Examples

### Create a new directory

- 0777 & recursive by default.
### Create A New File

- The directory to create the file in has to exist.

```php
PhpFs\Directory::create('./path/to/directory');
PhpFs\File::create('./filepath/cool-story-bro.txt');
```


### Create a new file
### Write Content To A File

- The directory to create the file in has to exist.
- Writes contents to a given file
- Overrides pre-existing content in the file

```php
PhpFs\File::create('./filepath/cool-story-bro.txt');
PhpFs\File::write('./filepath/cool-story-bro.txt', 'Let me tell you a story!');
```


### Remove a directory
### Append To A File

- Appends content to a given file

```php
PhpFs\File::append('./filepath/cool-story-bro.txt', "\nAnd the story goes as follows:");
```


### Prepend To A File

- Prepends content to a given file

```php
PhpFs\File::prepend('./filepath/cool-story-bro.txt', "The stories foreword\n");
```


## Directory Usage Examples

### Remove A Directory

- always recursive

Expand All @@ -56,7 +85,7 @@ PhpFs\Directory::remove('./path/to/directory');
```


### Empty a directory
### Empty A Directory

- always recursive

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "likeajohny/php-fs",
"description": "Tools to help you get around the filesystem with PHP.",
"version": "2.0.3",
"version": "2.0.4",
"type": "library",
"keywords": [
"filesystem",
Expand Down

0 comments on commit 1aae0da

Please sign in to comment.