2017 © Pedro Peláez
 

library file_info

PMVC Plugin for File information

image

pmvc-plugin/file_info

PMVC Plugin for File information

  • Wednesday, September 6, 2017
  • by HillLiu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 663 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Latest Stable Version Latest Unstable Version Build Status License Total Downloads, (*1)

File Information Plugin

Table of Contents

Introduction

This is a file information library, could help you get file size or time., (*2)

Install with Composer

1. Download composer

  • mkdir test_folder
  • curl -sS https://getcomposer.org/installer | php

2. Install by composer.json or use command-line directly

2.1 Install by composer.json

  • vim composer.json
{
    "require": {
        "pmvc-plugin/file_info": "dev-master"
    }
}
  • php composer.phar install

2.2 Or use composer command-line

  • php composer.phar require pmvc-plugin/file_info

How to use

Use Path only (file don't need exists)

include_once('vendor/autoload.php');
PMVC\Load::plug();
$fileInfo = \PMVC\plug('file_info');
$fileInfo->path('/abc/abc.php')->getExt(); // will return "php"

Path functions

  • getExt()
  • getContentType()
    • Return content-type, such as "image/png"

Use with file (file need exists)

include_once('vendor/autoload.php');
PMVC\Load::plug();
$fileInfo = \PMVC\plug('file_info');
$fileInfo->file('/abc/abc.php')->getExt(); // will return "php"

File functions (extends all Path functions)

  • realPath()
    • Get realpath
  • getSize()
   $fileInfo = \PMVC\plug('file_info');
   $size = $fileInfo->file('/abc/abc.php')->getSize();
   echo $size; //transafer to readable format automatically by __tostring()
  • getTime()
   $fileInfo = \PMVC\plug('file_info');
   $accessTime = $fileInfo->file('/abc/abc.php')->getTime()->atime();
   echo $accessTime; //transafer to readable format automatically by __tostring()

The Versions

06/09 2017

dev-master

9999999-dev

PMVC Plugin for File information

  Sources   Download

MIT

The Requires

 

by Hill

file plug-in pmvc

06/09 2017

0.1.3

0.1.3.0

PMVC Plugin for File information

  Sources   Download

MIT

The Requires

 

by Hill

file plug-in pmvc

05/09 2017

0.1.2

0.1.2.0

PMVC Plugin for File information

  Sources   Download

MIT

The Requires

 

by Hill

file plug-in pmvc

04/04 2016

0.1.0

0.1.0.0

PMVC Plugin for File information

  Sources   Download

MIT

The Requires

 

by Hill

file plug-in pmvc