Skip to content
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

PHP 8.3 compatibility #4553

Merged
merged 9 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- "8.0"
- "8.1"
- "8.2"
- "8.3"

services:
mysql:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Version 1.1.30 under development
- Bug #4547: PHP 8 compatibility: Fix deprecation in CCaptcha when using Imagick extension (apphp)
- Bug #4541: PHP 8 compatibility: Fix deprecation in MarkdownParser (mdeweerd)
- Bug #4544: PHP 8 compatibility: Fix deprecation in CLocale (apphp)
- Enh #4552: Added support for PHP 8.3 (sandippingle, ThePepster, marcovtwout)

Version 1.1.29 November 14, 2023
--------------------------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Thank you for choosing Yii - a high-performance component-based PHP framework.
and will only receive necessary security fixes and fixes to adjust the code for compatibility with PHP 7 and 8 if they do not cause breaking changes.
This allows you to keep your servers PHP version up to date in the environments where old Yii 1.1 applications are hosted and stay within the [version ranges supported by the PHP team](http://php.net/supported-versions.php).
>
> Currently tested and supported [up to PHP 8.2](https://github.com/yiisoft/yii/blob/master/.github/workflows/build.yml#L34).
> Currently tested and supported [up to PHP 8.3](https://github.com/yiisoft/yii/blob/master/.github/workflows/build.yml#L34).

INSTALLATION
------------
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
"phpunit/phpunit": {
"Fix PHP 7 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php7.patch",
"Fix PHP 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php8.patch",
"Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php81.patch"
"Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php81.patch",
"Fix PHP 8.3 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php83.patch"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions framework/base/CApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ public function getLocaleDataPath()
*/
public function setLocaleDataPath($value)
{
$property=new ReflectionProperty($this->localeClass,'dataPath');
$property->setValue($value);
$class=new ReflectionClass($this->localeClass);
$class->setStaticPropertyValue('dataPath',$value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion framework/utils/CVarDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function dumpAsString($var,$depth=10,$highlight=false)
if($highlight)
{
$result=highlight_string("<?php\n".self::$_output,true);
self::$_output=preg_replace('/&lt;\\?php<br \\/>/','',$result,1);
self::$_output=preg_replace('/&lt;\\?php(<br \\/>|\\n)/','',$result,1);
}
return self::$_output;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/framework/web/CCookieCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function testConstructorCookieBuilding()
}
/**
* @runInSeparateProcess
* @preserveGlobalState disabled
* @outputBuffering enabled
*/
public function testAdd()
Expand All @@ -59,6 +60,7 @@ public function testAdd()
}
/**
* @runInSeparateProcess
* @preserveGlobalState disabled
* @outputBuffering enabled
*/
public function testRemove()
Expand Down
1 change: 1 addition & 0 deletions tests/framework/web/CHttpSessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ protected function checkProb($gcProb) {
* @covers CHttpSession::setGCProbability
*
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function testSetGet() {
Yii::app()->setComponents(array('session' => array(
Expand Down
2 changes: 2 additions & 0 deletions tests/framework/web/auth/CWebUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function booleanProvider()

/**
* @runInSeparateProcess
* @preserveGlobalState disabled
* @outputBuffering enabled
* @dataProvider booleanProvider
*/
Expand Down Expand Up @@ -59,6 +60,7 @@ public function testLoginLogout($destroySession)

/**
* @runInSeparateProcess
* @preserveGlobalState disabled
* @outputBuffering enabled
*/
public function testCheckAccess()
Expand Down