diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0188b3f --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +#codeigniter 4 +!.htaccess +!.writable/api/index.html +!.writable/cache/index.html +!.writable/download/index.html +!.writable/excel/index.html +!.writable/uploads/index.html +!.writable/.htaccess +.env +writable/api/ +writable/cache/ +writable/debugbar/ +writable/download/ +writable/excel/ +writable/logs/ +writable/session/ +writable/uploads/ +vendor/ +vendors/ +composer.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0119e5f --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014-2019 British Columbia Institute of Technology +Copyright (c) 2019-2023 CodeIgniter Foundation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ccbcf47 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +#Tips +#참고 : https://github.com/bundanining/Shopping-Cart-Solution-CodeIgniter +vscode와 Git의 대소문자 구분시키기 +git config core.ignorecase false + +# 1. CodeIgniter 4 Application Starter + +`composer create-project codeigniter4/appstarter 프로젝트명` + +## 2. Setup + +php.ini에 extension=intl 필요 +apache의 DocumentRoot "패키지명/public" 수정 후 restart 필요 +Copy `env` to `.env` and tailor for your app, specifically the baseURL and any database settings. +.env 수정 +CI_ENVIRONMENT = development + +# 3. 필요한 추가 패키지 + +composer require saleh7/proxmox-ve_php_api + +## 4. Running Development Server + +php spark serve + +## 5. Web접속 + +개발용 -> localhost:8080 +실서버 -> https://proxmox.idcjp.jp + +## 6. new Controller추가시 Config\Routes.php에 Routing설정 필요 + +$routes->get('/ProxmoxAPI', 'ProxmoxAPI::index'); + +## 7. composer.json의 "psr-4" 수정시 reload + +"psr-4": { +"Tests\\Support\\": "tests/\_support" +"APP\\": "app" +} +composer dump-autoload + +## 8. php spark 사용법 (https://onlinewebtutorblog.com/how-to-work-with-codeigniter-4-model-and-entity-tutorial/) + +- User Table 관련 + php spark migrate:create create_user_table --> table 생성 + php spark migrate --> table 적용 + php spark make:migration update_and_addfield_to_users_table --> 기존 table 내용변경없이 column변경시 + php spark migrate:refresh --> table 수정후 재생성 + php spark migrate:rollback + php spark migrate:status --> 상태보기 + +- 초기 데이터 넣기 + php spark make:seeder user --suffix + php spark db:seed UsersSeeder + +- mvc 생성 --suffix 추가필요 + php spark make:model user --suffix + php spark make:controller user --suffix + php spark make:entity user --suffix + +- auth용 + php spark make:filter AuthGuard + +## 9. Login관련 참조 + +https://www.jurisic.org/post/2022/11/28/How-to-make-simple-Authentication-with-CodeIgniter-4 diff --git a/app/.htaccess b/app/.htaccess new file mode 100644 index 0000000..f24db0a --- /dev/null +++ b/app/.htaccess @@ -0,0 +1,6 @@ + + Require all denied + + + Deny from all + diff --git a/app/Cells/BoardCell.php b/app/Cells/BoardCell.php new file mode 100644 index 0000000..aaaebfd --- /dev/null +++ b/app/Cells/BoardCell.php @@ -0,0 +1,26 @@ +_boardModel = $this->_boardModel ?: new BoardModel(); + } + public function information(array $viewDatas): string + { + helper('Board'); + $viewDatas['cellDatas'] = array(); + $viewDatas['cellDatas']['entitys'] = $this->getBoardModel()->getEntitys([ + 'category_uid' => __FUNCTION__ + ]); + return view( + 'Views/front/board/cell/' . __FUNCTION__, + ['viewDatas' => $viewDatas] + ); + } +} diff --git a/app/Cells/ProductCell.php b/app/Cells/ProductCell.php new file mode 100644 index 0000000..1d3428f --- /dev/null +++ b/app/Cells/ProductCell.php @@ -0,0 +1,15 @@ +$viewDatas] + ); + } +} diff --git a/app/Common.php b/app/Common.php new file mode 100644 index 0000000..23e3e61 --- /dev/null +++ b/app/Common.php @@ -0,0 +1,15 @@ + + */ + public array $allowedHostnames = []; + + /** + * -------------------------------------------------------------------------- + * Index File + * -------------------------------------------------------------------------- + * + * Typically this will be your index.php file, unless you've renamed it to + * something else. If you are using mod_rewrite to remove the page set this + * variable so that it is blank. + */ + //public string $indexPage = 'index.php'; + public string $indexPage = ''; + /** + * -------------------------------------------------------------------------- + * URI PROTOCOL + * -------------------------------------------------------------------------- + * + * This item determines which server global should be used to retrieve the + * URI string. The default setting of 'REQUEST_URI' works for most servers. + * If your links do not seem to work, try one of the other delicious flavors: + * + * 'REQUEST_URI' Uses $_SERVER['REQUEST_URI'] + * 'QUERY_STRING' Uses $_SERVER['QUERY_STRING'] + * 'PATH_INFO' Uses $_SERVER['PATH_INFO'] + * + * WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! + */ + public string $uriProtocol = 'REQUEST_URI'; + + /** + * -------------------------------------------------------------------------- + * Default Locale + * -------------------------------------------------------------------------- + * + * The Locale roughly represents the language and location that your visitor + * is viewing the site from. It affects the language strings and other + * strings (like currency markers, numbers, etc), that your program + * should run under for this request. + */ + public string $defaultLocale = 'en'; + + /** + * -------------------------------------------------------------------------- + * Negotiate Locale + * -------------------------------------------------------------------------- + * + * If true, the current Request object will automatically determine the + * language to use based on the value of the Accept-Language header. + * + * If false, no automatic detection will be performed. + */ + public bool $negotiateLocale = false; + + /** + * -------------------------------------------------------------------------- + * Supported Locales + * -------------------------------------------------------------------------- + * + * If $negotiateLocale is true, this array lists the locales supported + * by the application in descending order of priority. If no match is + * found, the first locale will be used. + * + * @var string[] + */ + public array $supportedLocales = ['en']; + + /** + * -------------------------------------------------------------------------- + * Application Timezone + * -------------------------------------------------------------------------- + * + * The default timezone that will be used in your application to display + * dates with the date helper, and can be retrieved through app_timezone() + */ + public string $appTimezone = 'UTC'; + + /** + * -------------------------------------------------------------------------- + * Default Character Set + * -------------------------------------------------------------------------- + * + * This determines which character set is used by default in various methods + * that require a character set to be provided. + * + * @see http://php.net/htmlspecialchars for a list of supported charsets. + */ + public string $charset = 'UTF-8'; + + /** + * -------------------------------------------------------------------------- + * URI PROTOCOL + * -------------------------------------------------------------------------- + * + * If true, this will force every request made to this application to be + * made via a secure connection (HTTPS). If the incoming request is not + * secure, the user will be redirected to a secure version of the page + * and the HTTP Strict Transport Security header will be set. + */ + public bool $forceGlobalSecureRequests = false; + + /** + * -------------------------------------------------------------------------- + * Session Driver + * -------------------------------------------------------------------------- + * + * The session storage driver to use: + * - `CodeIgniter\Session\Handlers\FileHandler` + * - `CodeIgniter\Session\Handlers\DatabaseHandler` + * - `CodeIgniter\Session\Handlers\MemcachedHandler` + * - `CodeIgniter\Session\Handlers\RedisHandler` + * + * @deprecated use Config\Session::$driver instead. + */ + public string $sessionDriver = FileHandler::class; + + /** + * -------------------------------------------------------------------------- + * Session Cookie Name + * -------------------------------------------------------------------------- + * + * The session cookie name, must contain only [0-9a-z_-] characters + * + * @deprecated use Config\Session::$cookieName instead. + */ + public string $sessionCookieName = 'ci_session'; + + /** + * -------------------------------------------------------------------------- + * Session Expiration + * -------------------------------------------------------------------------- + * + * The number of SECONDS you want the session to last. + * Setting to 0 (zero) means expire when the browser is closed. + * + * @deprecated use Config\Session::$expiration instead. + */ + public int $sessionExpiration = 7200; + + /** + * -------------------------------------------------------------------------- + * Session Save Path + * -------------------------------------------------------------------------- + * + * The location to save sessions to and is driver dependent. + * + * For the 'files' driver, it's a path to a writable directory. + * WARNING: Only absolute paths are supported! + * + * For the 'database' driver, it's a table name. + * Please read up the manual for the format with other session drivers. + * + * IMPORTANT: You are REQUIRED to set a valid save path! + * + * @deprecated use Config\Session::$savePath instead. + */ + public string $sessionSavePath = WRITEPATH . 'session'; + + /** + * -------------------------------------------------------------------------- + * Session Match IP + * -------------------------------------------------------------------------- + * + * Whether to match the user's IP address when reading the session data. + * + * WARNING: If you're using the database driver, don't forget to update + * your session table's PRIMARY KEY when changing this setting. + * + * @deprecated use Config\Session::$matchIP instead. + */ + public bool $sessionMatchIP = false; + + /** + * -------------------------------------------------------------------------- + * Session Time to Update + * -------------------------------------------------------------------------- + * + * How many seconds between CI regenerating the session ID. + * + * @deprecated use Config\Session::$timeToUpdate instead. + */ + public int $sessionTimeToUpdate = 300; + + /** + * -------------------------------------------------------------------------- + * Session Regenerate Destroy + * -------------------------------------------------------------------------- + * + * Whether to destroy session data associated with the old session ID + * when auto-regenerating the session ID. When set to FALSE, the data + * will be later deleted by the garbage collector. + * + * @deprecated use Config\Session::$regenerateDestroy instead. + */ + public bool $sessionRegenerateDestroy = false; + + /** + * -------------------------------------------------------------------------- + * Session Database Group + * -------------------------------------------------------------------------- + * + * DB Group for the database session. + * + * @deprecated use Config\Session::$DBGroup instead. + */ + public ?string $sessionDBGroup = null; + + /** + * -------------------------------------------------------------------------- + * Cookie Prefix + * -------------------------------------------------------------------------- + * + * Set a cookie name prefix if you need to avoid collisions. + * + * @deprecated use Config\Cookie::$prefix property instead. + */ + public string $cookiePrefix = ''; + + /** + * -------------------------------------------------------------------------- + * Cookie Domain + * -------------------------------------------------------------------------- + * + * Set to `.your-domain.com` for site-wide cookies. + * + * @deprecated use Config\Cookie::$domain property instead. + */ + public string $cookieDomain = ''; + + /** + * -------------------------------------------------------------------------- + * Cookie Path + * -------------------------------------------------------------------------- + * + * Typically will be a forward slash. + * + * @deprecated use Config\Cookie::$path property instead. + */ + public string $cookiePath = '/'; + + /** + * -------------------------------------------------------------------------- + * Cookie Secure + * -------------------------------------------------------------------------- + * + * Cookie will only be set if a secure HTTPS connection exists. + * + * @deprecated use Config\Cookie::$secure property instead. + */ + public bool $cookieSecure = false; + + /** + * -------------------------------------------------------------------------- + * Cookie HttpOnly + * -------------------------------------------------------------------------- + * + * Cookie will only be accessible via HTTP(S) (no JavaScript). + * + * @deprecated use Config\Cookie::$httponly property instead. + */ + public bool $cookieHTTPOnly = true; + + /** + * -------------------------------------------------------------------------- + * Cookie SameSite + * -------------------------------------------------------------------------- + * + * Configure cookie SameSite setting. Allowed values are: + * - None + * - Lax + * - Strict + * - '' + * + * Alternatively, you can use the constant names: + * - `Cookie::SAMESITE_NONE` + * - `Cookie::SAMESITE_LAX` + * - `Cookie::SAMESITE_STRICT` + * + * Defaults to `Lax` for compatibility with modern browsers. Setting `''` + * (empty string) means default SameSite attribute set by browsers (`Lax`) + * will be set on cookies. If set to `None`, `$cookieSecure` must also be set. + * + * @deprecated use Config\Cookie::$samesite property instead. + */ + public ?string $cookieSameSite = 'Lax'; + + /** + * -------------------------------------------------------------------------- + * Reverse Proxy IPs + * -------------------------------------------------------------------------- + * + * If your server is behind a reverse proxy, you must whitelist the proxy + * IP addresses from which CodeIgniter should trust headers such as + * X-Forwarded-For or Client-IP in order to properly identify + * the visitor's IP address. + * + * You need to set a proxy IP address or IP address with subnets and + * the HTTP header for the client IP address. + * + * Here are some examples: + * [ + * '10.0.1.200' => 'X-Forwarded-For', + * '192.168.5.0/24' => 'X-Real-IP', + * ] + * + * @var array + */ + public array $proxyIPs = []; + + /** + * -------------------------------------------------------------------------- + * CSRF Token Name + * -------------------------------------------------------------------------- + * + * The token name. + * + * @deprecated Use `Config\Security` $tokenName property instead of using this property. + */ + public string $CSRFTokenName = 'csrf_test_name'; + + /** + * -------------------------------------------------------------------------- + * CSRF Header Name + * -------------------------------------------------------------------------- + * + * The header name. + * + * @deprecated Use `Config\Security` $headerName property instead of using this property. + */ + public string $CSRFHeaderName = 'X-CSRF-TOKEN'; + + /** + * -------------------------------------------------------------------------- + * CSRF Cookie Name + * -------------------------------------------------------------------------- + * + * The cookie name. + * + * @deprecated Use `Config\Security` $cookieName property instead of using this property. + */ + public string $CSRFCookieName = 'csrf_cookie_name'; + + /** + * -------------------------------------------------------------------------- + * CSRF Expire + * -------------------------------------------------------------------------- + * + * The number in seconds the token should expire. + * + * @deprecated Use `Config\Security` $expire property instead of using this property. + */ + public int $CSRFExpire = 7200; + + /** + * -------------------------------------------------------------------------- + * CSRF Regenerate + * -------------------------------------------------------------------------- + * + * Regenerate token on every submission? + * + * @deprecated Use `Config\Security` $regenerate property instead of using this property. + */ + public bool $CSRFRegenerate = true; + + /** + * -------------------------------------------------------------------------- + * CSRF Redirect + * -------------------------------------------------------------------------- + * + * Redirect to previous page with error on failure? + * + * @deprecated Use `Config\Security` $redirect property instead of using this property. + */ + public bool $CSRFRedirect = false; + + /** + * -------------------------------------------------------------------------- + * CSRF SameSite + * -------------------------------------------------------------------------- + * + * Setting for CSRF SameSite cookie token. Allowed values are: + * - None + * - Lax + * - Strict + * - '' + * + * Defaults to `Lax` as recommended in this link: + * + * @see https://portswigger.net/web-security/csrf/samesite-cookies + * + * @deprecated `Config\Cookie` $samesite property is used. + */ + public string $CSRFSameSite = 'Lax'; + + /** + * -------------------------------------------------------------------------- + * Content Security Policy + * -------------------------------------------------------------------------- + * + * Enables the Response's Content Secure Policy to restrict the sources that + * can be used for images, scripts, CSS files, audio, video, etc. If enabled, + * the Response object will populate default values for the policy from the + * `ContentSecurityPolicy.php` file. Controllers can always add to those + * restrictions at run time. + * + * For a better understanding of CSP, see these documents: + * + * @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/ + * @see http://www.w3.org/TR/CSP/ + */ + public bool $CSPEnabled = false; +} diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php new file mode 100644 index 0000000..abd9df9 --- /dev/null +++ b/app/Config/Autoload.php @@ -0,0 +1,97 @@ + SYSTEMPATH, + * 'App' => APPPATH + * ]; + * + * @var array|string> + * @phpstan-var array> + */ + public $psr4 = [ + APP_NAMESPACE => APPPATH, // For custom app namespace + 'Config' => APPPATH . 'Config', + ]; + + /** + * ------------------------------------------------------------------- + * Class Map + * ------------------------------------------------------------------- + * The class map provides a map of class names and their exact + * location on the drive. Classes loaded in this manner will have + * slightly faster performance because they will not have to be + * searched for within one or more directories as they would if they + * were being autoloaded through a namespace. + * + * Prototype: + * $classmap = [ + * 'MyClass' => '/path/to/class/file.php' + * ]; + * + * @var array + */ + public $classmap = []; + + /** + * ------------------------------------------------------------------- + * Files + * ------------------------------------------------------------------- + * The files array provides a list of paths to __non-class__ files + * that will be autoloaded. This can be useful for bootstrap operations + * or for loading functions. + * + * Prototype: + * $files = [ + * '/path/to/my/file.php', + * ]; + * + * @var string[] + * @phpstan-var list + */ + public $files = []; + + /** + * ------------------------------------------------------------------- + * Helpers + * ------------------------------------------------------------------- + * Prototype: + * $helpers = [ + * 'form', + * ]; + * + * @var string[] + * @phpstan-var list + */ + public $helpers = []; +} diff --git a/app/Config/Boot/development.php b/app/Config/Boot/development.php new file mode 100644 index 0000000..05a8612 --- /dev/null +++ b/app/Config/Boot/development.php @@ -0,0 +1,32 @@ + + */ + public array $file = [ + 'storePath' => WRITEPATH . 'cache/', + 'mode' => 0640, + ]; + + /** + * ------------------------------------------------------------------------- + * Memcached settings + * ------------------------------------------------------------------------- + * Your Memcached servers can be specified below, if you are using + * the Memcached drivers. + * + * @see https://codeigniter.com/user_guide/libraries/caching.html#memcached + * + * @var array + */ + public array $memcached = [ + 'host' => '127.0.0.1', + 'port' => 11211, + 'weight' => 1, + 'raw' => false, + ]; + + /** + * ------------------------------------------------------------------------- + * Redis settings + * ------------------------------------------------------------------------- + * Your Redis server can be specified below, if you are using + * the Redis or Predis drivers. + * + * @var array + */ + public array $redis = [ + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + 'database' => 0, + ]; + + /** + * -------------------------------------------------------------------------- + * Available Cache Handlers + * -------------------------------------------------------------------------- + * + * This is an array of cache engine alias' and class names. Only engines + * that are listed here are allowed to be used. + * + * @var array + */ + public array $validHandlers = [ + 'dummy' => DummyHandler::class, + 'file' => FileHandler::class, + 'memcached' => MemcachedHandler::class, + 'predis' => PredisHandler::class, + 'redis' => RedisHandler::class, + 'wincache' => WincacheHandler::class, + ]; +} diff --git a/app/Config/Constants.php b/app/Config/Constants.php new file mode 100644 index 0000000..f9d6a3e --- /dev/null +++ b/app/Config/Constants.php @@ -0,0 +1,303 @@ + [ + 'path' => 'layouts' . DIRECTORY_SEPARATOR . 'empty', + 'stylesheets' => [ + '', + '', + '', + ], + 'javascripts' => [ + '', + ] + ], + 'front' => [ + 'title' => '사용자화면', + 'path' => 'layouts' . DIRECTORY_SEPARATOR . 'front', + 'menus' => ['aboutus', 'hosting', 'service', 'support'], + 'stylesheets' => [ + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'javascripts' => [ + '', + '', + '', + '', + '', + ], + ], + 'admin' => [ + 'title' => '관리자화면', + 'path' => 'layouts' . DIRECTORY_SEPARATOR . 'admin', + 'stylesheets' => [ + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'javascripts' => [ + '', + '', + '', + '', + '', + ] + ], +]); + +//URL +define('URLS', [ + 'LOGIN' => '/front/user/login', + 'SIGNUP' => '/front/user/signup', + 'LOGOUT' => '/front/user/logout', + 'Order' => '/front/order', + 'addCart' => '/front/order/addCart', + 'cancelCart' => '/front/order/cancelCart', + 'Billing' => '/front/billing', + 'card' => '/front/billing/card', + 'deposit' => '/front/billing/deposit', +]); +//SESSION 관련 +define('SESSION_NAMES', [ + 'RETURN_URL' => "return_url", + 'ISLOGIN' => "islogined", + 'AUTH' => 'auth', + 'CART' => 'cart' +]); +define('AUTH_FIELDS', ['ID' => 'id', 'TITLE' => 'title', 'ROLE' => 'role']); +//월이용권 상품의 Category번호 +define('RENTAL_PRODUCT_CATEGORYS', [5, 8]); +//인증 관련 +define('AUTH_ADAPTERS', [ + 'Local' => [ + 'DEBUG' => getenv("auth.loca.debug") ?: false, + ], + 'Google' => [ + 'DEBUG' => getenv("auth.google.debug") ?: false, + 'ICON' => getenv("auth.google.icon") ?: '', + 'CLIENT_ID' => getenv("auth.google.client.id"), + 'CLIENT_KEY' => getenv("auth.google.client.key"), + 'CALLBACK_URL' => getenv("auth.google.client.callback_url"), + 'TOKEN_NAME' => getenv('auth.google.client.token_name') ?: "access_token", + ], +]); + +define("MALLS", [ + "support" => getenv("mall.support") ?: "support@idcjp.jp", + "master" => getenv("mall.master") ?: "master@idcjp.jp", + "title" => getenv("mall.title") ?: "Mall Master", + 'card' => getenv("mall.card") ?: "TEST", + 'payments' => [ + 'CookiePayment' => [ + 'token_url' => getenv("mall.payment.pay2pay.token_url") ?: "{TOKEN 발행 URL}", + 'token_id' => getenv("mall.payment.pay2pay.id") ?: 'cookiepayments에서 발급받은 ID', + 'token_key' => getenv("mall.payment.pay2pay.key") ?: 'cookiepayments에서 발급받은 연동키', + 'api_key' => getenv("mall.payment.pay2pay.apikey") ?: "COOKIEPAY에서 발급받은 연동키", + 'api_url' => getenv("mall.payment.pay2pay.url") ?: "{요청도메인}/keyin/payment", + ], + ], + "banks" => [ + 'BANK1' => [ + "name" => getenv("mall.bank.ibk.name") ?: "기업은행", + "account" => getenv("mall.bank.ibk.account") ?: "525-05694804-012", + "holder" => getenv("mall.bank.ibk.holder") ?: "주식회사 르호봇" + ], + 'BANK2' => [ + "name" => getenv("mall.bank.kookmin.name") ?: "우리은행", + "account" => getenv("mall.bank.kookmin.account") ?: "1005-503-404205", + "holder" => getenv("mall.bank.kookmin.holder") ?: "주식회사 르호봇" + ], + ], +]); + +//Upload , Download 관련 +define('PATHS', [ + 'EXCEL' => WRITEPATH . "excel/", + 'BILLING' => WRITEPATH . "billing/", + 'UPLOAD' => WRITEPATH . "uploads/", + 'UPLOAD_IMAGE' => FCPATH . 'upload_images/', + 'DOWNLOAD' => WRITEPATH . "download/", + 'API' => WRITEPATH . "api/", +]); +foreach (PATHS as $key => $path) { + if (!is_dir($path)) { + mkdir($path, 0755); + } +} + +//아이콘 및 Sound관련 +define('ICONS', [ + 'LOGIN' => '', + 'LOGOUT' => '', + 'LOCK' => '', + 'NEW' => '', + 'REPLY' => '', + 'DELETE' => '', + 'RELOAD' => '', + 'SETUP' => '', + 'FLAG' => '', + 'SEARCH' => '', + 'EXCEL' => '', + 'HOME' => '', + 'PLAY' => '', + 'CART' => '', + 'CARD' => '', + 'DEPOSIT' => '', + 'UP' => '', + 'DOWN' => '', + 'LEFT' => '', + 'RIGHT' => '', + 'IMAGE_FILE' => '', +]); +define('CLASS_ICONS', [ + 'USER' => '', + 'USERSNS' => '', + 'BOARD' => '', + 'SITEPAGE' => '', + 'CATEGORY' => '', + 'PRODUCT' => '', + 'ORDER' => '', + 'BILLING' => '', + 'CART' => '', + 'CARD' => '', + 'DEPOSIT' => '', +]); +define('CLASS_TOP_BANNER', [ + 'USER' => '', + 'USERSNS' => '', + 'ORDER' => '', + 'BILLING' => '', + 'CARD' => '', + 'DEPOSIT' => '', + 'PRODUCT' => '', + 'SITEPAGE' => '', + 'BOARD' => '', +]); +define('AUDIOS', [ + 'Alram_GetEmail' => '', +]); + +//Default값 정의 +define('DEFAULTS', [ + 'CATEGORY_USER' => getenv('default.category.user') ?: 22, + 'CATEGORY_ORDER' => getenv('default.category.order') ?: 11, + 'CATEGORY_BILLING' => getenv('default.category.billing') ?: 28, + 'ROLE' => getenv('default.role') ?: "guest", + 'STATUS' => getenv('default.status') ?: "use", + 'EMPTY' => getenv('default.empty') ?: "", + 'PERPAGE' => getenv('default.perpage') ?: 20, + 'DELIMITER_FILE' => getenv('default.delimiter.file') ?: "||", + 'DELIMITER_ROLE' => getenv('default.delimiter.role') ?: ",", +]); + +//API Adapter초기갑 정의 +define('API', [ + 'SSL_VERIFY' => getenv('api.ssl') == 'true' ? true : false, + 'COOKIE_FILE' => PATHS['API'] . getenv('api.cookie.file') ?: "api-cookie_" . date("Ymd") . ".log", + 'DEBUG_FILE' => PATHS['API'] . getenv('api.debug.file') ?: "api-debug_" . date("Ymd") . ".log", +]); diff --git a/app/Config/ContentSecurityPolicy.php b/app/Config/ContentSecurityPolicy.php new file mode 100644 index 0000000..18612e1 --- /dev/null +++ b/app/Config/ContentSecurityPolicy.php @@ -0,0 +1,176 @@ +` element. + * + * Will default to self if not overridden + * + * @var string|string[]|null + */ + public $baseURI; + + /** + * Lists the URLs for workers and embedded frame contents + * + * @var string|string[] + */ + public $childSrc = 'self'; + + /** + * Limits the origins that you can connect to (via XHR, + * WebSockets, and EventSource). + * + * @var string|string[] + */ + public $connectSrc = 'self'; + + /** + * Specifies the origins that can serve web fonts. + * + * @var string|string[] + */ + public $fontSrc; + + /** + * Lists valid endpoints for submission from `
` tags. + * + * @var string|string[] + */ + public $formAction = 'self'; + + /** + * Specifies the sources that can embed the current page. + * This directive applies to ``, `