From e1074d09d5e432b4eaae2e7657c89e6862c4dbb2 Mon Sep 17 00:00:00 2001 From: Giso Stallenberg Date: Fri, 27 Nov 2015 17:23:50 +0100 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 93039e4..a13f6e8 100644 --- a/README.md +++ b/README.md @@ -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------ +```