Inheritance is a good way to give objects common functionality while changing key pieces to suit different purposes. For example, you can define an interface that describes how data flows through your application. Then you can write an abstract class with the database plumbing. Then maybe you’d create a posts class to represent a collection of posts, and that class is where you’d store the logic specific to posts. In this model, there is no code duplication, and you’re using interference to share code across multiple objects that largely work the same.
2021
You really have to appreciate his integrity, likely not an easy post for him to write. Still, it seems like an official GraphQL implementation would be prefered, and you could sunset a lot of the REST functionalities while fleshing out an API more suited for headless content management and delivery. I say merge it anyways!
www.reddit.com/r/PHP/com…
You’re likely putting too much thought into it. If you want to go with a .htaccess rule, I’d suggest updating the one in pub/ and making a rewrite rule routing to your WordPress directory. Personally, I would consider Magento and WordPress two separate app installations and would add configuration to apache directly for this. When you install Magento with composer, .htaccess files and the like will get clobbered so the separation is nice.
Definitely, seems like GraphQL should be a foundational feature. Many (new) AMP and CMS frameworks are written in js and rely extensively on GraphQL and edge-caching for performance. Surely WordPress will move in that direction too.
www.reddit.com/r/PHP/com…