wiki:MapGuideRfc89

Version 1 (modified by brucedechant, 15 years ago) ( diff )

--

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 Statusdraft
Implementation Statusdraft
Proposed Milestone2.2
Assigned PSC guide(s)Bruce Dechant
Voting History
+1
+0
-0
-1
Abstained

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 APIs:

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.

Note: See TracWiki for help on using the wiki.