gas-orm icon indicating copy to clipboard operation
gas-orm copied to clipboard

gas.php exception_handler exception in php7

Open V1nzi opened this issue 8 years ago • 0 comments

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)

V1nzi avatar Aug 31 '16 20:08 V1nzi