Skip to content

gas.php exception_handler exception in php7 #38

@Bruehdiger

Description

@Bruehdiger

The requirements for gas-orm say PHP >= 5.3, but it's not quite compatible with php7.

In libraries/gas.php the exception-handler expects the type "Exception", which throws an exception in php7, if an error in occurs in gas.php and the custom exception-handler is called.
A fix for php7 would be the exception-handler to expect the type "Throwable", which is implemented by "Exception" and "Error", but this wouldn't be backwards compatible to php5.
For compability to php5 and 7, you should remove the type declaration from the handler.

Result would be:
old:
public function exception(Exception $e)

new:
public function exception($e)

This should solve the problem according to php documentation.

Sources:
http://php.net/manual/de/migration70.incompatible.php
http://php.net/manual/en/class.throwable.php

Also, libraries/gas.php should be libraries/Gas.php so CodeIgniter actually can autoload it (at least on *nix, where stuff is case sensitive)

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