2017 © Pedro Peláez
 

library io

Common wrappers and IO utils for PHP

image

habanero/io

Common wrappers and IO utils for PHP

  • Tuesday, January 26, 2016
  • by pateketrueke
  • Repository
  • 1 Watchers
  • 4 Stars
  • 125 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Talkin' bout I/O

A collection of helper classes to do many simple tasks through filesystem., (*1)

The installation is done using the Composer/Packagist., (*2)

Quick reference

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)

Contribute

The library performs just basic things, if you want add more features or fix something, you're welcome., (*19)

The Versions

26/01 2016

dev-master

9999999-dev

Common wrappers and IO utils for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.4

 

The Development Requires

by Alvaro Cabrera