PHP Classes

PHP File Magic: Check file access and execution permissions

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 75 This week: 1All time: 10,157 This week: 560Up
Version License PHP version Categories
filemagic 1.0GNU General Publi...5.3PHP 5, Files and Folders
Description 

Author

This class can check file access and execution permissions.

It can detect the file MIME type using the finfo extension and well check its access permissions.

If the file has read access permissions it can also return its size, file type, file access statistics, MIME types, executable permissions, and contents hash values.

Picture of Wladek
  Performance   Level  
Name: Wladek <contact>
Classes: 1 package by
Country: Hungary Hungary
Age: ???
All time rank: 445439 in Hungary Hungary
Week rank: 411 Up4 in Hungary Hungary Up

Example

<?php

require __DIR__.DIRECTORY_SEPARATOR.'filemagic.php';
$m= new FileMagic('/bin/bash');

// This test generates all information regarding to the filename
var_dump($m->collected());
// OR we need the MIME type of affected file
var_dump($m->mime());
// OR we need an info about the file whether executeable or not reagrding to its mime type
var_dump($m->executable());


  Files folder image Files  
File Role Description
Plain text file filemagic.php Class The FileMagic class
Accessible without login Plain text file test.php Example An example for FileMagic class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:75
This week:1
All time:10,157
This week:560Up