Automation init...1

This commit is contained in:
최준흠 2024-09-05 00:24:06 +09:00
parent 1c1e64ed84
commit 1b55308fd3
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ class Crawler extends BaseController
$library->execute(); $library->execute();
//2. 워드프레스에 로그인 처리 기능 //2. 워드프레스에 로그인 처리 기능
//3. 워드프레스의 자유게시판에 게시물 등록 기능 //3. 워드프레스의 자유게시판에 게시물 등록 기능
log_message("info", "완료되었습니다."); log_message("notice", "완료되었습니다.");
return true; return true;
} catch (\Exception $e) { } catch (\Exception $e) {
log_message("error", $e->getMessage()); log_message("error", $e->getMessage());

View File

@ -65,7 +65,7 @@ trait MyWebTrait
'cookies' => $this->getCookieJar(), 'cookies' => $this->getCookieJar(),
]); ]);
if ($response->getStatusCode() != 200) { if ($response->getStatusCode() != 200) {
throw new \Exception("info", "로그인 실패: " . $response->getStatusCode()); throw new \Exception("로그인 실패: " . $response->getStatusCode());
} }
} }
@ -91,10 +91,10 @@ trait MyWebTrait
// 'sink' => $savePath, // 'sink' => $savePath,
]); ]);
if (!$response) { if (!$response) {
throw new \Exception("info", "{$fileName} 파일 다운로드 실패"); throw new \Exception("{$fileName} 파일 다운로드 실패");
} }
$this->saveByMyStorage($savePath, $response); $this->saveByMyStorage($savePath, $response);
log_message("info", "{$fileName} 파일이 다운로드되었습니다!"); log_message("notice", "{$fileName} 파일이 다운로드되었습니다!");
} }
} }
} }