├── .editorconfig ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── RESULTS.md ├── bin ├── cake ├── cake.bat └── cake.php ├── composer.json ├── config ├── Migrations │ └── 20150111023838_Init.php ├── app.php ├── app_custom.php ├── app_local.default.php ├── bootstrap.php ├── bootstrap_cli.php ├── paths.php └── routes.php ├── index.php ├── phpunit.xml.dist ├── src ├── Application.php ├── Command │ └── CommandExecCommand.php ├── Console │ └── Installer.php ├── Controller │ ├── AppController.php │ ├── Component │ │ ├── FooComponent.php │ │ └── empty │ ├── PagesController.php │ └── TokensController.php ├── Model │ ├── Behavior │ │ └── AlphaBehavior.php │ ├── Entity │ │ └── Token.php │ └── Table │ │ └── TokensTable.php └── View │ ├── AjaxView.php │ ├── AppView.php │ ├── Cell │ └── InboxCell.php │ └── Helper │ ├── FooHelper.php │ └── empty ├── templates ├── Error │ ├── error400.php │ └── error500.php ├── Pages │ └── home.php ├── Tokens │ ├── add.php │ ├── edit.php │ ├── index.php │ ├── model_delete.php │ ├── model_find.php │ ├── model_multi_save.php │ ├── model_no_validation.php │ ├── model_no_validation_no_rules.php │ ├── model_patch.php │ └── model_save.php ├── cell │ └── Inbox │ │ └── display.php ├── element │ ├── flash │ │ ├── default.php │ │ ├── error.php │ │ └── success.php │ └── info.php └── layout │ ├── default.php │ └── error.php ├── tests └── bootstrap.php └── webroot ├── .htaccess ├── css ├── base.css ├── cake.css └── milligram.min.css ├── favicon.ico ├── img ├── cake.icon.png └── cake.power.gif ├── index.php └── js └── empty /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This file is for unifying the coding style for different editors and IDEs. 2 | ; More information at https://editorconfig.org 3 | root = true 4 | 5 | [*] 6 | indent_style = tab 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.bat] 12 | end_of_line = crlf 13 | 14 | [*.yml] 15 | indent_style = space 16 | indent_size = 2 17 | 18 | [*.json] 19 | indent_style = space 20 | indent_size = 4 21 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Define the line ending behavior of the different file extensions 2 | # Set default behaviour, in case users don't have core.autocrlf set. 3 | * text text=auto eol=lf 4 | 5 | # Declare files that will always have CRLF line endings on checkout. 6 | *.bat eol=crlf 7 | 8 | # Declare files that will always have LF line endings on checkout. 9 | *.pem eol=lf 10 | 11 | # Denote all files that are truly binary and should not be modified. 12 | *.png binary 13 | *.jpg binary 14 | *.gif binary 15 | *.ico binary 16 | *.mo binary 17 | *.pdf binary 18 | *.phar binary 19 | *.zip binary 20 | *.a binary 21 | *.dll binary 22 | *.exe binary 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/* 2 | /tmp/* 3 | /logs/* 4 | /plugins/ 5 | /config/app_local.php 6 | /composer.lock 7 | /composer.phar 8 | /phpunit.phar 9 | /.idea/* 10 | /config/Migrations/schema-dump-default.lock 11 | .phpunit.result.cache 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016-present Mark Scherer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Execution order in CakePHP 2 | 3 | [![License](https://poser.pugx.org/cakephp/app/license.svg)](https://packagist.org/packages/cakephp/app) 4 | [![Minimum PHP Version](http://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/) 5 | [![Coding Standards](https://img.shields.io/badge/cs-PSR--2--R-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards) 6 | 7 | A demo app to **display execution order of files and callbacks in a CakePHP app**. 8 | This can be very useful for knowing if app-, plugin- or other callbacks run in the 9 | order one expects them to. 10 | 11 | This is an unstable repository and should be treated as an alpha. 12 | 13 | ## Results 14 | 15 | See [RESULTS.md](RESULTS.md). 16 | 17 | ## Installation 18 | 19 | Download and run `composer install`. 20 | 21 | You should now be able to visit the path to where you installed the app and see 22 | the setup traffic lights. 23 | 24 | ## Configuration and Usage 25 | 26 | Create `config/app_local.php` from the default template and setup the 'Datasources' and any other 27 | configuration relevant for your application. 28 | 29 | Run the `bin/cake migrations migrate` command to have a basic test table (tokens). 30 | 31 | Then run it and see the logs output. 32 | To build an updated RESULTS.md file, execute `bin/cake exec prep` after each run to build a TMP/exec.txt from the log output. 33 | 34 | ## Version notice 35 | This branch is only for CakePHP 5 (currently 5.1). 36 | 37 | For earlier versions please see [dereuromark.de/2013/01/22/cakephp-tips](http://www.dereuromark.de/2013/01/22/cakephp-tips/#dispatcher-execution-order) 38 | or check other branches. 39 | 40 | ## Contributing 41 | 42 | Feel free to add more stuff to it. 43 | -------------------------------------------------------------------------------- /RESULTS.md: -------------------------------------------------------------------------------- 1 | # Executionorder - Results 2 | 3 | ## Basic action + component + helper + cell 4 | ``` 5 | config/bootstrap 6 | config/routes 7 | Controller::initialize 8 | FooComponent::beforeFilter 9 | Controller::beforeFilter 10 | FooComponent::startup 11 | Controller.action 12 | FooComponent::beforeRender 13 | Controller::beforeRender 14 | 15 | AppView::initialize 16 | FooHelper::beforeRender (templates/Tokens/index.php) 17 | FooHelper::beforeRenderFile (templates/Tokens/index.php) 18 | 19 | InboxCell.action 20 | AppView::initialize 21 | FooHelper::beforeRender (templates/cell/Inbox/display.php) 22 | FooHelper::beforeRenderFile (templates/cell/Inbox/display.php) 23 | FooHelper::afterRenderFile (templates/cell/Inbox/display.php) 24 | FooHelper::afterRender (templates/cell/Inbox/display.php) 25 | 26 | FooHelper::beforeRenderFile (templates/element/info.php) 27 | FooHelper::afterRenderFile (templates/element/info.php) 28 | FooHelper::afterRenderFile (templates/Tokens/index.php) 29 | FooHelper::afterRender (templates/Tokens/index.php) 30 | 31 | FooHelper::beforeLayout (templates/layout/default.php) 32 | FooHelper::beforeRenderFile (templates/layout/default.php) 33 | FooHelper::afterRenderFile (templates/layout/default.php) 34 | FooHelper::afterLayout (templates/layout/default.php) 35 | 36 | FooComponent::shutdown 37 | Controller::afterFilter 38 | ``` 39 | Note that component callbacks are usually called first. 40 | 41 | ## Model find 42 | ``` 43 | config/bootstrap 44 | config/routes 45 | Controller::initialize 46 | FooComponent::beforeFilter 47 | Controller::beforeFilter 48 | FooComponent::startup 49 | Controller.action 50 | 51 | TokensTable:initialize 52 | AlphaBehavior:initialize 53 | AlphaBehavior:beforeFind 54 | TokensTable:beforeFind 55 | 56 | FooComponent::beforeRender 57 | Controller::beforeRender 58 | FooComponent::shutdown 59 | Controller::afterFilter 60 | ``` 61 | 62 | ## Model marshal (patch/validate) only 63 | ``` 64 | config/bootstrap 65 | config/routes 66 | Controller::initialize 67 | FooComponent::beforeFilter 68 | Controller::beforeFilter 69 | FooComponent::startup 70 | Controller.action 71 | 72 | TokensTable::initialize 73 | AlphaBehavior::initialize 74 | AlphaBehavior::beforeMarshal 75 | TokensTable::beforeMarshal 76 | TokensTable::validationDefault 77 | AlphaBehavior::buildValidator 78 | TokensTable::buildValidator 79 | AlphaBehavior::afterMarshal 80 | TokensTable::afterMarshal 81 | 82 | FooComponent::beforeRender 83 | Controller::beforeRender 84 | FooComponent::shutdown 85 | Controller::afterFilter 86 | ``` 87 | 88 | 89 | ## Model validate + save 90 | ``` 91 | config/bootstrap 92 | config/routes 93 | Controller::initialize 94 | FooComponent::beforeFilter 95 | Controller::beforeFilter 96 | FooComponent::startup 97 | Controller.action 98 | 99 | TokensTable::initialize 100 | AlphaBehavior::initialize 101 | AlphaBehavior::beforeMarshal 102 | TokensTable::beforeMarshal 103 | 104 | TokensTable::validationDefault 105 | AlphaBehavior::buildValidator 106 | TokensTable::buildValidator 107 | AlphaBehavior:afterMarshal 108 | TokensTable:afterMarshal 109 | 110 | TokensTable::buildRules 111 | AlphaBehavior::buildRules 112 | 113 | AlphaBehavior::beforeRules 114 | TokensTable::beforeRules 115 | AlphaBehavior::afterRules 116 | TokensTable::afterRules 117 | AlphaBehavior::beforeSave 118 | TokensTable::beforeSave 119 | AlphaBehavior::afterSave 120 | TokensTable::afterSave 121 | AlphaBehavior:afterSaveCommit 122 | TokensTable:afterSaveCommit 123 | 124 | FooComponent::beforeRender 125 | Controller::beforeRender 126 | AppView::initialize 127 | FooComponent::shutdown 128 | Controller::afterFilter 129 | ``` 130 | Note that behavior callbacks are usually called first. 131 | Exceptions are `initialize` and `buildRules` since those are not event listeners. 132 | 133 | ## Model save multiple times 134 | ``` 135 | ... 136 | TokensTable::initialize 137 | AlphaBehavior::initialize 138 | AlphaBehavior::beforeMarshal 139 | TokensTable::beforeMarshal 140 | 141 | TokensTable::validationDefault 142 | AlphaBehavior::buildValidator 143 | TokensTable::buildValidator 144 | AlphaBehavior::afterMarshal 145 | TokensTable::afterMarshal 146 | 147 | TokensTable::buildRules 148 | AlphaBehavior::buildRules 149 | 150 | AlphaBehavior::beforeRules 151 | TokensTable::beforeRules 152 | AlphaBehavior::afterRules 153 | TokensTable::afterRules 154 | AlphaBehavior::beforeSave 155 | TokensTable::beforeSave 156 | AlphaBehavior::afterSave 157 | TokensTable::afterSave 158 | AlphaBehavior:afterSaveCommit 159 | TokensTable:afterSaveCommit 160 | 161 | AlphaBehavior::beforeMarshal 162 | TokensTable::beforeMarshal 163 | AlphaBehavior::afterMarshal 164 | TokensTable::afterMarshal 165 | 166 | AlphaBehavior::beforeRules 167 | TokensTable::beforeRules 168 | AlphaBehavior::afterRules 169 | TokensTable::afterRules 170 | AlphaBehavior::beforeSave 171 | TokensTable::beforeSave 172 | AlphaBehavior::afterSave 173 | TokensTable::afterSave 174 | AlphaBehavior:afterSaveCommit 175 | TokensTable:afterSaveCommit 176 | ... 177 | ``` 178 | This shows that `initialize`, `validationDefault`, `buildValidator` and `buildRules` are only executed once, and then cached. 179 | They should not be used for data modification. Instead use `beforeMarshal`/`afterMarshal` if it should always be run on patching level. 180 | Use `beforeRules` if it only applies to saving. 181 | 182 | ## Model save without validation 183 | ``` 184 | ... 185 | TokensTable::initialize 186 | AlphaBehavior::initialize 187 | AlphaBehavior::beforeMarshal 188 | TokensTable::beforeMarshal 189 | AlphaBehavior::afterMarshal 190 | TokensTable::afterMarshal 191 | TokensTable::buildRules 192 | AlphaBehavior::buildRules 193 | AlphaBehavior::beforeRules 194 | TokensTable::beforeRules 195 | AlphaBehavior::afterRules 196 | TokensTable::afterRules 197 | AlphaBehavior::beforeSave 198 | TokensTable::beforeSave 199 | AlphaBehavior::afterSave 200 | TokensTable::afterSave 201 | AlphaBehavior:afterSaveCommit 202 | TokensTable:afterSaveCommit 203 | ... 204 | ``` 205 | This shows that `validationDefault` and `buildValidator` are not executed in this case. Only the callbacks around the domain rules are. 206 | 207 | ## Model save without validation and without rules 208 | ``` 209 | ... 210 | TokensTable::initialize 211 | AlphaBehavior::initialize 212 | AlphaBehavior::beforeMarshal 213 | TokensTable::beforeMarshal 214 | AlphaBehavior::afterMarshal 215 | TokensTable::afterMarshal 216 | AlphaBehavior::beforeSave 217 | TokensTable::beforeSave 218 | AlphaBehavior::afterSave 219 | TokensTable::afterSave 220 | AlphaBehavior:afterSaveCommit 221 | TokensTable:afterSaveCommit 222 | ... 223 | ``` 224 | In this case not even `buildRules` and the `beforeRules`/`afterRules` callbacks are triggered. 225 | But `beforeMarshal` and `afterMarshal` always, so be careful not to overuse them for validation, as you cannot circumvent them then. 226 | 227 | ## Model delete 228 | ``` 229 | ... 230 | AlphaBehavior:beforeDelete 231 | TokensTable:beforeDelete 232 | AlphaBehavior:afterDelete 233 | TokensTable:afterDelete 234 | AlphaBehavior:afterDeleteCommit 235 | TokensTable:afterDeleteCommit 236 | ... 237 | ``` 238 | 239 | ## Redirecting 240 | ``` 241 | config/bootstrap 242 | config/routes 243 | Controller::initialize 244 | FooComponent::beforeFilter 245 | Controller::beforeFilter 246 | FooComponent::startup 247 | Controller.action 248 | 249 | Controller::redirect 250 | FooComponent::beforeRedirect 251 | 252 | FooComponent::shutdown 253 | Controller::afterFilter 254 | ``` 255 | 256 | ## Exception in controller action 257 | ``` 258 | config/bootstrap 259 | config/routes 260 | Controller::initialize 261 | FooComponent::beforeFilter 262 | Controller::beforeFilter 263 | FooComponent::startup 264 | 265 | AppView::initialize 266 | ``` 267 | It jumps directly to the View, no `shutdown` or `afterFilter` callbacks fired anymore. 268 | 269 | ## Basic command 270 | ``` 271 | config/bootstrap (default + cli one) 272 | Command::__construct 273 | Command::initialize 274 | Command::startup 275 | Command::execute 276 | ``` 277 | -------------------------------------------------------------------------------- /bin/cake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | ################################################################################ 3 | # 4 | # Cake is a shell script for invoking CakePHP shell commands 5 | # 6 | # CakePHP(tm) : Rapid Development Framework (https://cakephp.org) 7 | # Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) 8 | # 9 | # Licensed under The MIT License 10 | # For full copyright and license information, please see the LICENSE.txt 11 | # Redistributions of files must retain the above copyright notice. 12 | # 13 | # @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) 14 | # @link https://cakephp.org CakePHP(tm) Project 15 | # @since 1.2.0 16 | # @license https://opensource.org/licenses/mit-license.php MIT License 17 | # 18 | ################################################################################ 19 | 20 | # Canonicalize by following every symlink of the given name recursively 21 | canonicalize() { 22 | NAME="$1" 23 | if [ -f "$NAME" ] 24 | then 25 | DIR=$(dirname -- "$NAME") 26 | NAME=$(cd -P "$DIR" > /dev/null && pwd -P)/$(basename -- "$NAME") 27 | fi 28 | while [ -h "$NAME" ]; do 29 | DIR=$(dirname -- "$NAME") 30 | SYM=$(readlink "$NAME") 31 | NAME=$(cd "$DIR" > /dev/null && cd "$(dirname -- "$SYM")" > /dev/null && pwd)/$(basename -- "$SYM") 32 | done 33 | echo "$NAME" 34 | } 35 | 36 | # Find a CLI version of PHP 37 | findCliPhp() { 38 | for TESTEXEC in php php-cli /usr/local/bin/php 39 | do 40 | SAPI=$(echo "" | $TESTEXEC 2>/dev/null) 41 | if [ "$SAPI" = "cli" ] 42 | then 43 | echo $TESTEXEC 44 | return 45 | fi 46 | done 47 | echo "Failed to find a CLI version of PHP; falling back to system standard php executable" >&2 48 | echo "php"; 49 | } 50 | 51 | # If current path is a symlink, resolve to real path 52 | realname="$0" 53 | if [ -L "$realname" ] 54 | then 55 | realname=$(readlink -f "$0") 56 | fi 57 | 58 | CONSOLE=$(dirname -- "$(canonicalize "$realname")") 59 | APP=$(dirname "$CONSOLE") 60 | 61 | # If your CLI PHP is somewhere that this doesn't find, you can define a PHP environment 62 | # variable with the correct path in it. 63 | if [ -z "$PHP" ] 64 | then 65 | PHP=$(findCliPhp) 66 | fi 67 | 68 | if [ "$(basename "$realname")" != 'cake' ] 69 | then 70 | exec "$PHP" "$CONSOLE"/cake.php "$(basename "$realname")" "$@" 71 | else 72 | exec "$PHP" "$CONSOLE"/cake.php "$@" 73 | fi 74 | 75 | exit 76 | -------------------------------------------------------------------------------- /bin/cake.bat: -------------------------------------------------------------------------------- 1 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 | :: 3 | :: Cake is a Windows batch script for invoking CakePHP shell commands 4 | :: 5 | :: CakePHP(tm) : Rapid Development Framework (https://cakephp.org) 6 | :: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) 7 | :: 8 | :: Licensed under The MIT License 9 | :: Redistributions of files must retain the above copyright notice. 10 | :: 11 | :: @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org) 12 | :: @link https://cakephp.org CakePHP(tm) Project 13 | :: @since 2.0.0 14 | :: @license https://opensource.org/licenses/mit-license.php MIT License 15 | :: 16 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 17 | 18 | @echo off 19 | 20 | SET app=%0 21 | SET lib=%~dp0 22 | 23 | php "%lib%cake.php" %* 24 | 25 | echo. 26 | 27 | exit /B %ERRORLEVEL% 28 | -------------------------------------------------------------------------------- /bin/cake.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php -q 2 | run($argv)); 11 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cakephp/app", 3 | "description": "CakePHP skeleton app", 4 | "homepage": "http://cakephp.org", 5 | "type": "project", 6 | "license": "MIT", 7 | "require": { 8 | "php": ">=8.2", 9 | "cakephp/cakephp": "^5.1", 10 | "cakephp/plugin-installer": "*" 11 | }, 12 | "require-dev": { 13 | "cakephp/debug_kit": "@stable", 14 | "fig-r/psr2r-sniffer": "dev-master" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "App\\": "src/" 19 | } 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "App\\Test\\": "tests/" 24 | } 25 | }, 26 | "scripts": { 27 | "cs-check": "phpcs -p -s --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/config/Migrations/ --extensions=php src/ tests/ config/ webroot/", 28 | "cs-fix": "phpcbf -p --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/config/Migrations/ --extensions=php src/ tests/ config/ webroot/", 29 | "post-install-cmd": "App\\Console\\Installer::postInstall", 30 | "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump" 31 | }, 32 | "prefer-stable": true, 33 | "config": { 34 | "allow-plugins": { 35 | "cakephp/plugin-installer": true, 36 | "dealerdirect/phpcodesniffer-composer-installer": true 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /config/Migrations/20150111023838_Init.php: -------------------------------------------------------------------------------- 1 | execute("CREATE TABLE IF NOT EXISTS `tokens` ( 26 | `id` int(10) unsigned NOT NULL AUTO_INCREMENT, 27 | `user_id` int(10) DEFAULT NULL, 28 | `type` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 29 | `key` varchar(60) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 30 | `content` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 31 | `used` tinyint(1) unsigned NOT NULL DEFAULT '0', 32 | `unlimited` tinyint(1) unsigned NOT NULL DEFAULT '0', 33 | `created` datetime DEFAULT NULL, 34 | `modified` datetime DEFAULT NULL, 35 | PRIMARY KEY (`id`), 36 | KEY `user_id` (`user_id`) 37 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;"); 38 | } 39 | 40 | /** 41 | * Migrate Down. 42 | * 43 | * @return void 44 | */ 45 | public function down() { 46 | $this->execute('DROP table tokens'); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN), 20 | 21 | /* 22 | * Configure basic information about the application. 23 | * 24 | * - namespace - The namespace to find app classes under. 25 | * - defaultLocale - The default locale for translation, formatting currencies and numbers, date and time. 26 | * - encoding - The encoding used for HTML + database connections. 27 | * - base - The base directory the app resides in. If false this 28 | * will be auto-detected. 29 | * - dir - Name of app directory. 30 | * - webroot - The webroot directory. 31 | * - wwwRoot - The file path to webroot. 32 | * - baseUrl - To configure CakePHP to *not* use mod_rewrite and to 33 | * use CakePHP pretty URLs, remove these .htaccess 34 | * files: 35 | * /.htaccess 36 | * /webroot/.htaccess 37 | * And uncomment the baseUrl key below. 38 | * - fullBaseUrl - A base URL to use for absolute links. When set to false (default) 39 | * CakePHP generates required value based on `HTTP_HOST` environment variable. 40 | * However, you can define it manually to optimize performance or if you 41 | * are concerned about people manipulating the `Host` header. 42 | * - imageBaseUrl - Web path to the public images/ directory under webroot. 43 | * - cssBaseUrl - Web path to the public css/ directory under webroot. 44 | * - jsBaseUrl - Web path to the public js/ directory under webroot. 45 | * - paths - Configure paths for non class-based resources. Supports the 46 | * `plugins`, `templates`, `locales` subkeys, which allow the definition of 47 | * paths for plugins, view templates and locale files respectively. 48 | */ 49 | 'App' => [ 50 | 'namespace' => 'App', 51 | 'encoding' => env('APP_ENCODING', 'UTF-8'), 52 | 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'), 53 | 'defaultTimezone' => env('APP_DEFAULT_TIMEZONE', 'UTC'), 54 | 'base' => false, 55 | 'dir' => 'src', 56 | 'webroot' => 'webroot', 57 | 'wwwRoot' => WWW_ROOT, 58 | //'baseUrl' => env('SCRIPT_NAME'), 59 | 'fullBaseUrl' => false, 60 | 'imageBaseUrl' => 'img/', 61 | 'cssBaseUrl' => 'css/', 62 | 'jsBaseUrl' => 'js/', 63 | 'paths' => [ 64 | 'plugins' => [ROOT . DS . 'plugins' . DS], 65 | 'templates' => [ROOT . DS . 'templates' . DS], 66 | 'locales' => [RESOURCES . 'locales' . DS], 67 | ], 68 | ], 69 | 70 | /* 71 | * Security and encryption configuration 72 | * 73 | * - salt - A random string used in security hashing methods. 74 | * The salt value is also used as the encryption key. 75 | * You should treat it as extremely sensitive data. 76 | */ 77 | 'Security' => [ 78 | 'salt' => env('SECURITY_SALT'), 79 | ], 80 | 81 | /* 82 | * Apply timestamps with the last modified time to static assets (js, css, images). 83 | * Will append a querystring parameter containing the time the file was modified. 84 | * This is useful for busting browser caches. 85 | * 86 | * Set to true to apply timestamps when debug is true. Set to 'force' to always 87 | * enable timestamping regardless of debug value. 88 | */ 89 | 'Asset' => [ 90 | //'timestamp' => true, 91 | // 'cacheTime' => '+1 year' 92 | ], 93 | 94 | /* 95 | * Configure the cache adapters. 96 | */ 97 | 'Cache' => [ 98 | 'default' => [ 99 | 'className' => FileEngine::class, 100 | 'path' => CACHE, 101 | 'url' => env('CACHE_DEFAULT_URL', null), 102 | ], 103 | 104 | /* 105 | * Configure the cache used for general framework caching. 106 | * Translation cache files are stored with this configuration. 107 | * Duration will be set to '+2 minutes' in bootstrap.php when debug = true 108 | * If you set 'className' => 'Null' core cache will be disabled. 109 | */ 110 | '_cake_translations_' => [ 111 | 'className' => FileEngine::class, 112 | 'prefix' => 'myapp_cake_translations_', 113 | 'path' => CACHE . 'persistent' . DS, 114 | 'serialize' => true, 115 | 'duration' => '+1 years', 116 | 'url' => env('CACHE_CAKECORE_URL', null), 117 | ], 118 | 119 | /* 120 | * Configure the cache for model and datasource caches. This cache 121 | * configuration is used to store schema descriptions, and table listings 122 | * in connections. 123 | * Duration will be set to '+2 minutes' in bootstrap.php when debug = true 124 | */ 125 | '_cake_model_' => [ 126 | 'className' => FileEngine::class, 127 | 'prefix' => 'myapp_cake_model_', 128 | 'path' => CACHE . 'models' . DS, 129 | 'serialize' => true, 130 | 'duration' => '+1 years', 131 | 'url' => env('CACHE_CAKEMODEL_URL', null), 132 | ], 133 | ], 134 | 135 | /* 136 | * Configure the Error and Exception handlers used by your application. 137 | * 138 | * By default errors are displayed using Debugger, when debug is true and logged 139 | * by Cake\Log\Log when debug is false. 140 | * 141 | * In CLI environments exceptions will be printed to stderr with a backtrace. 142 | * In web environments an HTML page will be displayed for the exception. 143 | * With debug true, framework errors like Missing Controller will be displayed. 144 | * When debug is false, framework errors will be coerced into generic HTTP errors. 145 | * 146 | * Options: 147 | * 148 | * - `errorLevel` - int - The level of errors you are interested in capturing. 149 | * - `trace` - boolean - Whether backtraces should be included in 150 | * logged errors/exceptions. 151 | * - `log` - boolean - Whether you want exceptions logged. 152 | * - `exceptionRenderer` - string - The class responsible for rendering uncaught exceptions. 153 | * The chosen class will be used for both CLI and web environments. If you want different 154 | * classes used in CLI and web environments you'll need to write that conditional logic as well. 155 | * The conventional location for custom renderers is in `src/Error`. Your exception renderer needs to 156 | * implement the `render()` method and return either a string or Http\Response. 157 | * `errorRenderer` - string - The class responsible for rendering PHP errors. The selected 158 | * class will be used for both web and CLI contexts. If you want different classes for each environment 159 | * you'll need to write that conditional logic as well. Error renderers need to 160 | * to implement the `Cake\Error\ErrorRendererInterface`. 161 | * - `skipLog` - array - List of exceptions to skip for logging. Exceptions that 162 | * extend one of the listed exceptions will also be skipped for logging. 163 | * E.g.: 164 | * `'skipLog' => ['Cake\Http\Exception\NotFoundException', 'Cake\Http\Exception\UnauthorizedException']` 165 | * - `extraFatalErrorMemory` - int - The number of megabytes to increase the memory limit by 166 | * when a fatal error is encountered. This allows 167 | * breathing room to complete logging or error handling. 168 | * - `ignoredDeprecationPaths` - array - A list of glob-compatible file paths that deprecations 169 | * should be ignored in. Use this to ignore deprecations for plugins or parts of 170 | * your application that still emit deprecations. 171 | */ 172 | 'Error' => [ 173 | 'errorLevel' => E_ALL, 174 | 'skipLog' => [], 175 | 'log' => true, 176 | 'trace' => true, 177 | 'ignoredDeprecationPaths' => [], 178 | ], 179 | 180 | /* 181 | * Debugger configuration 182 | * 183 | * Define development error values for Cake\Error\Debugger 184 | * 185 | * - `editor` Set the editor URL format you want to use. 186 | * By default atom, emacs, macvim, phpstorm, sublime, textmate, and vscode are 187 | * available. You can add additional editor link formats using 188 | * `Debugger::addEditor()` during your application bootstrap. 189 | * - `outputMask` A mapping of `key` to `replacement` values that 190 | * `Debugger` should replace in dumped data and logs generated by `Debugger`. 191 | */ 192 | 'Debugger' => [ 193 | 'editor' => 'phpstorm', 194 | ], 195 | 196 | /* 197 | * Email configuration. 198 | * 199 | * By defining transports separately from delivery profiles you can easily 200 | * re-use transport configuration across multiple profiles. 201 | * 202 | * You can specify multiple configurations for production, development and 203 | * testing. 204 | * 205 | * Each transport needs a `className`. Valid options are as follows: 206 | * 207 | * Mail - Send using PHP mail function 208 | * Smtp - Send using SMTP 209 | * Debug - Do not send the email, just return the result 210 | * 211 | * You can add custom transports (or override existing transports) by adding the 212 | * appropriate file to src/Mailer/Transport. Transports should be named 213 | * 'YourTransport.php', where 'Your' is the name of the transport. 214 | */ 215 | 'EmailTransport' => [ 216 | 'default' => [ 217 | 'className' => MailTransport::class, 218 | /* 219 | * The keys host, port, timeout, username, password, client and tls 220 | * are used in SMTP transports 221 | */ 222 | 'host' => 'localhost', 223 | 'port' => 25, 224 | 'timeout' => 30, 225 | /* 226 | * It is recommended to set these options through your environment or app_local.php 227 | */ 228 | //'username' => null, 229 | //'password' => null, 230 | 'client' => null, 231 | 'tls' => false, 232 | 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null), 233 | ], 234 | ], 235 | 236 | /* 237 | * Email delivery profiles 238 | * 239 | * Delivery profiles allow you to predefine various properties about email 240 | * messages from your application and give the settings a name. This saves 241 | * duplication across your application and makes maintenance and development 242 | * easier. Each profile accepts a number of keys. See `Cake\Mailer\Mailer` 243 | * for more information. 244 | */ 245 | 'Email' => [ 246 | 'default' => [ 247 | 'transport' => 'default', 248 | 'from' => 'you@localhost', 249 | /* 250 | * Will by default be set to config value of App.encoding, if that exists otherwise to UTF-8. 251 | */ 252 | //'charset' => 'utf-8', 253 | //'headerCharset' => 'utf-8', 254 | ], 255 | ], 256 | 257 | /* 258 | * Connection information used by the ORM to connect 259 | * to your application's datastores. 260 | * 261 | * ### Notes 262 | * - Drivers include Mysql Postgres Sqlite Sqlserver 263 | * See vendor\cakephp\cakephp\src\Database\Driver for the complete list 264 | * - Do not use periods in database name - it may lead to errors. 265 | * See https://github.com/cakephp/cakephp/issues/6471 for details. 266 | * - 'encoding' is recommended to be set to full UTF-8 4-Byte support. 267 | * E.g set it to 'utf8mb4' in MariaDB and MySQL and 'utf8' for any 268 | * other RDBMS. 269 | */ 270 | 'Datasources' => [ 271 | /* 272 | * These configurations should contain permanent settings used 273 | * by all environments. 274 | * 275 | * The values in app_local.php will override any values set here 276 | * and should be used for local and per-environment configurations. 277 | * 278 | * Environment variable-based configurations can be loaded here or 279 | * in app_local.php depending on the application's needs. 280 | */ 281 | 'default' => [ 282 | 'className' => Connection::class, 283 | 'driver' => Mysql::class, 284 | 'persistent' => false, 285 | 'timezone' => 'UTC', 286 | 287 | /* 288 | * For MariaDB/MySQL the internal default changed from utf8 to utf8mb4, aka full utf-8 support 289 | */ 290 | 'encoding' => 'utf8mb4', 291 | 292 | /* 293 | * If your MySQL server is configured with `skip-character-set-client-handshake` 294 | * then you MUST use the `flags` config to set your charset encoding. 295 | * For e.g. `'flags' => [\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4']` 296 | */ 297 | 'flags' => [], 298 | 'cacheMetadata' => true, 299 | 'log' => false, 300 | 301 | /* 302 | * Set identifier quoting to true if you are using reserved words or 303 | * special characters in your table or column names. Enabling this 304 | * setting will result in queries built using the Query Builder having 305 | * identifiers quoted when creating SQL. It should be noted that this 306 | * decreases performance because each query needs to be traversed and 307 | * manipulated before being executed. 308 | */ 309 | 'quoteIdentifiers' => false, 310 | 311 | /* 312 | * During development, if using MySQL < 5.6, uncommenting the 313 | * following line could boost the speed at which schema metadata is 314 | * fetched from the database. It can also be set directly with the 315 | * mysql configuration directive 'innodb_stats_on_metadata = 0' 316 | * which is the recommended value in production environments 317 | */ 318 | //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], 319 | ], 320 | 321 | /* 322 | * The test connection is used during the test suite. 323 | */ 324 | 'test' => [ 325 | 'className' => Connection::class, 326 | 'driver' => Mysql::class, 327 | 'persistent' => false, 328 | 'timezone' => 'UTC', 329 | 'encoding' => 'utf8mb4', 330 | 'flags' => [], 331 | 'cacheMetadata' => true, 332 | 'quoteIdentifiers' => false, 333 | 'log' => false, 334 | //'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'], 335 | ], 336 | ], 337 | 338 | /* 339 | * Configures logging options 340 | */ 341 | 'Log' => [ 342 | 'debug' => [ 343 | 'className' => FileLog::class, 344 | 'path' => LOGS, 345 | 'file' => 'debug', 346 | 'url' => env('LOG_DEBUG_URL', null), 347 | 'scopes' => null, 348 | 'levels' => ['notice', 'info', 'debug'], 349 | ], 350 | 'error' => [ 351 | 'className' => FileLog::class, 352 | 'path' => LOGS, 353 | 'file' => 'error', 354 | 'url' => env('LOG_ERROR_URL', null), 355 | 'scopes' => null, 356 | 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], 357 | ], 358 | // To enable this dedicated query log, you need to set your datasource's log flag to true 359 | 'queries' => [ 360 | 'className' => FileLog::class, 361 | 'path' => LOGS, 362 | 'file' => 'queries', 363 | 'url' => env('LOG_QUERIES_URL', null), 364 | 'scopes' => ['cake.database.queries'], 365 | ], 366 | ], 367 | 368 | /* 369 | * Session configuration. 370 | * 371 | * Contains an array of settings to use for session configuration. The 372 | * `defaults` key is used to define a default preset to use for sessions, any 373 | * settings declared here will override the settings of the default config. 374 | * 375 | * ## Options 376 | * 377 | * - `cookie` - The name of the cookie to use. Defaults to value set for `session.name` php.ini config. 378 | * Avoid using `.` in cookie names, as PHP will drop sessions from cookies with `.` in the name. 379 | * - `cookiePath` - The url path for which session cookie is set. Maps to the 380 | * `session.cookie_path` php.ini config. Defaults to base path of app. 381 | * - `timeout` - The time in minutes a session can be 'idle'. If no request is received in 382 | * this duration, the session will be expired and rotated. Pass 0 to disable idle timeout checks. 383 | * - `defaults` - The default configuration set to use as a basis for your session. 384 | * There are four built-in options: php, cake, cache, database. 385 | * - `handler` - Can be used to enable a custom session handler. Expects an 386 | * array with at least the `engine` key, being the name of the Session engine 387 | * class to use for managing the session. CakePHP bundles the `CacheSession` 388 | * and `DatabaseSession` engines. 389 | * - `ini` - An associative array of additional 'session.*` ini values to set. 390 | * 391 | * Within the `ini` key, you will likely want to define: 392 | * 393 | * - `session.cookie_lifetime` - The number of seconds that cookies are valid for. This 394 | * should be longer than `Session.timeout`. 395 | * - `session.gc_maxlifetime` - The number of seconds after which a session is considered 'garbage' 396 | * that can be deleted by PHP's session cleanup behavior. This value should be greater than both 397 | * `Sesssion.timeout` and `session.cookie_lifetime`. 398 | * 399 | * The built-in `defaults` options are: 400 | * 401 | * - 'php' - Uses settings defined in your php.ini. 402 | * - 'cake' - Saves session files in CakePHP's /tmp directory. 403 | * - 'database' - Uses CakePHP's database sessions. 404 | * - 'cache' - Use the Cache class to save sessions. 405 | * 406 | * To define a custom session handler, save it at src/Http/Session/.php. 407 | * Make sure the class implements PHP's `SessionHandlerInterface` and set 408 | * Session.handler to 409 | * 410 | * To use database sessions, load the SQL file located at config/schema/sessions.sql 411 | */ 412 | 'Session' => [ 413 | 'defaults' => 'php', 414 | ], 415 | 'DebugKit' => [ 416 | 'forceEnable' => filter_var(env('DEBUG_KIT_FORCE_ENABLE', false), FILTER_VALIDATE_BOOLEAN), 417 | 'safeTld' => env('DEBUG_KIT_SAFE_TLD', null), 418 | 'ignoreAuthorization' => env('DEBUG_KIT_IGNORE_AUTHORIZATION', false), 419 | ], 420 | ]; 421 | -------------------------------------------------------------------------------- /config/app_custom.php: -------------------------------------------------------------------------------- 1 | false, 5 | 6 | 'Security' => [ 7 | 'salt' => '0ebcb009bb3f8ebe43a4addc3fc1c1f310c50520', 8 | ], 9 | 10 | 'Datasources' => [ 11 | 'default' => [ 12 | 'host' => 'localhost', 13 | 'username' => 'root', 14 | 'password' => '', 15 | 'database' => '', // Set in app_local.php 16 | 'quoteIdentifiers' => true, 17 | ], 18 | 19 | /** 20 | * The test connection is used during the test suite. 21 | */ 22 | 'test' => [ 23 | 'host' => 'localhost', 24 | 'username' => 'root', 25 | 'password' => '', 26 | 'database' => '', // Set in app_local.php 27 | 'quoteIdentifiers' => true, 28 | ], 29 | ], 30 | 31 | 'FormConfig' => [ 32 | 'novalidate' => true, 33 | 'templates' => [ 34 | 'dateWidget' => '{{day}}{{month}}{{year}}{{hour}}{{minute}}{{second}}{{meridian}}', 35 | ], 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/app_local.default.php: -------------------------------------------------------------------------------- 1 | true, 5 | 6 | 'Datasources' => [ 7 | 'default' => [ 8 | 'database' => '', 9 | 'password' => '', 10 | ], 11 | 'test' => [ 12 | 'database' => '', 13 | 'password' => '', 14 | ], 15 | ], 16 | ]; 17 | -------------------------------------------------------------------------------- /config/bootstrap.php: -------------------------------------------------------------------------------- 1 | parse() 65 | // ->putenv() 66 | // ->toEnv() 67 | // ->toServer(); 68 | // } 69 | 70 | /* 71 | * Read configuration file and inject configuration into various 72 | * CakePHP classes. 73 | * 74 | * By default there is only one configuration file. It is often a good 75 | * idea to create multiple configuration files, and separate the configuration 76 | * that changes from configuration that does not. This makes deployment simpler. 77 | */ 78 | try { 79 | Configure::config('default', new PhpConfig()); 80 | Configure::load('app', 'default', false); 81 | } catch (Exception $e) { 82 | exit($e->getMessage() . "\n"); 83 | } 84 | 85 | Configure::load('app_custom'); 86 | 87 | /* 88 | * Load an environment local configuration file to provide overrides to your configuration. 89 | * Notice: For security reasons app_local.php **should not** be included in your git repo. 90 | */ 91 | if (file_exists(CONFIG . 'app_local.php')) { 92 | Configure::load('app_local', 'default'); 93 | } 94 | 95 | /* 96 | * When debug = true the metadata cache should only last 97 | * for a short time. 98 | */ 99 | if (Configure::read('debug')) { 100 | Configure::write('Cache._cake_model_.duration', '+2 minutes'); 101 | Configure::write('Cache._cake_core_.duration', '+2 minutes'); 102 | // disable router cache during development 103 | Configure::write('Cache._cake_routes_.duration', '+2 seconds'); 104 | } 105 | 106 | /* 107 | * Set the default server timezone. Using UTC makes time calculations / conversions easier. 108 | * Check http://php.net/manual/en/timezones.php for list of valid timezone strings. 109 | */ 110 | date_default_timezone_set(Configure::read('App.defaultTimezone')); 111 | 112 | /* 113 | * Configure the mbstring extension to use the correct encoding. 114 | */ 115 | mb_internal_encoding(Configure::read('App.encoding')); 116 | 117 | /* 118 | * Set the default locale. This controls how dates, number and currency is 119 | * formatted and sets the default language to use for translations. 120 | */ 121 | ini_set('intl.default_locale', Configure::read('App.defaultLocale')); 122 | 123 | /* 124 | * Register application error and exception handlers. 125 | */ 126 | (new ErrorTrap(Configure::read('Error')))->register(); 127 | (new ExceptionTrap(Configure::read('Error')))->register(); 128 | 129 | $isCli = PHP_SAPI === 'cli'; 130 | 131 | /* 132 | * Include the CLI bootstrap overrides. 133 | */ 134 | if ($isCli) { 135 | require __DIR__ . '/bootstrap_cli.php'; 136 | } 137 | 138 | /* 139 | * Set the full base URL. 140 | * This URL is used as the base of all absolute links. 141 | */ 142 | $fullBaseUrl = Configure::read('App.fullBaseUrl'); 143 | if (!$fullBaseUrl) { 144 | $s = null; 145 | if (env('HTTPS')) { 146 | $s = 's'; 147 | } 148 | 149 | $httpHost = env('HTTP_HOST'); 150 | if (isset($httpHost)) { 151 | $fullBaseUrl = 'http' . $s . '://' . $httpHost; 152 | } 153 | unset($httpHost, $s); 154 | } 155 | if ($fullBaseUrl) { 156 | Router::fullBaseUrl($fullBaseUrl); 157 | } 158 | unset($fullBaseUrl); 159 | 160 | Cache::setConfig(Configure::consume('Cache')); 161 | ConnectionManager::setConfig(Configure::consume('Datasources')); 162 | TransportFactory::setConfig(Configure::consume('EmailTransport')); 163 | Mailer::setConfig(Configure::consume('Email')); 164 | Log::setConfig(Configure::consume('Log')); 165 | Security::setSalt(Configure::consume('Security.salt')); 166 | 167 | /* 168 | * Setup detectors for mobile and tablet. 169 | */ 170 | ServerRequest::addDetector('mobile', function ($request) { 171 | $detector = new \Detection\MobileDetect(); 172 | 173 | return $detector->isMobile(); 174 | }); 175 | ServerRequest::addDetector('tablet', function ($request) { 176 | $detector = new \Detection\MobileDetect(); 177 | 178 | return $detector->isTablet(); 179 | }); 180 | 181 | /* 182 | * You can set whether the ORM uses immutable or mutable Time types. 183 | * The default changed in 4.0 to immutable types. You can uncomment 184 | * below to switch back to mutable types. 185 | * 186 | * You can enable default locale format parsing by adding calls 187 | * to `useLocaleParser()`. This enables the automatic conversion of 188 | * locale specific date formats. For details see 189 | * @link https://book.cakephp.org/4/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data 190 | */ 191 | // TypeFactory::build('time') 192 | // ->useMutable(); 193 | // TypeFactory::build('date') 194 | // ->useMutable(); 195 | // TypeFactory::build('datetime') 196 | // ->useMutable(); 197 | // TypeFactory::build('timestamp') 198 | // ->useMutable(); 199 | // TypeFactory::build('datetimefractional') 200 | // ->useMutable(); 201 | // TypeFactory::build('timestampfractional') 202 | // ->useMutable(); 203 | // TypeFactory::build('datetimetimezone') 204 | // ->useMutable(); 205 | // TypeFactory::build('timestamptimezone') 206 | // ->useMutable(); 207 | 208 | /* 209 | * Custom Inflector rules, can be set to correctly pluralize or singularize 210 | * table, model, controller names or whatever other string is passed to the 211 | * inflection functions. 212 | */ 213 | //Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']); 214 | //Inflector::rules('irregular', ['red' => 'redlings']); 215 | //Inflector::rules('uninflected', ['dontinflectme']); 216 | //Inflector::rules('transliteration', ['/å/' => 'aa']); 217 | 218 | Log::setConfig('exec', [ 219 | 'className' => 'Cake\Log\Engine\FileLog', 220 | 'path' => LOGS, 221 | 'levels' => [], 222 | 'file' => 'exec', 223 | 'scopes' => ['exec'], 224 | ]); 225 | 226 | Log::write('info', 'config/bootstrap', 'exec'); 227 | -------------------------------------------------------------------------------- /config/bootstrap_cli.php: -------------------------------------------------------------------------------- 1 | setRouteClass(DashedRoute::class); 51 | 52 | $routes->scope('/', function (RouteBuilder $builder) { 53 | 54 | /* 55 | * Here, we are connecting '/' (base path) to a controller called 'Pages', 56 | * its action called 'display', and we pass a param to select the view file 57 | * to use (in this case, templates/Pages/home.php)... 58 | */ 59 | $builder->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); 60 | 61 | /* 62 | * ...and connect the rest of 'Pages' controller's URLs. 63 | */ 64 | $builder->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']); 65 | 66 | /* 67 | * Connect catchall routes for all controllers. 68 | * 69 | * The `fallbacks` method is a shortcut for 70 | * 71 | * ``` 72 | * $builder->connect('/:controller', ['action' => 'index']); 73 | * $builder->connect('/:controller/:action/*', []); 74 | * ``` 75 | * 76 | * You can remove these routes once you've connected the 77 | * routes you want in your application. 78 | */ 79 | $builder->fallbacks(); 80 | }); 81 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | tests/TestCase/ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | src/ 32 | plugins/*/src/ 33 | 34 | src/Console/Installer.php 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/Application.php: -------------------------------------------------------------------------------- 1 | bootstrapCli(); 48 | } 49 | 50 | /* 51 | * Only try to load DebugKit in development mode 52 | * Debug Kit should not be installed on a production system 53 | */ 54 | if (Configure::read('debug')) { 55 | $this->addPlugin('DebugKit'); 56 | } 57 | 58 | // Load more plugins here 59 | } 60 | 61 | /** 62 | * Setup the middleware queue your application will use. 63 | * 64 | * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup. 65 | * @return \Cake\Http\MiddlewareQueue The updated middleware queue. 66 | */ 67 | public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue { 68 | $middlewareQueue 69 | // Catch any exceptions in the lower layers, 70 | // and make an error page/response 71 | ->add(new ErrorHandlerMiddleware(Configure::read('Error'))) 72 | 73 | // Handle plugin/theme assets like CakePHP normally does. 74 | ->add(new AssetMiddleware([ 75 | 'cacheTime' => Configure::read('Asset.cacheTime'), 76 | ])) 77 | 78 | // Add routing middleware. 79 | // If you have a large number of routes connected, turning on routes 80 | // caching in production could improve performance. For that when 81 | // creating the middleware instance specify the cache config name by 82 | // using it's second constructor argument: 83 | // `new RoutingMiddleware($this, '_cake_routes_')` 84 | ->add(new RoutingMiddleware($this)) 85 | 86 | // Parse various types of encoded request bodies so that they are 87 | // available as array through $request->getData() 88 | // https://book.cakephp.org/4/en/controllers/middleware.html#body-parser-middleware 89 | ->add(new BodyParserMiddleware()); 90 | 91 | return $middlewareQueue; 92 | } 93 | 94 | /** 95 | * Bootrapping for CLI application. 96 | * 97 | * That is when running commands. 98 | * 99 | * @return void 100 | */ 101 | protected function bootstrapCli(): void { 102 | try { 103 | //$this->addPlugin('Bake'); 104 | } catch (MissingPluginException $e) { 105 | // Do not halt if the plugin is missing 106 | } 107 | 108 | //$this->addPlugin('Migrations'); 109 | 110 | // Load more plugins here 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /src/Command/CommandExecCommand.php: -------------------------------------------------------------------------------- 1 | log('Command::__construct', 'info', 'exec'); 13 | } 14 | 15 | /** 16 | * @return void 17 | */ 18 | public function initialize(): void { 19 | parent::initialize(); 20 | 21 | $this->log('Command::initialize', 'info', 'exec'); 22 | } 23 | 24 | /** 25 | * @return void 26 | */ 27 | public function startup(): void { 28 | parent::startup(); 29 | 30 | $this->log('Command::startup', 'info', 'exec'); 31 | } 32 | 33 | /** 34 | * @param \Cake\Console\Arguments $args The command arguments. 35 | * @param \Cake\Console\ConsoleIo $io The console io 36 | * 37 | * @return int|null The exit code or null for success 38 | */ 39 | public function execute(Arguments $args, ConsoleIo $io): ?int { 40 | // Dont send our logging calls to stdout... 41 | $io->setLoggers(false); 42 | 43 | $this->log('Command::execute', 'info', 'exec'); 44 | 45 | return static::CODE_SUCCESS; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/Console/Installer.php: -------------------------------------------------------------------------------- 1 | getIO(); 36 | 37 | $rootDir = dirname(dirname(__DIR__)); 38 | 39 | static::createAppConfig($rootDir, $io); 40 | 41 | // ask if the permissions should be changed 42 | if ($io->isInteractive()) { 43 | $validator = (function ($arg) { 44 | if (in_array($arg, ['Y', 'y', 'N', 'n'])) { 45 | return $arg; 46 | } 47 | 48 | throw new Exception('This is not a valid answer. Please choose Y or n.'); 49 | }); 50 | $setFolderPermissions = $io->askAndValidate( 51 | 'Set Folder Permissions ? (Default to Y) [Y,n]? ', 52 | $validator, 53 | false, 54 | 'Y', 55 | ); 56 | 57 | if (in_array($setFolderPermissions, ['Y', 'y'])) { 58 | static::setFolderPermissions($rootDir, $io); 59 | } 60 | } else { 61 | static::setFolderPermissions($rootDir, $io); 62 | } 63 | 64 | static::setSecuritySalt($rootDir, $io); 65 | } 66 | 67 | /** 68 | * Create the config/app.php file if it does not exist. 69 | * 70 | * @param string $dir The application's root directory. 71 | * @param \Composer\IO\IOInterface $io IO interface to write to console. 72 | * @return void 73 | */ 74 | public static function createAppConfig($dir, $io) { 75 | $appConfig = $dir . '/config/app.php'; 76 | $defaultConfig = $dir . '/config/app.default.php'; 77 | if (!file_exists($appConfig)) { 78 | copy($defaultConfig, $appConfig); 79 | $io->write('Created `config/app.php` file'); 80 | } 81 | } 82 | 83 | /** 84 | * Set globally writable permissions on the "tmp" and "logs" directory. 85 | * 86 | * This is not the most secure default, but it gets people up and running quickly. 87 | * 88 | * @param string $dir The application's root directory. 89 | * @param \Composer\IO\IOInterface $io IO interface to write to console. 90 | * @return void 91 | */ 92 | public static function setFolderPermissions($dir, $io) { 93 | // Change the permissions on a path and output the results. 94 | $changePerms = function ($path, $perms, $io) { 95 | // Get current permissions in decimal format so we can bitmask it. 96 | $currentPerms = octdec(substr(sprintf('%o', fileperms($path)), -4)); 97 | if (($currentPerms & $perms) == $perms) { 98 | return; 99 | } 100 | 101 | $res = chmod($path, $currentPerms | $perms); 102 | if ($res) { 103 | $io->write('Permissions set on ' . $path); 104 | } else { 105 | $io->write('Failed to set permissions on ' . $path); 106 | } 107 | }; 108 | 109 | $walker = function ($dir, $perms, $io) use (&$walker, $changePerms) { 110 | $files = array_diff(scandir($dir), ['.', '..']); 111 | foreach ($files as $file) { 112 | $path = $dir . '/' . $file; 113 | 114 | if (!is_dir($path)) { 115 | continue; 116 | } 117 | 118 | $changePerms($path, $perms, $io); 119 | $walker($path, $perms, $io); 120 | } 121 | }; 122 | 123 | $worldWritable = bindec('0000000111'); 124 | $walker($dir . '/tmp', $worldWritable, $io); 125 | $changePerms($dir . '/tmp', $worldWritable, $io); 126 | $changePerms($dir . '/logs', $worldWritable, $io); 127 | } 128 | 129 | /** 130 | * Set the security.salt value in the application's config file. 131 | * 132 | * @param string $dir The application's root directory. 133 | * @param \Composer\IO\IOInterface $io IO interface to write to console. 134 | * @return void 135 | */ 136 | public static function setSecuritySalt($dir, $io) { 137 | $config = $dir . '/config/app.php'; 138 | $content = file_get_contents($config); 139 | 140 | $newKey = hash('sha256', $dir . php_uname() . microtime(true)); 141 | $content = str_replace('__SALT__', $newKey, $content, $count); 142 | 143 | if ($count == 0) { 144 | $io->write('No Security.salt placeholder to replace.'); 145 | 146 | return; 147 | } 148 | 149 | $result = file_put_contents($config, $content); 150 | if ($result) { 151 | $io->write('Updated Security.salt value in config/app.php'); 152 | 153 | return; 154 | } 155 | $io->write('Unable to update Security.salt value.'); 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /src/Controller/AppController.php: -------------------------------------------------------------------------------- 1 | loadComponent('Flash'); 28 | 29 | $this->log('Controller::initialize', 'info', 'exec'); 30 | } 31 | 32 | /** 33 | * @param \Cake\Event\EventInterface $event 34 | * @return void 35 | */ 36 | public function beforeFilter(EventInterface $event) { 37 | $this->log('Controller::beforeFilter', 'info', 'exec'); 38 | } 39 | 40 | /** 41 | * @param \Cake\Event\EventInterface $event 42 | * @return void 43 | */ 44 | public function beforeRender(EventInterface $event) { 45 | $this->log('Controller::beforeRender', 'info', 'exec'); 46 | } 47 | 48 | /** 49 | * @param \Cake\Event\EventInterface $event 50 | * @return void 51 | */ 52 | public function afterFilter(EventInterface $event) { 53 | $this->log('Controller::afterFilter', 'info', 'exec'); 54 | } 55 | 56 | /** 57 | * @param array|string $url 58 | * @param int $status 59 | * @return \Cake\Http\Response|null 60 | */ 61 | public function redirect($url, int $status = 302): ?Response { 62 | $this->log('Controller::redirect', 'info', 'exec'); 63 | 64 | return parent::redirect($url, $status); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/Controller/Component/FooComponent.php: -------------------------------------------------------------------------------- 1 | log('FooComponent::startup', 'info', 'exec'); 25 | } 26 | 27 | /** 28 | * @param \Cake\Event\EventInterface $event 29 | * @return void 30 | */ 31 | public function beforeFilter(EventInterface $event) { 32 | $this->log('FooComponent::beforeFilter', 'info', 'exec'); 33 | } 34 | 35 | /** 36 | * Called after the Controller::beforeRender(), after the view class is loaded, and before the 37 | * Controller::render() 38 | * 39 | * @param \Cake\Event\EventInterface $event 40 | * @return void 41 | */ 42 | public function beforeRender(EventInterface $event) { 43 | $this->log('FooComponent::beforeRender', 'info', 'exec'); 44 | } 45 | 46 | /** 47 | * @param \Cake\Event\EventInterface $event 48 | * @return void 49 | */ 50 | public function shutdown(EventInterface $event) { 51 | $this->log('FooComponent::shutdown', 'info', 'exec'); 52 | } 53 | 54 | /** 55 | * @param \Cake\Event\EventInterface $event 56 | * @param array|string $url 57 | * @param \Cake\Http\Response $response 58 | * @return void 59 | */ 60 | public function beforeRedirect(EventInterface $event, $url, Response $response) { 61 | $this->log('FooComponent::beforeRedirect', 'info', 'exec'); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/Controller/Component/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dereuromark/executionorder/5d01321006001917be31b7435ac819018664cc65/src/Controller/Component/empty -------------------------------------------------------------------------------- /src/Controller/PagesController.php: -------------------------------------------------------------------------------- 1 | redirect('/'); 50 | } 51 | if (in_array('..', $path, true) || in_array('.', $path, true)) { 52 | throw new ForbiddenException(); 53 | } 54 | $page = $subpage = null; 55 | 56 | if (!empty($path[0])) { 57 | $page = $path[0]; 58 | } 59 | if (!empty($path[1])) { 60 | $subpage = $path[1]; 61 | } 62 | $this->set(compact('page', 'subpage')); 63 | 64 | try { 65 | return $this->render(implode('/', $path)); 66 | } catch (MissingTemplateException $exception) { 67 | if (Configure::read('debug')) { 68 | throw $exception; 69 | } 70 | 71 | throw new NotFoundException(); 72 | } 73 | 74 | return $this->render(); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/Controller/TokensController.php: -------------------------------------------------------------------------------- 1 | loadComponent('Foo'); 24 | } 25 | 26 | /** 27 | * TokensController::index() 28 | * 29 | * @return void 30 | */ 31 | public function index() { 32 | $this->log('Controller.action', 'info', 'exec'); 33 | 34 | $this->viewBuilder()->setHelpers(['Foo']); 35 | } 36 | 37 | /** 38 | * @throws \Cake\Http\Exception\NotFoundException 39 | * @return void 40 | */ 41 | public function exception() { 42 | throw new NotFoundException(); 43 | } 44 | 45 | /** 46 | * @throws \Exception 47 | * @return void 48 | */ 49 | public function modelFind() { 50 | $this->log('Controller.action', 'info', 'exec'); 51 | 52 | $token = $this->Tokens->find()->first(); 53 | } 54 | 55 | /** 56 | * @throws \Exception 57 | * @return void 58 | */ 59 | public function modelSave() { 60 | $this->log('Controller.action', 'info', 'exec'); 61 | 62 | $token = $this->Tokens->newEmptyEntity(); 63 | $token = $this->Tokens->patchEntity($token, ['type' => 'x', 'key' => 'x', 'content' => 'foo', 'used' => 0, 'unlimited' => 0]); 64 | 65 | $result = $this->Tokens->save($token); 66 | if (!$result) { 67 | throw new Exception('Save failed'); 68 | } 69 | } 70 | 71 | /** 72 | * @throws \Exception 73 | * @return void 74 | */ 75 | public function modelDynamically() { 76 | $this->log('Controller.action', 'info', 'exec'); 77 | 78 | $this->Tokens->removeBehavior('Alpha'); 79 | $this->Tokens->addBehavior('Alpha'); 80 | 81 | $token = $this->Tokens->newEmptyEntity(); 82 | $token = $this->Tokens->patchEntity($token, ['type' => 'x', 'key' => 'x', 'content' => 'foo', 'used' => 0, 'unlimited' => 0]); 83 | 84 | $result = $this->Tokens->save($token); 85 | if (!$result) { 86 | throw new Exception('Save failed'); 87 | } 88 | 89 | $this->render('model'); 90 | } 91 | 92 | /** 93 | * @throws \Exception 94 | * @return void 95 | */ 96 | public function modelPatch() { 97 | $this->log('Controller.action', 'info', 'exec'); 98 | 99 | $token = $this->Tokens->newEmptyEntity(); 100 | $token = $this->Tokens->patchEntity($token, ['type' => 'x', 'key' => 'x', 'content' => 'foo', 'used' => 0, 'unlimited' => 0]); 101 | if ($token->getErrors()) { 102 | throw new Exception('Patch failed: ' . print_r($token->getErrors(), true)); 103 | } 104 | } 105 | 106 | /** 107 | * @throws \Exception 108 | * @return void 109 | */ 110 | public function modelNoValidation() { 111 | $this->log('Controller.action', 'info', 'exec'); 112 | 113 | $token = $this->Tokens->newEmptyEntity(); 114 | $token = $this->Tokens->patchEntity($token, ['foo' => 'bar'], ['validate' => false]); 115 | 116 | $result = $this->Tokens->save($token); 117 | if (!$result) { 118 | throw new Exception('Save failed: ' . print_r($token->getErrors(), true)); 119 | } 120 | } 121 | 122 | /** 123 | * @throws \Exception 124 | * @return void 125 | */ 126 | public function modelNoValidationNoRules() { 127 | $this->log('Controller.action', 'info', 'exec'); 128 | 129 | $token = $this->Tokens->newEmptyEntity(); 130 | $token = $this->Tokens->patchEntity($token, ['foo' => 'bar'], ['validate' => false]); 131 | 132 | $result = $this->Tokens->save($token, ['checkRules' => false]); 133 | if (!$result) { 134 | throw new Exception('Save failed'); 135 | } 136 | } 137 | 138 | /** 139 | * @throws \Exception 140 | * @return void 141 | */ 142 | public function modelMultiSave() { 143 | $this->log('Controller.action', 'info', 'exec'); 144 | 145 | $token = $this->Tokens->newEmptyEntity(); 146 | $token = $this->Tokens->patchEntity($token, ['type' => 'x', 'key' => 'x', 'content' => 'foo', 'used' => 0, 'unlimited' => 0]); 147 | 148 | $result = $this->Tokens->save($token); 149 | if (!$result) { 150 | throw new Exception('Save failed'); 151 | } 152 | 153 | $token = $this->Tokens->newEmptyEntity(); 154 | $token = $this->Tokens->patchEntity($token, ['type' => 'x', 'key' => 'x', 'content' => 'foo', 'used' => 0, 'unlimited' => 0]); 155 | 156 | $result = $this->Tokens->save($token); 157 | if (!$result) { 158 | throw new Exception('Save failed'); 159 | } 160 | } 161 | 162 | /** 163 | * @throws \Exception 164 | * @return void 165 | */ 166 | public function modelDelete() { 167 | $this->log('Controller.action', 'info', 'exec'); 168 | 169 | $token = $this->Tokens->newEmptyEntity(); 170 | $token = $this->Tokens->patchEntity($token, ['type' => 'x', 'key' => 'x', 'content' => 'foo', 'used' => 0, 'unlimited' => 0]); 171 | 172 | $result = $this->Tokens->save($token); 173 | if (!$result) { 174 | throw new Exception('Save failed'); 175 | } 176 | 177 | $token = $this->Tokens->get($result->id); 178 | $result = $this->Tokens->delete($token); 179 | if (!$result) { 180 | throw new Exception('Delete failed'); 181 | } 182 | } 183 | 184 | /** 185 | * @return \Cake\Http\Response|null 186 | */ 187 | public function redirecting() { 188 | $this->log('Controller.action', 'info', 'exec'); 189 | 190 | return $this->redirect(['action' => 'index']); 191 | } 192 | 193 | /** 194 | * @return \Cake\Http\Response|null 195 | */ 196 | public function add() { 197 | $token = $this->Tokens->newEmptyEntity(); 198 | 199 | if ($this->request->is('post')) { 200 | $token = $this->Tokens->patchEntity($token, $this->request->getData()); 201 | if ($this->Tokens->save($token)) { 202 | $this->Flash->success('Wonderful'); 203 | 204 | return $this->redirect(['action' => 'add']); 205 | } 206 | 207 | $this->Flash->error('Bad luck!'); 208 | } 209 | $this->set(compact('token')); 210 | } 211 | 212 | /** 213 | * @param int|null $id 214 | * @return \Cake\Http\Response|null 215 | */ 216 | public function edit($id = null) { 217 | $token = $this->Tokens->get($id); 218 | 219 | if ($this->request->is('put')) { 220 | $token = $this->Tokens->patchEntity($token, $this->request->getData()); 221 | if ($this->Tokens->save($token)) { 222 | $this->Flash->success('Wonderful'); 223 | 224 | return $this->redirect(['action' => 'edit']); 225 | } 226 | 227 | $this->Flash->error('Bad luck!'); 228 | } 229 | $this->set(compact('token')); 230 | } 231 | 232 | } 233 | -------------------------------------------------------------------------------- /src/Model/Behavior/AlphaBehavior.php: -------------------------------------------------------------------------------- 1 | true, 16 | 'type' => true, 17 | 'key' => true, 18 | 'content' => true, 19 | 'used' => true, 20 | 'unlimited' => true, 21 | 'user' => true, 22 | ]; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/Model/Table/TokensTable.php: -------------------------------------------------------------------------------- 1 | setTable('tokens'); 26 | $this->setDisplayField('key'); 27 | $this->setPrimaryKey('id'); 28 | $this->addBehavior('Timestamp'); 29 | 30 | $this->addBehavior('Alpha'); 31 | } 32 | 33 | /** 34 | * @param \Cake\Event\EventInterface $event 35 | * @param \Cake\ORM\Query $query 36 | * @param \ArrayObject $options 37 | * 38 | * @return void 39 | */ 40 | public function beforeFind(EventInterface $event, Query $query, ArrayObject $options): void { 41 | Log::write('info', 'TokensTable:beforeFind', 'exec'); 42 | } 43 | 44 | /** 45 | * @param \Cake\Event\EventInterface $event 46 | * @param \ArrayObject $data 47 | * @param \ArrayObject $options 48 | * @return void 49 | */ 50 | public function beforeMarshal(EventInterface $event, ArrayObject $data, ArrayObject $options) { 51 | Log::write('info', 'TokensTable:beforeMarshal', 'exec'); 52 | } 53 | 54 | /** 55 | * @param \Cake\Event\EventInterface $event 56 | * @param \Cake\Datasource\EntityInterface $entity 57 | * @param \ArrayObject $data 58 | * @param \ArrayObject $options 59 | * @return void 60 | */ 61 | public function afterMarshal(EventInterface $event, EntityInterface $entity, ArrayObject $data, ArrayObject $options) { 62 | Log::write('info', 'TokensTable:afterMarshal', 'exec'); 63 | } 64 | 65 | /** 66 | * Default validation rules. 67 | * 68 | * @param \Cake\Validation\Validator $validator instance 69 | * @return \Cake\Validation\Validator 70 | */ 71 | public function validationDefault(Validator $validator): Validator { 72 | Log::write('info', 'TokensTable:validationDefault', 'exec'); 73 | 74 | $validator 75 | ->add('id', 'valid', ['rule' => 'numeric']) 76 | ->allowEmpty('id', 'create') 77 | ->add('user_id', 'valid', ['rule' => 'numeric']) 78 | ->allowEmpty('user_id') 79 | ->requirePresence('type', 'create') 80 | ->notEmpty('type') 81 | ->requirePresence('key', 'create') 82 | ->notEmpty('key') 83 | ->requirePresence('content', 'create') 84 | ->notEmpty('content') 85 | ->add('used', 'valid', ['rule' => 'boolean']) 86 | ->requirePresence('used', 'create') 87 | ->notEmpty('used') 88 | ->add('unlimited', 'valid', ['rule' => 'boolean']) 89 | ->requirePresence('unlimited', 'create') 90 | ->notEmpty('unlimited'); 91 | 92 | return $validator; 93 | } 94 | 95 | /** 96 | * Returns a rules checker object that will be used for validating 97 | * application integrity. 98 | * 99 | * @param \Cake\ORM\RulesChecker $rules The rules object to be modified. 100 | * @return \Cake\ORM\RulesChecker 101 | */ 102 | public function buildRules(RulesChecker $rules): RulesChecker { 103 | Log::write('info', 'TokensTable:buildRules', 'exec'); 104 | 105 | //$rules->add($rules->existsIn(['user_id'], 'Users')); 106 | 107 | return $rules; 108 | } 109 | 110 | /** 111 | * @param \Cake\Event\EventInterface $event 112 | * @param \Cake\Validation\Validator $validator 113 | * @param string $name 114 | * @return void 115 | */ 116 | public function buildValidator(EventInterface $event, Validator $validator, $name) { 117 | Log::write('info', 'TokensTable:buildValidator', 'exec'); 118 | } 119 | 120 | /** 121 | * @param \Cake\Event\EventInterface $event 122 | * @param \Cake\Datasource\EntityInterface $entity 123 | * @param \ArrayObject $options 124 | * @param string $operation 125 | * @return void 126 | */ 127 | public function beforeRules(EventInterface $event, EntityInterface $entity, ArrayObject $options, $operation) { 128 | Log::write('info', 'TokensTable:beforeRules', 'exec'); 129 | } 130 | 131 | /** 132 | * @param \Cake\Event\EventInterface $event 133 | * @param \Cake\Datasource\EntityInterface $entity 134 | * @param array $result 135 | * @param string $operation 136 | * @return void 137 | */ 138 | public function afterRules(EventInterface $event, EntityInterface $entity, $result, $operation) { 139 | Log::write('info', 'TokensTable:afterRules', 'exec'); 140 | } 141 | 142 | /** 143 | * @param \Cake\Event\EventInterface $event 144 | * @param \Cake\Datasource\EntityInterface $entity 145 | * @param \ArrayObject $options 146 | * @return void 147 | */ 148 | public function beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) { 149 | Log::write('info', 'TokensTable:beforeSave', 'exec'); 150 | } 151 | 152 | /** 153 | * @param \Cake\Event\EventInterface $event 154 | * @param \Cake\Datasource\EntityInterface $entity 155 | * @param \ArrayObject $options 156 | * @return void 157 | */ 158 | public function afterSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) { 159 | Log::write('info', 'TokensTable:afterSave', 'exec'); 160 | } 161 | 162 | /** 163 | * @param \Cake\Event\EventInterface $event 164 | * @param \Cake\Datasource\EntityInterface $entity 165 | * @param \ArrayObject $options 166 | * @return void 167 | */ 168 | public function afterSaveCommit(EventInterface $event, EntityInterface $entity, ArrayObject $options) { 169 | Log::write('info', 'TokensTable:afterSaveCommit', 'exec'); 170 | } 171 | 172 | /** 173 | * @param \Cake\Event\EventInterface $event 174 | * @param \Cake\Datasource\EntityInterface $entity 175 | * @param \ArrayObject $options 176 | * @return void 177 | */ 178 | public function beforeDelete(EventInterface $event, EntityInterface $entity, ArrayObject $options) { 179 | Log::write('info', 'TokensTable:beforeDelete', 'exec'); 180 | } 181 | 182 | /** 183 | * @param \Cake\Event\EventInterface $event 184 | * @param \Cake\Datasource\EntityInterface $entity 185 | * @param \ArrayObject $options 186 | * @return void 187 | */ 188 | public function afterDelete(EventInterface $event, EntityInterface $entity, ArrayObject $options) { 189 | Log::write('info', 'TokensTable:afterDelete', 'exec'); 190 | } 191 | 192 | /** 193 | * @param \Cake\Event\EventInterface $event 194 | * @param \Cake\Datasource\EntityInterface $entity 195 | * @param \ArrayObject $options 196 | * @return void 197 | */ 198 | public function afterDeleteCommit(EventInterface $event, EntityInterface $entity, ArrayObject $options) { 199 | Log::write('info', 'TokensTable:afterDeleteCommit', 'exec'); 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /src/View/AjaxView.php: -------------------------------------------------------------------------------- 1 | response = $this->response->withType('ajax'); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/View/AppView.php: -------------------------------------------------------------------------------- 1 | loadHelper('Html');` 36 | * 37 | * @return void 38 | */ 39 | public function initialize(): void { 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/View/Cell/InboxCell.php: -------------------------------------------------------------------------------- 1 | log('FooHelper::beforeRenderFile (' . $viewFile . ')', 'info', 'exec'); 24 | } 25 | 26 | /** 27 | * @param \Cake\Event\EventInterface $event 28 | * @param string $viewFile 29 | * @param string $content 30 | * @return void 31 | */ 32 | public function afterRenderFile(EventInterface $event, $viewFile, $content) { 33 | $viewFile = str_replace(ROOT . DS, '', $viewFile); 34 | $this->log('FooHelper::afterRenderFile (' . $viewFile . ')', 'info', 'exec'); 35 | } 36 | 37 | /** 38 | * @param \Cake\Event\EventInterface $event 39 | * @param string $viewFile 40 | * @return void 41 | */ 42 | public function beforeRender(EventInterface $event, $viewFile) { 43 | $viewFile = str_replace(ROOT . DS, '', $viewFile); 44 | $this->log('FooHelper::beforeRender (' . $viewFile . ')', 'info', 'exec'); 45 | } 46 | 47 | /** 48 | * @param \Cake\Event\EventInterface $event 49 | * @param string $viewFile 50 | * @return void 51 | */ 52 | public function afterRender(EventInterface $event, $viewFile) { 53 | $viewFile = str_replace(ROOT . DS, '', $viewFile); 54 | $this->log('FooHelper::afterRender (' . $viewFile . ')', 'info', 'exec'); 55 | } 56 | 57 | /** 58 | * @param \Cake\Event\EventInterface $event 59 | * @param string $layoutFile 60 | * @return void 61 | */ 62 | public function beforeLayout(EventInterface $event, $layoutFile) { 63 | $layoutFile = str_replace(ROOT . DS, '', $layoutFile); 64 | $this->log('FooHelper::beforeLayout (' . $layoutFile . ')', 'info', 'exec'); 65 | } 66 | 67 | /** 68 | * @param \Cake\Event\EventInterface $event 69 | * @param string $layoutFile 70 | * @return void 71 | */ 72 | public function afterLayout(EventInterface $event, $layoutFile) { 73 | $layoutFile = str_replace(ROOT . DS, '', $layoutFile); 74 | $this->log('FooHelper::afterLayout (' . $layoutFile . ')', 'info', 'exec'); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/View/Helper/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dereuromark/executionorder/5d01321006001917be31b7435ac819018664cc65/src/View/Helper/empty -------------------------------------------------------------------------------- /templates/Error/error400.php: -------------------------------------------------------------------------------- 1 | layout = 'error'; 10 | 11 | if (Configure::read('debug')) : 12 | $this->layout = 'dev_error'; 13 | 14 | $this->assign('title', $message); 15 | $this->assign('templateName', 'error400.php'); 16 | 17 | $this->start('file'); 18 | echo $this->element('auto_table_warning'); 19 | $this->end(); 20 | endif; 21 | ?> 22 |

