-
Notifications
You must be signed in to change notification settings - Fork 446
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
style(PHP): Upgrade fossology project from PHP 7 to PHP 8 #1925
Conversation
Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. signed-off-by: Sarita Singh<saritasingh.0425@gmail.com>
@GMishx I have change syntax incompatible with PHP 8 and now it's working fine for PHP 8 and all the CI. Is there any other change needed? |
The PR looks good 👍 But I see there was an error on |
If we ignore the |
The test files in You can keep the syntax changes done by you (as it does not fail any test case) but ignore the directory will be helpful for future when a new PHP version is out. |
@GMishx Okay I'll ignore the test file but in that case the checks will still fail for PHP 8.0. So should I exclude |
Oh, sorry for the confusion, the changes with the PHP can be ignored or can be kept, it does not matter at the moment. Just wanted to ignore the directory from the syntaxtest.sh itself for future incompatibility issues. |
@GMishx I have excluded |
Signed-off-by: Sarita Singh<saritasingh.0425@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good. Need to set setup on PHP8
@GMishx Thanks! Please let me know if it requires more changes. |
If something came up during testing, will put it here. :-) |
Unfortunately, the code is producing a lot of warnings when running on PHP8. I have captured the following logs for reference.
|
Okay I'll go through them and make the required changes. |
Is there a way to reproduce these errors locally? |
Yes, you can install PHP 8 and simply install FOSSology on top of it. If you do not want to install PHP-8, you can try chroot or create a Docker container on Debian and install PHP-8 from Ondřej Surý's repository apt-get install -y apt-transport-https lsb-release ca-certificates curl
curl --output /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
apt-get update |
I am unable to reproduce the logs on my local machines with php8. I am getting some of the given fo-postinstall warning but not all. Could you share me actual steps you have used for testing so that I can reproduce these errors and warnings locally? |
Maybe because you are upgrading an existing installation? But the fix should be same for all.
Sure, so I took the existing Dockerfile and modified it to install PHP8. Then I build a container out of it and captured all logs from it. |
@itssingh Please reopen, once you do some further work on this PR. |
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Commit 1 from fossology#1925 style(php):upgrade fossology from PHP7 to PHP8 Array and string offset access syntax with curly braces is no longer supported in PHP 8 so made replaced curly braces with []. Commit 2 from fossology#1925 refactor(syntaxtest.sh): Exclude testdata folder from syntax test Signed-off-by: Sarita Singh <saritasingh.0425@gmail.com> Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
Description
The project currently uses PHP 7.x and is partially incompatible with PHP 8. It would be preferable to upgrade this project to PHP 8 for better compatibility with the latest technologies.
signed-off-by: Sarita Singh saritasingh.0425@gmail.com
fixes #1920
Changes
replaced curly braces with [ ].
How to test
Run Syntax Checks for PHP8 using command: bash src/testing/syntax/syntaxtest.sh