PHP Classes

PHP File I/O Manager: Read or write data to files in a single call

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 233 All time: 8,126 This week: 488Up
Version License PHP version Categories
file-manager 1.0.2GNU General Publi...5PHP 5, Files and Folders
Description 

Author

This class can read or write data to files in a single call.

It can take the path of a file and an open mode parameter that defines that either the file should be open for reading or appending, created for writing, or truncated if it already exists.

The class can read the whole file data or write a data string at once.

Picture of Samuel Adeshina
  Performance   Level  
Name: Samuel Adeshina is available for providing paid consulting. Contact Samuel Adeshina .
Classes: 19 packages by
Country: Nigeria Nigeria
Age: 25
All time rank: 5232 in Nigeria Nigeria
Week rank: 227 Up10 in Nigeria Nigeria Down
Innovation award
Innovation award
Nominee: 7x

Winner: 1x

Documentation

SIMPLE PHP FILE I/O MANAGER @author: <samueladeshina73@gmail.com> Just as the name implies, it is a very simple Class File That Can be used to handle various file input/output operations in a PHP application. It uses a dot net like syntax for calling various file handling operations available such as reading from, writing to, creating a new file, truncate a file and appending a new content to an already created file. You can do all this by calling only one method and passing the appropriate parameters to it. Example of Class Usage /*Class Instantiation*/ $FileManagerInstance = new FileManager(); /*Creating a new File*/ $createFile = $FileManagerInstance->File("FileName.fileformat", "Write", "OpenOrCreate", null) if ($createFile) { echo "File Created Successfully"; } else { print_r($createFile); } /*Truncating A File and Adding A New Content*/ $writeFile = $FileManagerInstance->File("FileName.fileformat", "Write", "Truncate", "This is the new content") if ($createFile) { echo "Write Operation Successfully"; } else { print_r($writeFile); } /* You can follow the same process to append extra contents to a file, just change the "Truncate" parameter to "Append" */ /*Reading From A File*/ $readFile = $FileManagerInstance->File("FileName.fileformat", "Read", "Open", null); echo $readFile; ... And thats it, very simple right? Always remember to unset unused variables, give this class a good rating on the site and have fun while coding!

  Files folder image Files (3)  
File Role Description
Plain text file file_manager.php Class This file contains the FileManager class
Accessible without login Plain text file help.txt Doc. this file explains how to use the class and its methods and also provided an instantiation instance
Accessible without login Plain text file LICENSE Lic. Merge branch 'master' of https://github.com/Samshal/PHP-FileManager

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:233
This week:0
All time:8,126
This week:488Up
User Comments (1)
A library should not die() but report errors.
9 years ago (grosminet750)
10%Star