2 Replies Latest reply on Oct 5, 2013 6:43 AM by Mike_Mitchell

    Converting from CMDL to PHP

    tdahlborn

      Anyone know of a tool that assists in converting the old CMDL into php ?

       

      I was asked to quote on a project to convert a CMDL customer search database into PHP. The challenge I dont know much PHP and dont know any CDML.

       

      Any ideas or suggestions to learn php to recreate search page:

      1 - 12 different fields

      2 - list the results

      3 - show error page

      4 - Show customer detail page.

       

      Filemaker Server Adv 12 running on Mac Server is the back bone.

        • 1. Re: Converting from CMDL to PHP

          FMS 11 has a PHP Site Assistant that can get you started. You would have to host your solution on FMS 11 to use this great tool (which was depricated in 12.)

           

          You really don't want to convert that exists, even if a converted existed.

           

          • 2. Re: Converting from CMDL to PHP
            Mike_Mitchell

            I did this a few years back on an old system. I tend to shy away from automated tools, so the "conversion" consisted of retaining that part of the old CDML code that was not CDML and substituting PHP calls where the CDML calls existed. It's been a while (so I don't remember the exact syntax), but as I remember, CDML inserted things like "FILEMAKER_FIELD" into the HTML that were parsed into the necessary objects on screen.

             

            The conversion wasn't terribly difficult, but it did involve creating the necessary PHP support structure (like the include files to call the database) and then inserting the necessary precursors at the top of each page to establish the connection to the database, create the DB object, etc. Those are not hard. Then, wherever you have a FileMaker field, you use the getRecords() method to fetch it out and echo the contents to the screen using the "echo" statement.

             

            If the customer wants to retain the old web page "as it" and just make it work with the new version of FileMaker, then it's not hard at all to substitute the necessary PHP code for the old CDML calls. But since you indicated you needed to learn PHP, you'll probably want to get access to some resources. Todd Duell has published a guide to the PHP API, which you can get from Amazon (http://www.amazon.com/FileMaker-API-PHP-Todd-Duell/dp/0615718078/ref=pd_sim_b_1). Todd also offers the book in PDF as a download (http://www.formulationspro.com/pages/products/downloads/132.pdf). There are plenty of online resources for PHP itself, starting with the PHP home site (http://www.php.net/manual/en/).

             

            On the other hand, if the customer is wanting an upgrade - wants the new site to be more modern, prettier, whatever - then you might consider a rewrite. My general advice is: Learn PHP, learn the FileMaker API. It won't take long to get you where you need to be.

             

            HTH

             

            Mike