Location: PHPKode > scripts > Directory Handler > index.php
<?php
/**
 * As far as we need it
 */
require_once 'DirectoryHandler.php';
/*
 * Create a new dir for testing
 * NOTE: some Linux servers don't allow PHP scripts to create directories
 * It is a matter of permissions from the root and not a problem with "DirectoryHandler" or PHP themselves
 * So contact your server administrator to change the Permissions so that PHP can handle directories
 * using "DirectoryHandler"
 * In most cases this can fix the server permissions:
 * 
 * chmod -R a+rw directoryName
 */
if(!is_dir( 'start' )) {
	mkdir( 'start' );
}
/**
 * 
 * New instance of DirectoryHandler is needed
 */
$dir = new DirectoryHandler();
/**
 * Creates a copy of "start" and names it as "new"
 */
$dir->copyDirectory( 'start', 'new' );
/**
 * Copies "new" and creates "other" 
 */
$dir->copyDirectory( 'new', 'other' );
/**
 * Deletes the "new" copy.
 * To prove that it was in fact deleted
 * You will have "other" that was created from "new" 
 */
$dir->deleteDirectory( 'new' );
/**
 * Renames "other" to "end"
 * So we end up with "start" and "end"
 */
$dir->renameDirectory( 'other', 'end' );
/*
 * End of file;
 */
Return current item: Directory Handler