Skip to content

Commit

Permalink
add composer patches for ci3 & ci-phpunit-test (with vaimo/composer-p…
Browse files Browse the repository at this point in the history
…atches)
  • Loading branch information
tenzap committed Feb 17, 2024
1 parent 29796d5 commit 1dbac23
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 0 deletions.
33 changes: 33 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"league/csv": "^8.2 || ^9.5",
"datto/json-rpc-http": "^4.0 || ^5.0",
"kissifrot/php-ixr": "1.8.*",
"vaimo/composer-patches": "4.22.4 || ^5",
"econea/nusoap": "^0.9.5.1"
},
"require-dev": {
Expand All @@ -29,5 +30,37 @@
"ext-mysqli": "To connect to a MySQL database",
"ext-pgsql": "To connect to a PostgreSQL database",
"ext-sqlite3": "To connect to a SQLite3 database"
},
"extra": {
"patches-base": "patches/{{VendorName}}_{{ModuleName}}/{{version}}/{{file}}",
"patches": {
"codeigniter/framework": {
"Add support for PHP 8.2 (part1)": {
"source": "10-php82_support.patch",
"version": [
"=v3.1.13"
]
},
"Add support for PHP 8.2 (part2)": {
"source": "10-php82_support-part2.patch",
"version": [
"=v3.1.13"
]
}
},
"kenjis/ci-phpunit-test": {
"Add support for PHP 8.2": {
"source": "support_php-8.2.patch",
"version": [
"=v3.0.4"
]
}
}
}
},
"config": {
"allow-plugins": {
"vaimo/composer-patches": true
}
}
}
20 changes: 20 additions & 0 deletions patches/Codeigniter_Framework/v3.1.13/10-php82_support-part2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
From 2fc2d480d0d3fc778a46ded0e093fef7a0d84257 Mon Sep 17 00:00:00 2001
From: George Petculescu <[email protected]>
Date: Fri, 3 Nov 2023 11:59:40 +0200
Subject: [PATCH] Fixes the usage of `_create_table_if` in Postgres forge class

---
system/database/drivers/postgre/postgre_forge.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -87,7 +87,7 @@

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';
}
}

123 changes: 123 additions & 0 deletions patches/Codeigniter_Framework/v3.1.13/10-php82_support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
From fb1256a5b009b6264fbc85be44e0d97654d3fcd9 Mon Sep 17 00:00:00 2001
From: George Petculescu <[email protected]>
Date: Sun, 6 Nov 2022 16:13:43 +0200
Subject: [PATCH] Adding PHP 8.2 support

---
.github/workflows/test-phpunit.yml | 20 +++++++++++++++++++-
system/core/Loader.php | 1 +
system/core/URI.php | 7 +++++++
system/database/DB_driver.php | 1 +
system/libraries/Driver.php | 1 +
system/libraries/Table.php | 4 ++--
tests/codeigniter/core/Loader_test.php | 2 +-
tests/codeigniter/libraries/Upload_test.php | 7 ++++---
tests/mocks/ci_testcase.php | 1 +
9 files changed, 37 insertions(+), 7 deletions(-)

--- a/system/core/Loader.php
+++ b/system/core/Loader.php
@@ -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.
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -52,6 +52,13 @@
class CI_URI {

/**
+ * CI_Config instance
+ *
+ * @var CI_Config
+ */
+ public $config;
+
+ /**
* List of cached URI segments
*
* @var array
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -51,6 +51,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/database/
*/
+#[AllowDynamicProperties]
abstract class CI_DB_driver {

/**
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -50,6 +50,7 @@
* @author EllisLab Dev Team
* @link
*/
+#[AllowDynamicProperties]
class CI_Driver_Library {

/**
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -489,12 +489,12 @@
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];
}
}
}
--- a/system/core/Controller.php
+++ b/system/core/Controller.php
@@ -50,6 +50,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/general/controllers.html
*/
+#[AllowDynamicProperties]
class CI_Controller {

/**
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -59,6 +59,13 @@
public $config;

/**
+ * CI_URI class object
+ *
+ * @var object
+ */
+ public $uri;
+
+ /**
* List of routes
*
* @var array
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -85,6 +85,14 @@
*/
public $new_image = '';

+
+ /**
+ * Path to destination image
+ *
+ * @var string
+ */
+ public $dest_image = '';
+
/**
* Image width
*
10 changes: 10 additions & 0 deletions patches/Kenjis_CiPhpunitTest/v3.0.4/support_php-8.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php
+++ b/application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php
@@ -21,6 +21,7 @@
* @property CIPHPUnitTestDouble $double
* @property CIPHPUnitTestReflection $reflection
*/
+#[AllowDynamicProperties]
class CIPHPUnitTestCase extends TestCase
{
protected $_error_reporting = -1;

0 comments on commit 1dbac23

Please sign in to comment.