chore: 批量修改文件权限为可执行
将项目内绝大多数文件的权限从644调整为755,统一可执行权限配置
This commit is contained in:
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+45
-21
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\command;
|
||||
|
||||
use Exception;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
@@ -31,7 +33,7 @@ class Lebo extends Command
|
||||
}
|
||||
protected function execute(Input $input, Output $output)
|
||||
{
|
||||
$this->aria2 = new Aria2('http://127.0.0.1:16800/jsonrpc','11223344');
|
||||
$this->aria2 = new Aria2('http://192.168.100.106:16800/jsonrpc', '11223344');
|
||||
$this->completed = false;
|
||||
while ($this->completed === false) {
|
||||
try {
|
||||
@@ -47,21 +49,32 @@ class Lebo extends Command
|
||||
}
|
||||
private function start()
|
||||
{
|
||||
// $savepath = store_path() . '/lebolebo/';
|
||||
$savepath = 'D:/lebolebo/';
|
||||
$savepath = store_path() . '/lebolebo/';
|
||||
// $savepath = 'D:/lebolebo/';
|
||||
$account_cache_key = 'lebo_account';
|
||||
$account_info = Cache::get($account_cache_key);
|
||||
if ($account_info) {
|
||||
} else {
|
||||
$account = new Account();
|
||||
$account_info = $account->login('13880615958', 'robo520');
|
||||
if ($account_info['code'] == 500) {
|
||||
dump($account_info['msg']);
|
||||
exit;
|
||||
}
|
||||
$curl = new Curl();
|
||||
Cache::set($account_cache_key, $account_info, 3600);
|
||||
dump('账号信息缓存成功');
|
||||
}
|
||||
// $curl = new Curl();
|
||||
$curr = new Curriculum();
|
||||
$curr->setHeader('token', $account_info['data']['token']);
|
||||
$course = $curr->list(0);
|
||||
$course = $curr->list(1);
|
||||
|
||||
foreach ($course['data']['list'] as $list){
|
||||
foreach ($course['data']['list'] as $index => $list) {
|
||||
$c = $savepath . $list['courseName'];
|
||||
// dump($index,$list['courseName']);
|
||||
if ($list['courseName'] != '线上-CSP-J 集训课程') {
|
||||
continue;
|
||||
}
|
||||
is_dir($c) || mkdir($c, 0755, true);
|
||||
$detail = $curr->detail($list['id']);
|
||||
$courseCover = $c . '/courseCover.png';
|
||||
@@ -72,7 +85,8 @@ class Lebo extends Command
|
||||
// $result = $curl->_fastDownload($downloadurl,$courseCover);
|
||||
$this->aria2->addUri(
|
||||
[$downloadurl],
|
||||
['dir'=>$c,
|
||||
[
|
||||
'dir' => $c,
|
||||
'out' => 'courseCover.png'
|
||||
]
|
||||
);
|
||||
@@ -123,7 +137,7 @@ class Lebo extends Command
|
||||
switch ($kk['resourceType']) {
|
||||
case '1': // PPT-HTML
|
||||
if (!isset($kk['content'])) {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
$filename = $kk['content']['fileName'];
|
||||
$downloadurl = $kk['content']['fileUrl'];
|
||||
@@ -141,8 +155,10 @@ class Lebo extends Command
|
||||
// }
|
||||
$this->aria2->addUri(
|
||||
[$downloadurl],
|
||||
['dir'=>$sessionName,
|
||||
'out'=>$filename]
|
||||
[
|
||||
'dir' => $sessionName,
|
||||
'out' => $filename
|
||||
]
|
||||
);
|
||||
} else if ($check && !is_file($file)) {
|
||||
if (is_file($check)) {
|
||||
@@ -161,8 +177,10 @@ class Lebo extends Command
|
||||
// }
|
||||
$this->aria2->addUri(
|
||||
[$downloadurl],
|
||||
['dir'=>$sessionName,
|
||||
'out'=>$filename]
|
||||
[
|
||||
'dir' => $sessionName,
|
||||
'out' => $filename
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -204,8 +222,10 @@ class Lebo extends Command
|
||||
// }
|
||||
$this->aria2->addUri(
|
||||
[$downloadurl],
|
||||
['dir'=>$shiyishi,
|
||||
'out'=>$filename]
|
||||
[
|
||||
'dir' => $shiyishi,
|
||||
'out' => $filename
|
||||
]
|
||||
);
|
||||
} else if ($check && !is_file($file)) {
|
||||
copy($check, $file);
|
||||
@@ -225,7 +245,7 @@ class Lebo extends Command
|
||||
case '13':
|
||||
// 教辅
|
||||
if (!isset($kk['content']['resourceList'])) {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
$jiaofupath = $sessionName . '/教辅/';
|
||||
if (!is_dir($jiaofupath)) {
|
||||
@@ -256,8 +276,10 @@ class Lebo extends Command
|
||||
// }
|
||||
$this->aria2->addUri(
|
||||
[$downloadurl],
|
||||
['dir'=>$jiaofupath,
|
||||
'out'=>$resourceList['fileName']]
|
||||
[
|
||||
'dir' => $jiaofupath,
|
||||
'out' => $resourceList['fileName']
|
||||
]
|
||||
);
|
||||
} else if ($check && !is_file($file)) {
|
||||
copy($check, $file);
|
||||
@@ -271,7 +293,7 @@ class Lebo extends Command
|
||||
case '14':
|
||||
// 备课
|
||||
if (!isset($kk['content']['resourceList'])) {
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
$beikepath = $sessionName . '/备课/';
|
||||
if (!is_dir($beikepath)) {
|
||||
@@ -299,8 +321,10 @@ class Lebo extends Command
|
||||
// }
|
||||
$this->aria2->addUri(
|
||||
[$downloadurl],
|
||||
['dir'=>$beikepath,
|
||||
'out'=>$resourceList['fileName']]
|
||||
[
|
||||
'dir' => $beikepath,
|
||||
'out' => $resourceList['fileName']
|
||||
]
|
||||
);
|
||||
} else if ($check && !is_file($file)) {
|
||||
copy($check, $file);
|
||||
@@ -337,7 +361,7 @@ class Lebo extends Command
|
||||
$key = 'lebolebo_check_header_' . md5($url);
|
||||
try {
|
||||
if (($head = Cache::get($key, null)) === NULL) {
|
||||
$head = @get_headers($url,1);
|
||||
$head = @get_headers($url, true);
|
||||
if ($head === false) {
|
||||
dump('获取文件信息失败,直接重新下载' . $file);
|
||||
return false;
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+6
-4
@@ -33,14 +33,16 @@ class Curriculum
|
||||
|
||||
public function list(int $page = 0)
|
||||
{
|
||||
$url = 'https://api-manage2.shengtongedu.cn/st-course-server/manage/course/coursePageListV3';
|
||||
// $url = 'https://api-manage2.shengtongedu.cn/st-course-server/manage/course/coursePageListV3';
|
||||
$url = 'https://api-manage2.shengtongedu.cn/st-course-server/manage/course/coursePageListV6';
|
||||
$options = [
|
||||
'body'=>json_encode([
|
||||
'campusIdList'=>["1863"],
|
||||
'campusIdList'=>["2404"],
|
||||
'pageNum'=>$page,
|
||||
'pageSize'=>200,
|
||||
'pageSize'=>96,
|
||||
'platform'=>"OMO_WEB",
|
||||
'total'=>101,
|
||||
'searchType'=>true,
|
||||
'total'=>152,
|
||||
]),
|
||||
'headers'=>$this->headers
|
||||
];
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user