From 8c5e18e699ddeb11f89c1baff75e782724dc9031 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 11:17:08 +0200 Subject: [PATCH 01/10] Update Readme --- readme.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.rst b/readme.rst index 8cddbefc34..585ad12626 100644 --- a/readme.rst +++ b/readme.rst @@ -20,7 +20,7 @@ https://github.com/NielBuys/CodeIgniter/releases Server Requirements ******************* -PHP version 7.2 or newer (PHP 8.2 ready) is recommended. +PHP version 7.2 or newer (PHP 8.3 ready) is recommended. ************ Installation From 7c4cabfa291f6c6688c490bdf4f61875b98bbe94 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 11:27:09 +0200 Subject: [PATCH 02/10] Change Composer description --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b3aef781a4..45ea4989c3 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "description": "The CodeIgniter framework", + "description": "Fork of CodeIgniter 3", "name": "nielbuys/framework", "type": "project", "homepage": "https://codeigniter.com", From 494a84f2ba71cbe1c15b8769184357f31823ba72 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 11:51:55 +0200 Subject: [PATCH 03/10] Remove encryption test --- tests/codeigniter/libraries/Encryption_test.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/codeigniter/libraries/Encryption_test.php b/tests/codeigniter/libraries/Encryption_test.php index 68bc3d804d..13d9a2b9b5 100644 --- a/tests/codeigniter/libraries/Encryption_test.php +++ b/tests/codeigniter/libraries/Encryption_test.php @@ -207,9 +207,6 @@ public function test_initialize_encrypt_decrypt() $this->assertEquals($message, $this->encryption->decrypt($this->encryption->encrypt($message))); - // Try DES in ECB mode, just for the sake of changing stuff - $this->encryption->initialize(array('cipher' => 'des', 'mode' => 'ecb', 'key' => substr($key, 0, 8))); - $this->assertEquals($message, $this->encryption->decrypt($this->encryption->encrypt($message))); } // -------------------------------------------------------------------- From d2bd14af4d57281d4466251265ba04d41ccdc657 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 13:46:45 +0200 Subject: [PATCH 04/10] Test updated --- .github/workflows/test-phpunit.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 9c36dddeb9..3d97656b09 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -12,10 +12,28 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.2', '8.1', '8.0', '7.4', '7.3', '7.2'] + php: [ '8.3', '8.2', '8.1', '8.0', '7.4'] DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ] compiler: [ default ] include: + - php: '8.3' + DB: 'pdo/mysql' + compiler: jit + - php: '8.3' + DB: 'pdo/pgsql' + compiler: jit + - php: '8.3' + DB: 'pdo/sqlite' + compiler: jit + - php: '8.3' + DB: 'mysqli' + compiler: jit + - php: '8.3' + DB: 'pgsql' + compiler: jit + - php: '8.3' + DB: 'sqlite' + compiler: jit - php: '8.2' DB: 'pdo/mysql' compiler: jit From 98e6dd2d6aaf8ee1db1923c27ff83f3b5fc5fa90 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 14:02:36 +0200 Subject: [PATCH 05/10] Fix test --- tests/codeigniter/core/Loader_test.php | 28 ++++++++++----------- tests/codeigniter/libraries/Driver_test.php | 8 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/codeigniter/core/Loader_test.php b/tests/codeigniter/core/Loader_test.php index 5fc4735ea5..94491f396a 100644 --- a/tests/codeigniter/core/Loader_test.php +++ b/tests/codeigniter/core/Loader_test.php @@ -36,7 +36,7 @@ public function test_library() // Test loading as an array. $this->assertInstanceOf('CI_Loader', $this->load->library(array($lib))); $this->assertTrue(class_exists($class), $class.' does not exist'); - $this->assertObjectHasAttribute($lib, $this->ci_obj); + $this->assertObjectHasProperty($lib, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$lib); // Create library in VFS @@ -88,21 +88,21 @@ public function test_library_extension() $this->assertInstanceOf('CI_Loader', $this->load->library($lib)); $this->assertTrue(class_exists($class), $class.' does not exist'); $this->assertTrue(class_exists($ext), $ext.' does not exist'); - $this->assertObjectHasAttribute($name, $this->ci_obj); + $this->assertObjectHasProperty($name, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$name); $this->assertInstanceOf($ext, $this->ci_obj->$name); // Test reloading with object name $obj = 'exttest'; $this->assertInstanceOf('CI_Loader', $this->load->library($lib, NULL, $obj)); - $this->assertObjectHasAttribute($obj, $this->ci_obj); + $this->assertObjectHasProperty($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$obj); $this->assertInstanceOf($ext, $this->ci_obj->$obj); // Test reloading unset($this->ci_obj->$name); $this->assertInstanceOf('CI_Loader', $this->load->library($lib)); - $this->assertObjectHasAttribute($name, $this->ci_obj); + $this->assertObjectHasProperty($name, $this->ci_obj); // Create baseless library $name = 'ext_baseless_lib'; @@ -140,7 +140,7 @@ public function test_library_config() $obj = 'testy'; $this->assertInstanceOf('CI_Loader', $this->load->library($lib, NULL, $obj)); $this->assertTrue(class_exists($class), $class.' does not exist'); - $this->assertObjectHasAttribute($obj, $this->ci_obj); + $this->assertObjectHasProperty($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$obj); $this->assertEquals($cfg, $this->ci_obj->$obj->config); @@ -172,7 +172,7 @@ public function test_load_library_in_application_dir() // Was the model class instantiated. $this->assertTrue(class_exists($class), $class.' does not exist'); - $this->assertObjectHasAttribute($lib, $this->ci_obj); + $this->assertObjectHasProperty($lib, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$lib); } @@ -193,13 +193,13 @@ class_exists('CI_Driver_Library', TRUE); // Test loading as an array. $this->assertInstanceOf('CI_Loader', $this->load->driver(array($driver))); $this->assertTrue(class_exists($class), $class.' does not exist'); - $this->assertObjectHasAttribute($driver, $this->ci_obj); + $this->assertObjectHasProperty($driver, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$driver); // Test loading as a library with a name $obj = 'testdrive'; $this->assertInstanceOf('CI_Loader', $this->load->library($driver, NULL, $obj)); - $this->assertObjectHasAttribute($obj, $this->ci_obj); + $this->assertObjectHasProperty($obj, $this->ci_obj); $this->assertInstanceOf($class, $this->ci_obj->$obj); // Test a string given to params @@ -222,7 +222,7 @@ public function test_models() // Was the model class instantiated. $this->assertTrue(class_exists($model)); - $this->assertObjectHasAttribute($model, $this->ci_obj); + $this->assertObjectHasProperty($model, $this->ci_obj); // Test no model given $this->assertInstanceOf('CI_Loader', $this->load->model('')); @@ -248,8 +248,8 @@ public function test_model_subdir() // Was the model class instantiated? $this->assertTrue(class_exists($model)); - $this->assertObjectHasAttribute($name, $this->ci_obj); - $this->assertObjectHasAttribute($name, $this->ci_obj); + $this->assertObjectHasProperty($name, $this->ci_obj); + $this->assertObjectHasProperty($name, $this->ci_obj); $this->assertInstanceOf($base, $this->ci_obj->$name); $this->assertInstanceOf($model, $this->ci_obj->$name); @@ -575,17 +575,17 @@ public function test_initialize() // Verify library $this->assertTrue(class_exists($lib_class), $lib_class.' does not exist'); - $this->assertObjectHasAttribute($lib, $this->ci_obj); + $this->assertObjectHasProperty($lib, $this->ci_obj); $this->assertInstanceOf($lib_class, $this->ci_obj->$lib); // Verify driver $this->assertTrue(class_exists($drv_class), $drv_class.' does not exist'); - $this->assertObjectHasAttribute($drv, $this->ci_obj); + $this->assertObjectHasProperty($drv, $this->ci_obj); $this->assertInstanceOf($drv_class, $this->ci_obj->$drv); // Verify model $this->assertTrue(class_exists($model), $model.' does not exist'); - $this->assertObjectHasAttribute($model, $this->ci_obj); + $this->assertObjectHasProperty($model, $this->ci_obj); $this->assertInstanceOf($model, $this->ci_obj->$model); // Verify config calls diff --git a/tests/codeigniter/libraries/Driver_test.php b/tests/codeigniter/libraries/Driver_test.php index ea5cfa235f..5089bb851e 100644 --- a/tests/codeigniter/libraries/Driver_test.php +++ b/tests/codeigniter/libraries/Driver_test.php @@ -51,12 +51,12 @@ public function test_load_driver() $this->assertEquals($this->name, $this->lib->get_name()); // Was driver loaded? - $this->assertObjectHasAttribute($driver, $this->lib); + $this->assertObjectHasProperty($driver, $this->lib); $this->assertInstanceOf($class, $this->lib->$driver); $this->assertInstanceOf('CI_Driver', $this->lib->$driver); // Was decorate called? - $this->assertObjectHasAttribute($prop, $this->lib->$driver); + $this->assertObjectHasProperty($prop, $this->lib->$driver); $this->assertTrue($this->lib->$driver->$prop); // Do we get an error for an invalid driver? @@ -86,7 +86,7 @@ public function test_load_app_driver() $this->assertNotNull($this->lib->load_driver($driver)); // Was driver loaded? - $this->assertObjectHasAttribute($driver, $this->lib); + $this->assertObjectHasProperty($driver, $this->lib); $this->assertInstanceOf($class, $this->lib->$driver); $this->assertInstanceOf('CI_Driver', $this->lib->$driver); @@ -120,7 +120,7 @@ public function test_load_driver_ext() $this->assertNotNull($this->lib->load_driver($driver)); // Was driver loaded? - $this->assertObjectHasAttribute($driver, $this->lib); + $this->assertObjectHasProperty($driver, $this->lib); $this->assertInstanceOf($class, $this->lib->$driver); $this->assertInstanceOf($baseclass, $this->lib->$driver); $this->assertInstanceOf('CI_Driver', $this->lib->$driver); From 381b2f252647eabddc9a34d0ec1d9723ef1b9f19 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 14:04:43 +0200 Subject: [PATCH 06/10] Update Actions --- .github/workflows/test-phpunit.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 3d97656b09..83c0774217 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -113,7 +113,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Override PHP ini values for JIT compiler if: matrix.compiler == 'jit' run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV @@ -131,7 +131,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} From 3c771b941dfb95d3c3fdcf52164d6f68ea7d0754 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 14:39:28 +0200 Subject: [PATCH 07/10] Fix test --- .github/workflows/test-phpunit.yml | 4 ++-- tests/codeigniter/helpers/text_helper_test.php | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 83c0774217..7cc1a295fa 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -113,7 +113,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Override PHP ini values for JIT compiler if: matrix.compiler == 'jit' run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV @@ -131,7 +131,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php index 5be1837b88..07b7015b6e 100644 --- a/tests/codeigniter/helpers/text_helper_test.php +++ b/tests/codeigniter/helpers/text_helper_test.php @@ -101,7 +101,15 @@ public function test_censored_words() public function test_highlight_code() { - $expect = "\n<?php var_dump(\$this); ?> \n\n"; + if (substr(PHP_VERSION, 0, 3) >= '8.3') + { + $expect = "
<?php var_dump($this); ?> ?>
"; + } + else + { + $expect = "\n<?php var_dump(\$this); ?> \n\n"; + } + $this->assertEquals($expect, highlight_code('')); } From fe559fa28df0f3dd404595c867ce6c3a8bb68fcd Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 14:45:20 +0200 Subject: [PATCH 08/10] Fix test --- tests/codeigniter/helpers/text_helper_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php index 07b7015b6e..da98bb513d 100644 --- a/tests/codeigniter/helpers/text_helper_test.php +++ b/tests/codeigniter/helpers/text_helper_test.php @@ -103,7 +103,7 @@ public function test_highlight_code() { if (substr(PHP_VERSION, 0, 3) >= '8.3') { - $expect = "
<?php var_dump($this); ?> ?>
"; + $expect = "
<?php var_dump(\$this); ?> ?>
"; } else { From 9954a518302f75029b33327af85db3febabd8354 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 14:52:58 +0200 Subject: [PATCH 09/10] Fix action warning --- .github/workflows/test-phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 7cc1a295fa..5e54e1bc88 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -129,7 +129,7 @@ jobs: - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v4 with: From ccd42e6c50fba99f780f0aad8d4f10ba74ca7772 Mon Sep 17 00:00:00 2001 From: Niel Buys Date: Wed, 28 Feb 2024 15:14:46 +0200 Subject: [PATCH 10/10] Minimum php now 7.4 --- composer.json | 2 +- readme.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 45ea4989c3..dcfeb44da6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "source": "https://github.com/bcit-ci/CodeIgniter" }, "require": { - "php": ">=7.2" + "php": ">=7.4" }, "suggest": { "paragonie/random_compat": "Provides better randomness in PHP 5.x" diff --git a/readme.rst b/readme.rst index 585ad12626..cd4f1cc008 100644 --- a/readme.rst +++ b/readme.rst @@ -20,7 +20,7 @@ https://github.com/NielBuys/CodeIgniter/releases Server Requirements ******************* -PHP version 7.2 or newer (PHP 8.3 ready) is recommended. +PHP version 7.4 or newer (PHP 8.3 ready) is recommended. ************ Installation