Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can encapsulate your business logic on the WordPress PHP side into PHP classes first.

What you want to do is break your WordPress application into classes containing the business logic and turn WordPress into a dumb wrapper for those classes. At that point, you can move those new classes over to Laravel when you are ready to make the switch.

For example, you can switch your customer dashboard views over to be written in Laravel. You can use either nginx/apache to route, or have a base index.php file that either includes the WordPress index.php or the Laravel index.php based upon PHP code. Within your new Laravel routes, you will be boostrapping WordPress from Laravel and calling WordPress code from within Laravel.

For example the WordPress users. You could create a new class and interface to encapsulate all of the WordPress user code inside your WordPressUser class that implements MyAppUserInterface. Eventually, you will create a new class that implements that interface for Laravel once you are ready to switch out WordPress for user management and use Laravel. With that said, I would likely leave users to be the very last thing you change. And quite possibly, think about leaving WordPress around solely for user auth and management.

The same idea works for posts and other entities you are currently using within WordPress.

On the WordPress side you can implement hooks that can call methods on the Laravel side as you move through the transition.

Rewrites are so often deadly. Please put some serious thought into it. No one knows your business better than you do, so I'll just leave you with that friendly advice.

Also, writing this makes me chuckle as I can't even get a response from a single resume I've sent out over the last two weeks. Sigh...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: