2017 © Pedro Pelรกez
 

library phio

Object-oriented filesystem library for PHP

image

amekusa/phio

Object-oriented filesystem library for PHP

  • Thursday, September 1, 2016
  • by amekusa
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

PhiO: Object-oriented filesystem library for PHP

Install

Install via Composer., (*1)

composer require amekusa/phio

Examples

Assumed directory structure:, (*2)

/
โ””โ”€โ”€ srv
    โ””โ”€โ”€ http
        โ”œโ”€โ”€ favicon.svg
     ย ย  โ”œโ”€โ”€ index.html
        โ”œโ”€โ”€ script.js
        โ””โ”€โ”€ style.css

Iterate over files in a directory

use amekusa\phio\Directory;

$dir = new Directory('/srv/http');
foreach ($dir as $file) {
    echo $file->getPath() . "\n";
}

This code results:, (*3)

/srv/http/favicon.svg
/srv/http/index.html
/srv/http/script.js
/srv/http/style.css

Filter files

use amekusa\phio\Directory;
use amekusa\phio\Filter;

$dir = new Directory('/srv/http');
$dir->addFilter(new Filter('s*.*s'));

foreach ($dir as $file) {
    echo $file->getPath() . "\n";
}

This code results:, (*4)

/srv/http/script.js
/srv/http/style.css

You can also use regular expression like this:, (*5)

use amekusa\phio\Directory;
use amekusa\phio\RegexFilter;

$dir = new Directory('/srv/http');
$dir->addFilter(new RegexFilter('/\.[a-z]{3}$/'));

foreach ($dir as $file) {
    echo $file->getPath() . "\n";
}

This code results:, (*6)

/srv/http/favicon.svg
/srv/http/style.css

The Versions

01/09 2016

dev-develop

dev-develop http://amekusa.github.io/phio

Object-oriented filesystem library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

file system fs oop

29/08 2016

dev-master

9999999-dev http://amekusa.github.io/phio

Object-oriented filesystem library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

file system fs oop

29/08 2016

0.2.0

0.2.0.0 http://amekusa.github.io/phio

Object-oriented filesystem library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

file system fs oop

29/08 2016

0.1.0

0.1.0.0 http://amekusa.github.io/phio

Object-oriented filesystem library for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

file system fs oop