Transform the IPF Classlibrary to PSR-4 and PHP 8.2 - #1701
Conversation
…t to test thoroughly
…omposer, but that is not yet implemented for HTMLPurifier
Co-authored-by: Raimondas Rimkevičius <github@mekdrop.name>
…unused dev dependencies, and clean up scripts
no license info than the wrong info
the autoloader in the vendor folder.
Use === to compare $entry against '.' and '..' to avoid type coercion and ensure exact string matches.
Return success from copyRecursive and add a recursive flag to getFileCount. When validating vendor copies, verify autoload.php SHA-1 and compare recursive file counts; remove partial copies and return a descriptive error if verification fails.
Apply coding-style cleanup (short array syntax, spacing, brace placement, normalized quotes) and replace the legacy SIMPLEPIE_LOCATOR_NONE with \SimplePie\SimplePie::LOCATOR_NONE.
Determine protocol from HTTPS, default HTTP_HOST to 'localhost' when absent, and examine PHP_SELF, REQUEST_URI (path only), and SCRIPT_NAME for the script path. Sanitize values with htmlentities and fall back to an empty base if no path info is available.
…ove method signatures
…ith strict types for Config category
…vider annotations
|
I'm doing a separate push of every part of the library, one folder at a time. Every part should also have associated tests to verify that the alias exists and the legacy code should keep working. |
|
This is a lot of work! I have been scrolling through the file differences and it all seems quite solid. As we move forward with this, there is a nagging consideration - file systems that are case sensitive will see all these as new folders and files and there will be a lot of cleanup to do. |
|
Thanks! It is quite mechanical work, but I want to verify everything manually and not let AI handle this all alone. |
|
Renaming icms to Icms would be part of the process - also would need to rename all the folders and files beneath it. Maybe it would be easier to rename the existing folder to icms_legacy (or something similar) and add everything in a new Icms folder Oh - and thank you for putting your expertise ahead of AI! |
|
going from icms to icms_legacy also means renaming folders, which is the tricky thing we're trying to avoid if possible. Perhaps keep all the original files as legacy, with only the class alias in them? And the PSR-4 transformed files would go into a composer library from the start, or a group of composer libraries, depending on how we structure this |
|
Maybe I'm not looking at it properly. In the list of changes for this PR, files and folders are being removed from /icms/ and added to /Icms/, which is the desired result. Where the challenge will be is on a non-case-sensitive operating system and being able to determine what you're dealing with during an upgrade. |
|
I believe that is how Git interprets a rename of a folder : remove and add again of the files in those folders, as Git only stores the content of files. A folder without a file in it can't be managed by Git. |
Transform the existing classlibrary to PSR-4 structure and PHP 8.2+.
This builds on the changes in https://github.com/fiammybe/impresscms/tree/ipf-to-composer