gisostallenberg/file-permission-calculator

Library to convert file permissions from various formats to another

1.0.3 2016-07-05 08:25 UTC

This package is auto-updated.

Last update: 2024-11-24 04:42:25 UTC


README

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