<?php
/**
* Extended File system API
*
* eFilesyste class
*
* @category System
* @package eFilesystem
* @author JoungKyun.Kim <http://oops.org>
* @copyright (c) 2009 OOPS.ORG
* @license BSD
* @version $Id$
* @link http://pear.oops.org/package/ePrint
* @since File available since relase 0.0.1
*/
require_once './eFilesystem.php';
function answer ($v) {
echo ( $v === true ) ? 'OK' : 'FALSE';
echo "\n";
}
echo "##### SELF test #############################################\n";
try {
echo '1. check file_nr ... ';
/*
if ( is_array ($r) ) {
ePrint::echoi ($r, 4);
echo "\n";
}
*/
unset ($r);
echo '2. check mkdir_p ... ';
#echo ePrint::whiteSpace (4, true) . "indent 4\n";
answer ($r);
if ( $r === true ) {
echo " check tree ... \n";
ePrint::echoi ($capture, 4);
}
echo '3. check unlink_r ... ';
answer ($r);
echo "4. check dirlist ...\n";
ePrint::echoi ($r, 4);
echo "\n";
echo "5. check find ... \n";
ePrint::echoi ($r, 4);
echo "\n\n";
echo "##### OBJ test #############################################\n";
echo '1. check file_nr ... ';
$r = $fs->file_nr ('eFilesystem.php');
/*
if ( is_array ($r) ) {
$fs->echoi ($r, 4);
echo "\n";
}
*/
unset ($r);
echo '2. check mkdir_p ... ';
#echo $fs->whiteSpace (4, true) . "indent 4\n";
$r = $fs->mkdir_p ('./aaa/bbb');
answer ($r);
if ( $r === true ) {
echo " check tree ... \n";
$fs->tree ('./aaa');
$fs->echoi ($capture, 4);
}
echo '3. check unlink_r ... ';
$r = $fs->unlink_r ('./aaa');
answer ($r);
echo "4. check dirlist ...\n";
$r = $fs->dirlist ('./');
$fs->echoi ($r, 4);
echo "\n";
echo "5. check find ... \n";
$r = $fs->find ('./');
$fs->echoi ($r, 4);
echo "\n";
fprintf (STDERR, "%s\n", $e->Message ());
#print_r ($e);
#print_r ($e->Trace ());
#echo $e->TraceAsString () . "\n";
print_r ($e->TraceAsArray ()) .
"\n";
$e->finalize ();
}
?>