PHPackages                             mdeschermeier/fileworker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. mdeschermeier/fileworker

ActiveLibrary[File &amp; Storage](/categories/file-storage)

mdeschermeier/fileworker
========================

v1.0(9y ago)128MITPHP

Since Mar 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mdeschermeier/fileworker)[ Packagist](https://packagist.org/packages/mdeschermeier/fileworker)[ RSS](/packages/mdeschermeier-fileworker/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

mdeschermeier\\FileWorker
=========================

[](#mdeschermeierfileworker)

A simple package for searching, renaming, deleting, reading, and writing .csv files.

- Class name: FileWorker
- Namespace: mdeschermeier\\FileWorker

Methods
-------

[](#methods)

### getCSVData

[](#getcsvdata)

```
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.

- Visibility: **public**
- This method is **static**.

#### Arguments

[](#arguments)

- $filename **string**
- $max\_line\_size **integer**
- $delim **string**

### writeCSVData

[](#writecsvdata)

```
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.

Also optionally takes a file write mode setting.

- Visibility: **public**
- This method is **static**.

#### Arguments

[](#arguments-1)

- $data **array**
- $filename **string**
- $header **array**
- $mode **string**

### deleteFile

[](#deletefile)

```
boolean FileWorker::deleteFile(string $filename)

```

Simple wrapper for deleting files.

- Visibility: **public**
- This method is **static**.

#### Arguments

[](#arguments-2)

- $filename **string**

### findFilesByExt

[](#findfilesbyext)

```
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.

- Visibility: **public**
- This method is **static**.

#### Arguments

[](#arguments-3)

- $dir **string**
- $filetypes **string**
- $regex\_passed **boolean**

### findFilesByName

[](#findfilesbyname)

```
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.

- Visibility: **public**
- This method is **static**.

#### Arguments

[](#arguments-4)

- $dir **string**
- $term **string**
- $regex\_passed **boolean**

### renameFile

[](#renamefile)

```
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.

- Visibility: **public**
- This method is **static**.

#### Arguments

[](#arguments-5)

- $original\_name **string**
- $new\_name **string**
- $parent\_dir **string**

### buildRegex

[](#buildregex)

```
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.

- Visibility: **private**
- This method is **static**.

#### Arguments

[](#arguments-6)

- $term **string**
- $regex\_passed **boolean**

README.md generated with evert/phpdoc-md.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3393d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16123463?v=4)[Mike Deschermeier](/maintainers/mdeschermeier)[@mdeschermeier](https://github.com/mdeschermeier)

---

Top Contributors

[![mdeschermeier](https://avatars.githubusercontent.com/u/16123463?v=4)](https://github.com/mdeschermeier "mdeschermeier (13 commits)")

### Embed Badge

![Health badge](/badges/mdeschermeier-fileworker/health.svg)

```
[![Health](https://phpackages.com/badges/mdeschermeier-fileworker/health.svg)](https://phpackages.com/packages/mdeschermeier-fileworker)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
