https://github.com/elusivecodes/fyrepath
FyrePath is a free, open-source path library for PHP.
https://github.com/elusivecodes/fyrepath
file path php utility
Last synced: 6 months ago
JSON representation
FyrePath is a free, open-source path library for PHP.
- Host: GitHub
- URL: https://github.com/elusivecodes/fyrepath
- Owner: elusivecodes
- License: mit
- Created: 2021-10-14T09:32:31.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-29T01:48:09.000Z (over 1 year ago)
- Last Synced: 2024-09-02T23:03:05.248Z (over 1 year ago)
- Topics: file, path, php, utility
- Language: PHP
- Homepage:
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FyrePath
**FyrePath** is a free, open-source path library for *PHP*.
## Table Of Contents
- [Installation](#installation)
- [Methods](#methods)
## Installation
**Using Composer**
```
composer require fyre/path
```
In PHP:
```php
use Fyre\Utility\Path;
```
## Methods
**Base Name**
Get the base name from a file path.
- `$path` is a string representing the file path.
```php
$baseName = Path::baseName($path);
```
**Dir Name**
Get the directory name from a file path.
- `$path` is a string representing the file path.
```php
$dirName = Path::dirName($path);
```
**Extension**
Get the file extension from a file path.
- `$path` is a string representing the file path.
```php
$extension = Path::extension($path);
```
**File Name**
Get the file name from a file path.
- `$path` is a string representing the file path.
```php
$fileName = Path::fileName($path);
```
**Format**
Format path info as a file path.
- `$pathInfo` is an array containing the path info.
```php
$path = Path::format($pathInfo);
```
**Is Absolute**
Determine whether a file path is absolute.
- `$path` is a string representing the file path.
```php
$isAbsolute = Path::isAbsolute($path);
```
**Join**
Join path segments.
All arguments supplied will be joined.
```php
$path = Path::join(...$paths);
```
**Normalize**
Normalize a file path.
- `$path` is a string representing the file path.
```php
$normalized = Path::normalize($path);
```
**Parse**
Parse a file path.
- `$path` is a string representing the file path.
```php
$pathInfo = Path::parse($path);
```
**Resolve**
Resolve a file path from path segments.
All arguments supplied will be resolved.
```php
$path = Path::resolve(...$paths);
```