New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x Build and Pass with PHP7.2 #11619
Conversation
Now you are getting somewhere, errors become visible:
Seem to be the issues left for PHP7.2 compatibility. |
These are a big headache to fix. |
8e7c071
to
701519c
Compare
I didn't fail when I only ran
Probably related to the next ticket. |
…, 'user')` can't be executed, so delete.
// https://github.com/php/php-src/commit/a93a51c3bf4ea1638ce0adc4a899cb93531b9f0d | ||
if (version_compare(PHP_VERSION, '7.2.0', '>=')) { | ||
unset($sessionConfig['ini']['session.save_handler']); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I referred to the following code. However, I think it is PHP 7.2.0+ that this setting cannot be done
cakephp/src/Network/Session.php
Lines 111 to 114 in 8b3905a
// In PHP7.1.0+ session.save_handler can't be set to user by the user. | |
// https://github.com/php/php-src/blob/master/ext/session/session.c#L559 | |
if (!empty($sessionConfig['handler']) && version_compare(PHP_VERSION, '7.1.0', '<=')) { | |
$sessionConfig['ini']['session.save_handler'] = 'user'; |
- session.c on PHP 7.1.0: https://github.com/php/php-src/blob/php-7.1.0/ext/session/session.c#L549-L574
- session.c on PHP 7.2.0: https://github.com/php/php-src/blob/php-7.2.0/ext/session/session.c#L559-L563
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have the correct code here. There is an open issue for database sessions in PHP7.2 (#11628)
@@ -328,7 +328,7 @@ public function bakeActions($controllerName, $admin = null, $wannaUseSession = t | |||
* @param array $components Components to use in controller | |||
* @return string Baked controller | |||
*/ | |||
public function bake($controllerName, $actions = '', $helpers = null, $components = null) { | |||
public function bake($controllerName, $actions = '', $helpers = array(), $components = array()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a change to correct errors that occur in the following lines.
But it is not BC with existing applications.
Make null
be converted to array()
.
…gnature for backward compatibility.
$this->out("\n" . __d('cake_console', 'Baking controller class for %s...', $controllerName), 1, Shell::QUIET); | ||
|
||
if (is_null($helpers)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually favor $helpers === null
as it uses fewer function calls.
Refs #11346
In this Pull Request, Installed the
mcrypt
extension from pecl in the CI so that we can test it.pear config-set preferred_state snapshot
. Because pecl's mcrypt package issnapshot
, is notstable
https://pecl.php.net/package/mcryptpecl install
to execute first. Because failscomposer require "phpunit/phpunit=$PHPUNIT"