dev-master
9999999-devCommon wrappers and IO utils for PHP
MIT
The Requires
- php >=5.3.4
The Development Requires
by Alvaro Cabrera
Wallogit.com
2017 © Pedro Peláez
Common wrappers and IO utils for PHP
A collection of helper classes to do many simple tasks through filesystem., (*1)
The installation is done using the Composer/Packagist., (*2)
Retrieve the mime-type value from a given file, (*3)
IO\Helpers::mimetype($filename)
Return the formatted byte-length value, (*4)
IO\Helpers::fmtsize($bytes[, $unit = NULL[, $format = '%01.2f %s']])
Assemble and resolve paths from its arguments, (*5)
IO\Helpers::join($arg1[, $arg2[, $argN]])
Retrieve files in the given directory, (*6)
IO\Dir::entries($path[, $filter = '*'[, $recursive = FALSE]])
Copy files between directories, (*7)
IO\Dir::cpfiles($from, $to[, $filter = '*'[, $recursive = FALSE]])
Find files through given directory, (*8)
IO\Dir::findfile($path[, $filter = '*'[, $recursive = FALSE[, $index = 0]]])
Remove files from given directory, (*9)
IO\Dir::unfile($path[, $filter = '*'[, $recursive = FALSE]])
Retrieve the size in bytes from given directory, (*10)
IO\Dir::size($path[, $recursive = FALSE])
Execute the lambda function for each file within the given directory using opendir() and pass the value from readdir() to the lambda block. Then use closedir() after the whole iteration., (*11)
IO\Dir::open($path, $lambda)
Execute the lambda for each file within the given directory and pass the file path to the lambda block recursively. This method use entries() to build its tree., (*12)
IO\Dir::each($path, $filter, $lambda)
Get the filename extension, (*13)
IO\File::ext($name[, $dot = FALSE])
Get the whole filepath without extension, (*14)
IO\File::extn($name[, $base = FALSE])
Read a single file or URL, (*15)
IO\File::read($path)
Writes a single file, (*16)
IO\File::write($file, $content, $append)
Use fopen() and pass the #resource to execute the lambda block, then close the file using fclose() automatically., (*17)
IO\File::open($file, $access, $lambda)
Execute the lambda for each line from the given file., (*18)
IO\File::each($path, $lambda)
The library performs just basic things, if you want add more features or fix something, you're welcome., (*19)
Common wrappers and IO utils for PHP
MIT