Giter VIP home page Giter VIP logo

cakephp-1.3.21's Introduction

CakePHP 1.3 for PHP 7.3+

An unofficial port of CakePHP 1.3.21 to PHP 7.3+

Build Status

โš ๏ธ Only use this code, if you have an active CakePHP 1.3 version that you have to port to PHP 8! Otherwise use a current CakePHP version!

Getting Started

  1. Make sure your code is PHP 7.3 or newer ready.
  2. If you made any changes in the cake-directory, that you want to reapply in this newer PHP version, write them down.
  3. Delete your cake-directory.
  4. Copy only the cake-directory from this repository to your existing installation.
  5. Reapply the changes you wrote down in step 2.
  6. Find and fix problems related to the changes described below.

Porting CakePHP to recent PHP versions required the introduction of some breaking changes. Make sure you update your own code according to the following changes:

Renamed classes

Two classes had to be renamed:

  • The class String has been renamed to CakeString
  • The class Object has been renamed to CakeObject

Renamed class functions

Three class functions had to be renamed:

  • JsHelper->value() has been renamed to JsHelper->jsonValue()
  • JavascriptHelper->value() has been renamed to JavascriptHelper->jsonValue()
  • JsBaseEngineHelper->value() has been renamed to JsBaseEngineHelper->jsonValue()

Renamed files

One file had to be renamed:

  • "cake/libs/error.php" has been renamed to "cake/libs/error_handler.php": Change any App::import('Core', 'Error') to App::import('Core', 'ErrorHandler')

Removed database drivers

Two database drivers had to be removed:

  • "mysql" (replace with "mysqli")
  • "mssql"

Necessary configuration changes

One configuration variable has to be changed:

  • "Security.cipherSeed" must be a valid int instead of a string. Make sure, it is small enough to be treated like an int, and not like a float on your system. Otherwise cookies will not be decoded correctly!

MySQL

The sql-mode ONLY_FULL_GROUP_BY must be disabled. CakePHP creates queries that are incompatible with this mode.

Postgres

The method lastInsertId() with a second parameter had to be renamed to lastInsertX() due to inheritance

New possible configuration options

Two new options are possible:

  • "Session.cookie_samesite" sets the SameSite-cookie-parameter. Defaults to "Lax". Requires PHP 7.3+ to work.
  • "Session.httpOnly" sets the HttpOnly cookie parameter.

CookieComponent

The CookieComponent now supports the SameSite-attribute.

In your controller set it like this: $this->Cookie->samesite = "None";

Note: Value of "None" will not be sent to incompatible clients like Safari, in order to keep the intended behavior. Defaults to "Lax".

Running the tests

Core-tests have been ported to PHP 7.3+.

To run any tests, you need a Simpletest 1.0.1 version with PHP 7 support in the vendors-directory.

Notes:

  • The original CakePHP 1.3 developers noted, that the core-tests cannot be run all at once. You need to run them individually, or they will fail.
  • Some core-tests will fail, if you are not using a dedicated test-database. These are shortcomings in the test-cases.
  • Some core-tests fail randomly, that's why they are being excluded from travis.

Contributing

Please issue a pull request if you want to contribute.

cakephp-1.3.21's People

Contributors

markstory avatar phpnut avatar nateabele avatar jperras avatar felixge avatar lorenzo avatar renan avatar predominant avatar admad avatar littleant avatar jrbasso avatar ceeram avatar mariuswilms avatar vincentreitz avatar phally avatar star-szr avatar skie avatar dogmatic69 avatar ozzyogkush avatar mariano avatar bar avatar voidet avatar jippi avatar lapenz avatar farhadi avatar sime avatar evilbloodydemon avatar rchavik avatar mekhtiari avatar torifat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.