Browse Source

CakePHP 4 (#5346)

* Update to CakePHP 4.0

* Update readme

* Cleanup composer.json

* Use PHP 7.4

* Try to get cakephp test running

* Fix php-fpm

* Clean dockerfile

* Fix, clean and faster nginx.conf

* Removed unneeded files

* Add --quite option to composer install

Co-authored-by: Joan Miquel <[email protected]>
ADmad 5 years ago
parent
commit
16cd646c1d
26 changed files with 137 additions and 706 deletions
  1. 2 5
      frameworks/PHP/cakephp/README.md
  2. 1 1
      frameworks/PHP/cakephp/benchmark_config.json
  3. 0 12
      frameworks/PHP/cakephp/build.properties
  4. 0 250
      frameworks/PHP/cakephp/build.xml
  5. 2 3
      frameworks/PHP/cakephp/cakephp.dockerfile
  6. 5 21
      frameworks/PHP/cakephp/composer.json
  7. 5 5
      frameworks/PHP/cakephp/config/app.php
  8. 29 35
      frameworks/PHP/cakephp/config/bootstrap.php
  9. 5 0
      frameworks/PHP/cakephp/config/paths.php
  10. 0 39
      frameworks/PHP/cakephp/config/requirements.php
  11. 0 109
      frameworks/PHP/cakephp/config/routes.php
  12. 3 3
      frameworks/PHP/cakephp/deploy/conf/php-fpm.conf
  13. 2 2
      frameworks/PHP/cakephp/deploy/nginx.conf
  14. 17 55
      frameworks/PHP/cakephp/src/Application.php
  15. 0 55
      frameworks/PHP/cakephp/src/Controller/AppController.php
  16. 7 12
      frameworks/PHP/cakephp/src/Controller/FortunesController.php
  17. 9 12
      frameworks/PHP/cakephp/src/Controller/JsonController.php
  18. 5 12
      frameworks/PHP/cakephp/src/Controller/PlaintextController.php
  19. 24 37
      frameworks/PHP/cakephp/src/Controller/WorldController.php
  20. 1 7
      frameworks/PHP/cakephp/src/Model/Table/FortuneTable.php
  21. 1 7
      frameworks/PHP/cakephp/src/Model/Table/WorldTable.php
  22. 0 1
      frameworks/PHP/cakephp/src/Template/Plaintext/index.ctp
  23. 19 19
      frameworks/PHP/cakephp/templates/Fortunes/index.php
  24. 0 0
      frameworks/PHP/cakephp/templates/layout/default.php
  25. 0 0
      frameworks/PHP/cakephp/tmp/cache/models/.gitkeep
  26. 0 4
      frameworks/PHP/cakephp/webroot/index.php

+ 2 - 5
frameworks/PHP/cakephp/README.md

@@ -18,17 +18,14 @@ Uses the CakePHP Model functionality.
 ## Infrastructure Software Versions
 ## Infrastructure Software Versions
 The tests were run with:
 The tests were run with:
 
 
-* [Cake Version 3.7](https://cakephp.org/)
-* [PHP Version 7.3](http://www.php.net/) No PHP7 until upgrade the framework version
+* [Cake Version 4.0](https://cakephp.org/)
+* [PHP Version 7.4](http://www.php.net/)
 * [nginx 1.12.0](http://nginx.org/)
 * [nginx 1.12.0](http://nginx.org/)
 * [MySQL 5.7.20](https://dev.mysql.com/)
 * [MySQL 5.7.20](https://dev.mysql.com/)
 
 
 Cake Debug mode is set to false in [core.php](config/app.php), as
 Cake Debug mode is set to false in [core.php](config/app.php), as
 appropriate for a production deployment.
 appropriate for a production deployment.
 
 
-To support the Cake JsonView and use the recommended URLs, 
-we also made a [routes configuration change](confi/routes.php).
-
 ## Test URLs
 ## Test URLs
 ### JSON Encoding Test
 ### JSON Encoding Test
 
 

+ 1 - 1
frameworks/PHP/cakephp/benchmark_config.json

@@ -20,7 +20,7 @@
             "webserver": "nginx",
             "webserver": "nginx",
             "os": "Linux",
             "os": "Linux",
             "database_os": "Linux",
             "database_os": "Linux",
-            "display_name": "CakePHP 3.7 (PHP7)",
+            "display_name": "CakePHP 4.0",
             "notes": "",
             "notes": "",
             "versus": "php"
             "versus": "php"
         }
         }

+ 0 - 12
frameworks/PHP/cakephp/build.properties

@@ -1,12 +0,0 @@
-# Name
-project.name = CakePHP
-
-# Git stuff
-git.remote = changeme!
-
-# Directories
-build.dir = build
-dist.dir = dist
-
-# Server
-pirum.dir = /home/cakephp/www-live/pear.cakephp.org

+ 0 - 250
frameworks/PHP/cakephp/build.xml

@@ -1,250 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<project name="CakePHP" default="build">
-	<!--
-	Build.xml file for CakePHP
-
-	Uses phing to create releases, and pear packages.
-	Based off of build.xml in doctrine.
-
-	Requires the d51PearPkg2 to be installed:
-
-	pear channel-discover pear.domain51.com
-	pear install domain51/Phing_d51PearPkg2Task
-
-	Use the `release` task to update VERSION.txt, and create a new tag.
-	Use the `build` task to create a pear package based on the current working copy.
-	Use the `clean` task to clean up packaging artifacts.
-
-	-->
-
-	<taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2" />
-	<property file="build.properties" />
-
-	<!--
-		The set of files we're going to package
-		Exclude the cli scripts, as they get installed separately.
-	 -->
-	<fileset id="libs" dir="./lib/Cake">
-		<include name="**" />
-		<exclude name="Console/cake.bat" />
-		<exclude name="Console/cake.php" />
-		<exclude name="Console/cake" />
-	</fileset>
-
-	<!--
-		CLI scripts to package and install
-	-->
-	<fileset id="cli" dir="./lib/Cake/Console">
-		<include name="cake.bat" />
-		<include name="cake.php" />
-		<include name="cake" />
-	</fileset>
-
-	<fileset id="non-tests" dir="./lib/Cake">
-		<exclude name=".lib/Cake/Test" />
-	</fileset>
-
-	<!-- start fresh each time.  Remove the dist and build dirs -->
-	<target name="clean">
-		<delete dir="${build.dir}" includeemptydirs="true" />
-		<delete dir="${dist.dir}" includeemptydirs="true" />
-	</target>
-
-	<!-- Read the current version, so we can replace it -->
-	<target name="current-version">
-		<exec executable="php" outputProperty="version">
-			<arg value="-r" />
-			<arg value="$fh = file('./lib/Cake/VERSION.txt'); echo array_pop($fh);" />
-		</exec>
-	</target>
-
-	<!-- Makes directories and sets properties -->
-	<target name="prepare" depends="current-version">
-		<!-- set PEAR stability based on version number. -->
-		<condition property="pear.stability" value="beta">
-			<contains string="${version}" substring="beta" casesensitive="false"/>
-		</condition>
-		<condition property="pear.stability" value="alpha">
-			<contains string="${version}" substring="alpha" casesensitive="false"/>
-		</condition>
-		<condition property="pear.stability" value="devel">
-			<contains string="${version}" substring="dev" casesensitive="false"/>
-		</condition>
-		<condition property="pear.stability" value="beta">
-			<contains string="${version}" substring="rc" casesensitive="false" />
-		</condition>
-		<condition property="pear.stability" value="stable">
-			<not><isset property="pear.stability"/></not>
-		</condition>
-
-		<!-- pear versions need to not have '-' -->
-		<exec executable="php" outputProperty="pear.version">
-			<arg value="-r" />
-			<arg value="echo str_replace(array('-'), array(''), '${version}');" />
-		</exec>
-
-		<!-- Used for other targets -->
-		<property name="pear.package" value="${project.name}-${pear.version}" />
-
-		<echo msg="Preparing package of ${version} (${pear.version}+${pear.stability})" />
-
-		<!-- Get the current git branch -->
-		<exec command="git name-rev HEAD 2>/dev/null | awk '{ print $2 }'" outputProperty="git.branch" />
-	</target>
-
-	<!--
-		Copy all the files to build/ so they can be packaged up.
-	-->
-	<target name="copy-files" depends="clean,prepare">
-		<echo msg="Creating build + dist directories." />
-		<mkdir dir="${build.dir}" />
-		<mkdir dir="${dist.dir}" />
-
-		<echo msg="Copying files to build directory" />
-		<copy todir="${build.dir}/${pear.package}/Cake">
-			<fileset refid="libs" />
-		</copy>
-		<copy todir="${build.dir}/${pear.package}/bin">
-			<fileset refid="cli" />
-		</copy>
-	</target>
-
-	<!--
-		Define the package.xml.  Using xml to make xml is fun!
-	-->
-	<target name="define-pear-package" depends="copy-files">
-		<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${pear.package}">
-			<name>CakePHP</name>
-			<summary>CakePHP Rapid Development Framework</summary>
-			<channel>pear.cakephp.org</channel>
-			<description>CakePHP is an application development framework for PHP 5.2+</description>
-
-			<lead user="mark_story" name="Mark Story" email="[email protected]" />
-			<lead user="lorenzo" name="José Lorenzo Rodríguez" email="[email protected]" />
-			<lead user="PhpNut" name="Larry Masters" email="[email protected]" />
-			<developer user="ADmad" name="Adnan Sarela" email="[email protected]" />
-			<developer user="AD7six" name="Andy Dawson" email="[email protected]" />
-			<developer user="Ceeram" name="Marc Ypes" email="[email protected]" />
-			<developer user="jrbasso" name="Juan Basso" email="" />
-			<developer user="Predominant" name="Graham Weldon" email="[email protected]" />
-			<developer user="renan.saddam" name="Renan Gonçalves" email="[email protected]" />
-			<developer user="rchavik" name="Rachman Chavik" email="[email protected]" />
-
-			<license>MIT License</license>
-			<version release="${pear.version}" api="${pear.version}" />
-			<stability release="${pear.stability}" api="${pear.stability}" />
-			<notes>http://github.com/cakephp/cakephp/blob/master/README</notes>
-			<dependencies>
-				<php minimum_version="5.2.8" />
-				<pear minimum_version="1.9.0" recommended_version="1.9.4" />
-				<package name="PHPUnit" channel="pear.phpunit.de" minimum_version="3.5.0" type="optional" />
-			</dependencies>
-			<dirroles key="bin">script</dirroles>
-			<dirroles key="Cake/Test">php</dirroles>
-			<dirroles key="Cake/Console/Templates/skel">php</dirroles>
-			<dirroles key="Cake/Console/Templates/default">php</dirroles>
-			<dirroles key="Cake/View">php</dirroles>
-			<release>
-				<install as="cake" name="bin/cake" />
-				<install as="cake.php" name="bin/cake.php" />
-				<install as="cake.bat" name="bin/cake.bat" />
-			</release>
-			<exceptions key="Cake/VERSION.txt">php</exceptions>
-			<exceptions key="Cake/LICENSE.txt">php</exceptions>
-		</d51pearpkg2>
-	</target>
-
-	<!-- Generate the PEAR package from a directory and move the files to the dist folder -->
-	<target name="generate-package" depends="define-pear-package">
-		<exec command="pear package" dir="${build.dir}/${pear.package}" passthru="true"/>
-		<echo msg="Moving ${pear.package}.tgz"/>
-		<move file="${build.dir}/${pear.package}/${pear.package}.tgz" todir="${dist.dir}" />
-	</target>
-
-	<!--
-		Bump the version number and commit that.
-	-->
-	<target name="next-version" depends="current-version">
-		<echo msg="Incrementing version." />
-		<propertyprompt propertyName="release_version" defaultValue="${version}" promptText="Enter version to be released."/>
-		<echo msg="$file = file_get_contents('./lib/Cake/VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./lib/Cake/VERSION.txt', $file);" />
-		<exec executable="php">
-			<arg value="-r" />
-			<arg value="$file = file_get_contents('./lib/Cake/VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./lib/Cake/VERSION.txt', $file);" />
-		</exec>
-		<echo msg="Version number updated." />
-		<property name="version" value="${release_version}" override="true" />
-	</target>
-
-	<!--
-		Create the release commit that updates the version number and pushes the commits.
-	-->
-	<target name="release-commit" depends="next-version,prepare">
-		<echo msg="Creating new release commit" />
-		<exec command="git add ./lib/Cake/VERSION.txt" logoutput="true" checkreturn="true" />
-		<exec command="git commit -m 'Update version number to ${release_version}'" logoutput="true" checkreturn="true" />
-		<exec command="git tag -s ${release_version} -m 'CakePHP ${release_version}'" logoutput="true" checkreturn="true" />
-
-		<propertyprompt propertyName="shipit" defaultValue="n" promptText="Ship the new commit and tag?" />
-		<condition property="noshipit" value="1">
-			<equals arg1="n" arg2="${shipit}" casesensitive="false" />
-		</condition>
-		<fail if="noshipit" msg="You said not to ship it." />
-
-		<echo msg="Pushing commit and tag." />
-		<exec command="git push ${git.remote} ${git.branch}" logoutput="true" checkreturn="true" />
-		<exec command="git push ${git.remote} ${release_version}" logoutput="true" checkreturn="true" />
-		<echo msg="Push complete." />
-	</target>
-
-	<!--
-		Upload to pirum pear channel.
-	-->
-	<target name="distribute" depends="prepare" description="Upload pear packages to pear.cakephp.org">
-		<echo msg="Uploading tgz file to cakephp.org" />
-		<exec command="scp ${dist.dir}/${pear.package}.tgz [email protected]:${pirum.dir}" dir="." checkreturn="true"  />
-
-		<echo msg="Adding new release to pirum" />
-		<exec command="ssh [email protected] pirum add ${pirum.dir} ${pirum.dir}/${pear.package}.tgz" checkreturn="true" />
-	</target>
-
-	<target name="codestyle" description="Check codestyle (human readable format)">
-		<phpcodesniffer
-			standard="CakePHP"
-			allowedFileExtensions="php">
-			<fileset refid="libs" />
-		</phpcodesniffer>
-	</target>
-
-	<target name="reports-ci">
-		<phpcodesniffer
-			standard="CakePHP"
-			allowedFileExtensions="php">
-			<fileset refid="libs" />
-			<formatter type="checkstyle" outfile="checkstyle.xml" />
-		</phpcodesniffer>
-		<phpcpd
-			minLines="4"
-			minTokens="50">
-			<fileset refid="libs" />
-			<formatter type="pmd" outfile="pmd-cpd.xml"/>
-		</phpcpd>
-		<phpdepend>
-			<fileset refid="non-tests" />
-			<logger type="jdepend-xml" outfile="jdepend.xml"/>
-		</phpdepend>
-		<phpmd rulesets="codesize,unusedcode,design">
-			<fileset refid="non-tests" />
-			<formatter type="xml" outfile="reports/pmd.html"/>
-		</phpmd>
-	</target>
-
-	<!--
-		Top level easy to type targets
-	-->
-	<target name="build" depends="generate-package" description="Generate a pear package" />
-	<target name="release" depends="release-commit,build,distribute" description="Release a new version of CakePHP" />
-	<target name="code-reports" depends="reports-ci"
-		description="Run the code reports, generating XML output for CI server use." />
-
-</project>

+ 2 - 3
frameworks/PHP/cakephp/cakephp.dockerfile

@@ -11,17 +11,16 @@ RUN apt-get install -yqq composer > /dev/null
 
 
 COPY deploy/conf/* /etc/php/7.4/fpm/
 COPY deploy/conf/* /etc/php/7.4/fpm/
 COPY deploy/conf/* /etc/php/7.4/cli/
 COPY deploy/conf/* /etc/php/7.4/cli/
-RUN sed -i "s|listen = /run/php/php7.4-fpm.sock|listen = /run/php/php7.4-fpm.sock|g" /etc/php/7.4/fpm/php-fpm.conf
 
 
 ADD ./ /cakephp
 ADD ./ /cakephp
 WORKDIR /cakephp
 WORKDIR /cakephp
 
 
 RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/7.4/fpm/php-fpm.conf ; fi;
 RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/7.4/fpm/php-fpm.conf ; fi;
 
 
-RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet --ignore-platform-reqs
+RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet
 
 
 RUN chmod -R 777 /cakephp
 RUN chmod -R 777 /cakephp
 
 
 CMD service php7.4-fpm start && \
 CMD service php7.4-fpm start && \
-    nginx -c /cakephp/deploy/nginx.conf -g "daemon off;"
+    nginx -c /cakephp/deploy/nginx.conf
 
 

+ 5 - 21
frameworks/PHP/cakephp/composer.json

@@ -5,33 +5,16 @@
     "type": "project",
     "type": "project",
     "license": "MIT",
     "license": "MIT",
     "require": {
     "require": {
-        "php": "^7.1.3",
-        "cakephp/cakephp": "3.7.*",
-        "cakephp/migrations": "^2.0.0",
-        "cakephp/plugin-installer": "^1.0",
-        "mobiledetect/mobiledetectlib": "2.*"
-    },
-    "require-dev": {
-
-    },
-    "suggest": {
-        "markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
-        "dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility."
+        "php": ">=7.2",
+        "cakephp/cakephp": "^4.0",
+        "cakephp/plugin-installer": "^1.0"
     },
     },
     "autoload": {
     "autoload": {
         "psr-4": {
         "psr-4": {
             "App\\": "src/"
             "App\\": "src/"
         }
         }
     },
     },
-    "autoload-dev": {
-        "psr-4": {
-            "App\\Test\\": "tests/",
-            "Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
-        }
-    },
     "scripts": {
     "scripts": {
-        "post-install-cmd": "App\\Console\\Installer::postInstall",
-        "post-create-project-cmd": "App\\Console\\Installer::postInstall",
         "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
         "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
         "check": [
         "check": [
             "@test",
             "@test",
@@ -39,9 +22,10 @@
         ],
         ],
         "cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
         "cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
         "cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
         "cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
+        "stan": "phpstan analyse src/",
+        "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
         "test": "phpunit --colors=always"
         "test": "phpunit --colors=always"
     },
     },
-    "prefer-stable": true,
     "config": {
     "config": {
         "sort-packages": true
         "sort-packages": true
     }
     }

+ 5 - 5
frameworks/PHP/cakephp/config/app.php

@@ -55,8 +55,8 @@ return [
         'jsBaseUrl' => 'js/',
         'jsBaseUrl' => 'js/',
         'paths' => [
         'paths' => [
             'plugins' => [ROOT . DS . 'plugins' . DS],
             'plugins' => [ROOT . DS . 'plugins' . DS],
-            'templates' => [APP . 'Template' . DS],
-            'locales' => [APP . 'Locale' . DS],
+            'templates' => [ROOT . DS . 'templates' . DS],
+            'locales' => [RESOURCES . 'locales' . DS],
         ],
         ],
     ],
     ],
 
 
@@ -343,7 +343,7 @@ return [
      */
      */
     'Log' => [
     'Log' => [
         'debug' => [
         'debug' => [
-            'className' => 'Cake\Log\Engine\FileLog',
+            'className' => 'Cake\Log\Engine\NullEngine',
             'path' => LOGS,
             'path' => LOGS,
             'file' => 'debug',
             'file' => 'debug',
             'url' => env('LOG_DEBUG_URL', null),
             'url' => env('LOG_DEBUG_URL', null),
@@ -351,7 +351,7 @@ return [
             'levels' => ['emergency'],
             'levels' => ['emergency'],
         ],
         ],
         'error' => [
         'error' => [
-            'className' => 'Cake\Log\Engine\FileLog',
+            'className' => 'Cake\Log\Engine\NullEngine',
             'path' => LOGS,
             'path' => LOGS,
             'file' => 'error',
             'file' => 'error',
             'url' => env('LOG_ERROR_URL', null),
             'url' => env('LOG_ERROR_URL', null),
@@ -360,7 +360,7 @@ return [
         ],
         ],
         // To enable this dedicated query log, you need set your datasource's log flag to true
         // To enable this dedicated query log, you need set your datasource's log flag to true
         'queries' => [
         'queries' => [
-            'className' => 'Cake\Log\Engine\FileLog',
+            'className' => 'Cake\Log\Engine\NullEngine',
             'path' => LOGS,
             'path' => LOGS,
             'file' => 'queries',
             'file' => 'queries',
             'url' => env('LOG_QUERIES_URL', null),
             'url' => env('LOG_QUERIES_URL', null),

+ 29 - 35
frameworks/PHP/cakephp/config/bootstrap.php

@@ -39,7 +39,7 @@ use Cake\Datasource\ConnectionManager;
 use Cake\Error\ErrorHandler;
 use Cake\Error\ErrorHandler;
 use Cake\Http\ServerRequest;
 use Cake\Http\ServerRequest;
 use Cake\Log\Log;
 use Cake\Log\Log;
-use Cake\Mailer\Email;
+use Cake\Mailer\Mailer;
 use Cake\Mailer\TransportFactory;
 use Cake\Mailer\TransportFactory;
 use Cake\Utility\Inflector;
 use Cake\Utility\Inflector;
 use Cake\Utility\Security;
 use Cake\Utility\Security;
@@ -134,7 +134,8 @@ if ($isCli) {
  *
  *
  * If you define fullBaseUrl in your config file you can remove this.
  * If you define fullBaseUrl in your config file you can remove this.
  */
  */
-if (!Configure::read('App.fullBaseUrl')) {
+$fullBaseUrl = Configure::read('App.fullBaseUrl');
+if (!$fullBaseUrl) {
     $s = null;
     $s = null;
     if (env('HTTPS')) {
     if (env('HTTPS')) {
         $s = 's';
         $s = 's';
@@ -146,51 +147,44 @@ if (!Configure::read('App.fullBaseUrl')) {
     }
     }
     unset($httpHost, $s);
     unset($httpHost, $s);
 }
 }
+if ($fullBaseUrl) {
+    Router::fullBaseUrl($fullBaseUrl);
+}
+unset($fullBaseUrl);
 
 
 Cache::setConfig(Configure::consume('Cache'));
 Cache::setConfig(Configure::consume('Cache'));
 ConnectionManager::setConfig(Configure::consume('Datasources'));
 ConnectionManager::setConfig(Configure::consume('Datasources'));
 TransportFactory::setConfig(Configure::consume('EmailTransport'));
 TransportFactory::setConfig(Configure::consume('EmailTransport'));
-Email::setConfig(Configure::consume('Email'));
+Mailer::setConfig(Configure::consume('Email'));
 Log::setConfig(Configure::consume('Log'));
 Log::setConfig(Configure::consume('Log'));
 Security::setSalt(Configure::consume('Security.salt'));
 Security::setSalt(Configure::consume('Security.salt'));
 
 
 /*
 /*
- * The default crypto extension in 3.0 is OpenSSL.
- * If you are migrating from 2.x uncomment this code to
- * use a more compatible Mcrypt based implementation
- */
-//Security::engine(new \Cake\Utility\Crypto\Mcrypt());
-
-/*
- * Setup detectors for mobile and tablet.
- */
-ServerRequest::addDetector('mobile', function ($request) {
-    $detector = new \Detection\MobileDetect();
-
-    return $detector->isMobile();
-});
-ServerRequest::addDetector('tablet', function ($request) {
-    $detector = new \Detection\MobileDetect();
-
-    return $detector->isTablet();
-});
-
-/*
- * Enable immutable time objects in the ORM.
+ * You can set whether the ORM uses immutable or mutable Time types.
+ * The default changed in 4.0 to immutable types. You can uncomment
+ * below to switch back to mutable types.
  *
  *
  * You can enable default locale format parsing by adding calls
  * You can enable default locale format parsing by adding calls
  * to `useLocaleParser()`. This enables the automatic conversion of
  * to `useLocaleParser()`. This enables the automatic conversion of
  * locale specific date formats. For details see
  * locale specific date formats. For details see
- * @link https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data
- */
-Type::build('time')
-    ->useImmutable();
-Type::build('date')
-    ->useImmutable();
-Type::build('datetime')
-    ->useImmutable();
-Type::build('timestamp')
-    ->useImmutable();
+ * @link https://book.cakephp.org/4/en/core-libraries/internationalization-and-localization.html#parsing-localized-datetime-data
+ */
+// TypeFactory::build('time')
+//    ->useMutable();
+// TypeFactory::build('date')
+//    ->useMutable();
+// TypeFactory::build('datetime')
+//    ->useMutable();
+// TypeFactory::build('timestamp')
+//    ->useMutable();
+// TypeFactory::build('datetimefractional')
+//    ->useMutable();
+// TypeFactory::build('timestampfractional')
+//    ->useMutable();
+// TypeFactory::build('datetimetimezone')
+//    ->useMutable();
+// TypeFactory::build('timestamptimezone')
+//    ->useMutable();
 
 
 /*
 /*
  * Custom Inflector rules, can be set to correctly pluralize or singularize
  * Custom Inflector rules, can be set to correctly pluralize or singularize

+ 5 - 0
frameworks/PHP/cakephp/config/paths.php

@@ -75,6 +75,11 @@ define('LOGS', ROOT . DS . 'logs' . DS);
  */
  */
 define('CACHE', TMP . 'cache' . DS);
 define('CACHE', TMP . 'cache' . DS);
 
 
+/**
+ * Path to the resources directory.
+ */
+define('RESOURCES', ROOT . DS . 'resources' . DS);
+
 /**
 /**
  * The absolute path to the "cake" directory, WITHOUT a trailing DS.
  * The absolute path to the "cake" directory, WITHOUT a trailing DS.
  *
  *

+ 0 - 39
frameworks/PHP/cakephp/config/requirements.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link          https://cakephp.org CakePHP(tm) Project
- * @since         3.5.0
- * @license       https://opensource.org/licenses/mit-license.php MIT License
- */
-
-/*
- * You can empty out this file, if you are certain that you match all requirements.
- */
-
-/*
- * You can remove this if you are confident that your PHP version is sufficient.
- */
-if (version_compare(PHP_VERSION, '5.6.0') < 0) {
-    trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.' . PHP_EOL, E_USER_ERROR);
-}
-
-/*
- * You can remove this if you are confident you have intl installed.
- */
-//if (!extension_loaded('intl')) {
-//    trigger_error('You must enable the intl extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
-//}
-
-/*
- * You can remove this if you are confident you have mbstring installed.
- */
-if (!extension_loaded('mbstring')) {
-    trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
-}

+ 0 - 109
frameworks/PHP/cakephp/config/routes.php

@@ -1,109 +0,0 @@
-<?php
-/**
- * Routes configuration
- *
- * In this file, you set up routes to your controllers and their actions.
- * Routes are very important mechanism that allows you to freely connect
- * different URLs to chosen controllers and their actions (functions).
- *
- * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link          https://cakephp.org CakePHP(tm) Project
- * @license       https://opensource.org/licenses/mit-license.php MIT License
- */
-
-use Cake\Routing\Router;
-
-
-/**
- * The default class to use for all routes
- *
- * The following route classes are supplied with CakePHP and are appropriate
- * to set as the default:
- *
- * - Route
- * - InflectedRoute
- * - DashedRoute
- *
- * If no call is made to `Router::defaultRouteClass()`, the class used is
- * `Route` (`Cake\Routing\Route\Route`)
- *
- * Note that `Route` does not do any inflections on URLs which will result in
- * inconsistently cased URLs when used with `:plugin`, `:controller` and
- * `:action` markers.
- *
- * Cache: Routes are cached to improve performance, check the RoutingMiddleware
- * constructor in your `src/Application.php` file to change this behavior.
- *
- */
-
-Router::scope('/', function ($routes) {
-    // Register scoped middleware for in scopes.
-//    $routes->registerMiddleware('csrf', new CsrfProtectionMiddleware([
-//        'httpOnly' => true
-//    ]));
-
-    $routes->connect('/json', ['controller' => 'Json', 'action' => 'index']);
-    $routes->connect('/plaintext', ['controller' => 'Plaintext', 'action' => 'index']);
-    $routes->connect('/fortunes', ['controller' => 'Fortunes', 'action' => 'index']);
-    $routes->connect('/db', ['controller' => 'World', 'action' => 'query']);
-    $routes->connect('/queries', ['controller' => 'World', 'action' => 'index']);
-    $routes->connect('/updates', ['controller' => 'World', 'action' => 'updates']);
-
-    /**
-     * Apply a middleware to the current route scope.
-     * Requires middleware to be registered via `Application::routes()` with `registerMiddleware()`
-     */
-    //$routes->applyMiddleware('csrf');
-
-    /**
-     * Here, we are connecting '/' (base path) to a controller called 'Pages',
-     * its action called 'display', and we pass a param to select the view file
-     * to use (in this case, src/Template/Pages/home.ctp)...
-     */
-    $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);
-
-    /**
-     * ...and connect the rest of 'Pages' controller's URLs.
-     */
-    $routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);
-
-    /**
-     * Connect catchall routes for all controllers.
-     *
-     * Using the argument `DashedRoute`, the `fallbacks` method is a shortcut for
-     *
-     * ```
-     * $routes->connect('/:controller', ['action' => 'index'], ['routeClass' => 'DashedRoute']);
-     * $routes->connect('/:controller/:action/*', [], ['routeClass' => 'DashedRoute']);
-     * ```
-     *
-     * Any route class can be used with this method, such as:
-     * - DashedRoute
-     * - InflectedRoute
-     * - Route
-     * - Or your own route class
-     *
-     * You can remove these routes once you've connected the
-     * routes you want in your application.
-     */
-    //$routes->fallbacks(DashedRoute::class);
-});
-
-/**
- * If you need a different set of middleware or none at all,
- * open new scope and define routes there.
- *
- * ```
- * Router::scope('/api', function (RouteBuilder $routes) {
- *     // No $routes->applyMiddleware() here.
- *     // Connect API actions here.
- * });
- * ```
- */

+ 3 - 3
frameworks/PHP/cakephp/deploy/conf/php-fpm.conf

@@ -14,14 +14,14 @@
 ; Pid file
 ; Pid file
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: none
 ; Default Value: none
-pid = /run/php/php7.3-fpm.pid
+pid = /run/php/php-fpm.pid
 
 
 ; Error log file
 ; Error log file
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; If it's set to "syslog", log is sent to syslogd instead of being written
 ; into a local file.
 ; into a local file.
 ; Note: the default prefix is /var
 ; Note: the default prefix is /var
 ; Default Value: log/php-fpm.log
 ; Default Value: log/php-fpm.log
-;error_log = /var/log/php7.3-fpm.log
+;error_log = /var/log/php-fpm.log
 error_log = /dev/stderr
 error_log = /dev/stderr
 
 
 
 
@@ -161,7 +161,7 @@ group = www-data
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;                            (IPv6 and IPv4-mapped) on a specific port;
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ;   '/path/to/unix/socket' - to listen on a unix socket.
 ; Note: This value is mandatory.
 ; Note: This value is mandatory.
-listen = /run/php/php7.3-fpm.sock
+listen = /run/php/php-fpm.sock
 
 
 ; Set listen(2) backlog.
 ; Set listen(2) backlog.
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)

+ 2 - 2
frameworks/PHP/cakephp/deploy/nginx.conf

@@ -1,6 +1,6 @@
 user www-data;
 user www-data;
 worker_processes  auto;
 worker_processes  auto;
-
+daemon off;
 events {
 events {
     worker_connections 16384;
     worker_connections 16384;
 	multi_accept off;
 	multi_accept off;
@@ -39,7 +39,7 @@ http {
 
 
 
 
     upstream fastcgi_backend {
     upstream fastcgi_backend {
-        server unix:/var/run/php/php7.3-fpm.sock;
+        server unix:/var/run/php/php-fpm.sock;
         keepalive 40;
         keepalive 40;
     }
     }
 
 

+ 17 - 55
frameworks/PHP/cakephp/src/Application.php

@@ -14,12 +14,10 @@
  */
  */
 namespace App;
 namespace App;
 
 
-use Cake\Core\Configure;
-use Cake\Core\Exception\MissingPluginException;
-use Cake\Error\Middleware\ErrorHandlerMiddleware;
 use Cake\Http\BaseApplication;
 use Cake\Http\BaseApplication;
-use Cake\Routing\Middleware\AssetMiddleware;
+use Cake\Http\MiddlewareQueue;
 use Cake\Routing\Middleware\RoutingMiddleware;
 use Cake\Routing\Middleware\RoutingMiddleware;
+use Cake\Routing\RouteBuilder;
 
 
 /**
 /**
  * Application setup class.
  * Application setup class.
@@ -29,69 +27,33 @@ use Cake\Routing\Middleware\RoutingMiddleware;
  */
  */
 class Application extends BaseApplication
 class Application extends BaseApplication
 {
 {
-    /**
-     * {@inheritDoc}
-     */
-    public function bootstrap()
-    {
-        // Call parent to load bootstrap from files.
-        parent::bootstrap();
-
-        if (PHP_SAPI === 'cli') {
-            $this->bootstrapCli();
-        }
-
-        /*
-         * Only try to load DebugKit in development mode
-         * Debug Kit should not be installed on a production system
-         */
-//        if (Configure::read('debug')) {
-//            $this->addPlugin(\DebugKit\Plugin::class);
-//        }
-
-        // Load more plugins here
-    }
-
     /**
     /**
      * Setup the middleware queue your application will use.
      * Setup the middleware queue your application will use.
      *
      *
      * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup.
      * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to setup.
      * @return \Cake\Http\MiddlewareQueue The updated middleware queue.
      * @return \Cake\Http\MiddlewareQueue The updated middleware queue.
      */
      */
-    public function middleware($middlewareQueue)
+    public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
     {
     {
         $middlewareQueue
         $middlewareQueue
-            // Catch any exceptions in the lower layers,
-            // and make an error page/response
-            ->add(new ErrorHandlerMiddleware(null, Configure::read('Error')))
-
-            // Handle plugin/theme assets like CakePHP normally does.
-            //->add(new AssetMiddleware([
-            //    'cacheTime' => Configure::read('Asset.cacheTime')
-            //]))
-
             // Add routing middleware.
             // Add routing middleware.
-            // Routes collection cache enabled by default, to disable route caching
-            // pass null as cacheConfig, example: `new RoutingMiddleware($this)`
-            // you might want to disable this cache in case your routing is extremely simple
-            ->add(new RoutingMiddleware($this, '_cake_routes_'));
+            // If you have a large number of routes connected, turning on routes
+            // caching in production could improve performance. For that when
+            // creating the middleware instance specify the cache config name by
+            // using it's second constructor argument:
+            // `new RoutingMiddleware($this, '_cake_routes_')`
+            ->add(new RoutingMiddleware($this));
 
 
         return $middlewareQueue;
         return $middlewareQueue;
     }
     }
 
 
-    /**
-     * @return void
-     */
-    protected function bootstrapCli()
+    public function routes(RouteBuilder $routes): void
     {
     {
-        try {
-            $this->addPlugin('Bake');
-        } catch (MissingPluginException $e) {
-            // Do not halt if the plugin is missing
-        }
-
-        $this->addPlugin('Migrations');
-
-        // Load more plugins here
-    }
+        $routes->connect('/json', ['controller' => 'Json', 'action' => 'index']);
+        $routes->connect('/plaintext', ['controller' => 'Plaintext', 'action' => 'index']);
+        $routes->connect('/fortunes', ['controller' => 'Fortunes', 'action' => 'index']);
+        $routes->connect('/db', ['controller' => 'World', 'action' => 'query']);
+        $routes->connect('/queries', ['controller' => 'World', 'action' => 'index']);
+        $routes->connect('/updates', ['controller' => 'World', 'action' => 'updates']);
+    }    
 }
 }

+ 0 - 55
frameworks/PHP/cakephp/src/Controller/AppController.php

@@ -1,55 +0,0 @@
-<?php
-/**
- * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
- * @link      https://cakephp.org CakePHP(tm) Project
- * @since     0.2.9
- * @license   https://opensource.org/licenses/mit-license.php MIT License
- */
-namespace App\Controller;
-
-use Cake\Controller\Controller;
-use Cake\Event\Event;
-
-/**
- * Application Controller
- *
- * Add your application-wide methods in the class below, your controllers
- * will inherit them.
- *
- * @link https://book.cakephp.org/3.0/en/controllers.html#the-app-controller
- */
-class AppController extends Controller
-{
-
-    /**
-     * Initialization hook method.
-     *
-     * Use this method to add common initialization code like loading components.
-     *
-     * e.g. `$this->loadComponent('Security');`
-     *
-     * @return void
-     */
-    public function initialize()
-    {
-        parent::initialize();
-
-        $this->loadComponent('RequestHandler', [
-            'enableBeforeRedirect' => false,
-        ]);
-        $this->loadComponent('Flash');
-
-        /*
-         * Enable the following component for recommended CakePHP security settings.
-         * see https://book.cakephp.org/3.0/en/controllers/components/security.html
-         */
-        //$this->loadComponent('Security');
-    }
-}

+ 7 - 12
frameworks/PHP/cakephp/src/Controller/FortunesController.php

@@ -2,27 +2,22 @@
 
 
 namespace App\Controller;
 namespace App\Controller;
 
 
-use Cake\ORM\TableRegistry;
+use Cake\Controller\Controller;
 
 
-class FortunesController extends AppController {
+class FortunesController extends Controller {
 
 
-    public function index() {
-        $viewBuilder = $this->viewBuilder();
-        $viewBuilder->setLayout('fortunes');
-        $viewBuilder->setTemplate('/Fortunes/index');
+    protected $modelClass = 'Fortune';
 
 
-        $fortunesTable = TableRegistry::getTableLocator()->get('Fortune');
-
-        $query = $fortunesTable->find('all');
+    public function index() 
+    {
+        $query = $this->Fortune->find('all');
 
 
         // Calling all() will execute the query
         // Calling all() will execute the query
         // and return the result set.
         // and return the result set.
         $fortunes = $query->all();
         $fortunes = $query->all();
 
 
-
-
         // stuffing in the dynamic data
         // stuffing in the dynamic data
-        $fortune = $fortunesTable->newEntity([
+        $fortune = $this->Fortune->newEntity([
             'id' => 0,
             'id' => 0,
             'message' => 'Additional fortune added at request time.'
             'message' => 'Additional fortune added at request time.'
         ]);
         ]);

+ 9 - 12
frameworks/PHP/cakephp/src/Controller/JsonController.php

@@ -4,19 +4,16 @@
 //
 //
 namespace App\Controller;
 namespace App\Controller;
 
 
-use Cake\Datasource\ConnectionManager;
+use Cake\Controller\Controller;
 
 
-class JsonController extends AppController {
+class JsonController extends Controller {
 
 
-     public function initialize()
-     {
-         parent::initialize();
-         $this->loadComponent('RequestHandler');
-     }
+    public function index() 
+    {
+        $data = ['message' => 'Hello, World!'];
 
 
-     public function index() {
-         $this->set('message', "Hello, World!");
-         $this->set('_serialize', array('message'));
-         $this->RequestHandler->renderAs($this, 'json');
-     }
+        return $this->response
+            ->withStringBody(\json_encode($data))
+            ->withType('application/json');
+    }
 }
 }

+ 5 - 12
frameworks/PHP/cakephp/src/Controller/PlaintextController.php

@@ -2,22 +2,15 @@
 
 
 namespace App\Controller;
 namespace App\Controller;
 
 
-class PlaintextController extends AppController {
+use Cake\Controller\Controller;
 
 
-    public function initialize()
-    {
-        parent::initialize();
-        $this->loadComponent('RequestHandler');
-    }
+class PlaintextController extends Controller {
 
 
     public function index() 
     public function index() 
     {
     {
-        $this->viewBuilder()->setLayout('plaintext');
-
-        $this->response = $this->response->withStringBody("Hello, World!");
-        $this->response = $this->response->withType('text/plain');
-
-        return $this->response;
+        return $this->response
+            ->withStringBody('Hello, World!')
+            ->withType('text/plain');
     }
     }
 
 
 }
 }

+ 24 - 37
frameworks/PHP/cakephp/src/Controller/WorldController.php

@@ -4,24 +4,17 @@
 //
 //
 namespace App\Controller;
 namespace App\Controller;
 
 
-use Cake\ORM\TableRegistry;
+use Cake\Controller\Controller;
 
 
-class WorldController extends AppController {
+class WorldController extends Controller {
 
 
-
-    public function initialize()
-    {
-        parent::initialize();
-        $this->loadComponent('RequestHandler');
-    }
+    protected $modelClass = 'World';
 
 
     protected function _getQueryCount()
     protected function _getQueryCount()
     {
     {
-        $query_count = $this->request->getQuery('queries');
+        $query_count = (int)$this->request->getQuery('queries');
 
 
-        $query_count = (int)$query_count;
-        if ($query_count === 0) 
-        {
+        if ($query_count === 0) {
             $query_count = 1;
             $query_count = 1;
         } elseif ($query_count > 500) {
         } elseif ($query_count > 500) {
             $query_count = 500;
             $query_count = 500;
@@ -32,58 +25,52 @@ class WorldController extends AppController {
 
 
     public function index() 
     public function index() 
     {
     {
-        $this->viewBuilder()->setLayout('plaintext');
         // Create an array with the response string.
         // Create an array with the response string.
-        $worlds = array();
-        $worldTable = TableRegistry::getTableLocator()->get('World');
+        $worlds = [];
         $query_count = $this->_getQueryCount();
         $query_count = $this->_getQueryCount();
 
 
         // For each query, store the result set values in the response array
         // For each query, store the result set values in the response array
         for ($i = 0; $i < $query_count; $i++) {
         for ($i = 0; $i < $query_count; $i++) {
-            $worlds[] = $worldTable->get(rand(1,10000));
+            $worlds[] = $this->World->get(rand(1,10000));
         }
         }
-	$this->set('worlds', $worlds);
+	    $this->set('worlds', $worlds);
 
 
-        $this->set('_serialize', 'worlds');
-        $this->RequestHandler->renderAs($this, 'json');
+        $this->viewBuilder()
+            ->setClassName('Json')
+            ->setOption('serialize', 'worlds');
     }
     }
 
 
     public function query()
     public function query()
     {
     {
-        $this->viewBuilder()->setLayout('plaintext');
-        $worldTable = TableRegistry::getTableLocator()->get('World');
-        $world = $worldTable->get(rand(1,10000));
+        $world = $this->World->get(rand(1,10000));
 
 
-        return $this->response->withType("application/json")->withStringBody(json_encode($world, JSON_FORCE_OBJECT));
+        return $this->response
+            ->withType('application/json')
+            ->withStringBody(\json_encode($world, JSON_FORCE_OBJECT));
     }
     }
 
 
     public function updates()
     public function updates()
     {
     {
-        $this->viewBuilder()->setLayout('plaintext');
-        $worldTable = TableRegistry::getTableLocator()->get('World');
-
         // Create an array with the response string.
         // Create an array with the response string.
-        $worlds = array();
+        $worlds = [];
 
 
         $query_count = $this->_getQueryCount();
         $query_count = $this->_getQueryCount();
 
 
         // For each query, store the result set values in the response array
         // For each query, store the result set values in the response array
-        for ($i = 0; $i < $query_count; $i++)
-        {
-            $world = $worldTable->get(rand(1,10000));
-
-            $newWorld = $worldTable->get(rand(1,10000));
-            $newWorld->randomNumber = mt_rand(1, 10000);
+        for ($i = 0; $i < $query_count; $i++) {
+            $world = $this->World->get(rand(1,10000));
+            $world->randomNumber = mt_rand(1, 10000);
 
 
-            $worldTable->save($newWorld);
+            $this->World->save($world);
             $worlds[] = $world;
             $worlds[] = $world;
-	}
+	    }
 
 
         // Return json list
         // Return json list
         $this->set('worlds', $worlds);
         $this->set('worlds', $worlds);
 
 
-        $this->set('_serialize', 'worlds');
-        $this->RequestHandler->renderAs($this, 'json');
+        $this->viewBuilder()
+            ->setClassName('Json')
+            ->setOption('serialize', 'worlds');
     }
     }
 
 
 }
 }

+ 1 - 7
frameworks/PHP/cakephp/src/Model/Table/FortuneTable.php

@@ -6,11 +6,5 @@ use Cake\ORM\Table;
 
 
 class FortuneTable extends Table
 class FortuneTable extends Table
 {
 {
-
-	protected $table = 'fortune';
-
-	public function initialize(array $config)
-	{
-
-	}
+	protected $_table = 'fortune';
 }
 }

+ 1 - 7
frameworks/PHP/cakephp/src/Model/Table/WorldTable.php

@@ -6,11 +6,5 @@ use Cake\ORM\Table;
 
 
 class WorldTable extends Table
 class WorldTable extends Table
 {
 {
-
-	protected $table = 'world';
-
-	public function initialize(array $config)
-	{
-
-	}
+	protected $_table = 'world';
 }
 }

+ 0 - 1
frameworks/PHP/cakephp/src/Template/Plaintext/index.ctp

@@ -1 +0,0 @@
-<?php echo $message; ?>

+ 19 - 19
frameworks/PHP/cakephp/src/Template/Layout/fortunes.ctp → frameworks/PHP/cakephp/templates/Fortunes/index.php

@@ -1,20 +1,20 @@
-<!DOCTYPE html>
-<html>
-<head><title>Fortunes</title></head>
-<body>
-<table>
-	<tr>
-		<th>id</th>
-		<th>message</th>
-	</tr>
-	<?php
-	foreach ($fortunes as $fortune) {
-		?>
-        <tr>
-            <td><?php echo $fortune->id; ?></td>
-            <td><?php echo h($fortune->message); ?></td>
-        </tr>
-	<?php } ?>
-</table>
-</body>
+<!DOCTYPE html>
+<html>
+<head><title>Fortunes</title></head>
+<body>
+<table>
+	<tr>
+		<th>id</th>
+		<th>message</th>
+	</tr>
+	<?php
+	foreach ($fortunes as $fortune) {
+		?>
+        <tr>
+            <td><?php echo $fortune->id; ?></td>
+            <td><?php echo h($fortune->message); ?></td>
+        </tr>
+	<?php } ?>
+</table>
+</body>
 </html>
 </html>

+ 0 - 0
frameworks/PHP/cakephp/src/Template/Layout/plaintext.ctp → frameworks/PHP/cakephp/templates/layout/default.php


+ 0 - 0
frameworks/PHP/cakephp/src/Template/Fortunes/index.ctp → frameworks/PHP/cakephp/tmp/cache/models/.gitkeep


+ 0 - 4
frameworks/PHP/cakephp/webroot/index.php

@@ -15,13 +15,9 @@
  * @license       MIT License (https://opensource.org/licenses/mit-license.php)
  * @license       MIT License (https://opensource.org/licenses/mit-license.php)
  */
  */
 
 
-// Check platform requirements
-require dirname(__DIR__) . '/config/requirements.php';
-
 // For built-in server
 // For built-in server
 if (PHP_SAPI === 'cli-server') {
 if (PHP_SAPI === 'cli-server') {
     $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
     $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
-
     $url = parse_url(urldecode($_SERVER['REQUEST_URI']));
     $url = parse_url(urldecode($_SERVER['REQUEST_URI']));
     $file = __DIR__ . $url['path'];
     $file = __DIR__ . $url['path'];
     if (strpos($url['path'], '..') === false && strpos($url['path'], '.') !== false && is_file($file)) {
     if (strpos($url['path'], '..') === false && strpos($url['path'], '.') !== false && is_file($file)) {