Hi,
I have a site written in JSP/Java servlets and is considering reprogramming it to PHP/CGI. Before I start digging into coding I would like to know if my current solution is possible/recomended. This is how i imagine my site after porting:
I have a simple MVC setup:
- all requests goes to controller.cgi which calls model1.cgi or model2.cgi or ... depending on a passed variable telling what page is requested
- model1.cgi reads other request variables if any and store them in session variables
- if needed, model1.cgi calls other cgi:s (dbcall1.cgi) to get/put data to the database
- model1.cgi open and close the database connection and pass it to dbcall1.cgi
- dbcall1.cgi stores results in session variables
- There is only one session variable stored, a class containing variables of primitives and other sessionvariableclasses i make. This session variable should be stored on the server, read when the next calls comes from the same user and stored for 10 minutes after last request
- when model1.cgi is ready controller.cgi calls requestedpage1.php wich simply shows session variables
Is this possible with PHP/CGI? Or have I misunderstood something?
Is it a good structures for PHP/CGI? Is there better structures?
How would you do it?
And finally, is there source code examples for similar solutions?