This commit is contained in:
2026-03-11 15:57:27 +01:00
parent 481271c972
commit b4b460fd21
10775 changed files with 2071579 additions and 26409 deletions

View File

@@ -0,0 +1,28 @@
<?php
if (!defined('WPVIVID_PLUGIN_DIR')){
die;
}
abstract class WPvivid_Remote{
public $current_file_name = '';
public $current_file_size = '';
public $last_time = 0;
public $last_size = 0;
public $object;
public $remote;
abstract public function test_connect();
abstract public function upload($task_id,$files,$callback = ''); // $files = array();
abstract public function download($file,$local_path,$callback = ''); // $file = array('file_name' => ,'size' =>,'md5' =>)
abstract public function cleanup($files); // $files = array();
public function formatBytes($bytes, $precision = 2)
{
$units = array('B', 'KB', 'MB', 'GB', 'TB');
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);
$bytes /= (1 << (10 * $pow));
return round($bytes, $precision) . '' . $units[$pow];
}
}