作者 lyh

未续费项目增加搜索

... ... @@ -51,12 +51,13 @@ class SyncTimeMinuteFile extends Command
echo date('Y-m-d H:i:s') . ' | file_ok:' . $dir.$path . PHP_EOL;
continue;
}
$this->param['name'] = basename($path);
$this->param['path'] = str_replace('/'.$this->param['name'],'',$path);
$file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
$code = shell_exec($cmd);
// $this->param['name'] = basename($path);
// $this->param['path'] = str_replace('/'.$this->param['name'],'',$path);
// $file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);
// $cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
// echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
// $code = shell_exec($cmd);
$code = $this->synchronizationFile($path);
if(200 != (int)$code){
echo date('Y-m-d H:i:s') . ' | 错误状态:' . $code . PHP_EOL;
$errorFileModel = new ErrorFile();
... ... @@ -67,6 +68,14 @@ class SyncTimeMinuteFile extends Command
return true;
}
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
/**
* @remark :获取图片文件链接
* @name :getUrl
... ...
... ... @@ -30,12 +30,7 @@ class SyncVideo extends Command
public function handle()
{
$path = $this->argument('path');
$this->param['name'] = basename($path);
$this->param['path'] = str_replace('/'.$this->param['name'],'',$path);
$file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,0);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
$code = shell_exec($cmd);
$code = $this->synchronizationFile($path);
echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
if(200 != (int)$code){
echo date('Y-m-d H:i:s') . ' | ' . $code . PHP_EOL;
... ... @@ -45,6 +40,14 @@ class SyncVideo extends Command
return true;
}
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
/**
* @remark :获取图片文件链接
* @name :getUrl
... ...