[mapguide-users] MapGuide 3.1 Ad Layer on Runtime PHP

Lisa Weber lisaw at precisionmanagementsolutions.com.au
Fri Dec 15 17:27:31 PST 2017


I am updating codebase originally running on AIMS 2013 to MGOS 3.1 on Apache
and have hit an issue. 

 

 

When updating code associated with calling a layer it keeps erroring out
before calling the layer. The error is:

 

PHP Fatal error:  Class 'MgServiceType' not found in C:\Program
Files\OSGeo\MapGuide\Web\www\VIRTUAL\variety\region_variety_change_filter.ph
p on line 34

 

Line 34 of the code is      $resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService).

 

Here is the code snippet setup used including the line that causes the
error:

 

require_once('../../mapviewerphp/common.php');

               $webconfigFilePath = "C:/Program
Files/OSGeo/MapGuide/Web/www/webconfig.ini";

$mapName = $_REQUEST['MAPNAME'];

              $sessionId = $_REQUEST['SESSION'];

               

    MgInitializeWebTier ($webconfigFilePath);

 

    $userinfo = new MgUserInformation($sessionId);

    $siteConnection = new MgSiteConnection();

    $siteConnection->Open($userinfo);

   $resourceService =
$siteConnection->CreateService(MgServiceType::ResourceService);

 

I have confirmed that the MapGuide API still lists the class as used above.
I have other reports that I ported straight from AIMS to MGOS 3.1 that work
without issue, so I don't think the issue is code differences between AIMS
and MGOS3.1 but can't rule that out completely. 

 

Is it possible that the code as used is not calling the class properly? Any
help would be appreciated.

 

Thanks,

Lisa

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20171216/cc7e7f65/attachment.html>


More information about the mapguide-users mailing list