[mapguide-users] MGOS 4.0 and REST

Pierre Cardinal pierre.cardinal at sympatico.ca
Wed Aug 17 16:50:32 PDT 2022


With PHP 8.1.4 and XDebug 3 Config for Xdebug in php.ini [XDebug]zend_extension = "php_xdebug-3.1.5-8.1-vs16-nts-x86_64.dll"xdebug.mode=debugxdebug.start_with_request = yesxdebug.log_level = 0  Config of VSCode launch.json {    "version": "0.2.0",    "configurations": [                {            "name": "Listen for XDebug",            "type": "php",            "request": "launch",            "port": 9003        }    ]}  For xdebug.log_level = 0, look at php - Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 - Stack Overflow   De : mapguide-users <mapguide-users-bounces at lists.osgeo.org> De la part de pierre.cardinal at sympatico.caEnvoyé : 15 août 2022 20:26À : 'MapGuide Users Mail List' <mapguide-users at lists.osgeo.org>Objet : Re: [mapguide-users] MGOS 4.0 and REST Also in VSCode, you should have the following  parameters in the configuration file launch.json  {    // Utilisez IntelliSense pour en savoir plus sur les attributs possibles.    // Pointez pour afficher la description des attributs existants.    // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387    "version": "0.2.0",    "configurations": [         {            "name": "Listen for XDebug",            "type": "php",            "request": "launch",            "port": 9000        }    ]} De : mapguide-users <mapguide-users-bounces at lists.osgeo.org> De la part de pierre.cardinal at sympatico.caEnvoyé : 15 août 2022 19:48À : 'MapGuide Users Mail List' <mapguide-users at lists.osgeo.org>Objet : Re: [mapguide-users] MGOS 4.0 and REST  The DLL for XDEBUG are at https://xdebug.org/download/historical De : mapguide-users <mapguide-users-bounces at lists.osgeo.org> De la part de pierre.cardinal at sympatico.caEnvoyé : 3 août 2022 21:17À : 'MapGuide Users Mail List' <mapguide-users at lists.osgeo.org>Objet : Re: [mapguide-users] MGOS 4.0 and REST Hi Jackie, Debugging PHP under VSCode with Xdebug 2 : Windows 10 with IIS (regular installation for MapGuide Web Tier)PHP 5.6.40dll for xdebug 2 :  D:\mgos\Web\Php\ext\php_xdebug-2.5.4-5.6-vc11-x86_64.dll php.ini config for xdebug 2 :   [XDebug]zend_extension = "D:\mgos\Web\Php\ext\php_xdebug-2.5.4-5.6-vc11-x86_64.dll"xdebug.remote_enable = 1xdebug.remote_autostart = 1xdebug.remote_host=localhostxdebug.remote_port=9000xdebug.remote_handler=dbgp installation of the PHP Xdebug extension in VSCode : PHP Debug from Robert Luhttps://marketplace.visualstudio.com/items?itemName=robberphex.php-debug modification json  user parameter in VSCode {    "php.validate.executablePath": "D:/mgos/Web/Php/php.exe"} open the file D:\mgos\Web\www\rest\index.php with vscodeadd a breakpoint  to a line of index.phpclick on the bug icon on the left of the VSCode windowclick on the green arrow next to « Listen for XDebug » at the top of the VSCode window in your browser execute http://<servername>/maguide/rest/index.phpin vscode the debugger will stop at the first line with a breakpointnow you should be in business  note : The configuration for php.ini is different for Xdebug 3 (PHP 8).Don’t forget the FastCGI delay when debugging.  Some references :  https://marketplace.visualstudio.com/items?itemName=xdebug.php-debughttps://docs.devsense.com/en/vs/debugging/configuring-xdebughttps://code.visualstudio.com/docs/languages/php Hope it helps    Question from my side                 Where is the code for MGOS 4.0.0 preview 3. Is it under SVN https://trac.osgeo.org/mapguide/browser/trunk/MgDev or is it under  GitHub mapguide/MgDev at master · jumpinjackie/mapguide · GitHub ? What is the difference between both ?    Regards,  Pierre   De : mapguide-users <mapguide-users-bounces at lists.osgeo.org> De la part de Jackie NgEnvoyé : 3 août 2022 13:32À : mapguide-users at lists.osgeo.orgObjet : Re: [mapguide-users] MGOS 4.0 and REST mapguide-rest has not been maintained for years now due to competing priorities in real life and on other projects. I am assuming by MGOS 4.0 you are using the current preview 3 release. If you are using my vanilla SWIG sandbox branch then I can say mapguide-rest will definitely not work right now as that is still targeting PHP 5.6 and the vanilla SWIG branch now bundles PHP 8. Assuming you are on the preview 3 release that still bundles PHP 5.6, then if you are using the 1.0 RC5 release I can say that release will not work because it has a class that collides with a class of the same name in the MapGuide API (MgGeoJsonWriter). All I can say is try building mapguide-rest from git master (which renames this conflicting class) and see if that works with your preview 3 installation. Otherwise I would just hold off on trying to use mapguide-rest with MGOS 4.0. The next preview release of MGOS 4.0 when it drops, will ship with PHP 8.1, which means mapguide-rest will *definitely* not work for reasons already stated above. There will need to be dev work (which I currently do not have time for) to migrate mapguide-rest over to PHP 8.1. So all things considered mapguide-rest will not be usable with MGOS 4.0 in the foreseeable future until at least the final release of MGOS 4.0 is out the door. Only then can I reasonably invest some time into migrating over mapguide-rest. As an aside, I am also interested in how you set up your VSCode for PHP debugging. I only got this to work for debugging PHP scripts that are run from the command-line. I never got this to work for PHP code running on a web server. - Jackie You wrote: Hi Jackie,What can it be ?MGOS 4.0 from last release with IIS under Server2012 R2MGOS 4.0 from build with IIS under Win10When I tried to use mapguide-REST withhttp://localhost/mapguide/rest/index.php, I have the following message :404 Page Not FoundThe page you are looking for could not be found. Check the address bar toensure your URL is spelled correctly. If all else fails, you can visit ourhome page at the link below.Visit the Home Page <http://localhost/mapguide/rest/index.php/> And in the VS Code debugger  I have the exception Slim\Exception\Stop (line1020 in Slim.php)  -- Please Note: I no longer create new posts or post replies to any OSGeo mailing list through nabble. As a result, you most likely won't see this message appear on nabble's view of any OSGeo mailing list and may only see this message through mailing list archives or depending on your mailing list subscription settings, through daily message digests or automated notifications from the mailing lists.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapguide-users/attachments/20220817/7601b343/attachment.htm>


More information about the mapguide-users mailing list