v1.0
1.0.0.0
MIT
The Development Requires
Wallogit.com
2017 © Pedro Peláez
A simple package for searching, renaming, deleting, reading, and writing .csv files., (*1)
mixed FileWorker::getCSVData(string $filename, integer $max_line_size, string $delim)
Given a csv filename, parses the file and returns associative array of records with the header in the 'header' key of the returned array and a 2D array of records in the 'data' key., (*2)
boolean FileWorker::writeCSVData(array $data, string $filename, array $header, string $mode)
Given a 2D array of records, a filename (or path), and optionally an array of header fields, this function will write data to a csv formatted file., (*3)
Also optionally takes a file write mode setting., (*4)
boolean FileWorker::deleteFile(string $filename)
Simple wrapper for deleting files., (*5)
mixed FileWorker::findFilesByExt(string $dir, string $filetypes, boolean $regex_passed)
File search utility by file extension. Supports regex matching via passing the pattern in through the second parameter, just be sure to flip $regex_passed to true if passing regex. Supplying just the first parameter returns all files found., (*6)
mixed FileWorker::findFilesByName(string $dir, string $term, boolean $regex_passed)
File search utility by filename. Supports regex matching via passing the pattern in through the second parameter, just be sure to flip $regex_passed to true if passing regex. Supplying just the first parameter returns all files found., (*7)
mixed FileWorker::renameFile(string $original_name, string $new_name, string $parent_dir)
Simple wrapper for renaming files. Optional $parent_dir parameter for renaming files in non-local directories., (*8)
string FileWorker::buildRegex(string $term, boolean $regex_passed)
Compiles various search terms into regex patterns for use with public class methods. Returns a pattern that matches everything by default., (*9)
README.md generated with evert/phpdoc-md., (*10)
MIT