nimayneb/flops

Fluent Local Phile system API

0.12.0 2019-10-23 13:02 UTC

README

FLOPS is a API only for the Local File system with a fluent but verbosity (no abbreviations) interface support.

Key features:

  • No dependencies (excepts POSIX extension)
  • No regular expressions
  • No use of SPL (Standard PHP Library)
  • Proven and simplest patterns (see PHP documentation)

Use PHP internals for filesystem:

chgrp chmod clearstatcache copy disk_​free_​space disk_​total_​space fclose feof fgetc fgets file_​exists file_​get_​contents file_​put_​contents fileatime filectime filegroup filemtime fileowner fileperms filesize fopen fread fseek ftell ftruncate fwrite is_​dir is_​executable is_​file is_​link is_​readable is_​writable mkdir pathinfo readlink realpath rename rmdir symlink touch unlink

Example of use:

use JayBeeR\Flops\LocalFileSystem;

$localBinaries = LocalFileSystem::get('/usr/local/bin/');
$composerFile = LocalFileSystem::get('composer.phar');
$composerBinary = $composerFile->copyTo($localBinaries)->omitExtension();
$composerBinary->setPermission(function(Permissions $permissions) {
    $permissions->setExecutionAccessRightsForAll();
});

Table of contents

  1. Configuration
  2. File information
  3. Directory information
  4. Symbolic link information
  5. File resources
  6. File encoding
  7. File modes
  8. Permissions
  9. Root line
  10. Write content
  11. Exceptions

Wishlist

  • Tests!
  • more Documentations
  • Exceptions give context help
  • more Semantic Exceptions (and Refactoring)
  • Execution process (STDIN, STDOUT, STDERR)