nbish11 / fileinfo
A FileInfo class for thos without support for PHP's finfo class.
v1.0.0
2016-07-14 21:03 UTC
Requires
- php: >=5.3.2
Requires (Dev)
- codeclimate/php-test-reporter: ^0.3.2
- phpunit/phpunit: ^4.8
This package is auto-updated.
Last update: 2024-12-29 05:15:59 UTC
README
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.
License
Copyright © 2016 Nathan Bishop
Please see LICENSE for more information.