2017 © Pedro Peláez
 

library flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

image

lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  • Wednesday, August 12, 2015
  • by lechimp-p
  • Repository
  • 1 Watchers
  • 1 Stars
  • 392 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 5 % Grown

The README.md

Build Status Scrutinizer Coverage, (*1)

Flightcontrol

An interface for iteration and recursion over the Leagues flysystem., (*2)

This README.md is also a literate PHP-file., (*3)

This code is released under the GPLv3 License, (*4)

Usage

Initialisation

The flightcontrol is initialized over a flysystem, e.g. as such:, (*5)


Make sure us use the Local::SKIP_LINKS-option when using flightcontrol, as it will only handle files and directories., (*6)

Filesystem Objects

The flightcontrol can give you objects from the flystem:, (*7)

get("/");
assert($root !== null);
assert($root instanceof \Lechimp\Flightcontrol\FSObject);

// the tests directory:
$tests = $flightcontrol->directory("/tests");
assert($tests !== null);
assert($tests instanceof \Lechimp\Flightcontrol\Directory);

// this file:
$readme = $flightcontrol->file("/README.md");  
assert($readme !== null);
assert($readme instanceof \Lechimp\Flightcontrol\File);

?>

Note that you could use Flightcontrol::get to either get a directory or file, and Flightcontrol::directory to get a directory or Flightcontrol::file to get a file respectively. These getters will return null if there is no matching object on the flysystem., (*8)

You could also use FSObject::toDirectory or FSObject::toFile to force an FSObject to a file or directory, where you get a null if the object is not what you want it to be., (*9)

Properties of Filesystem Object

The objects returned from the flightcontrol have different properties:, (*10)

path() == '.$tests->path()."\n";
assert($tests->path() == "/tests");
echo '$tests->name() == '.$tests->name()."\n";
assert($tests->name() == "tests");

// properties of files:
echo '$readme->timestamp() == '.$readme->timestamp()."\n";
assert(is_string($readme->timestamp()) || is_int($readme->timestamp()));
echo '$readme->mimetype() == '.$readme->mimetype()."\n";
assert($readme->mimetype() == "text/plain");
echo '$readme->content()'."\n";
assert(is_string($readme->content()));

// properties of directories:
$contents = $tests->contents();
echo '$tests->contents()'."\n";
assert(count($contents) > 0);
assert($contents[0] instanceof \Lechimp\Flightcontrol\FSObject);

?>

File::content returns the content of the file as string. Directory::contents gives you a list of filesystem objects in the directory., (*11)

The Versions

12/08 2015

dev-master

9999999-dev https://github.com/lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem

12/08 2015

0.12.0

0.12.0.0 https://github.com/lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem

12/08 2015

0.11.1

0.11.1.0 https://github.com/lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem

11/08 2015

0.11.0

0.11.0.0 https://github.com/lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem

09/08 2015

0.10.0

0.10.0.0 https://github.com/lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem

04/08 2015

0.9.0

0.9.0.0 https://github.com/lechimp-p/flightcontrol

An interface for iterationr and recursion in directories over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem

23/07 2015

0.7.0

0.7.0.0 https://github.com/lechimp-p/flightcontrol

An iterator interface over the leagues flysystem.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Klees

filesystem flysystem