Ejemplo n.º 1
0
/**
 * Example file to demonstrate use of directory_info class
 *
 * File: example/example.php
 * @package directory_info
 */
include 'directoryinfo.inc.php';
// Directory path relative to the location of this file
$pathtodir = 'example/tst/';
$dirobj = new directory_info();
$array_ext = array('jpg', 'png', 'zip');
$myList = $dirobj->get_ext_based_filelist(null, $pathtodir, true, $array_ext);
print_r($myList);
echo '<br />';
$myList = $dirobj->get_filelist(null, $pathtodir, false);
print_r($myList);
echo ' - bez podfolderow<br />';
print 'filecount is (bez): ' . $dirobj->filecount;
echo '<br />';
$myList = $dirobj->get_filelist(null, $pathtodir, true);
print_r($myList);
echo ' - z folderami- use recursive<br />';
print 'filecount is (z podfolderem): ' . $dirobj->filecount;
echo '<br />';
$myList = $dirobj->get_human_readable_dirsize(null, $pathtodir, true);
print_r($myList);
echo '<br />';
$myList = $dirobj->get_human_readable_filesize($pathtodir . 'Malta 1266.jpg');
print_r($myList);
echo '<br />';