am working on the main system powered by Yii that sits at the main domain.
another dev was assigned to build a different system using “pure php” that will sit at the sub domain. what’s the best way to approach this thing in order for my system to work with the separate system using my login stuff only ? …in other words integration
Initial thought would be to use a front-controller pattern on the non-framework side. If it’s a large application you can break it into a main front-controller with access to sub-applications I.e. payment, inventory, shipping etc. and then sub controllers for each sub application.
If it’s a medium/small size project, a single front-controller would suffice.
The key is to figure out early what functionality each application will take care of.
can you please explain further?
All I want to happen is, the pure php powered application at the sub domain
can also use the session thing when I log-in at the main system powered by yii
Firstly, are you sure you can’t develop both sites using a framework?
You’ll have to think this through very clearly. For example, do the two sites need to communicate? - pass objects etc. Hopefully you’ll just need a simple username/pwd validation because you won’t be able to easily access Yii’s RBAC authorization info in the sub domain - you’ll have to duplicate this in the sub domain.
If you want to force users to login through Yii app you’ll have to do PHP session handling to check if a valid session is alive, if not, redirect to Yii login. From there redirect back to the sub domain. All restricted pages in the sub domain will have to check for a valid session.
the other dev assigned for that separate system was asked not to use Yii but pure php
I still don’t know why. but thanks for these wonderful suggestions/tips