Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2023-06-02 (3 months ago)  | | Not yet rated by the users | | Total: 367 | | All time: 6,825 This week: 204 |
|
Description | | Author |
This class can get several types of information about files.
It takes a given file name and if it exists in can return several details about that file.
Currently it returns the file directory path, base name, file name extension, and the detected MIME type based on the file name extension. | |
|
Details
FileInfo
[![Build Status][build-img]][build-url]
[![Code Climate][gpa-img]][gpa-url]
[![Test Coverage][coverage-img]][coverage-url]
Provides a simple and flexible API wrapper around PHP's pathinfo method.
Installation
The recommended way of installing this package is through Composer:
$ composer require nbish11/fileinfo
Basic Usage
<?php
require 'vendor/autoload.php';
$finfo = new FileInfo('C:/path/to/file.txt');
// Using standard API methods:
echo $finfo->getDirectory(); // 'C:/path/to/'
echo $finfo->getBaseName(); // 'file.txt'
echo $finfo->getExtension(); // 'txt'
echo $finfo->getFileName(); // 'file'
echo $finfo->getMimeType(); // 'text/plain'
// Using class properties:
echo $finfo->directory; // 'C:/path/to/'
echo $finfo->basename; // 'file.txt'
echo $finfo->extension; // 'txt'
echo $finfo->filename; // 'file'
echo $finfo->mimetype; // 'text/plain'
Contributing
> Please see CONTRIBUTING.
<a name="license"></a>License
> Copyright © 2016 Nathan Bishop
>
> Please see LICENSE for more information.
[build-url]: https://travis-ci.org/nbish11/FileInfo
[build-img]: https://travis-ci.org/nbish11/FileInfo.svg?branch=master
[gpa-url]: https://codeclimate.com/github/nbish11/FileInfo
[gpa-img]: https://codeclimate.com/github/nbish11/FileInfo/badges/gpa.svg
[coverage-url]: https://codeclimate.com/github/nbish11/FileInfo/coverage
[coverage-img]: https://codeclimate.com/github/nbish11/FileInfo/badges/coverage.svg
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.