Skip to content

Commit

Permalink
Merge pull request #4553 from yiisoft/php-8.3-compatibility
Browse files Browse the repository at this point in the history
PHP 8.3 compatibility
  • Loading branch information
marcovtwout authored Sep 20, 2024
2 parents b2c129b + ddb22ad commit 9d0b1ff
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 5 deletions.
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](https://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

0 comments on commit 9d0b1ff

Please sign in to comment.