作者 lyh

gxdemo脚本

@@ -19,7 +19,7 @@ class SyncVideo extends Command @@ -19,7 +19,7 @@ class SyncVideo extends Command
19 * 19 *
20 * @var string 20 * @var string
21 */ 21 */
22 - protected $signature = 'sync_video {file}'; 22 + protected $signature = 'sync_video {path}';
23 23
24 /** 24 /**
25 * The console command description. 25 * The console command description.
@@ -29,8 +29,9 @@ class SyncVideo extends Command @@ -29,8 +29,9 @@ class SyncVideo extends Command
29 protected $description = '同步图片与文件'; 29 protected $description = '同步图片与文件';
30 public function handle() 30 public function handle()
31 { 31 {
32 - $this->param['path'] = $this->argument('file');  
33 - $file_path = $this->getUrl($this->param['path'], 0,0); 32 + $this->param['path'] = $this->argument('path');
  33 + $this->param['name'] = basename($this->param['path']);
  34 + $file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,$this->param['location']);
34 $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php'; 35 $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
35 echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL; 36 echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
36 $code = shell_exec($cmd); 37 $code = shell_exec($cmd);