wiki:MapGuideRfc89

MapGuide RFC 89 - Upgrade to PHP 5.3

This page contains a change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission DateMarch 22, 2009
Last ModifiedBruce Dechant Timestamp
AuthorBruce Dechant
RFC Statusadopted
Implementation Statusimplemented
Proposed Milestone2.2
Assigned PSC guide(s)Bruce Dechant
Voting History
+1Andy, Bob, Bruce, Jason, Tom, Trevor
+0
-0
-1
AbstainedHaris, Kenneth, Paul

Overview

This RFC updates MapGuide to use the latest version of PHP 5.3.

For details, refer to the PHP website:

http://php.net/

Motivation

There have been several security fixes and bug fixes done to PHP since the release currently included with MapGuide.

Proposed Solution

Upgrade existing PHP 5.2 to the latest PHP 5.3.

Implications

All exception classes must be derived from the PHP Exception base class. Changing this causes more issues - namely a side effect of having to have the PHP Exception class as the base class is that it becomes the base class of MgObject which almost everything in our API derives from. This causes an API naming conflict with existing MapGuide APIs because PHP is case insensitive - ie: getMessage() and GetMessage() are the same in the PHP world.

The PHP Exception class is defined as follows: (These are the APIs with which we can have conflicts with)

const static zend_function_entry default_exception_functions[] = {
                ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
                ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC)
                ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, getCode, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, getFile, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, getLine, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, getTrace, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, getPrevious, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, getTraceAsString, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
                ZEND_ME(exception, __toString, NULL, 0)
                {NULL, NULL, NULL}
};

Of the above APIs only the getMessage() and getCode() APIs are currently causing conflicts with MapGuide APIs.

In order to get around the conflicts with PHP the following API changes need to be made to our existing MapGuide API:

Note: In order for all of our APIs to be consistant these changes will be done for .NET, Java and PHP.

MgException class changes:
Change GetMessage() to GetExceptionMessage()

MgResources class changes:
Change GetMessage() to GetResourceMessage()

MgCoodinateSystem class changes:
Change GetCode() to GetCsCode()
Change SetCode() to SetCsCode() for consistency.
Change IsLegalCode() to IsLegalCsCode() for consistency.

MgCoodinateSystemDatum class changes:
Change GetCode() to GetDtCode()
Change SetCode() to SetDtCode() for consistency.
Change IsLegalCode() to IsLegalDtCode() for consistency.

MgCoodinateSystemEllipsoid class changes:
Change GetCode() to GetElCode()
Change SetCode() to SetElCode() for consistency.
Change IsLegalCode() to IsLegalElCode() for consistency.

MgWebInvokeScriptCommand class changes:
Change GetCode() to GetScriptCode()
Change SetCode() to SetScriptCode() for consistency.

These API changes will impact:

  • Viewers
  • Sample applications
  • Development guides
  • Existing applications

Test Plan

Build/Run on Windows/Linux.

Funding/Resources

Supplied by Autodesk.

Last modified 15 years ago Last modified on 04/08/10 08:50:36
Note: See TracWiki for help on using the wiki.