pocketarc / codeigniter

Fork of CI3 kept up to date with PHP 8.3 (and beyond; will be maintained indefinitely).
MIT License
61 stars 14 forks source link

Backward compatibility between BCIT/CI 3.1.13 and Pocketarc/CI 3.2.0 #3

Closed pugelarouge closed 6 months ago

pugelarouge commented 8 months ago

Hello,

as per my email here are some incompatibilities I've found between main 3.1.13 and fork 3.2.0 (due to 3.2.0 being forked from BCIT/CI:dev-develop) - mainly here for the benefit of others, that's all that I have noticed, will update if I find any more

1 - The core CI_Model has had it's constructor removed (it didn't do anything useful but existed) ... in practice just means have to remove calls to parent->parent::__construct(); from all of my app's models.

2 - The router has had it's access methods removed ( fetch_directory(), fetch_class(), fetch_method() ) so you have to access the directory / class / method properties directly, again not a big deal just a case of changing $Router->fetch_directory() to $Router->directory etc...

TIA, Pugelarouge

pugelarouge commented 7 months ago

Hello,

Additionally, I've just noticed read_file() has been removed from the file helper ... again trivial to fix as just a wrapper to @file_get_content()

Thanks, P

jamieburchell commented 7 months ago

There are lots of differences between develop and the actual release. I wouldn't expect it to be compatible if basing releases off develop.

You should probably use another fork, or fork it yourself because forks can become opinionated about how they move forward. This is what I have recently done for the company I work at that still has CI 3 projects.

mckaygerhard commented 7 months ago

noted this now.. umm i started today to post some notes due that.. (i alredy proposed some check in #2 )

pocketarc commented 7 months ago

@pugelarouge I agree with you here - I got an email about another incompatibility, and will deal with it and the rest of the notes here; this fork will definitely revert as many incompatibilities introduced in 3.2.0 as I can.

The goal of this fork is to remain a maintenance version of CI3. No backward compatibility breaks, just whatever changes are necessary to keep it running smoothly for old projects that are simply not going to get rewritten in a new framework (CI4, Laravel, or whatever else).

I myself am running this on PHP 8.3 now as well, and it's all fine, so will be publishing 3.2.1 soon to make that clear.

@mckaygerhard Will look at the changes you've made, and integrate them if possible.

mckaygerhard commented 6 months ago

@pocketarc can you share with us about the incompatibilities you received.. maybe we have some ideas or prevous xperiences.. thanks in advance..

pocketarc commented 6 months ago

I've just pushed 3.2.1, which resolves the incompatibilities mentioned here. If anyone spots any other incompatibility that is affecting them, please raise a new issue so it can be dealt with!

poodle123 commented 5 months ago

I am using your CI 3.2.1 on PHP 8.3-latest FPM (8.3.4) (P+) with libmysql 8.0-latest (8.0.34) and have not found any errors yet during cache warming. APCu performs very well; not seeing any sort of issue with a load of 600+ cache requests per second.

Thanks for the work. Really appreciate it.

pocketarc commented 5 months ago

@poodle123 I'm glad it's been of use! There are lots of projects out there that were built with CI3 and aren't going to get rewritten, but they need to keep running on modern servers. I'm glad I can help with that, even just a little.

poodle123 commented 5 months ago

absolutely. i went one step further yesterday and replaced mt_rand() with random_int(PHP_INT_MIN, PHP_INT_MAX) in the system files to account for the deprecation of mt_rand() even though that is not yet required because i did the same for my application files. this just affects:

core\Common.php core\Security.php helpers\captcha_helper.php helpers\form_helper.php helpers\string_helper.php libraties\Upload.php

Hope we can maintain CI3 for the future. I am not really keen on porting my project to CI4

pocketarc commented 5 months ago

That sounds great - I would like to integrate that as well (but we'd need to make sure to use mt_rand if random_int isn't available, which it isn't in earlier versions of PHP that CI3 supports).

Would you be willing to raise that as a PR? If not, that's OK - I'll do it when I have a bit of time available!

mckaygerhard commented 5 months ago

your point is the correct @pocketarc you should address the availability of php5 , php7 and php8 .. please remmember that any backguard compatibility must be in the core/compat directory

you have the is_php function in core/Common.php file, that determines if current version of php is equal or greater than the supplied value as string, that uses the version_compare from php api and stores in CI private properties

i also noted you used the development version of CI3 and not the stable one.. that is not so good cos does not permit to sync the changes https://codeberg.org/codeigniter/codeigniterpower/commit/3c9fcc86565c1a074e8be47a83541221154b1a8c already addresed at https://github.com/codeigniterpower/codeigniterpower/commit/3c9fcc86565c1a074e8be47a83541221154b1a8c