You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

71 lines
2.4 KiB

<?php
namespace App\Console\Commands;
use App\Services\FileService;
use App\Services\GooglePhotoSyncService;
use App\Services\LiveStreamService;
use Illuminate\Console\Command;
class TestCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'test:all';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$service = new GooglePhotoSyncService();
// $service->syncDBToRedis();exit;
$service->syncImageFiles();exit;
$service = new FileService();
// $service->queryFileTime("/Users/shixuesen/Documents/sync/image/instagram/mobe_carrie0223/mobe__0020/82339160_561812341080795_8865402232426240219_n.jpg");exit;
echo $service->processDirAndFindLastFileMTime("/Users/shixuesen/Documents/sync/image/weibo/");exit;
// $service = new LiveStreamService();
// $service->moveFilesAndRenameFiles("/Users/shixuesen/Downloads/rsyncFiles/a", "/Users/shixuesen/Downloads/rsyncFiles/b");
// exit;
// $a = str_replace("/", "", "aaaaa/bbbb");
// echo $a;exit;
//
$file = "/Volumes/Crucial X6/Image/weibo/image/一只小短短OwO--7f605a17gy1gxpb0pg31vj22eo37k1kz.jpg";
$file = "/Users/shixuesen/Documents/sync/image/instagram/Likes/eeelyeee_277962893_719835709026094_2370282265319075961_n.jpg";
// $file = "/Users/shixuesen/OneDrive/Pictures/instagram/Likes_new/eeelyeee_277962893_719835709026094_2370282265319075961_n.jpg";
$file = "/Users/shixuesen/Documents/sync/image/instagram/boram__jj/277958530_1581189285586989_5049761303029075957_n.jpg";
// $file = "/Users/shixuesen/OneDrive/Pictures/instagram/boram__jj/277958530_1581189285586989_5049761303029075957_n.jpg";
$mtime = date("Y-m-d H:i:s", filemtime($file));
$atime = date("Y-m-d H:i:s", fileatime($file));
$ctime = date("Y-m-d H:i:s", filectime($file));
// $stat = stat($file);
echo "file mtime is $mtime, atime is $atime, ctime is $ctime";
// dump($stat);
}
}