├── .github ├── FUNDING.yml └── workflows │ └── ci_build.yml ├── .gitignore ├── .php-cs-fixer.dist.php ├── README.md ├── app ├── .htaccess ├── Common.php ├── Config │ ├── App.php │ ├── Autoload.php │ ├── Boot │ │ ├── development.php │ │ ├── production.php │ │ └── testing.php │ ├── CURLRequest.php │ ├── Cache.php │ ├── Constants.php │ ├── ContentSecurityPolicy.php │ ├── Cookie.php │ ├── Cors.php │ ├── Database.php │ ├── DocTypes.php │ ├── Email.php │ ├── Encryption.php │ ├── Events.php │ ├── Exceptions.php │ ├── Feature.php │ ├── Filters.php │ ├── ForeignCharacters.php │ ├── Format.php │ ├── Generators.php │ ├── Honeypot.php │ ├── Images.php │ ├── Kint.php │ ├── Logger.php │ ├── Migrations.php │ ├── Mimes.php │ ├── Modules.php │ ├── Optimize.php │ ├── Pager.php │ ├── Paths.php │ ├── Publisher.php │ ├── Routes.php │ ├── Routing.php │ ├── Security.php │ ├── Services.php │ ├── Session.php │ ├── Toolbar.php │ ├── UserAgents.php │ ├── Validation.php │ └── View.php ├── Controllers │ ├── About.php │ ├── Api │ │ └── Portfolio.php │ ├── BaseController.php │ ├── Contact.php │ ├── Home.php │ └── Portfolio.php ├── Database │ ├── Migrations │ │ └── .gitkeep │ └── Seeds │ │ └── .gitkeep ├── Filters │ ├── .gitkeep │ └── LayoutUsage.php ├── Helpers │ └── .gitkeep ├── Language │ └── .gitkeep ├── Libraries │ └── .gitkeep ├── Models │ └── .gitkeep ├── ThirdParty │ └── .gitkeep ├── Views │ ├── about.php │ ├── contact.php │ ├── errors │ │ ├── cli │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ │ └── html │ │ │ ├── debug.css │ │ │ ├── debug.js │ │ │ ├── error_400.php │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ ├── home.php │ ├── layout.php │ └── portfolio.php └── index.html ├── builds ├── codecov.yml ├── composer.json ├── composer.lock ├── data └── portfolio.php ├── env ├── infection.json.dist ├── license.txt ├── phpcs.xml ├── phpunit.xml.dist ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── js │ ├── about.js │ ├── app.js │ ├── contact.js │ ├── create-page.js │ ├── home.js │ ├── portfolio-store-module.js │ ├── portfolio.js │ └── store.js └── robots.txt ├── rector.php ├── spark ├── tests ├── Controller │ ├── AboutTest.php │ ├── Api │ │ └── PortfolioTest.php │ ├── ContactTest.php │ ├── HomeTest.php │ └── PortfolioTest.php ├── HTTP │ ├── NonAjaxRequestTest.php │ └── NotFoundPageRequestTest.php └── unit │ └── Filters │ └── LayoutUsageTest.php ├── webpack.config.js └── writable ├── .htaccess ├── cache └── index.html ├── logs └── index.html ├── session └── index.html └── uploads └── index.html /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: samsonasik 2 | -------------------------------------------------------------------------------- /.github/workflows/ci_build.yml: -------------------------------------------------------------------------------- 1 | name: "ci build" 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - "master" 8 | 9 | jobs: 10 | build: 11 | name: PHP ${{ matrix.php-versions }} 12 | runs-on: ubuntu-latest 13 | strategy: 14 | fail-fast: false 15 | matrix: 16 | php-versions: ['8.2', '8.3', '8.4'] 17 | steps: 18 | - name: Setup PHP Action 19 | uses: shivammathur/setup-php@1.8.2 20 | with: 21 | extensions: intl 22 | php-version: "${{ matrix.php-versions }}" 23 | coverage: xdebug 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | - name: "Validate composer.json and composer.lock" 27 | run: "composer validate" 28 | - name: "Install dependencies" 29 | run: "composer install" 30 | - name: "CS Check" 31 | run: "composer cs-check" 32 | - name: "Code analyze" 33 | run: "vendor/bin/rector process --dry-run" 34 | - name: "Run test suite" 35 | run: "XDEBUG_MODE=coverage vendor/bin/phpunit" 36 | - if: matrix.php-versions == '8.0' 37 | name: Run mutation test 38 | env: 39 | INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} 40 | STRYKER_DASHBOARD_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }} 41 | run: | 42 | composer require --dev infection/infection 43 | XDEBUG_MODE=coverage vendor/bin/infection 44 | - if: matrix.php-versions == '8.2' && github.event.pull_request.head.repo.full_name == 'samsonasik/ci4-vue' 45 | name: Upload coverage to Codecov 46 | uses: codecov/codecov-action@v1 47 | with: 48 | token: ${{ secrets.CODECOV_TOKEN }} 49 | file: ./build/logs/clover.xml 50 | flags: tests 51 | name: codecov-umbrella 52 | yml: ./codecov.yml 53 | fail_ci_if_error: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #------------------------- 2 | # Operating Specific Junk Files 3 | #------------------------- 4 | 5 | # OS X 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # OS X Thumbnails 11 | ._* 12 | 13 | # Windows image file caches 14 | Thumbs.db 15 | ehthumbs.db 16 | Desktop.ini 17 | 18 | # Recycle Bin used on file shares 19 | $RECYCLE.BIN/ 20 | 21 | # Windows Installer files 22 | *.cab 23 | *.msi 24 | *.msm 25 | *.msp 26 | 27 | # Windows shortcuts 28 | *.lnk 29 | 30 | # Linux 31 | *~ 32 | 33 | # KDE directory preferences 34 | .directory 35 | 36 | # Linux trash folder which might appear on any partition or disk 37 | .Trash-* 38 | 39 | #------------------------- 40 | # Environment Files 41 | #------------------------- 42 | # These should never be under version control, 43 | # as it poses a security risk. 44 | .env 45 | .vagrant 46 | Vagrantfile 47 | 48 | #------------------------- 49 | # Temporary Files 50 | #------------------------- 51 | writable/cache/* 52 | !writable/cache/index.html 53 | 54 | writable/logs/* 55 | !writable/logs/index.html 56 | 57 | writable/session/* 58 | !writable/session/index.html 59 | 60 | writable/uploads/* 61 | !writable/uploads/index.html 62 | 63 | writable/debugbar/* 64 | 65 | php_errors.log 66 | 67 | #------------------------- 68 | # User Guide Temp Files 69 | #------------------------- 70 | user_guide_src/build/* 71 | user_guide_src/cilexer/build/* 72 | user_guide_src/cilexer/dist/* 73 | user_guide_src/cilexer/pycilexer.egg-info/* 74 | 75 | #------------------------- 76 | # Test Files 77 | #------------------------- 78 | tests/coverage* 79 | 80 | # Don't save phpunit under version control. 81 | phpunit 82 | 83 | #------------------------- 84 | # Composer 85 | #------------------------- 86 | vendor/ 87 | 88 | #------------------------- 89 | # IDE / Development Files 90 | #------------------------- 91 | 92 | # Modules Testing 93 | _modules/* 94 | 95 | # phpenv local config 96 | .php-version 97 | 98 | # Jetbrains editors (PHPStorm, etc) 99 | .idea/ 100 | *.iml 101 | 102 | # Netbeans 103 | nbproject/ 104 | build/ 105 | nbbuild/ 106 | dist/ 107 | nbdist/ 108 | nbactions.xml 109 | nb-configuration.xml 110 | .nb-gradle/ 111 | 112 | # Sublime Text 113 | *.tmlanguage.cache 114 | *.tmPreferences.cache 115 | *.stTheme.cache 116 | *.sublime-workspace 117 | *.sublime-project 118 | .phpintel 119 | /api/ 120 | 121 | # Visual Studio Code 122 | .vscode/ 123 | 124 | /results/ 125 | /phpunit*.xml 126 | /.phpunit.*.cache 127 | infection.log 128 | 129 | .php-cs-fixer.cache 130 | 131 | /.phpunit.cache -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | files() 9 | ->in([ 10 | __DIR__ . '/app', 11 | __DIR__ . '/data', 12 | __DIR__ . '/tests', 13 | __DIR__ . '/public', 14 | ]) 15 | ->exclude(['Views']); 16 | 17 | $options = [ 18 | 'finder' => $finder, 19 | ]; 20 | 21 | return Factory::create(new CodeIgniter4(), [], $options)->forProjects(); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example Using Vue.js in CodeIgniter 4 application 2 | 3 | ![ci build](https://github.com/samsonasik/ci4-vue/workflows/ci%20build/badge.svg) 4 | [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fsamsonasik%2Fci4-vue%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/samsonasik/ci4-vue/master) 5 | [![Code Coverage](https://codecov.io/gh/samsonasik/ci4-vue/branch/master/graph/badge.svg)](https://codecov.io/gh/samsonasik/ci4-vue) 6 | [![Downloads](https://poser.pugx.org/samsonasik/ci4-vue/downloads)](https://packagist.org/packages/samsonasik/ci4-vue) 7 | 8 | > Version ^0.1.0 is for Vue 3 usage in CodeIgniter 4 application 9 | 10 | > For Vue 2 usage in CodeIgniter 4 application, you can use version [~0.0.17](https://github.com/samsonasik/ci4-vue/tree/0.0.x) 11 | 12 | Introduction 13 | ------------ 14 | 15 | A CodeIgniter 4 Skeleton Application with Vue.js integration. 16 | 17 | Features 18 | -------- 19 | 20 | - SPA application with Vue Router with cached pages after visited. 21 | - Using server side template from CodeIgniter 4, compiled with `Vue.compile()` in Vue.js component's `render()`. 22 | - Using Vuex for state management library, combo with sessionStorage on portfolio page. 23 | - Webpack support for [production](#production) 24 | 25 | ## Setup 26 | 27 | *1.* Run composer create-project command: 28 | 29 | ```bash 30 | composer create-project samsonasik/ci4-vue 31 | ``` 32 | 33 | *2.* Copy file `ci4-vue/env` to `ci4-vue/.env`: 34 | 35 | ```bash 36 | cp ci4-vue/env ci4-vue/.env 37 | ``` 38 | 39 | *3.* Set environment and app configuration 40 | 41 | Open `ci4-vue/.env` and set `CI_ENVIRONMENT`, `app.baseURL`, `app.indexPage`: 42 | 43 | ```bash 44 | # file ci4-vue/.env 45 | CI_ENVIRONMENT = development 46 | 47 | app.baseURL = 'http://localhost:8080' 48 | app.indexPage = '' 49 | ``` 50 | 51 | *4.* Run PHP Development server 52 | 53 | ```php 54 | # go to ci4-vue directory 55 | cd ci4-vue 56 | 57 | # run php development server inside ci4-vue directory 58 | php spark serve 59 | ``` 60 | 61 | *5.* Open web browser http://localhost:8080 62 | 63 | ## Production 64 | 65 | For deploy to production purpose, it has `webpack.config.js` in root directory that when we run `webpack` command, we can get `public/js/dist/bundle.js` after run it. If you don't have a `webpack` installed yet in your system, you can install nodejs and install `webpack` and `webpack-cli`: 66 | 67 | ```bash 68 | sudo npm install -g webpack 69 | sudo npm install -g webpack-cli 70 | ``` 71 | 72 | So, we can run: 73 | 74 | ```bash 75 | webpack 76 | 77 | Hash: 8e63a0daee1be975aeb3 78 | Version: webpack 4.43.0 79 | Time: 469ms 80 | Built at: 07/02/2020 6:13:41 PM 81 | Asset Size Chunks Chunk Names 82 | public/js/dist/bundle.js 2.7 KiB 0 [emitted] main 83 | Entrypoint main = public/js/dist/bundle.js 84 | [0] ./public/js/app.js + 4 modules 3.85 KiB {0} [built] 85 | | ./public/js/app.js 772 bytes [built] 86 | | ./public/js/create-page.js 924 bytes [built] 87 | | ./public/js/portfolio.js 1.67 KiB [built] 88 | | ./public/js/store.js 183 bytes [built] 89 | | ./public/js/portfolio-store-module.js 353 bytes [built] 90 | ``` 91 | 92 | After it generated, we can update `.env` file as follow: 93 | 94 | ```bash 95 | # file .env 96 | CI_ENVIRONMENT = production 97 | 98 | app.baseURL = 'https://www.your-website.com' 99 | app.indexPage = '' 100 | ``` 101 | 102 | In `app/Views/layout.php`, we have a `ENVIRONMENT` check to use `js/app.js` when on development, and use `/js/dist/bundle.js` on production when exists. 103 | 104 | ```php 105 | // src/App/templates/layout/default.phtml 106 | 107 | 108 | // ... 109 | 118 | // ... 119 | ``` 120 | 121 | that will automatically take care of that. 122 | -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /app/Common.php: -------------------------------------------------------------------------------- 1 | 31 | */ 32 | public array $allowedHostnames = []; 33 | 34 | /** 35 | * -------------------------------------------------------------------------- 36 | * Index File 37 | * -------------------------------------------------------------------------- 38 | * 39 | * Typically, this will be your `index.php` file, unless you've renamed it to 40 | * something else. If you have configured your web server to remove this file 41 | * from your site URIs, set this variable to an empty string. 42 | */ 43 | public string $indexPage = 'index.php'; 44 | 45 | /** 46 | * -------------------------------------------------------------------------- 47 | * URI PROTOCOL 48 | * -------------------------------------------------------------------------- 49 | * 50 | * This item determines which server global should be used to retrieve the 51 | * URI string. The default setting of 'REQUEST_URI' works for most servers. 52 | * If your links do not seem to work, try one of the other delicious flavors: 53 | * 54 | * 'REQUEST_URI': Uses $_SERVER['REQUEST_URI'] 55 | * 'QUERY_STRING': Uses $_SERVER['QUERY_STRING'] 56 | * 'PATH_INFO': Uses $_SERVER['PATH_INFO'] 57 | * 58 | * WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded! 59 | */ 60 | public string $uriProtocol = 'REQUEST_URI'; 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Allowed URL Characters 65 | |-------------------------------------------------------------------------- 66 | | 67 | | This lets you specify which characters are permitted within your URLs. 68 | | When someone tries to submit a URL with disallowed characters they will 69 | | get a warning message. 70 | | 71 | | As a security measure you are STRONGLY encouraged to restrict URLs to 72 | | as few characters as possible. 73 | | 74 | | By default, only these are allowed: `a-z 0-9~%.:_-` 75 | | 76 | | Set an empty string to allow all characters -- but only if you are insane. 77 | | 78 | | The configured value is actually a regular expression character group 79 | | and it will be used as: '/\A[]+\z/iu' 80 | | 81 | | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! 82 | | 83 | */ 84 | public string $permittedURIChars = 'a-z 0-9~%.:_\-'; 85 | 86 | /** 87 | * -------------------------------------------------------------------------- 88 | * Default Locale 89 | * -------------------------------------------------------------------------- 90 | * 91 | * The Locale roughly represents the language and location that your visitor 92 | * is viewing the site from. It affects the language strings and other 93 | * strings (like currency markers, numbers, etc), that your program 94 | * should run under for this request. 95 | */ 96 | public string $defaultLocale = 'en'; 97 | 98 | /** 99 | * -------------------------------------------------------------------------- 100 | * Negotiate Locale 101 | * -------------------------------------------------------------------------- 102 | * 103 | * If true, the current Request object will automatically determine the 104 | * language to use based on the value of the Accept-Language header. 105 | * 106 | * If false, no automatic detection will be performed. 107 | */ 108 | public bool $negotiateLocale = false; 109 | 110 | /** 111 | * -------------------------------------------------------------------------- 112 | * Supported Locales 113 | * -------------------------------------------------------------------------- 114 | * 115 | * If $negotiateLocale is true, this array lists the locales supported 116 | * by the application in descending order of priority. If no match is 117 | * found, the first locale will be used. 118 | * 119 | * IncomingRequest::setLocale() also uses this list. 120 | * 121 | * @var list 122 | */ 123 | public array $supportedLocales = ['en']; 124 | 125 | /** 126 | * -------------------------------------------------------------------------- 127 | * Application Timezone 128 | * -------------------------------------------------------------------------- 129 | * 130 | * The default timezone that will be used in your application to display 131 | * dates with the date helper, and can be retrieved through app_timezone() 132 | * 133 | * @see https://www.php.net/manual/en/timezones.php for list of timezones 134 | * supported by PHP. 135 | */ 136 | public string $appTimezone = 'UTC'; 137 | 138 | /** 139 | * -------------------------------------------------------------------------- 140 | * Default Character Set 141 | * -------------------------------------------------------------------------- 142 | * 143 | * This determines which character set is used by default in various methods 144 | * that require a character set to be provided. 145 | * 146 | * @see http://php.net/htmlspecialchars for a list of supported charsets. 147 | */ 148 | public string $charset = 'UTF-8'; 149 | 150 | /** 151 | * -------------------------------------------------------------------------- 152 | * Force Global Secure Requests 153 | * -------------------------------------------------------------------------- 154 | * 155 | * If true, this will force every request made to this application to be 156 | * made via a secure connection (HTTPS). If the incoming request is not 157 | * secure, the user will be redirected to a secure version of the page 158 | * and the HTTP Strict Transport Security (HSTS) header will be set. 159 | */ 160 | public bool $forceGlobalSecureRequests = false; 161 | 162 | /** 163 | * -------------------------------------------------------------------------- 164 | * Reverse Proxy IPs 165 | * -------------------------------------------------------------------------- 166 | * 167 | * If your server is behind a reverse proxy, you must whitelist the proxy 168 | * IP addresses from which CodeIgniter should trust headers such as 169 | * X-Forwarded-For or Client-IP in order to properly identify 170 | * the visitor's IP address. 171 | * 172 | * You need to set a proxy IP address or IP address with subnets and 173 | * the HTTP header for the client IP address. 174 | * 175 | * Here are some examples: 176 | * [ 177 | * '10.0.1.200' => 'X-Forwarded-For', 178 | * '192.168.5.0/24' => 'X-Real-IP', 179 | * ] 180 | * 181 | * @var array 182 | */ 183 | public array $proxyIPs = []; 184 | 185 | /** 186 | * -------------------------------------------------------------------------- 187 | * Content Security Policy 188 | * -------------------------------------------------------------------------- 189 | * 190 | * Enables the Response's Content Secure Policy to restrict the sources that 191 | * can be used for images, scripts, CSS files, audio, video, etc. If enabled, 192 | * the Response object will populate default values for the policy from the 193 | * `ContentSecurityPolicy.php` file. Controllers can always add to those 194 | * restrictions at run time. 195 | * 196 | * For a better understanding of CSP, see these documents: 197 | * 198 | * @see http://www.html5rocks.com/en/tutorials/security/content-security-policy/ 199 | * @see http://www.w3.org/TR/CSP/ 200 | */ 201 | public bool $CSPEnabled = false; 202 | } 203 | -------------------------------------------------------------------------------- /app/Config/Autoload.php: -------------------------------------------------------------------------------- 1 | |string> 41 | */ 42 | public $psr4 = [ 43 | APP_NAMESPACE => APPPATH, 44 | ]; 45 | 46 | /** 47 | * ------------------------------------------------------------------- 48 | * Class Map 49 | * ------------------------------------------------------------------- 50 | * The class map provides a map of class names and their exact 51 | * location on the drive. Classes loaded in this manner will have 52 | * slightly faster performance because they will not have to be 53 | * searched for within one or more directories as they would if they 54 | * were being autoloaded through a namespace. 55 | * 56 | * Prototype: 57 | * $classmap = [ 58 | * 'MyClass' => '/path/to/class/file.php' 59 | * ]; 60 | * 61 | * @var array 62 | */ 63 | public $classmap = []; 64 | 65 | /** 66 | * ------------------------------------------------------------------- 67 | * Files 68 | * ------------------------------------------------------------------- 69 | * The files array provides a list of paths to __non-class__ files 70 | * that will be autoloaded. This can be useful for bootstrap operations 71 | * or for loading functions. 72 | * 73 | * Prototype: 74 | * $files = [ 75 | * '/path/to/my/file.php', 76 | * ]; 77 | * 78 | * @var list 79 | */ 80 | public $files = []; 81 | 82 | /** 83 | * ------------------------------------------------------------------- 84 | * Helpers 85 | * ------------------------------------------------------------------- 86 | * Prototype: 87 | * $helpers = [ 88 | * 'form', 89 | * ]; 90 | * 91 | * @var list 92 | */ 93 | public $helpers = []; 94 | } 95 | -------------------------------------------------------------------------------- /app/Config/Boot/development.php: -------------------------------------------------------------------------------- 1 | 82 | */ 83 | public array $file = [ 84 | 'storePath' => WRITEPATH . 'cache/', 85 | 'mode' => 0640, 86 | ]; 87 | 88 | /** 89 | * ------------------------------------------------------------------------- 90 | * Memcached settings 91 | * ------------------------------------------------------------------------- 92 | * 93 | * Your Memcached servers can be specified below, if you are using 94 | * the Memcached drivers. 95 | * 96 | * @see https://codeigniter.com/user_guide/libraries/caching.html#memcached 97 | * 98 | * @var array 99 | */ 100 | public array $memcached = [ 101 | 'host' => '127.0.0.1', 102 | 'port' => 11211, 103 | 'weight' => 1, 104 | 'raw' => false, 105 | ]; 106 | 107 | /** 108 | * ------------------------------------------------------------------------- 109 | * Redis settings 110 | * ------------------------------------------------------------------------- 111 | * Your Redis server can be specified below, if you are using 112 | * the Redis or Predis drivers. 113 | * 114 | * @var array 115 | */ 116 | public array $redis = [ 117 | 'host' => '127.0.0.1', 118 | 'password' => null, 119 | 'port' => 6379, 120 | 'timeout' => 0, 121 | 'database' => 0, 122 | ]; 123 | 124 | /** 125 | * -------------------------------------------------------------------------- 126 | * Available Cache Handlers 127 | * -------------------------------------------------------------------------- 128 | * 129 | * This is an array of cache engine alias' and class names. Only engines 130 | * that are listed here are allowed to be used. 131 | * 132 | * @var array> 133 | */ 134 | public array $validHandlers = [ 135 | 'dummy' => DummyHandler::class, 136 | 'file' => FileHandler::class, 137 | 'memcached' => MemcachedHandler::class, 138 | 'predis' => PredisHandler::class, 139 | 'redis' => RedisHandler::class, 140 | 'wincache' => WincacheHandler::class, 141 | ]; 142 | 143 | /** 144 | * -------------------------------------------------------------------------- 145 | * Web Page Caching: Cache Include Query String 146 | * -------------------------------------------------------------------------- 147 | * 148 | * Whether to take the URL query string into consideration when generating 149 | * output cache files. Valid options are: 150 | * 151 | * false = Disabled 152 | * true = Enabled, take all query parameters into account. 153 | * Please be aware that this may result in numerous cache 154 | * files generated for the same page over and over again. 155 | * ['q'] = Enabled, but only take into account the specified list 156 | * of query parameters. 157 | * 158 | * @var bool|list 159 | */ 160 | public $cacheQueryString = false; 161 | } 162 | -------------------------------------------------------------------------------- /app/Config/Constants.php: -------------------------------------------------------------------------------- 1 | |string|null 49 | */ 50 | public $defaultSrc; 51 | 52 | /** 53 | * Lists allowed scripts' URLs. 54 | * 55 | * @var list|string 56 | */ 57 | public $scriptSrc = 'self'; 58 | 59 | /** 60 | * Lists allowed stylesheets' URLs. 61 | * 62 | * @var list|string 63 | */ 64 | public $styleSrc = 'self'; 65 | 66 | /** 67 | * Defines the origins from which images can be loaded. 68 | * 69 | * @var list|string 70 | */ 71 | public $imageSrc = 'self'; 72 | 73 | /** 74 | * Restricts the URLs that can appear in a page's `` element. 75 | * 76 | * Will default to self if not overridden 77 | * 78 | * @var list|string|null 79 | */ 80 | public $baseURI; 81 | 82 | /** 83 | * Lists the URLs for workers and embedded frame contents 84 | * 85 | * @var list|string 86 | */ 87 | public $childSrc = 'self'; 88 | 89 | /** 90 | * Limits the origins that you can connect to (via XHR, 91 | * WebSockets, and EventSource). 92 | * 93 | * @var list|string 94 | */ 95 | public $connectSrc = 'self'; 96 | 97 | /** 98 | * Specifies the origins that can serve web fonts. 99 | * 100 | * @var list|string 101 | */ 102 | public $fontSrc; 103 | 104 | /** 105 | * Lists valid endpoints for submission from `
` tags. 106 | * 107 | * @var list|string 108 | */ 109 | public $formAction = 'self'; 110 | 111 | /** 112 | * Specifies the sources that can embed the current page. 113 | * This directive applies to ``, `