Automation init...3

This commit is contained in:
최준흠 2024-09-14 20:44:49 +09:00
parent 4cd11024f1
commit e392c9d19c
20 changed files with 37 additions and 37 deletions

View File

@ -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
{

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\Cloudflare;
namespace App\Libraries;
abstract class CloudflareLibrary
{

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyStorage\Mangboard;
namespace App\Libraries\Mangboard;
use App\Models\Mangboard\BoardModel;
use App\Entities\Mangboard\UserEntity;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyStorage\Mangboard;
namespace App\Libraries\Mangboard;
use App\Models\Mangboard\BoardsModel;
use App\Entities\Mangboard\UserEntity;

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyStorage\Mangboard\File;
namespace App\Libraries\Mangboard\File;
use App\Libraries\MyUtil\ImageLibrary as MyUtilLibrary;

View File

@ -1,12 +1,11 @@
<?php
namespace App\Libraries\MyStorage\Mangboard;
namespace App\Libraries\Mangboard;
use App\Models\Mangboard\FileModel;
use App\Libraries\MyStorage\Mangboard\File\ImageLibrary;
use App\Libraries\Mangboard\File\ImageLibrary;
use App\Libraries\MyStorage\FileLibrary as MyStorageLibrary;
use App\Entities\Mangboard\UserEntity;
use App\Entities\Mangboard\FileEntity;
use App\Entities\Mangboard\BoardsEntity;
use App\Entities\Mangboard\BoardEntity;

View File

@ -1,14 +1,13 @@
<?php
namespace App\Libraries\MyStorage\Mangboard;
namespace App\Libraries\Mangboard;
use App\Libraries\MySocket\WebLibrary;
use App\Libraries\MySocket\WebLibrary as MySocketLibrary;
use App\Models\Mangboard\UserModel;
use App\Entities\Mangboard\UserEntity;
class UserLibrary extends WebLibrary
class UserLibrary extends MySocketLibrary
{
private $_web_library = null;
private $_user_model = null;
public function __construct() {}
public function getUserModel(): UserModel
@ -18,13 +17,6 @@ class UserLibrary extends WebLibrary
}
return $this->_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
{

View File

@ -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
{

View File

@ -2,6 +2,7 @@
namespace App\Libraries\MyAuth;
use App\Libraries\MyAuthLibrary;
use App\Entities\UserEntity;
class LocalLibrary extends MyAuthLibrary

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyAuth;
namespace App\Libraries;
use App\Entities\UserEntity;
use App\Models\UserModel;

View File

@ -2,12 +2,14 @@
namespace App\Libraries\MyCrawler;
use Symfony\Component\DomCrawler\Crawler;
use App\Libraries\MyStorage\Mangboard\FileLibrary as MyStorageLibrary;
use App\Libraries\MyStorage\Mangboard\BoardsLibrary;
use App\Libraries\MyStorage\Mangboard\BoardLibrary;
use App\Libraries\MyCrawlerLibrary;
use App\Libraries\MySocket\WebLibrary as MySocketLibrary;
use App\Libraries\Mangboard\FileLibrary as MyStorageLibrary;
use App\Libraries\Mangboard\BoardsLibrary;
use App\Libraries\Mangboard\BoardLibrary;
use App\Entities\Mangboard\UserEntity;
use Symfony\Component\DomCrawler\Crawler;
use App\Traits\FileTrait;
class YamapLibrary extends MyCrawlerLibrary

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyCrawler;
namespace App\Libraries;
use App\Libraries\CommonLibrary;
use Symfony\Component\DomCrawler\Crawler;

View File

@ -1,8 +1,10 @@
<?php
namespace App\Libraries\MySocket;
namespace App\Libraries\MySocket\Web;
class GoogleLibrary extends WebLibrary
use App\Libraries\MySocket\WebLibrary as MySocketLibrary;
class GoogleLibrary extends MySocketLibrary
{
private $_client = null;
private $_session = null;

View File

@ -4,6 +4,7 @@ namespace App\Libraries\MySocket;
use GuzzleHttp\Cookie\CookieJar;
use GuzzleHttp\Client;
use App\Libraries\MySocketLibrary;
class WebLibrary extends MySocketLibrary
{

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MySocket;
namespace App\Libraries;
use App\Libraries\CommonLibrary;

View File

@ -2,6 +2,7 @@
namespace App\Libraries\MyStorage;
use App\Libraries\MyStorageLibrary;
use App\Traits\FileTrait;
class FileLibrary extends MyStorageLibrary
@ -46,7 +47,7 @@ class FileLibrary extends MyStorageLibrary
$saveFilePath = $fullPath . DIRECTORY_SEPARATOR . $this->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);

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyStorage;
namespace App\Libraries;
use App\Libraries\CommonLibrary;

View File

@ -2,7 +2,7 @@
namespace App\Libraries\MyUtil;
use App\Libraries\MyUtil\MyUtilLibrary;
use App\Libraries\MyUtilLibrary;
use App\Traits\FileTrait;
class ImageLibrary extends MyUtilLibrary

View File

@ -1,6 +1,6 @@
<?php
namespace App\Libraries\MyUtil;
namespace App\Libraries;
use App\Libraries\CommonLibrary;

View File

@ -35,10 +35,11 @@ trait FileTrait
{
// 디렉토리에서 파일 목록 가져오기
$files = [];
foreach (scandir($path) as $file) {
foreach (scandir($path) as $file_name) {
// 확장자가 이미지 형식인지 확인
if ($this->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;