PHPackages                             lewiscowles/file-extension-utils - 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. lewiscowles/file-extension-utils

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

lewiscowles/file-extension-utils
================================

Utilities for dealing with file extensions

2.0.0(6y ago)22872[4 issues](https://github.com/Lewiscowles1986/filesystem-file-extension-php/issues)GPL-3.0PHPPHP &gt;=7.2CI failing

Since Nov 16Pushed 5y ago2 watchersCompare

[ Source](https://github.com/Lewiscowles1986/filesystem-file-extension-php)[ Packagist](https://packagist.org/packages/lewiscowles/file-extension-utils)[ RSS](/packages/lewiscowles-file-extension-utils/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (2)Versions (6)Used By (0)

filesystem-file-extension-php
=============================

[](#filesystem-file-extension-php)

PHP File Extension Utility Library

[![Build Status](https://camo.githubusercontent.com/5a5db3fccac626cacdac29f17112670d94b0335d01ea1f3a63be050fb24cd5c8/68747470733a2f2f7472617669732d63692e6f72672f4c65776973636f776c6573313938362f66696c6573797374656d2d66696c652d657874656e73696f6e2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Lewiscowles1986/filesystem-file-extension-php)[![Coverage Status](https://camo.githubusercontent.com/f376809dbf7c5f97b65667d69836a5b9147add3d5cfc783475ed73d3d2679ae6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4c65776973636f776c6573313938362f66696c6573797374656d2d66696c652d657874656e73696f6e2d7068702f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Lewiscowles1986/filesystem-file-extension-php?branch=master)[![Latest Version](https://camo.githubusercontent.com/16d406c5a0b61bdee94f70406419e4c14f03c6b3908536a7ea335713a1cb9ff3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f4c65776973636f776c6573313938362f66696c6573797374656d2d66696c652d657874656e73696f6e2d7068702e737667)](https://github.com/Lewiscowles1986/filesystem-file-extension-php/releases)[![GitHub License](https://camo.githubusercontent.com/a72aa41233ca825be7cff92cbf284e0d07ccb8180d2afa9e28c72ecc272b57f9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c76332d79656c6c6f772e737667)](https://raw.githubusercontent.com/Lewiscowles1986/filesystem-file-extension-php/master/LICENSE)

Details
-------

[](#details)

### Runtime &amp; Environment

[](#runtime--environment)

#### Production

[](#production)

This should work with any [security supported version of PHP 7.x](https://www.php.net/supported-versions.php) line

#### Development

[](#development)

Additional requirements are required for development

- Composer
- doxygen
- xDebug

### Namespaces

[](#namespaces)

`lewiscowles\Utils\FileSystem\Extension`

#### Methods provided

[](#methods-provided)

```
fixExtensionIfNeeded (string $originalExtension, string $filename) : string
```

```
getExtensionFromFilename (string $filename) : string
```

```
hasNoExtension (string $filename) : bool
```

```
isExtensionTooShort (string $extension) : bool
```

```
isDualPartExtension (string $extension) : bool
```

```
isDotFile (string $filename) : bool
```

Purpose
-------

[](#purpose)

This package was created solely for the purpose of facilitating the WordPress SVG plugin. It is my hope that it provides other benefit, but that has not been the case.

If you spot a bug, or have a feature-request or improvement, please [create an issue](/Lewiscowles1986/filesystem-file-extension-php/issues).

Contributing
------------

[](#contributing)

Documentation and Tests must be provided for any contribution. If this is a problem due to lack of knowledge or experience; please make an issue and submit a draft PR to ask for help. This should be a small enough library that learning can be helped.

At all times a polite and courteous tone should be used when communicating, contributing or interacting with this repository.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92% 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

Every ~298 days

Total

4

Last Release

2202d ago

Major Versions

1.2.5 → 2.0.02020-04-30

PHP version history (2 changes)1.0.1PHP &gt;=7.0

1.2.5PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9311118828e6efd86d66a7ca0991ed23fa8f3dad550931b3a90d495cb582ca8a?d=identicon)[LewisCowles1986](/maintainers/LewisCowles1986)

---

Top Contributors

[![Lewiscowles1986](https://avatars.githubusercontent.com/u/2605791?v=4)](https://github.com/Lewiscowles1986 "Lewiscowles1986 (23 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (2 commits)")

---

Tags

filesystemphp-libraryphp7tiny-library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lewiscowles-file-extension-utils/health.svg)

```
[![Health](https://phpackages.com/badges/lewiscowles-file-extension-utils/health.svg)](https://phpackages.com/packages/lewiscowles-file-extension-utils)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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