PHP Classes

PHP Scan Files in Directory: Scan files and directories with DirectoryIterator

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 70%Total: 304 All time: 7,387 This week: 455Up
Version License PHP version Categories
fsscan 1.0.0GNU General Publi...5PHP 5, Files and Folders
Description 

Author

This class can scan files and directories with DirectoryIterator.

It takes the path of a given directory and scans it to extract the list of files.

The class may optionally ignore hidden files that start with . and links.

It returns an array object with the list of files and their attributes JSON encoded.

Picture of Everton da Rosa
  Performance   Level  
Name: Everton da Rosa <contact>
Classes: 17 packages by
Country: Brazil Brazil
Innovation award
Innovation award
Nominee: 3x

Example

<?php
try {
    require
'fsscan.php';

   
$nodes = new FSScan('/home/everton/Documentos/Prefeitura/Incategorizaveis');

   
//exibe o conte?do do ArrayObject
   
foreach ($nodes->getNodes() as $item){
        echo
'<pre>';
       
var_dump($item);
        echo
'<pre>';
        echo
'<hr>';

    }

   
//nodes como JSON
   
echo '<pre>', $nodes->getJSONNodes(), '</pre>';
} catch (
Exception $ex) {
    echo
$ex->getTraceAsString();
}
?>


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file example.php Example Example f use
Plain text file fsscan.php Class Class file

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:304
This week:0
All time:7,387
This week:455Up
 User Ratings  
 
 All time
Utility:100%StarStarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:-
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:70%StarStarStarStar
Rank:287