Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Paul Scott  >  File Manager  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: File Manager
Perform several types of file manipulation
Author: By
Last change:
Date: 8 years ago
Size: 885 bytes
 

Contents

Class file image Download
<?php
//include the class src
include('filemanager_class_inc.php');
//instantiate the class
$files = new filemanager;

//do a recursive file search for *.php
$phpfiles $files->globr('/var/www/html/phpclasses/','*.php',NULL);
print_r($phpfiles);

//find the parent directory
$parent $files->parentDir();
echo 
$parent;

//change a files permissions...
$files->changeMode('/var/www/html/test.php',0777);

//Method to perform a Recursive chmod
$files->chmod_R('/var/www/',0777);

//get the octal for a given permission
$octal $files->chmodnum('--rxwrxw');
echo 
$octal;

//Recursively chown files to a group
$files->recurse_chown_chgrp('/var/www/'$uid$gid);

//recursively copy a directory and contents to dest
$files->copyr('/var/www/phpclasses''/var/www/php_backups');

//Determine how much free drive space is available
$files->df('/');

//or for Windows
$files->df("C:");
?>