cakephp/filesystem

Name: filesystem

Owner: CakePHP

Description: [READ ONLY] Convenience library to help you work with files and folders.

Created: 2015-05-16 17:19:29.0

Updated: 2018-05-13 23:21:16.0

Pushed: 2018-05-21 01:31:57.0

Homepage: null

Size: 66

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Total Downloads License

CakePHP Filesystem Library

The Folder and File utilities are convenience classes to help you read from and write/append to files; list files within a folder and other common directory related tasks.

Basic Usage

Create a folder instance and search for all the .ctp files within it:

Cake\Filesystem\Folder;

 = new Folder('/path/to/folder');
es = $dir->find('.*\.ctp');

Now you can loop through the files and read from or write/append to the contents or simply delete the file:

ach ($files as $file) {
$file = new File($dir->pwd() . DIRECTORY_SEPARATOR . $file);
$contents = $file->read();
// $file->write('I am overwriting the contents of this file');
// $file->append('I am adding to the bottom of this file.');
// $file->delete(); // I am deleting this file
$file->close(); // Be sure to close the file when you're done

Documentation

Please make sure you check the official documentation


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.