Yes, the constants can be hard coded, such as
MgServiceType ... RenderingService = 4
or
MgMimeType ...  Agf  = "application/agf"

There is a handy constants file for these kind of types.
C:\Program
Files\OSGeo\MapGuide\Web\www\fusion\layers\MapGuide\php\Constants.php

On Tue, Jan 20, 2026 at 2:05 PM David Bowen <[email protected]> wrote:

> Hi Gordon,
> Sorry, I don't think I properly explained what I'm looking for. When
> Jackie's script is run, where are the functions it calls located? For
> example, when MgMimeType is called, where is the corresponding code? Is it
> located in the PHP extension MapGuideApi.dll? When I try to run the script
> using CodeIgniter 4, I get an error message saying the Class can't be
> located.
>
> On Tue, Jan 20, 2026 at 11:40 AM Gordon Luckett <
> [email protected]> wrote:
>
>> The code, found here:
>>
>> https://themapguyde.blogspot.com/2022/04/mapguide-dev-diary-important.html?m=1
>>
>> You can put the PHP in the C:\Program Files\OSGeo\MapGuide\Web\www\
>> folder..
>>
>> gordon
>>
>>
>> On Tue, Jan 20, 2026 at 11:04 AM David Bowen <[email protected]> wrote:
>>
>>> Where are the functions called in Jackie's "sanity check" code located?
>>> I'm presuming the PHP extension file MapGuideApi.dll file but would like
>>> confirmation. I'm trying to get help through the CodeIgniter forums but
>>> need to have a better understanding of what's being called.
>>>
>>> On Mon, Jan 12, 2026 at 8:27 AM David Bowen <[email protected]> wrote:
>>>
>>>> Hi Gordon,
>>>>
>>>> Unfortunately, adding that line to httpd.conf didn't resolve the issue.
>>>> I'm still getting the same error.
>>>>
>>>> On Fri, Jan 9, 2026 at 10:25 AM Gordon Luckett <
>>>> [email protected]> wrote:
>>>>
>>>>> I wonder if you should add the following to your conf file?
>>>>>
>>>>> AddType application/octet-stream .agf
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Jan 9, 2026 at 10:20 AM David Bowen <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi Gordon,
>>>>>> Thanks for providing this, and apologies for the delayed response. I
>>>>>> added it to one of the application's controllers and wasn't able to get 
>>>>>> it
>>>>>> to successfully run. I'm able to get the initial section of code to echo 
>>>>>> to
>>>>>> screen, but once there are MapGuide functions, it fails.
>>>>>>
>>>>>> This section of code works fine:
>>>>>> echo "Initializing web tier";
>>>>>> try {
>>>>>>     MgInitializeWebTier("DIR_PATH\Web\www\webconfig.ini");\
>>>>>> } catch (MgException $initEx) {
>>>>>>     echo "Init failure!";
>>>>>>     die;
>>>>>> } catch (Exception $ex) {
>>>>>>     echo "[php]: Exception: " . $ex->getMessage() . "\n";
>>>>>>     die;
>>>>>> }
>>>>>> echo "[php]: Initialized\n";
>>>>>> // We haven't and shouldn't need to require/include constants.php
>>>>>> // they are now baked into the PHP extension along with the other
>>>>>> // MapGuide API proxy classes
>>>>>> echo "[php]: Testing some constants\n";
>>>>>>
>>>>>> The next line is where it fails:
>>>>>> echo "  - " . MgMimeType::Agf . "\n";
>>>>>>
>>>>>> The error CodeIgniter's returning is:
>>>>>> Class "App\Controllers\Maptools\MgMimeType" not found
>>>>>>
>>>>>> It seems like MapGuide functions aren't being recognized/loaded by
>>>>>> CodeIgniter. The MapGuideAPI is enabled in php.ini, and it shows as 
>>>>>> enabled
>>>>>> when I run info.php.
>>>>>>
>>>>>> Any input would be greatly appreciated.
>>>>>>
>>>>>> Thanks,
>>>>>> David
>>>>>>
>>>>>> On Wed, Nov 12, 2025 at 11:05 AM Gordon Luckett <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi David
>>>>>>> When in doubt, I use Jackie's Sanity Check..
>>>>>>>
>>>>>>>
>>>>>>> https://themapguyde.blogspot.com/2022/04/mapguide-dev-diary-important.html?m=1
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, 12 Nov 2025, 10:39 David Bowen via mapguide-users, <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Our application is built using the Model/View/Controller (MVC)
>>>>>>>> framework CodeIgniter and I'm attempting to update the MVC framework 
>>>>>>>> from
>>>>>>>> v3.1.13 to v4.6.3, but I'm encountering an issue where it seems that 
>>>>>>>> one of
>>>>>>>> the MapGuide functions isn’t being loaded or recognized. The issue 
>>>>>>>> occurs
>>>>>>>> during the log out process, where a user logs out of the application 
>>>>>>>> and
>>>>>>>> there's a series of steps that take place to destroy the sessions (code
>>>>>>>> below).
>>>>>>>> I'm getting the following error when I attempt to log out of the
>>>>>>>> application: Call to undefined function
>>>>>>>> App\Controllers\Login\MgUserInformation(). This function,
>>>>>>>> MgUserInformation, is successfully called when the user first logs 
>>>>>>>> into the
>>>>>>>> application and a session is created, so I’m unclear what’s causing the
>>>>>>>> issue.
>>>>>>>> Does anyone have familiarity with MGOS and CodeIgniter 4, or would
>>>>>>>> anyone have suggestions on how to check if MGOS functions are being
>>>>>>>> properly loaded?
>>>>>>>> We're running MGOS 4 Beta 2 and are unable to go to MGOS 4 until
>>>>>>>> we've updated the MCV framework.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> David
>>>>>>>>
>>>>>>>> function logout() {
>>>>>>>>     //Log out and destroy session
>>>>>>>> $this->mgExtDir = getenv('mg_extensionsDir');
>>>>>>>>     $this->webconfig_ini = getenv( 'webconfigFilePath' );
>>>>>>>>     $this->mgMapID = $this->_getValueByFieldName( 'MAPNAME' );
>>>>>>>>     $this->mgSessionId = $this->_getValueByFieldName( 'SESSION' );
>>>>>>>>     try {
>>>>>>>>         // Initialize the Web Extensions and connect to the Server
>>>>>>>> using
>>>>>>>>         // the Web Extensions session identifier stored in PHP
>>>>>>>> session state.
>>>>>>>>
>>>>>>>>         MgInitializeWebTier( $this->webconfig_ini );
>>>>>>>>         $si = $this->mgSessionId;
>>>>>>>>        // code fails on following line
>>>>>>>>         $userInfo = new MgUserInformation( $this->mgSessionId );
>>>>>>>>         $siteConnection = new MgSiteConnection();
>>>>>>>>         $siteConnection->Open( $userInfo );
>>>>>>>>
>>>>>>>>         $siteConnection->GetSite()->DestroySession(
>>>>>>>> $this->mgSessionId );
>>>>>>>>     } catch ( MgException $e ) {
>>>>>>>>         echo $e->GetMessage();
>>>>>>>>         echo $e->GetDetails();
>>>>>>>>     }
>>>>>>>>     $session_dat = array( 'logged_in' => FALSE );
>>>>>>>>     session()->set( $session_dat );
>>>>>>>>     session()->destroy();
>>>>>>>>     return redirect()->to( 'login/login' ); //Direct user back to
>>>>>>>> login screen
>>>>>>>> }
>>>>>>>> _______________________________________________
>>>>>>>> mapguide-users mailing list
>>>>>>>> [email protected]
>>>>>>>> https://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>>>>>
>>>>>>>
_______________________________________________
mapguide-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapguide-users

Reply via email to