Current File : //etc/sentora/panel/etc/apps/filemanager/get_file_detail.php |
<?php
session_start();
//ini_set("display_errors", true);
error_reporting(0);
class File_Copy_Move_detail
{
public function __construct()
{
require_once("include/common_function.php");
}
public function get_file_count()
{
sleep(2);
if (class_exists('CommonFunction'))
{
if(array_key_exists("copy_move_file_path",$_SESSION))
{
$tmp_file_name = $_SESSION['copy_move_file_path'];
$cmd = "fileread ".$tmp_file_name;
//print_r(get_class_methods('CommonFunction'));
if(method_exists('CommonFunction', 'file_read_socket'))
{
$socket_return = CommonFunction::file_read_socket($cmd);
if(!$socket_return)
{
echo json_encode(array("status" =>0));
}
else
{
$sock_data1 = trim(preg_replace('/\s+/', ' ', $socket_return));
$sock_data = explode(" ",$sock_data1);
$file_count = intval($sock_data[0]);
$extract_status = trim(preg_replace('/\s+/', '', $sock_data[1]));
if($extract_status == "__HRPANEL_BACKUP_COMPLETED__")
{
$cmd = "filedelete ".$tmp_file_name;
CommonFunction::file_delete_socket($cmd);
echo json_encode(array("status" =>2));
}
else
{
echo json_encode(array("status"=>1,"file_count"=>$file_count));
}
}
}
else
{
echo json_encode(array("status" =>0));
}
}
else
{
echo json_encode(array("status" =>0,"asd"=>13));
}
}
else { echo json_encode(array("status" =>0,"asd"=>12)); }
}
}
$cpm = new File_Copy_Move_detail();
$cpm->get_file_count();
?>