23 |

24 | : 25 | '{$url}'") ?> 26 |

27 | -------------------------------------------------------------------------------- /templates/Error/error500.php: -------------------------------------------------------------------------------- 1 | layout = 'error'; 11 | 12 | if (Configure::read('debug')) : 13 | $this->layout = 'dev_error'; 14 | 15 | $this->assign('title', $message); 16 | $this->assign('templateName', 'error500.php'); 17 | 18 | $this->start('file'); 19 | ?> 20 | 21 | getFile() ?> 22 | getLine() ?> 23 | Error in: 24 | Html->link(sprintf('%s, line %s', Debugger::trimPath($file), $line), Debugger::editorUrl($file, $line)); ?> 25 | 26 | element('auto_table_warning'); 28 | 29 | $this->end(); 30 | endif; 31 | ?> 32 |

33 |

34 | : 35 | 36 |

37 | -------------------------------------------------------------------------------- /templates/Pages/home.php: -------------------------------------------------------------------------------- 1 | disableAutoLayout(); 24 | 25 | $checkConnection = function (string $name) { 26 | $error = null; 27 | $connected = false; 28 | try { 29 | ConnectionManager::get($name)->getDriver()->connect(); 30 | // No exception means success 31 | $connected = true; 32 | } catch (Exception $connectionError) { 33 | $error = $connectionError->getMessage(); 34 | if (method_exists($connectionError, 'getAttributes')) { 35 | $attributes = $connectionError->getAttributes(); 36 | if (isset($attributes['message'])) { 37 | $error .= '
' . $attributes['message']; 38 | } 39 | } 40 | if ($name === 'debug_kit') { 41 | $error = 'Try adding your current top level domain to the 42 | DebugKit.safeTld 43 | config and reload.'; 44 | if (!in_array('sqlite', \PDO::getAvailableDrivers())) { 45 | $error .= '
You need to install the PHP extension pdo_sqlite so DebugKit can work properly.'; 46 | } 47 | } 48 | } 49 | 50 | return compact('connected', 'error'); 51 | }; 52 | 53 | if (!Configure::read('debug')) : 54 | throw new NotFoundException( 55 | 'Please replace templates/Pages/home.php with your own version or re-enable debug mode.' 56 | ); 57 | endif; 58 | 59 | ?> 60 | 61 | 62 | 63 | Html->charset() ?> 64 | 65 | 66 | CakePHP: the rapid development PHP framework: 67 | <?= $this->fetch('title') ?> 68 | 69 | Html->meta('icon') ?> 70 | 71 | Html->css(['normalize.min', 'milligram.min', 'fonts', 'cake', 'home']) ?> 72 | 73 | fetch('meta') ?> 74 | fetch('css') ?> 75 | fetch('script') ?> 76 | 77 | 78 |
79 |
80 | 81 | CakePHP 82 | 83 |

84 | Welcome to CakePHP Chiffon (🍰) 85 |

86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 | Please be aware that this page will not be shown if you turn off debug mode unless you replace templates/Pages/home.php with your own version. 95 |
96 |
97 | 104 |
105 | 106 |
107 |
108 |
109 |
110 |

Environment

111 |
    112 | =')) : ?> 113 |
  • Your version of PHP is 8.1.0 or higher (detected ).
  • 114 | 115 |
  • Your version of PHP is too low. You need PHP 8.1.0 or higher to use CakePHP (detected ).
  • 116 | 117 | 118 | 119 |
  • Your version of PHP has the mbstring extension loaded.
  • 120 | 121 |
  • Your version of PHP does NOT have the mbstring extension loaded.
  • 122 | 123 | 124 | 125 |
  • Your version of PHP has the openssl extension loaded.
  • 126 | 127 |
  • Your version of PHP does NOT have the openssl extension loaded.
  • 128 | 129 | 130 | 131 |
  • Your version of PHP has the intl extension loaded.
  • 132 | 133 |
  • Your version of PHP does NOT have the intl extension loaded.
  • 134 | 135 | 136 | 137 |
  • You should set zend.assertions to 1 in your php.ini for your development environment.
  • 138 | 139 |
140 |
141 |
142 |

Filesystem

143 |
    144 | 145 |
  • Your tmp directory is writable.
  • 146 | 147 |
  • Your tmp directory is NOT writable.
  • 148 | 149 | 150 | 151 |
  • Your logs directory is writable.
  • 152 | 153 |
  • Your logs directory is NOT writable.
  • 154 | 155 | 156 | 157 | 158 |
  • The is being used for core caching. To change the config edit config/app.php
  • 159 | 160 |
  • Your cache is NOT working. Please check the settings in config/app.php
  • 161 | 162 |
163 |
164 |
165 |
166 |
167 |
168 |

Database

169 | 172 |
    173 | 174 |
  • CakePHP is able to connect to the database.
  • 175 | 176 |
  • CakePHP is NOT able to connect to the database.
  • 177 | 178 |
179 |
180 |
181 |

DebugKit

182 |
    183 | 184 |
  • DebugKit is loaded.
  • 185 | 188 | 189 |
  • DebugKit can connect to the database.
  • 190 | 191 |
  • There are configuration problems present which need to be fixed:
  • 192 | 193 | 194 |
  • DebugKit is not loaded.
  • 195 | 196 |
197 |
198 |
199 |
200 |
201 | 206 |
207 |
208 |
209 | 215 |
216 |
217 |
218 | 228 |
229 |
230 |
231 | 236 |
237 |
238 |
239 |
240 | 241 | 242 | -------------------------------------------------------------------------------- /templates/Tokens/add.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('List Tokens'), ['action' => 'index']) ?>
  • 5 |
  • Html->link(__('List Users'), ['controller' => 'Users', 'action' => 'index']) ?>
  • 6 |
  • Html->link(__('New User'), ['controller' => 'Users', 'action' => 'add']) ?>
  • 7 |
8 |
9 |
10 | Form->create($token); ?> 11 |
12 | 13 | Form->input('user_id', ['options' => $users]); 15 | echo $this->Form->input('type'); 16 | echo $this->Form->input('key'); 17 | echo $this->Form->input('content'); 18 | echo $this->Form->input('used'); 19 | echo $this->Form->input('unlimited'); 20 | ?> 21 |
22 | Form->button(__('Submit')) ?> 23 | Form->end() ?> 24 |
25 | -------------------------------------------------------------------------------- /templates/Tokens/edit.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Form->postLink( 5 | __('Delete'), 6 | ['action' => 'delete', $token->id], 7 | ['confirm' => __('Are you sure you want to delete # {0}?', $token->id)] 8 | ) 9 | ?>
  • 10 |
  • Html->link(__('List Tokens'), ['action' => 'index']) ?>
  • 11 |
  • Html->link(__('List Users'), ['controller' => 'Users', 'action' => 'index']) ?>
  • 12 |
  • Html->link(__('New User'), ['controller' => 'Users', 'action' => 'add']) ?>
  • 13 |
14 |
15 |
16 | Form->create($token); ?> 17 |
18 | 19 | Form->input('user_id', ['options' => $users]); 21 | echo $this->Form->input('type'); 22 | echo $this->Form->input('key'); 23 | echo $this->Form->input('content'); 24 | echo $this->Form->input('used'); 25 | echo $this->Form->input('unlimited'); 26 | ?> 27 |
28 | Form->button(__('Submit')) ?> 29 | Form->end() ?> 30 |
31 | -------------------------------------------------------------------------------- /templates/Tokens/index.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 | cell('Inbox::display'); ?> 9 | 10 |
11 | element('info'); ?> 12 |
13 | -------------------------------------------------------------------------------- /templates/Tokens/model_delete.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
11 | -------------------------------------------------------------------------------- /templates/Tokens/model_find.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
11 | -------------------------------------------------------------------------------- /templates/Tokens/model_multi_save.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
-------------------------------------------------------------------------------- /templates/Tokens/model_no_validation.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
-------------------------------------------------------------------------------- /templates/Tokens/model_no_validation_no_rules.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
-------------------------------------------------------------------------------- /templates/Tokens/model_patch.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
11 | -------------------------------------------------------------------------------- /templates/Tokens/model_save.php: -------------------------------------------------------------------------------- 1 |
2 |

3 |
    4 |
  • Html->link(__('Overview'), ['controller' => 'Pages', 'action' => 'display', 'home']) ?>
  • 5 |
6 |
7 | 8 |
9 | element('info'); ?> 10 |
-------------------------------------------------------------------------------- /templates/cell/Inbox/display.php: -------------------------------------------------------------------------------- 1 | My cell content 2 | -------------------------------------------------------------------------------- /templates/element/flash/default.php: -------------------------------------------------------------------------------- 1 | 15 |
16 | -------------------------------------------------------------------------------- /templates/element/flash/error.php: -------------------------------------------------------------------------------- 1 | 11 |
12 | -------------------------------------------------------------------------------- /templates/element/flash/success.php: -------------------------------------------------------------------------------- 1 | 11 |
12 | -------------------------------------------------------------------------------- /templates/element/info.php: -------------------------------------------------------------------------------- 1 | See `ROOT/logs/exec.log'` for details. 2 | -------------------------------------------------------------------------------- /templates/layout/default.php: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | Html->charset() ?> 21 | 22 | <?= $this->fetch('title') ?> 23 | 24 | Html->meta('icon') ?> 25 | 26 | 27 | 28 | 29 | Html->css('milligram.min.css') ?> 30 | Html->css('cake.css') ?> 31 | 32 | fetch('meta') ?> 33 | fetch('css') ?> 34 | fetch('script') ?> 35 | 36 | 37 |
38 | Flash->render() ?> 39 | fetch('content') ?> 40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /templates/layout/error.php: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | Html->charset() ?> 21 | 22 | <?= $this->fetch('title') ?> 23 | 24 | Html->meta('icon') ?> 25 | 26 | 27 | 28 | 29 | Html->css('milligram.min.css') ?> 30 | Html->css('cake.css') ?> 31 | 32 | fetch('meta') ?> 33 | fetch('css') ?> 34 | fetch('script') ?> 35 | 36 | 37 |
38 | Flash->render() ?> 39 | fetch('content') ?> 40 | Html->link(__('Back'), 'javascript:history.back()') ?> 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 'Cake\Database\Connection', 40 | 'driver' => 'Cake\Database\Driver\Sqlite', 41 | 'database' => TMP . 'debug_kit.sqlite', 42 | 'encoding' => 'utf8', 43 | 'cacheMetadata' => true, 44 | 'quoteIdentifiers' => false, 45 | ]); 46 | 47 | ConnectionManager::alias('test_debug_kit', 'debug_kit'); 48 | 49 | // Fixate sessionid early on, as php7.2+ 50 | // does not allow the sessionid to be set after stdout 51 | // has been written to. 52 | session_id('cli'); 53 | -------------------------------------------------------------------------------- /webroot/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteRule ^ index.php [L] 5 | 6 | -------------------------------------------------------------------------------- /webroot/css/cake.css: -------------------------------------------------------------------------------- 1 | a.disabled { 2 | pointer-events: none; 3 | } 4 | 5 | a:hover { 6 | color: #15848F; 7 | } 8 | 9 | a { 10 | color: #1798A5; 11 | } 12 | 13 | .side-nav li a:not(.button) { 14 | color: #15848F; 15 | } 16 | 17 | .side-nav li a:not(.button):hover { 18 | color: #15848F; 19 | } 20 | 21 | header { 22 | background-color: #15848F; 23 | color: #ffffff; 24 | font-size: 30px; 25 | height: 84px; 26 | line-height: 64px; 27 | padding: 16px 0px; 28 | box-shadow: 0px 1px rgba(0, 0, 0, 0.24); 29 | } 30 | 31 | header .header-title { 32 | padding-left:80px 33 | } 34 | 35 | 36 | legend { 37 | color:#15848F; 38 | } 39 | 40 | .row { 41 | max-width: 80rem; 42 | } 43 | 44 | .actions.columns { 45 | margin-top:1rem; 46 | border-left: 5px solid #15848F; 47 | padding-left: 15px; 48 | padding: 32px 20px; 49 | } 50 | 51 | .actions.columns h3 { 52 | color:#15848F; 53 | } 54 | 55 | .index table { 56 | margin-top: 2rem; 57 | border: 0; 58 | } 59 | 60 | .index table thead { 61 | height: 3.5rem; 62 | } 63 | 64 | .header-help { 65 | float: right; 66 | margin-right:2rem; 67 | margin-top: -80px; 68 | font-size:16px; 69 | } 70 | 71 | .header-help span { 72 | font-weight: normal; 73 | text-align: center; 74 | text-decoration: none; 75 | line-height: 1; 76 | white-space: nowrap; 77 | display: inline-block; 78 | padding: 0.25rem 0.5rem 0.375rem; 79 | font-size: 0.8rem; 80 | background-color: #0097a7; 81 | color: #FFF; 82 | border-radius: 1000px; 83 | } 84 | 85 | .header-help a { 86 | color: #fff; 87 | } 88 | 89 | ul.pagination li a { 90 | color: rgba(0, 0 ,0 , 0.54); 91 | } 92 | 93 | ul.pagination li.active a { 94 | background: none repeat scroll 0% 0% #DCE47E; 95 | color: #FFF; 96 | font-weight: bold; 97 | cursor: default; 98 | } 99 | 100 | .paginator { 101 | text-align: center; 102 | } 103 | 104 | .paginator ul.pagination li { 105 | float: none; 106 | display: inline-block; 107 | } 108 | 109 | .paginator p { 110 | text-align: right; 111 | color: rgba(0, 0 ,0 , 0.54); 112 | } 113 | 114 | button { 115 | background: #8D6E65; 116 | } 117 | 118 | .form button:hover, .form button:focus { 119 | background: #7A6058; 120 | box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.26) !important; 121 | } 122 | 123 | .form button[type="submit"] { 124 | float: right; 125 | text-transform: uppercase; 126 | box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.26); 127 | } 128 | 129 | .form .error-message { 130 | display: block; 131 | padding: 0.375rem 0.5625rem 0.5625rem; 132 | margin-top: -1px; 133 | margin-bottom: 1rem; 134 | font-size: 0.75rem; 135 | font-weight: normal; 136 | font-style: italic; 137 | color: rgba(0, 0, 0, 0.54); 138 | } 139 | 140 | .required > label { 141 | font-weight: bold; 142 | } 143 | .required > label:after { 144 | content: ' *'; 145 | color: #C3232D; 146 | } 147 | 148 | select[multiple] { 149 | min-height:150px; 150 | background: none; 151 | } 152 | input[type=checkbox], 153 | input[type=radio] { 154 | margin-right: 0.5em; 155 | } 156 | 157 | .date select, 158 | .time select, 159 | .datetime select { 160 | display: inline; 161 | width: auto; 162 | margin-right: 10px; 163 | } 164 | 165 | .error label, 166 | .error label.error { 167 | color: #C3232D; 168 | } 169 | 170 | div.message { 171 | border-style: solid; 172 | border-width: 1px; 173 | display: block; 174 | font-weight: normal; 175 | position: relative; 176 | padding: 0.875rem 1.5rem 0.875rem 20%; 177 | transition: opacity 300ms ease-out 0s; 178 | background-color: #DCE47E; 179 | border-color: #DCE47E; 180 | color: #626262; 181 | } 182 | 183 | div.message.error { 184 | background-color: #C3232D; 185 | border-color: #C3232D; 186 | color: #FFF; 187 | } 188 | 189 | div.message:before { 190 | line-height: 0px; 191 | font-size: 20px; 192 | height: 12px; 193 | width: 12px; 194 | border-radius: 15px; 195 | text-align: center; 196 | vertical-align: middle; 197 | display: inline-block; 198 | position: relative; 199 | left: -11px; 200 | background-color: #FFF; 201 | padding: 12px 14px 12px 10px; 202 | content: "i"; 203 | color: #DCE47E; 204 | } 205 | 206 | div.message.error:before { 207 | padding: 11px 16px 14px 7px; 208 | color: #C3232D; 209 | content: "x"; 210 | } 211 | 212 | .view h2 { 213 | color: #6F6F6F; 214 | } 215 | 216 | .view .columns.strings { 217 | border-radius: 3px; 218 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 219 | margin-right:0.7rem; 220 | } 221 | 222 | .view .numbers { 223 | background-color: #B7E3EC; 224 | color: #FFF; 225 | border-radius: 3px; 226 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 227 | margin-right: 0.7rem; 228 | } 229 | 230 | .view .columns.dates { 231 | border-radius: 3px; 232 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 233 | margin-right:0.7rem; 234 | background-color:#DCE47E; 235 | color: #fff; 236 | } 237 | 238 | .view .columns.booleans { 239 | border-radius: 3px; 240 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 241 | margin-right:0.7rem; 242 | background-color: #8D6E65; 243 | color: #fff; 244 | } 245 | 246 | .view .strings p { 247 | border-bottom: 1px solid #eee; 248 | } 249 | .view .numbers .subheader, .view .dates .subheader { 250 | color:#747474; 251 | } 252 | .view .booleans .subheader { 253 | color: #E9E9E9 254 | } 255 | 256 | .view .texts .columns { 257 | margin-top:1.2rem; 258 | border-bottom: 1px solid #eee; 259 | } 260 | 261 | 262 | /** Notices and Errors **/ 263 | .cake-error, 264 | .cake-debug, 265 | .notice, 266 | p.error, 267 | p.notice { 268 | display: block; 269 | clear: both; 270 | background-repeat: repeat-x; 271 | margin-bottom: 18px; 272 | padding: 7px 14px; 273 | border-radius: 3px; 274 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 275 | } 276 | 277 | .cake-debug, 278 | .notice, 279 | p.notice { 280 | color: #000000; 281 | background: #ffcc00; 282 | } 283 | 284 | .cake-error, 285 | p.error { 286 | color: #fff; 287 | background: #C3232D; 288 | } 289 | 290 | pre { 291 | background: none repeat scroll 0% 0% #FFF; 292 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 293 | margin: 15px 0px; 294 | color: rgba(0, 0 ,0 , 0.74); 295 | padding:5px; 296 | } 297 | 298 | .cake-error .cake-stack-trace { 299 | margin-top:10px; 300 | } 301 | 302 | .cake-stack-trace code { 303 | background: inherit; 304 | border:0; 305 | } 306 | 307 | .cake-code-dump .code-highlight { 308 | display: block; 309 | background-color: #FFC600; 310 | } 311 | 312 | .cake-error a, 313 | .cake-error a:hover { 314 | color:#fff; 315 | text-decoration: underline; 316 | } 317 | 318 | .home header { 319 | width: 100%; 320 | height: 85%; 321 | position: relative; 322 | display: table; 323 | } 324 | 325 | .home h1 { 326 | font-family: "Gill Sans MT", Calibri, sans-serif; 327 | } 328 | 329 | .home header .header-image { 330 | display: table-cell; 331 | vertical-align: middle; 332 | text-align: center; 333 | } 334 | 335 | .home header h1 { 336 | color: #fff; 337 | } 338 | 339 | .home .checks { 340 | padding:30px; 341 | color: #626262; 342 | border-radius: 3px; 343 | box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.24); 344 | margin-top:50px; 345 | } 346 | 347 | .checks.platform { 348 | background-color: #B7E3EC; 349 | } 350 | 351 | .checks.filesystem { 352 | background: #DCE47E; 353 | } 354 | 355 | .checks.database { 356 | background-color: #DFF0D8; 357 | padding-bottom: 10px; 358 | margin-bottom: 30px; 359 | } 360 | 361 | .home .checks .success:before, .home .checks .problem:before { 362 | line-height: 0px; 363 | font-size: 28px; 364 | height: 12px; 365 | width: 12px; 366 | border-radius: 15px; 367 | text-align: center; 368 | vertical-align: middle; 369 | display: inline-block; 370 | position: relative; 371 | left: -11px; 372 | } 373 | 374 | .home .checks .success:before { 375 | content: "✓"; 376 | color: green; 377 | margin-right: 9px; 378 | } 379 | 380 | .home .checks .problem:before { 381 | content: "✘"; 382 | color: red; 383 | margin-right: 9px; 384 | } 385 | -------------------------------------------------------------------------------- /webroot/css/milligram.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Milligram v1.4.1 3 | * https://milligram.io 4 | * 5 | * Copyright (c) 2020 CJ Patoilo 6 | * Licensed under the MIT license 7 | */ 8 | 9 | *,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{color:#606c76;font-family:'Roboto', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;font-size:1.6em;font-weight:300;letter-spacing:.01em;line-height:1.6}blockquote{border-left:0.3rem solid #d1d1d1;margin-left:0;margin-right:0;padding:1rem 1.5rem}blockquote *:last-child{margin-bottom:0}.button,button,input[type='button'],input[type='reset'],input[type='submit']{background-color:#9b4dca;border:0.1rem solid #9b4dca;border-radius:.4rem;color:#fff;cursor:pointer;display:inline-block;font-size:1.1rem;font-weight:700;height:3.8rem;letter-spacing:.1rem;line-height:3.8rem;padding:0 3.0rem;text-align:center;text-decoration:none;text-transform:uppercase;white-space:nowrap}.button:focus,.button:hover,button:focus,button:hover,input[type='button']:focus,input[type='button']:hover,input[type='reset']:focus,input[type='reset']:hover,input[type='submit']:focus,input[type='submit']:hover{background-color:#606c76;border-color:#606c76;color:#fff;outline:0}.button[disabled],button[disabled],input[type='button'][disabled],input[type='reset'][disabled],input[type='submit'][disabled]{cursor:default;opacity:.5}.button[disabled]:focus,.button[disabled]:hover,button[disabled]:focus,button[disabled]:hover,input[type='button'][disabled]:focus,input[type='button'][disabled]:hover,input[type='reset'][disabled]:focus,input[type='reset'][disabled]:hover,input[type='submit'][disabled]:focus,input[type='submit'][disabled]:hover{background-color:#9b4dca;border-color:#9b4dca}.button.button-outline,button.button-outline,input[type='button'].button-outline,input[type='reset'].button-outline,input[type='submit'].button-outline{background-color:transparent;color:#9b4dca}.button.button-outline:focus,.button.button-outline:hover,button.button-outline:focus,button.button-outline:hover,input[type='button'].button-outline:focus,input[type='button'].button-outline:hover,input[type='reset'].button-outline:focus,input[type='reset'].button-outline:hover,input[type='submit'].button-outline:focus,input[type='submit'].button-outline:hover{background-color:transparent;border-color:#606c76;color:#606c76}.button.button-outline[disabled]:focus,.button.button-outline[disabled]:hover,button.button-outline[disabled]:focus,button.button-outline[disabled]:hover,input[type='button'].button-outline[disabled]:focus,input[type='button'].button-outline[disabled]:hover,input[type='reset'].button-outline[disabled]:focus,input[type='reset'].button-outline[disabled]:hover,input[type='submit'].button-outline[disabled]:focus,input[type='submit'].button-outline[disabled]:hover{border-color:inherit;color:#9b4dca}.button.button-clear,button.button-clear,input[type='button'].button-clear,input[type='reset'].button-clear,input[type='submit'].button-clear{background-color:transparent;border-color:transparent;color:#9b4dca}.button.button-clear:focus,.button.button-clear:hover,button.button-clear:focus,button.button-clear:hover,input[type='button'].button-clear:focus,input[type='button'].button-clear:hover,input[type='reset'].button-clear:focus,input[type='reset'].button-clear:hover,input[type='submit'].button-clear:focus,input[type='submit'].button-clear:hover{background-color:transparent;border-color:transparent;color:#606c76}.button.button-clear[disabled]:focus,.button.button-clear[disabled]:hover,button.button-clear[disabled]:focus,button.button-clear[disabled]:hover,input[type='button'].button-clear[disabled]:focus,input[type='button'].button-clear[disabled]:hover,input[type='reset'].button-clear[disabled]:focus,input[type='reset'].button-clear[disabled]:hover,input[type='submit'].button-clear[disabled]:focus,input[type='submit'].button-clear[disabled]:hover{color:#9b4dca}code{background:#f4f5f6;border-radius:.4rem;font-size:86%;margin:0 .2rem;padding:.2rem .5rem;white-space:nowrap}pre{background:#f4f5f6;border-left:0.3rem solid #9b4dca;overflow-y:hidden}pre>code{border-radius:0;display:block;padding:1rem 1.5rem;white-space:pre}hr{border:0;border-top:0.1rem solid #f4f5f6;margin:3.0rem 0}input[type='color'],input[type='date'],input[type='datetime'],input[type='datetime-local'],input[type='email'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='url'],input[type='week'],input:not([type]),textarea,select{-webkit-appearance:none;background-color:transparent;border:0.1rem solid #d1d1d1;border-radius:.4rem;box-shadow:none;box-sizing:inherit;height:3.8rem;padding:.6rem 1.0rem .7rem;width:100%}input[type='color']:focus,input[type='date']:focus,input[type='datetime']:focus,input[type='datetime-local']:focus,input[type='email']:focus,input[type='month']:focus,input[type='number']:focus,input[type='password']:focus,input[type='search']:focus,input[type='tel']:focus,input[type='text']:focus,input[type='url']:focus,input[type='week']:focus,input:not([type]):focus,textarea:focus,select:focus{border-color:#9b4dca;outline:0}select{background:url('data:image/svg+xml;utf8,') center right no-repeat;padding-right:3.0rem}select:focus{background-image:url('data:image/svg+xml;utf8,')}select[multiple]{background:none;height:auto}textarea{min-height:6.5rem}label,legend{display:block;font-size:1.6rem;font-weight:700;margin-bottom:.5rem}fieldset{border-width:0;padding:0}input[type='checkbox'],input[type='radio']{display:inline}.label-inline{display:inline-block;font-weight:normal;margin-left:.5rem}.container{margin:0 auto;max-width:112.0rem;padding:0 2.0rem;position:relative;width:100%}.row{display:flex;flex-direction:column;padding:0;width:100%}.row.row-no-padding{padding:0}.row.row-no-padding>.column{padding:0}.row.row-wrap{flex-wrap:wrap}.row.row-top{align-items:flex-start}.row.row-bottom{align-items:flex-end}.row.row-center{align-items:center}.row.row-stretch{align-items:stretch}.row.row-baseline{align-items:baseline}.row .column{display:block;flex:1 1 auto;margin-left:0;max-width:100%;width:100%}.row .column.column-offset-10{margin-left:10%}.row .column.column-offset-20{margin-left:20%}.row .column.column-offset-25{margin-left:25%}.row .column.column-offset-33,.row .column.column-offset-34{margin-left:33.3333%}.row .column.column-offset-40{margin-left:40%}.row .column.column-offset-50{margin-left:50%}.row .column.column-offset-60{margin-left:60%}.row .column.column-offset-66,.row .column.column-offset-67{margin-left:66.6666%}.row .column.column-offset-75{margin-left:75%}.row .column.column-offset-80{margin-left:80%}.row .column.column-offset-90{margin-left:90%}.row .column.column-10{flex:0 0 10%;max-width:10%}.row .column.column-20{flex:0 0 20%;max-width:20%}.row .column.column-25{flex:0 0 25%;max-width:25%}.row .column.column-33,.row .column.column-34{flex:0 0 33.3333%;max-width:33.3333%}.row .column.column-40{flex:0 0 40%;max-width:40%}.row .column.column-50{flex:0 0 50%;max-width:50%}.row .column.column-60{flex:0 0 60%;max-width:60%}.row .column.column-66,.row .column.column-67{flex:0 0 66.6666%;max-width:66.6666%}.row .column.column-75{flex:0 0 75%;max-width:75%}.row .column.column-80{flex:0 0 80%;max-width:80%}.row .column.column-90{flex:0 0 90%;max-width:90%}.row .column .column-top{align-self:flex-start}.row .column .column-bottom{align-self:flex-end}.row .column .column-center{align-self:center}@media (min-width: 40rem){.row{flex-direction:row;margin-left:-1.0rem;width:calc(100% + 2.0rem)}.row .column{margin-bottom:inherit;padding:0 1.0rem}}a{color:#9b4dca;text-decoration:none}a:focus,a:hover{color:#606c76}dl,ol,ul{list-style:none;margin-top:0;padding-left:0}dl dl,dl ol,dl ul,ol dl,ol ol,ol ul,ul dl,ul ol,ul ul{font-size:90%;margin:1.5rem 0 1.5rem 3.0rem}ol{list-style:decimal inside}ul{list-style:circle inside}.button,button,dd,dt,li{margin-bottom:1.0rem}fieldset,input,select,textarea{margin-bottom:1.5rem}blockquote,dl,figure,form,ol,p,pre,table,ul{margin-bottom:2.5rem}table{border-spacing:0;overflow-x:auto;text-align:left;width:100%}td,th{border-bottom:0.1rem solid #e1e1e1;padding:1.2rem 1.5rem}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}@media (min-width: 40rem){table{display:table;overflow-x:initial}}b,strong{font-weight:bold}p{margin-top:0}h1,h2,h3,h4,h5,h6{font-weight:300;letter-spacing:-.1rem;margin-bottom:2.0rem;margin-top:0}h1{font-size:4.6rem;line-height:1.2}h2{font-size:3.6rem;line-height:1.25}h3{font-size:2.8rem;line-height:1.3}h4{font-size:2.2rem;letter-spacing:-.08rem;line-height:1.35}h5{font-size:1.8rem;letter-spacing:-.05rem;line-height:1.5}h6{font-size:1.6rem;letter-spacing:0;line-height:1.4}img{max-width:100%}.clearfix:after{clear:both;content:' ';display:table}.float-left{float:left}.float-right{float:right} 10 | -------------------------------------------------------------------------------- /webroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dereuromark/executionorder/5d01321006001917be31b7435ac819018664cc65/webroot/favicon.ico -------------------------------------------------------------------------------- /webroot/img/cake.icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dereuromark/executionorder/5d01321006001917be31b7435ac819018664cc65/webroot/img/cake.icon.png -------------------------------------------------------------------------------- /webroot/img/cake.power.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dereuromark/executionorder/5d01321006001917be31b7435ac819018664cc65/webroot/img/cake.power.gif -------------------------------------------------------------------------------- /webroot/index.php: -------------------------------------------------------------------------------- 1 | emit($server->run()); 38 | -------------------------------------------------------------------------------- /webroot/js/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dereuromark/executionorder/5d01321006001917be31b7435ac819018664cc65/webroot/js/empty --------------------------------------------------------------------------------