GithubHelp home page GithubHelp logo

filesystem's Introduction

Filesystem

Donate

Iriven Php Filesystem: A helper class for filesystem operations. This class uses PHP Iterators in order to dynamically and stably provide filesystem operation access

Goals

  • Have a generic API for handling common tasks across files and folders.
  • Have consistent output which you can rely on.
  • Integrate well with all PHP packages/frameworks.
  • Make it easy to test your filesystem interactions.
  • Support streams for big file handling.

Overview

The following methods are provided:

public static function appendToFile($file, $content, $context = null)
public static function basename($path)
public static function checksum($file, $type = 'md5')
public static function chgrp($file, $group, $recursive = false)
public static function chmod( $file,$mode,$recursive=false,$umask=null)
public static function chown($file, $user, $group = null, $recursive = false)
public static function clean($directory)
public static function convertBytes($bytes, $unit='', $precision=2)
public static function copy($source, $destination, $permissions = 0775)
public static function cwd()
public static function dirname($path)
public static function diskUsage($path)
public static function extension($path)
public static function exists( $path )
public static function filename($path)
public static function getPerms($path, $octal=true)
public static function getSize($path, $humanReadable = true)
public static function group($file)
public static function hardlink($file, $destination)
public static function insertIntoFile($file, $marker, $data, $after = true)
public static function isDir($path)
public static function isExecutable($path)
public static function isFile($path)
public static function isHidden($path)
public static function isLink($path)
public static function isReadable($path)
public static function isWritable($path)
public static function mimeType($path)
public static function mkdir($directory, $mode=0775)
public static function move($source, $destination, $overwrite = false)
public static function owner($file)
public static function pathname($path, $relativeTo = null)
public static function prependToFile($path, $content)
public static function readFile($path, $lock = false)
public static function readlink($path, $canonicalize = false)
public static function remove($path)
public static function rename($source, $destination, $overwrite = false)
public static function replaceInFile($file, $search, $replace)
public static function rmdir($directory)
public static function scandir($directory, $fileExtension = null, $excludeHidden=false, $childFirst=true)
public static function separator()
public static function stat($path)
public static function symlink($directory, $link, $copyOnWindows = false)
public static function touch($file, $time = null, $atime = null)
public static function tree($directory, $depth = 0)
public static function type($path)
public static function writeFile($file,$content, $flags = 0, $context = null)

Installation

The class can be used standalone, however it's recommended to install via Composer:

composer require iriven/Filesystem

If using Composer, just do something like:

use \Iriven\Plugins\Filesystem\FileSystem;
include 'path/to/vendor/autoload.php';

Otherwise, simply include the class:

use \Iriven\Plugins\Filesystem\FileSystem;
include 'path/to/FileSystem.php';

Authors

License

This project is licensed under the GNU General Public License V3 - see the LICENSE file for details

Donation

If this project help you reduce time to develop, please consider making a donation, even a small one! This application is free and intends to remain so, please support it if you can.

Donate

Disclaimer

If you use this library in your project please add a backlink to this page by this code.

<a href="https://github.com/iriven/Filesystem" target="_blank">This Project Uses Alfred's TCHONDJO  Filesystem Library.</a>

Issues Repport

Repport issues Here

Security

If you discover any security related issues, please email iriven@yahoo{dot}fr instead of using the issue tracker. All security vulnerabilities will be promptly addressed

Enjoy

Oh and if you've come down this far, you might as well follow me on twitter.

filesystem's People

Contributors

iriven avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.