Skip to content

Changes required for migration from PHP 7.4.x to PHP 8.1.x #16

@petersm3

Description

@petersm3

Summary

Changes required to codebase moving from PHP 7.4.x to PHP 8.1.x

lightvc.php

https://github.com/awbush/lightvc/blob/master/modules/lightvc/lightvc.php#L1183

Apache logs: "PHP Fatal error: Uncaught Error: Unknown named parameter $page_name in ... lightvc.php"

Convert array of parameters to an indexed array (losing the keys) resulting in positional args using array_values()

From:

call_user_func_array(array($this, $func), $actionParams);

To:

call_user_func_array(array($this, $func), array_values($actionParams));

beforeAction()

If calling beforeAction() per https://github.com/awbush/lightvc/blob/master/modules/lightvc/docs/user_guide/controllers.md#execute-code-beforeafter-an-action

Apache logs: "PHP Fatal error: Cannot use "parent" when current class scope has no parent in ..."

Remove parent:: from all calls, e.g.,

From:

    protected function beforeAction() {
        parent::beforeAction(); // chain to parent
    }

To:

    protected function beforeAction() {
        beforeAction(); // chain to parent
    }

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions