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

Include mserror.i and call msSetup() for PHP7 Swig mapscript #5946

Merged
merged 2 commits into from Dec 12, 2019

Conversation

@bragef
Copy link

bragef commented Dec 11, 2019

The default exception handling routines in mserror.i is missing if the only mapscript module defined is SWIGPHP7. This causes all mapscript errors to throw an uncathable 'E_ERROR' and quit php instead of throwing an exception.

@bragef

This comment has been minimized.

Copy link
Author

bragef commented Dec 11, 2019

Please ignore this for now; will do some more testing here.

@jmckenna

This comment has been minimized.

Copy link
Member

jmckenna commented Dec 11, 2019

roger, thanks @bragef

@bragef

This comment has been minimized.

Copy link
Author

bragef commented Dec 12, 2019

I think this should be safe to commit. I was a bit hesitant because I got a some exceptions which did not make sense after enabling the exeption handlers, e.g. the getMetaData methods trown an exception for a non-existent key. However, looking at the code this was more of a mis-feature than a bug. At any rate, it can be avoided by using acessing the hashObj instead. I also got a couple of exceptions because of a font initialisation bug (see below)

@bragef

This comment has been minimized.

Copy link
Author

bragef commented Dec 12, 2019

The PHP Swig mapscript was missing a call to msSetup(), so that the font cache was not properly initialized.

This causes labels to not appear on maps, or appear erratically. Without exceptions, I got a lot of errors of the type

[Wed Dec 11 13:59:21 2019].450696 msGetFontFace(): General error message. Freetype was unable to load font file "arial.ttf" for key "arial"

and with exceptions enabled mapscript threw an exeption when drawLabelCache() were called.

This is the same issue as is described in this thread:
http://osgeo-org.1560.x6.nabble.com/PHP-Mapscript-swig-issue-on-macOS-td5414228.html

@bragef bragef changed the title Include mserror.i for PHP7 Swig mapscript builds Include mserror.i and call msSetup() for PHP7 Swig mapscript Dec 12, 2019
@jmckenna

This comment has been minimized.

Copy link
Member

jmckenna commented Dec 12, 2019

I cannot reproduce the initial font errors reported, and still cannot. However your changes look valid. Merging...

@jmckenna jmckenna merged commit b64932c into mapserver:master Dec 12, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jmckenna

This comment has been minimized.

Copy link
Member

jmckenna commented Dec 12, 2019

thanks again @bragef !!

jmckenna added a commit that referenced this pull request Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.