Automation init...3
This commit is contained in:
parent
4cd11024f1
commit
e392c9d19c
@ -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
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\Cloudflare;
|
||||
namespace App\Libraries;
|
||||
|
||||
abstract class CloudflareLibrary
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyStorage\Mangboard;
|
||||
namespace App\Libraries\Mangboard;
|
||||
|
||||
use App\Models\Mangboard\BoardModel;
|
||||
use App\Entities\Mangboard\UserEntity;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyStorage\Mangboard;
|
||||
namespace App\Libraries\Mangboard;
|
||||
|
||||
use App\Models\Mangboard\BoardsModel;
|
||||
use App\Entities\Mangboard\UserEntity;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyStorage\Mangboard\File;
|
||||
namespace App\Libraries\Mangboard\File;
|
||||
|
||||
use App\Libraries\MyUtil\ImageLibrary as MyUtilLibrary;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
{
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Libraries\MyAuth;
|
||||
|
||||
use App\Libraries\MyAuthLibrary;
|
||||
use App\Entities\UserEntity;
|
||||
|
||||
class LocalLibrary extends MyAuthLibrary
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyAuth;
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Entities\UserEntity;
|
||||
use App\Models\UserModel;
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyCrawler;
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Libraries\CommonLibrary;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
@ -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;
|
||||
@ -4,6 +4,7 @@ namespace App\Libraries\MySocket;
|
||||
|
||||
use GuzzleHttp\Cookie\CookieJar;
|
||||
use GuzzleHttp\Client;
|
||||
use App\Libraries\MySocketLibrary;
|
||||
|
||||
class WebLibrary extends MySocketLibrary
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MySocket;
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Libraries\CommonLibrary;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyStorage;
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Libraries\CommonLibrary;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libraries\MyUtil;
|
||||
namespace App\Libraries;
|
||||
|
||||
use App\Libraries\CommonLibrary;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user