Ec (2); & nbsp; copy the code classmakeHtml {& nbsp; var $ fileName; File Name & nbsp; var $ dirRoot; & nbsp; directory address & nbsp; functiongetFile ($ name, $ root) {& nbsp; script ec (2); script
| The Code is as follows: |
|
|
Class makeHtml {
Var $ fileName; // file name
Var $ dirRoot; // directory address
Function getFile ($ name, $ root ){
$ This-> fileName = $ name;
$ This-> dirRoot = $ root;
If (file_exists ($ root )){
$ This-> makeRoot ($ root );
}
}
Function makeNew ($ content ){
$ Fp = @ fopen ($ this-> dirRoot. "/". $ this-> fileName, "w ");
If (! Fwrite ($ fp, $ content )){
Fclose ($ fp );
@ Unlink ($ fn );
Return 0;
} Else {
Fclose ($ fp );
Return 1;
}
}
Function _ delFile (){
If (unlink ($ this-> fileName. "/". $ this-> fileRoot )){
Return 1;
} Else {
Return 0;
}
}
Function delFile ($ fileName, $ fileRoot ){
If (unlink ($ fileRoot. "/". $ fileName )){
Return 1;
} Else {
Return 0;
}
}
Function getRoot (){
}
Function makeRoot (){
}
Function delRoot (){
}
} |