Best practice to interact with App written in PHP/Symfony/Doctrine

Hello !
For one of my projects, i need to create an Android/iOs app that interact with an existing web app.
This app rely on a mysql database and is written in PHP/Symfony/JS and with Doctrine.
There are lots of things already written, and i'd like to be able to interact with these without writting again every function

The only way i know, is to write my own PHP scripts, mimicking what the original app was doing. Then echo something understandable for my Xamarin App.

Does someone ever had to do such thing? What would be the best practices to do so?

Thanks by advance

Tagged:

Posts

  • JohnHJohnH GBMember ✭✭✭✭✭

    @momone50 said:
    Hello !
    For one of my projects, i need to create an Android/iOs app that interact with an existing web app.
    This app rely on a mysql database and is written in PHP/Symfony/JS and with Doctrine.
    There are lots of things already written, and i'd like to be able to interact with these without writting again every function

    The only way i know, is to write my own PHP scripts, mimicking what the original app was doing. Then echo something understandable for my Xamarin App.

    Does someone ever had to do such thing? What would be the best practices to do so?

    Thanks by advance

    I would create a web service for this, put all the common code in there that interacts with your db, and have the app as well as your web application call it. That way you can share your business logic across all platforms that you want to support.

  • momone50momone50 FRMember ✭✭

    Hi. Thanks for your advice. But i can't touch the code of the original App. I have to find a way to use it as it is. Or rewrite everything...

  • JohnHJohnH GBMember ✭✭✭✭✭

    @momone50 said:
    Hi. Thanks for your advice. But i can't touch the code of the original App. I have to find a way to use it as it is. Or rewrite everything...

    You might be able to write the webservice to make the calls to your PHP backend (ot call the PHP backend from the app), but that really depends how well it has been written and what it does.

  • momone50momone50 FRMember ✭✭

    I'll take a look at what you say. It might be some work, but could be useful therafter.

    I'm open to other suggestions though !

Sign In or Register to comment.