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

Adding PHP 8.2 support #6173

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
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
20 changes: 19 additions & 1 deletion .github/workflows/test-phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,28 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4']
php: [ '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4']
DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ]
compiler: [ default ]
include:
- php: '8.2'
DB: 'pdo/mysql'
compiler: jit
- php: '8.2'
DB: 'pdo/pgsql'
compiler: jit
- php: '8.2'
DB: 'pdo/sqlite'
compiler: jit
- php: '8.2'
DB: 'mysqli'
compiler: jit
- php: '8.2'
DB: 'pgsql'
compiler: jit
- php: '8.2'
DB: 'sqlite'
compiler: jit
- php: '8.1'
DB: 'pdo/mysql'
compiler: jit
Expand Down
1 change: 1 addition & 0 deletions system/core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/general/controllers.html
*/
#[AllowDynamicProperties]
class CI_Controller {

/**
Expand Down
1 change: 1 addition & 0 deletions system/core/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/libraries/loader.html
*/
#[AllowDynamicProperties]
class CI_Loader {

// All these are set automatically. Don't mess with them.
Expand Down
7 changes: 7 additions & 0 deletions system/core/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ class CI_Router {
*/
public $config;

/**
* CI_URI class object
*
* @var object
*/
public $uri;

/**
* List of routes
*
Expand Down
7 changes: 7 additions & 0 deletions system/core/URI.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
*/
class CI_URI {

/**
* CI_Config instance
*
* @var CI_Config
*/
public $config;

/**
* List of cached URI segments
*
Expand Down
1 change: 1 addition & 0 deletions system/database/DB_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/database/
*/
#[AllowDynamicProperties]
abstract class CI_DB_driver {

/**
Expand Down
2 changes: 1 addition & 1 deletion system/database/drivers/postgre/postgre_forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function __construct(&$db)

if (version_compare($this->db->version(), '9.0', '>'))
{
$this->create_table_if = 'CREATE TABLE IF NOT EXISTS';
$this->_create_table_if = 'CREATE TABLE IF NOT EXISTS';
}
}

Expand Down
1 change: 1 addition & 0 deletions system/libraries/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* @author EllisLab Dev Team
* @link
*/
#[AllowDynamicProperties]
class CI_Driver_Library {

/**
Expand Down
8 changes: 8 additions & 0 deletions system/libraries/Image_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ class CI_Image_lib {
*/
public $new_image = '';


/**
* Path to destination image
*
* @var string
*/
public $dest_image = '';

/**
* Image width
*
Expand Down
4 changes: 2 additions & 2 deletions system/libraries/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ protected function _compile_template()
return;
}

$this->temp = $this->_default_template();
$temp = $this->_default_template();
foreach (array('table_open', 'thead_open', 'thead_close', 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'tbody_open', 'tbody_close', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val)
{
if ( ! isset($this->template[$val]))
{
$this->template[$val] = $this->temp[$val];
$this->template[$val] = $temp[$val];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/codeigniter/core/Loader_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function test_library_config()
// Create library in VFS
$lib = 'unit_test_config_lib';
$class = 'CI_'.ucfirst($lib);
$content = '<?php class '.$class.' { public function __construct($params) { $this->config = $params; } }';
$content = "<?php \n#[AllowDynamicProperties]\nclass ".$class.' { public function __construct($params) { $this->config = $params; } }';
$this->ci_vfs_create(ucfirst($lib), $content, $this->ci_base_root, 'libraries');

// Create config file
Expand Down
7 changes: 4 additions & 3 deletions tests/codeigniter/libraries/Upload_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ function test_data()
$data = array(
'file_name' => 'hello.txt',
'file_type' => 'text/plain',
'file_path' => '/tmp/',
'full_path' => '/tmp/hello.txt',
'raw_name' => 'hello',
'orig_name' => 'hello.txt',
'client_name' => '',
'file_ext' => '.txt',
Expand All @@ -80,6 +77,10 @@ function test_data()
$this->upload->{$k} = $v;
}

$data['file_path'] = '/tmp/';
$data['full_path'] = '/tmp/hello.txt';
$data['raw_name'] = 'hello';

$this->assertEquals('hello.txt', $this->upload->data('file_name'));
$this->assertEquals($data, $this->upload->data());
}
Expand Down
1 change: 1 addition & 0 deletions tests/mocks/ci_testcase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

#[AllowDynamicProperties]
class CI_TestCase extends \PHPUnit\Framework\TestCase {

public $ci_vfs_root;
Expand Down
Loading