<?php

class CommandPhpSectionBackup extends Command{
  
  private function CreateDir(){
    
  }
  
  
  public function Execute($VarBackupName) {
    $VarFrom = $_SERVER['DOCUMENT_ROOT'] .'/../'. $VarBackupName;
    $VarTo = $this->ObjUpdateMod->UpdateBackupFolder . $VarBackupName;
    
    if(is_file($VarFrom)){
      $VarPos = strrpos($VarTo, '/');
      $VarFolderForCreate = substr($VarTo, 0, $VarPos+1);
    }
    elseif(is_dir($VarFrom)){
      $VarFolderForCreate = $VarTo;
      
    }
    else{
      return FALSE;
    }
    @mkdir($VarFolderForCreate, NULL, TRUE);
//    echo "VarFolderForCreate: ". $VarFolderForCreate;
//    $VarTo = $this->ObjUpdateMod->UpdateBackupFolder . $VarBackupName;
//    echo "VarFrom: ". $VarFrom;
//    echo "VarTo: ". $VarTo;
    $VarResult = $this->cp_r($VarFrom, $VarTo);
    return $VarResult;
//    return FALSE;
  }
}
?>