From e392c9d19ca5ae1cf15f8e3251629c4a22e46629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Sat, 14 Sep 2024 20:44:49 +0900 Subject: [PATCH] Automation init...3 --- app/Controllers/CrawlerController.php | 2 +- .../{Cloudflare => }/CloudflareLibrary.php | 2 +- .../{MyStorage => }/Mangboard/BoardLibrary.php | 2 +- .../{MyStorage => }/Mangboard/BoardsLibrary.php | 2 +- .../Mangboard/File/ImageLibrary.php | 2 +- .../{MyStorage => }/Mangboard/FileLibrary.php | 5 ++--- .../{MyStorage => }/Mangboard/UserLibrary.php | 14 +++----------- app/Libraries/MyAuth/GoogleLibrary.php | 5 +++-- app/Libraries/MyAuth/LocalLibrary.php | 1 + app/Libraries/{MyAuth => }/MyAuthLibrary.php | 2 +- app/Libraries/MyCrawler/YamapLibrary.php | 10 ++++++---- app/Libraries/{MyCrawler => }/MyCrawlerLibrary.php | 2 +- app/Libraries/MySocket/{ => Web}/GoogleLibrary.php | 6 ++++-- app/Libraries/MySocket/WebLibrary.php | 1 + app/Libraries/{MySocket => }/MySocketLibrary.php | 2 +- app/Libraries/MyStorage/FileLibrary.php | 3 ++- app/Libraries/{MyStorage => }/MyStorageLibrary.php | 2 +- app/Libraries/MyUtil/ImageLibrary.php | 2 +- app/Libraries/{MyUtil => }/MyUtilLibrary.php | 2 +- app/Traits/FileTrait.php | 7 ++++--- 20 files changed, 37 insertions(+), 37 deletions(-) rename app/Libraries/{Cloudflare => }/CloudflareLibrary.php (99%) rename app/Libraries/{MyStorage => }/Mangboard/BoardLibrary.php (98%) rename app/Libraries/{MyStorage => }/Mangboard/BoardsLibrary.php (96%) rename app/Libraries/{MyStorage => }/Mangboard/File/ImageLibrary.php (96%) rename app/Libraries/{MyStorage => }/Mangboard/FileLibrary.php (97%) rename app/Libraries/{MyStorage => }/Mangboard/UserLibrary.php (78%) rename app/Libraries/{MyAuth => }/MyAuthLibrary.php (97%) rename app/Libraries/{MyCrawler => }/MyCrawlerLibrary.php (96%) rename app/Libraries/MySocket/{ => Web}/GoogleLibrary.php (92%) rename app/Libraries/{MySocket => }/MySocketLibrary.php (91%) rename app/Libraries/{MyStorage => }/MyStorageLibrary.php (97%) rename app/Libraries/{MyUtil => }/MyUtilLibrary.php (84%) diff --git a/app/Controllers/CrawlerController.php b/app/Controllers/CrawlerController.php index 7af3859..1225d14 100644 --- a/app/Controllers/CrawlerController.php +++ b/app/Controllers/CrawlerController.php @@ -4,7 +4,7 @@ namespace App\Controllers; use App\Libraries\MyCrawler\YamapLibrary as MyCrawler; use App\Controllers\CommonController; -use App\Libraries\MyStorage\Mangboard\UserLibrary; +use App\Libraries\Mangboard\UserLibrary; class CrawlerController extends CommonController { diff --git a/app/Libraries/Cloudflare/CloudflareLibrary.php b/app/Libraries/CloudflareLibrary.php similarity index 99% rename from app/Libraries/Cloudflare/CloudflareLibrary.php rename to app/Libraries/CloudflareLibrary.php index 1911179..191115e 100644 --- a/app/Libraries/Cloudflare/CloudflareLibrary.php +++ b/app/Libraries/CloudflareLibrary.php @@ -1,6 +1,6 @@ _user_model; } - public function getWebLibrary(string $host): WebLibrary - { - if ($this->_web_library === null) { - $this->_web_library = new WebLibrary($host); - } - return $this->_web_library; - } // 로그인 메서드 public function login(string $host, string $id, string $password): bool|UserEntity { diff --git a/app/Libraries/MyAuth/GoogleLibrary.php b/app/Libraries/MyAuth/GoogleLibrary.php index 71c3822..67f38ec 100644 --- a/app/Libraries/MyAuth/GoogleLibrary.php +++ b/app/Libraries/MyAuth/GoogleLibrary.php @@ -2,9 +2,10 @@ namespace App\Libraries\MyAuth; -use App\Entities\SNSUserEntity; -use App\Entities\UserEntity; use App\Libraries\MySocket\GoogleLibrary as MySocketLibrary; +use App\Libraries\MyAuthLibrary; +use App\Entities\UserEntity; +use App\Entities\SNSUserEntity; class GoogleLibrary extends MyAuthLibrary { diff --git a/app/Libraries/MyAuth/LocalLibrary.php b/app/Libraries/MyAuth/LocalLibrary.php index 7e8cb79..0f33f3c 100644 --- a/app/Libraries/MyAuth/LocalLibrary.php +++ b/app/Libraries/MyAuth/LocalLibrary.php @@ -2,6 +2,7 @@ namespace App\Libraries\MyAuth; +use App\Libraries\MyAuthLibrary; use App\Entities\UserEntity; class LocalLibrary extends MyAuthLibrary diff --git a/app/Libraries/MyAuth/MyAuthLibrary.php b/app/Libraries/MyAuthLibrary.php similarity index 97% rename from app/Libraries/MyAuth/MyAuthLibrary.php rename to app/Libraries/MyAuthLibrary.php index 38a5ba8..e5646c5 100644 --- a/app/Libraries/MyAuth/MyAuthLibrary.php +++ b/app/Libraries/MyAuthLibrary.php @@ -1,6 +1,6 @@ getOriginName(); if (file_exists($saveFilePath)) { $fileInfos = pathinfo($saveFilePath, PATHINFO_ALL); - $saveFile = $fileInfos['filename'] . "_" . uniqid() . $fileInfos['extension']; + $saveFile = base64_encode($fileInfos['filename']) . "." . $fileInfos['extension']; $saveFilePath = $fullPath . DIRECTORY_SEPARATOR . $this->getOriginName(); log_message("notice", __FUNCTION__ . "파일명 변경 : 원본파일 {$this->getOriginName()}->저장파일 {$saveFile}"); $this->setOriginName($saveFile); diff --git a/app/Libraries/MyStorage/MyStorageLibrary.php b/app/Libraries/MyStorageLibrary.php similarity index 97% rename from app/Libraries/MyStorage/MyStorageLibrary.php rename to app/Libraries/MyStorageLibrary.php index 648d8ec..06f46e9 100644 --- a/app/Libraries/MyStorage/MyStorageLibrary.php +++ b/app/Libraries/MyStorageLibrary.php @@ -1,6 +1,6 @@ isFileType($path, $file, $type)) { - $files[] = $file; + $file_ext = pathinfo($path . DIRECTORY_SEPARATOR . $file_name, PATHINFO_EXTENSION); + if ($this->isFileType($file_ext, $type)) { + $files[] = $file_name; } } return $files;