Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gisostallenberg committed Nov 27, 2015
1 parent 770ddd6 commit e1074d0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@ Library to convert file permissions from various formats to another
```bash
composer require gisostallenberg/file-permission-calculator
```

## Usage examples
```php
use GisoStallenberg\FilePermissionCalculator\FilePermissionCalculator;

echo new FilePermissionCalculator(0100700); // -rwx------
echo new FilePermissionCalculator(0700); // urwx------
echo FilePermissionCalculator::fromStringRepresentation('-rw-r--r--')->getMode(); // 33188
echo FilePermissionCalculator::fromStringRepresentation('-rw-r--r--')->getOctalString(); // 100644
echo FilePermissionCalculator::fromStringRepresentation('-rw-r--r--'); // -rw-r--r--
echo FilePermissionCalculator::fromOctalString('0100700'); // -rwx------
```

0 comments on commit e1074d0

Please sign in to comment.