Viewing File: /usr/local/cpanel/whostmgr/docroot/cgi/softaculous/lib/panels/remote/customio.sample.php
<?php
class CustomIO{
// Public
var $ftp_conn;
// Private
private $host = '';
private $port = '';
private $user = '';
private $pass = '';
function __construct(){
// Not required
}
/**
* Destructor
*/
function __destruct(){
// Task when process is completed. Generally closing the connection.
}
/**
* Connect to the server
* Param1 : $host - Domain name or the IP address to connect
* Param2 : $port - Port through which server will be connected
* Param2 : $user - User to login
* Param2 : $pass - Password of the user to login
* Return : int(1) in case of error
: return $this->ftp_conn with the resource connection
*/
function connect($host, $port, $user, $pass){
// Connect to the host and login
}
/**
* Delete file
* Param : File Path to be deleted
* Return : Boolean. True if deleted successfully.
*/
function delete($filename){
// Delete Code will come here
}
/**
* Is directory present
* Param : $dir - Path to directory
* Return : Boolean. True if directory is present.
*/
function is_dir($dir){
// Check if directory specified is present
}
/**
* Change Directory
* Param : $dir - Path to directory
* Return : Boolean. True if directory was changed.
*/
function chdir($dir){
// Change Directory
}
/**
* Delete file
* Param : File Path to be deleted
* Return : String. Path of the Directory.
*/
function pwd(){
// Prints Working Directory
}
/**
* Change Mode
* Param1 : $pathname - Path to be chmod
* Return : Boolean. True if chmod was successful.
*/
function chmod($pathname, $mode){
// Change Mode
}
/**
* Check if file exists
* Param : $file - File Path
* Return : Boolean. True is file is present.
*/
function file_exists($file){
// Check if file exists
}
/**
* Rename File/Folder
* Param1 : $from - Old Path
* Param2 : $to - New Path
* Return : Boolean. True if file/folder was renamed successfully.
*/
function rename($from, $to){
// Rename file/folder
}
/**
* Delete directory
* Param : $dir - Path to Directory
* Return : Boolean. True if deleted successfully.
*/
function rmdir($dir){
// Remove Directory
}
/**
* Make Directory
* Param : $dirname - Directory Path
* Return : Boolean. True if directory was successfully created.
*/
function mkdir($dirname, $mode = 0755){
// Make Directory
}
/**
* Make Directory Recursively
* Param : $dirname - Directory Path
* Return : Boolean. True if directory was successfully created.
*/
function mmkdir($dir, $mode = 0755) {
// Make Directory recursively
}
/**
* Exec (Optional)
* Param : $command - Command to be excuted
* Return : Boolean. True if executed successfully.
*/
function exec($command){
// Exec Function (Optional)
}
/**
* Check if directory or file exists
* Param : $file - file/directory path
* Return : Boolean. True if file/directory exists.
*/
function is_exists($file){
// Check if directory or file exists
}
/**
* File List of the Directory
* Param : $dir - Path of the Directory
* Return : array. Return format should be same as ftp_nlist
*/
function filelist($dir){
// Get the file list similar to ftp_nlist
}
/**
* Put a file
* Param1 : File Path of Local file
* Param2 : File Path of Remote file
* Return : Boolean. True if file was uploaded successfully.
*/
function put($local_file, $remote_file){
// Put File Local to Remote
}
/**
* Get the file from Remote to Local
* Param1 : Path to Remote File
* Param2 : Path to Local File
* Return : Boolean. True is deleted successfully.
*/
function get($remote_file, $local_file){
// Get file remote to local
}
/**
* Put the whole directory recursively
* Param1 : Local Directory
* Param2 : Remote Directory
* Return : Boolean. True if whole directory was uploaded.
*/
function mput($local, $remote){
// Put whole directory recursively
}
/**
* Takes the DATA rather than the LOCAL file
* Param1 : Remote file
* Param2 : String (Content of the file)
* Param3 : Boolean - Allow restoring. 1 to enable
* Return : Boolean. True is deleted successfully.
*/
function softput($remotefile=NULL, $softdata, $rest=0) {
// Put String to Remote File
}
/**
* Returns the Data
* Param : remote file
* Return : String. Contents of the file.
*/
function softget($remotefile=NULL) {
// Reads and returns the contents of the remote file
}
}
?>Back to Directory