2017 © Pedro Peláez
 

library filesystem

Filesystem (directory, file, ...)

image

corex/filesystem

Filesystem (directory, file, ...)

  • Monday, June 4, 2018
  • by corex
  • Repository
  • 0 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 125 % Grown

The README.md

Filesystem (directory, file, cache, ...)

License Build Status codecov, (*1)

Cache

Simple cache implementation., (*2)

A few examples., (*3)

// Generate key based on string + array.
$key = Cache::key('test', ['param1' => 'Something']);

// Set path for cache stores.
Cache::path('/path/cache/stores');

// Set lifetime for cache in seconds.
Cache::lifetime(600);

// Set lifetime for cache in minutes.
Cache::lifetime('60m');

// Set lifetime for cache in hours.
Cache::lifetime('1h');

// Get from cache from 'custom-store'.
$data = Cache::get('test', 'default.value', 'custom-store');

// Put data in cache to 'custom-store'.
Cache::put('test', 'data', 'custom-store');

// Flush cache 'custom-store'.
Cache::flush('custom-store');

Directory

Various directory helpers., (*4)

A few examples., (*5)

// Test if directory exists.
$exist = Directory::exist('/my/path');

// Check if directory is writeable.
$isWriteable = Directory::isWritable('/my/path');

// Make directory.
Directory::make('/my/path');

// Get entries of a directory.
$entries = Directory::entries('/my/path', '*', true, true, true);

File

Various file helpers (i.e. stub, json, etc.), (*6)

A few examples., (*7)

// Check if file exists.
$exist = File::exist($filename);

// Get from file.
$content = File::get($filename);

// Load lines.
$lines = File::getLines($filename);

// Save content.
File::put($filename, $content);

// Save lines.
File::putLines($filename, $lines);

// Get stub.
$stub = File::getStub($filename, [
    'firstname' => 'Roger',
    'lastname' => 'Moore'
]);

// Get template.
$template = File::getTemplate($filename, [
    'firstname' => 'Roger',
    'lastname' => 'Moore'
]);

// Get json.
$array = File::getJson($filename);

// Put json.
File::putJson($filename, $array);

// Get temp filename.
$filename = File::getTempFilename();

// Delete file.
File::delete($filename);

The Versions

04/06 2018

dev-develop

dev-develop

Filesystem (directory, file, ...)

  Sources   Download

MIT

The Requires

 

The Development Requires

04/06 2018

dev-master

9999999-dev

Filesystem (directory, file, ...)

  Sources   Download

MIT

The Requires

 

The Development Requires

04/06 2018

1.0.2

1.0.2.0

Filesystem (directory, file, ...)

  Sources   Download

MIT

The Requires

 

The Development Requires

26/05 2018

1.0.1

1.0.1.0

Filesystem (directory, file, ...)

  Sources   Download

MIT

The Requires

 

The Development Requires

26/05 2018

1.0.0

1.0.0.0

Filesystem (directory, file, ...)

  Sources   Download

MIT

The Requires

 

The Development Requires