| @@ -13,4 +13,4 @@ | ||
| 13 | 13 | * @license https://opensource.org/licenses/mit-license.php MIT License | 
| 14 | 14 | */ | 
| 15 | 15 | |
| 16 | -require 'webroot' . DIRECTORY_SEPARATOR . 'index.php'; | |
| 16 | +require 'webroot'.DIRECTORY_SEPARATOR.'index.php'; | |
| @@ -9,7 +9,7 @@ discard block | ||
| 9 | 9 | * Is the forum installed? Runs installer if not. Default: run installer. | 
| 10 | 10 | */ | 
| 11 | 11 | 'installed' => filter_var( | 
| 12 | -            env('INSTALLED', !file_exists(CONFIG . '/installer')), | |
| 12 | +            env('INSTALLED', !file_exists(CONFIG.'/installer')), | |
| 13 | 13 | FILTER_VALIDATE_BOOLEAN | 
| 14 | 14 | ), | 
| 15 | 15 | /** | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | /** | 
| 40 | 40 | * Upload directory root with trailing slash | 
| 41 | 41 | */ | 
| 42 | - 'uploadDirectory' => WWW_ROOT . 'useruploads' . DIRECTORY_SEPARATOR | |
| 42 | + 'uploadDirectory' => WWW_ROOT.'useruploads'.DIRECTORY_SEPARATOR | |
| 43 | 43 | ], | 
| 44 | 44 | |
| 45 | 45 | /** | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | */ | 
| 47 | 47 | Router::defaultRouteClass(DashedRoute::class); | 
| 48 | 48 | |
| 49 | -Router::scope('/', function (RouteBuilder $routes) { | |
| 49 | +Router::scope('/', function(RouteBuilder $routes) { | |
| 50 | 50 | /** | 
| 51 | 51 | * Here, we are connecting '/' (base path) to a controller called 'Pages', | 
| 52 | 52 | * its action called 'display', and we pass a param to select the view file | 
| @@ -96,7 +96,7 @@ discard block | ||
| 96 | 96 | $routes->fallbacks(DashedRoute::class); | 
| 97 | 97 | }); | 
| 98 | 98 | |
| 99 | -Router::scope('/entries', function ($routes) { | |
| 99 | +Router::scope('/entries', function($routes) { | |
| 100 | 100 | $routes->setExtensions(['json']); | 
| 101 | 101 | $routes->connect( | 
| 102 | 102 | '/threadLine/*', | 
| @@ -21,19 +21,19 @@ | ||
| 21 | 21 | * You can remove this if you are confident that your PHP version is sufficient. | 
| 22 | 22 | */ | 
| 23 | 23 |  if (version_compare(PHP_VERSION, '5.6.0') < 0) { | 
| 24 | -    trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.' . PHP_EOL, E_USER_ERROR); | |
| 24 | +    trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.'.PHP_EOL, E_USER_ERROR); | |
| 25 | 25 | } | 
| 26 | 26 | |
| 27 | 27 | /* | 
| 28 | 28 | * You can remove this if you are confident you have intl installed. | 
| 29 | 29 | */ | 
| 30 | 30 |  if (!extension_loaded('intl')) { | 
| 31 | -    trigger_error('You must enable the intl extension to use CakePHP.' . PHP_EOL, E_USER_ERROR); | |
| 31 | +    trigger_error('You must enable the intl extension to use CakePHP.'.PHP_EOL, E_USER_ERROR); | |
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | 34 | /* | 
| 35 | 35 | * You can remove this if you are confident you have mbstring installed. | 
| 36 | 36 | */ | 
| 37 | 37 |  if (!extension_loaded('mbstring')) { | 
| 38 | -    trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR); | |
| 38 | +    trigger_error('You must enable the mbstring extension to use CakePHP.'.PHP_EOL, E_USER_ERROR); | |
| 39 | 39 | } | 
| @@ -39,47 +39,47 @@ | ||
| 39 | 39 | /** | 
| 40 | 40 | * Path to the application's directory. | 
| 41 | 41 | */ | 
| 42 | -define('APP', ROOT . DS . APP_DIR . DS); | |
| 42 | +define('APP', ROOT.DS.APP_DIR.DS); | |
| 43 | 43 | |
| 44 | 44 | /** | 
| 45 | 45 | * Path to the config directory. | 
| 46 | 46 | */ | 
| 47 | -define('CONFIG', ROOT . DS . 'config' . DS); | |
| 47 | +define('CONFIG', ROOT.DS.'config'.DS); | |
| 48 | 48 | |
| 49 | 49 | /** | 
| 50 | 50 | * File path to the webroot directory. | 
| 51 | 51 | */ | 
| 52 | -define('WWW_ROOT', ROOT . DS . 'webroot' . DS); | |
| 52 | +define('WWW_ROOT', ROOT.DS.'webroot'.DS); | |
| 53 | 53 | |
| 54 | 54 | /** | 
| 55 | 55 | * Path to the tests directory. | 
| 56 | 56 | */ | 
| 57 | -define('TESTS', ROOT . DS . 'tests' . DS); | |
| 57 | +define('TESTS', ROOT.DS.'tests'.DS); | |
| 58 | 58 | |
| 59 | 59 | /** | 
| 60 | 60 | * Path to the temporary files directory. | 
| 61 | 61 | */ | 
| 62 | -define('TMP', ROOT . DS . 'tmp' . DS); | |
| 62 | +define('TMP', ROOT.DS.'tmp'.DS); | |
| 63 | 63 | |
| 64 | 64 | /** | 
| 65 | 65 | * Path to the logs directory. | 
| 66 | 66 | */ | 
| 67 | -define('LOGS', ROOT . DS . 'logs' . DS); | |
| 67 | +define('LOGS', ROOT.DS.'logs'.DS); | |
| 68 | 68 | |
| 69 | 69 | /** | 
| 70 | 70 | * Path to the cache files directory. It can be shared between hosts in a multi-server setup. | 
| 71 | 71 | */ | 
| 72 | -define('CACHE', TMP . 'cache' . DS); | |
| 72 | +define('CACHE', TMP.'cache'.DS); | |
| 73 | 73 | |
| 74 | 74 | /** | 
| 75 | 75 | * The absolute path to the "cake" directory, WITHOUT a trailing DS. | 
| 76 | 76 | * | 
| 77 | 77 | * CakePHP should always be installed with composer, so look there. | 
| 78 | 78 | */ | 
| 79 | -define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'vendor' . DS . 'cakephp' . DS . 'cakephp'); | |
| 79 | +define('CAKE_CORE_INCLUDE_PATH', ROOT.DS.'vendor'.DS.'cakephp'.DS.'cakephp'); | |
| 80 | 80 | |
| 81 | 81 | /** | 
| 82 | 82 | * Path to the cake directory. | 
| 83 | 83 | */ | 
| 84 | -define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS); | |
| 85 | -define('CAKE', CORE_PATH . 'src' . DS); | |
| 84 | +define('CORE_PATH', CAKE_CORE_INCLUDE_PATH.DS); | |
| 85 | +define('CAKE', CORE_PATH.'src'.DS); | |
| @@ -16,7 +16,7 @@ discard block | ||
| 16 | 16 | /* | 
| 17 | 17 | * Configure paths required to find CakePHP + general filepath constants | 
| 18 | 18 | */ | 
| 19 | -require __DIR__ . '/paths.php'; | |
| 19 | +require __DIR__.'/paths.php'; | |
| 20 | 20 | |
| 21 | 21 | /* | 
| 22 | 22 | * Bootstrap CakePHP. | 
| @@ -27,7 +27,7 @@ discard block | ||
| 27 | 27 | * - Registering the CakePHP autoloader. | 
| 28 | 28 | * - Setting the default application paths. | 
| 29 | 29 | */ | 
| 30 | -require CORE_PATH . 'config' . DS . 'bootstrap.php'; | |
| 30 | +require CORE_PATH.'config'.DS.'bootstrap.php'; | |
| 31 | 31 | |
| 32 | 32 | use Cake\Cache\Cache; | 
| 33 | 33 | use Cake\Console\ConsoleErrorHandler; | 
| @@ -50,8 +50,8 @@ discard block | ||
| 50 | 50 | * You should copy `config/.env.default to `config/.env` and set/modify the | 
| 51 | 51 | * variables as required. | 
| 52 | 52 | */ | 
| 53 | -if (!env('APP_NAME') && file_exists(CONFIG . '.env')) { | |
| 54 | - $dotenv = new \josegonzalez\Dotenv\Loader([CONFIG . '.env']); | |
| 53 | +if (!env('APP_NAME') && file_exists(CONFIG.'.env')) { | |
| 54 | + $dotenv = new \josegonzalez\Dotenv\Loader([CONFIG.'.env']); | |
| 55 | 55 | $dotenv->parse() | 
| 56 | 56 | ->putenv() | 
| 57 | 57 | ->toEnv() | 
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 | * Load additional config files | 
| 75 | 75 | */ | 
| 76 | 76 |      Configure::load('saito_config', 'default'); | 
| 77 | -    Configure::config('saitoCore', new PhpConfig(APP . '/Lib/')); | |
| 77 | +    Configure::config('saitoCore', new PhpConfig(APP.'/Lib/')); | |
| 78 | 78 |      Configure::load('version', 'saitoCore'); | 
| 79 | 79 | |
| 80 | 80 | Configure::write( | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | |
| 85 | 85 |      Configure::load('email', 'default'); | 
| 86 | 86 |  } catch (\Exception $e) { | 
| 87 | - exit($e->getMessage() . "\n"); | |
| 87 | + exit($e->getMessage()."\n"); | |
| 88 | 88 | } | 
| 89 | 89 | |
| 90 | 90 | /* | 
| @@ -136,7 +136,7 @@ discard block | ||
| 136 | 136 | * Include the CLI bootstrap overrides. | 
| 137 | 137 | */ | 
| 138 | 138 |  if ($isCli) { | 
| 139 | - require __DIR__ . '/bootstrap_cli.php'; | |
| 139 | + require __DIR__.'/bootstrap_cli.php'; | |
| 140 | 140 | } | 
| 141 | 141 | |
| 142 | 142 | /* | 
| @@ -153,7 +153,7 @@ discard block | ||
| 153 | 153 | |
| 154 | 154 |      $httpHost = env('HTTP_HOST'); | 
| 155 | 155 |      if (isset($httpHost)) { | 
| 156 | -        Configure::write('App.fullBaseUrl', 'http' . $s . '://' . $httpHost); | |
| 156 | +        Configure::write('App.fullBaseUrl', 'http'.$s.'://'.$httpHost); | |
| 157 | 157 | } | 
| 158 | 158 | unset($httpHost, $s); | 
| 159 | 159 | } | 
| @@ -175,12 +175,12 @@ discard block | ||
| 175 | 175 | /* | 
| 176 | 176 | * Setup detectors for mobile and tablet. | 
| 177 | 177 | */ | 
| 178 | -ServerRequest::addDetector('mobile', function ($request) { | |
| 178 | +ServerRequest::addDetector('mobile', function($request) { | |
| 179 | 179 | $detector = new \Detection\MobileDetect(); | 
| 180 | 180 | |
| 181 | 181 | return $detector->isMobile(); | 
| 182 | 182 | }); | 
| 183 | -ServerRequest::addDetector('tablet', function ($request) { | |
| 183 | +ServerRequest::addDetector('tablet', function($request) { | |
| 184 | 184 | $detector = new \Detection\MobileDetect(); | 
| 185 | 185 | |
| 186 | 186 | return $detector->isTablet(); | 
| @@ -231,7 +231,7 @@ discard block | ||
| 231 | 231 | |
| 232 | 232 |  Plugin::load('ImageUploader', ['bootstrap' => true, 'routes' => true]); | 
| 233 | 233 | |
| 234 | -include Cake\Core\App::path('Lib')[0] . 'BaseFunctions.php'; | |
| 234 | +include Cake\Core\App::path('Lib')[0].'BaseFunctions.php'; | |
| 235 | 235 | |
| 236 | 236 | \Cake\Event\EventManager::instance()->on(\Saito\Event\SaitoEventManager::getInstance()); | 
| 237 | 237 | |
| @@ -60,9 +60,9 @@ discard block | ||
| 60 | 60 | 'cssBaseUrl' => 'css/', | 
| 61 | 61 | 'jsBaseUrl' => 'js/', | 
| 62 | 62 | 'paths' => [ | 
| 63 | - 'plugins' => [ROOT . DS . 'plugins' . DS], | |
| 64 | - 'templates' => [APP . 'Template' . DS], | |
| 65 | - 'locales' => [APP . 'Locale' . DS], | |
| 63 | + 'plugins' => [ROOT.DS.'plugins'.DS], | |
| 64 | + 'templates' => [APP.'Template'.DS], | |
| 65 | + 'locales' => [APP.'Locale'.DS], | |
| 66 | 66 | ], | 
| 67 | 67 | ], | 
| 68 | 68 | |
| @@ -111,8 +111,8 @@ discard block | ||
| 111 | 111 | */ | 
| 112 | 112 | '_cake_core_' => [ | 
| 113 | 113 | 'className' => $cache['engine'], | 
| 114 | - 'prefix' => $cache['prefix'] . 'cake_core_', | |
| 115 | - 'path' => CACHE . 'persistent/', | |
| 114 | + 'prefix' => $cache['prefix'].'cake_core_', | |
| 115 | + 'path' => CACHE.'persistent/', | |
| 116 | 116 | 'serialize' => true, | 
| 117 | 117 | 'duration' => '+1 years', | 
| 118 | 118 |              'url' => env('CACHE_CAKECORE_URL', null), | 
| @@ -125,8 +125,8 @@ discard block | ||
| 125 | 125 | */ | 
| 126 | 126 | '_cake_model_' => [ | 
| 127 | 127 | 'className' => $cache['engine'], | 
| 128 | - 'prefix' => $cache['prefix'] . 'cake_model_', | |
| 129 | - 'path' => CACHE . 'models/', | |
| 128 | + 'prefix' => $cache['prefix'].'cake_model_', | |
| 129 | + 'path' => CACHE.'models/', | |
| 130 | 130 | 'serialize' => true, | 
| 131 | 131 | 'duration' => '+1 years', | 
| 132 | 132 |              'url' => env('CACHE_CAKEMODEL_URL', null), | 
| @@ -138,7 +138,7 @@ discard block | ||
| 138 | 138 | */ | 
| 139 | 139 | '_cake_routes_' => [ | 
| 140 | 140 | 'className' => $cache['engine'], | 
| 141 | - 'prefix' => $cache['prefix'] . 'cake_model_', | |
| 141 | + 'prefix' => $cache['prefix'].'cake_model_', | |
| 142 | 142 | 'path' => CACHE, | 
| 143 | 143 | 'serialize' => true, | 
| 144 | 144 | 'duration' => '+1 years', | 
| @@ -8,6 +8,6 @@ | ||
| 8 | 8 | Router::scope( | 
| 9 | 9 | '/api/v2/', | 
| 10 | 10 | ['plugin' => 'Api'], | 
| 11 | -    function ($routes) { | |
| 11 | +    function($routes) { | |
| 12 | 12 | } | 
| 13 | 13 | ); | 
| @@ -1,6 +1,6 @@ discard block | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | -declare(strict_types = 1); | |
| 3 | +declare(strict_types=1); | |
| 4 | 4 | |
| 5 | 5 | /** | 
| 6 | 6 | * Saito - The Threaded Web Forum | 
| @@ -14,7 +14,7 @@ discard block | ||
| 14 | 14 | use Cake\Core\Configure; | 
| 15 | 15 | |
| 16 | 16 | // @bogus | 
| 17 | -$getUri = function () { | |
| 17 | +$getUri = function() { | |
| 18 | 18 |      if (!empty($_SERVER['PATH_INFO'])) { | 
| 19 | 19 | $uri = $_SERVER['PATH_INFO']; | 
| 20 | 20 |      } elseif (isset($_SERVER['REQUEST_URI'])) { |