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.
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.