Jump to content

Recommended Posts

I am building an add-on for Concrete5 who's purpose is to configure and display HighCharts.  I will later be porting it to Wordpress and Joomla for their equivalent plugin and component.

 

Much of the functionality of the add-on is provided by a remote REST API which the add-on communicates to using cURL, and the only thing the script on the Concrete5 machine does is:

  • When displaying a page, make a request to the REST API, create a view and includes the results received in it, and provide that view to the overall Concrete5 view which is presented to the client.
  • When an Ajax request is received, proxy it to the REST API, receive the results, and forward them back to the client.
  • Host appropriate JavaScript files, and a small amount additional scope which can easily be moved to the REST API.

This is making me question why I am creating any Concrete5 (and then Wordpress and Joomla) specific script.  Maybe I should move everything to the remote REST API server.  But how would it look?  Would I then have same-origin issues? Is this not how PHP is suppose to work, and should I be using something like Node.js?

 

PS.  Sorry for the lame topic title, but I couldn't think of anything better.

Link to comment
https://forums.phpfreaks.com/topic/302125-implications-of-different-architectures/
Share on other sites

You would have origin issues - unless you configured the server to allow cross-origin requests. You can totally do that.

 

Is it how PHP is supposed to work? There is no "supposed". It is capable of doing many things and you are using it to do one thing. That's fine. Node.js? If you want, but that's an entirely different discussion.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.