40        $folders = preg_split(
"#[\\\\/]#", $folder);
 
   42        for(
$i = 0, $c = count($folders); 
$i < $c; 
$i++) {
 
   43            if(empty($folders[
$i])) {
 
   46                    $base .= DIRECTORY_SEPARATOR;
 
   54            $base .= DIRECTORY_SEPARATOR;
 
   67            return $this->copy(
$source, $dest);
 
   75        while ( 
false !== ($entry = $dir->read()) ) {
 
   77            if ($entry == 
'.' || $entry == 
'..') {
 
   84            if ($dest !== 
"$source/$entry") {
 
   85                $this->
copyr(
"$source/$entry", 
"$dest/$entry");
 
  111        if (!$this->file_exists($dirname)) {
 
  116        if ($this->is_file($dirname) || $this->is_link($dirname)) {
 
  117            return $this->unlink($dirname);
 
  121        $dir = $this->dir($dirname);
 
  122        while (
false !== $entry = $dir->read()) {
 
  124            if ($entry == 
'.' || $entry == 
'..') {
 
  128            $this->
rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);
 
  133        return $this->rmdir($dirname);
 
  139    public function globr($dir, $pattern, $flags = NULL)
 
  141        $files = $this->glob(
"$dir/$pattern", $flags);
 
  143        $sub_dirs = $this->glob(
"$dir/*", GLOB_ONLYDIR);
 
  144        if ($sub_dirs === 
false) $sub_dirs = array();
 
  145        foreach ($sub_dirs as $sub_dir) {
 
  146            $sub_files = $this->
globr($sub_dir, $pattern, $flags);
 
  159        return call_user_func_array(
$name, $args);
 
An exception for terminatinating execution or to throw for unit testing.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file