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 Richard Hayes  >  DirOperator  >  Example.php  >  Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example usage
Class: DirOperator
Create, read and delete directories.
Author: By
Last change: upgrade for 1.5
Date: 11 years ago
Size: 760 bytes
 

Contents

Class file image Download
<?php
//====================================
//             Example
//====================================

include_once('DirOperator.php');

$d = new DirOperator();

// Use subdirectories.
$d -> setSubDir();

// Print out contents, only html, htm and .gif files + exclude phpMyAdmin directory.
print_r($d -> output('./'"(htm|html|gif)\$""(phpMyAdmin)"));
print 
'<hr>';

// Reset object
$d -> reset();

// We're not fussy! include all files and all directories.
print_r($d -> output('./'));

// Create a directory
$d -> create("./testdir");
print 
'<hr>';

// Reset object
$d -> reset();

// Include directories with output
$d -> showDir();
print_r($d -> output('./'));

// Delete a directory
$d -> delete("./testdir");
?>