Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 1.57 KB

README.md

File metadata and controls

25 lines (21 loc) · 1.57 KB

Latest Stable Version Latest Unstable Version License Total Downloads Travis

File Permission Calculator

Library to convert file permissions from various formats to another

Installation

composer require gisostallenberg/file-permission-calculator

Usage examples

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------