Skip to content
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

gas.php exception_handler exception in php7 #38

Open
Bruehdiger opened this issue Aug 31, 2016 · 0 comments
Open

gas.php exception_handler exception in php7 #38

Bruehdiger opened this issue Aug 31, 2016 · 0 comments

Comments

@Bruehdiger
Copy link

Bruehdiger commented Aug 31, 2016

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)

@Bruehdiger Bruehdiger changed the title gas.php set_exception_handler exception in php7 gas.php exception_handler exception in php7 Aug 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant