3 ms·
Use the right tool for the right job. I always use plain PHP for all those things I want to keep running forever without having to spend time and brain space to
by mickael-kerjean 3y ago
Use the right tool for the right job. I always use plain PHP for all those things I want to keep running forever without having to spend time and brain space to maintain. You can't beat putting a file on a LAMP server and forget it's running. I have tons of public endpoint that do all sort of stuff , aren't core to my business and don't want to deal with the operation hassle that would come to keep such framework working and running in the long run.
Just a few examples of such PHP script:
1. an endpoint that is being called by my CI to send messages on IRC and telegram when a new build is ready
2. the analytics bit of my project so I know who does what without relying on google analytics but by storing all that stuff in a mysql db. It's under 25 lines of PHP code and has worked a lot better for me than any analytics tools I've tried: https://gist.githubusercontent.com/mickael-kerjean/289d3d0be8fab2f90e2ff541bc3415a6/raw/8e31ac2a72e22c7c9def201b804a7021b8fd925a/analytics.php https://gist.githubusercontent.com/mickael-kerjean/289d3d0be...
3. the target of the contact me form of my project
4. all the webhooks and other simple marketing automation stuff I need to process one way or another
5. all sort of online tools relevant to my niche to boost the SEO side of my OSS project
6. my status page which is an array of url I look after that is being curl around
7. crud cloud instance of my OSS project
and many many more examples, got about a hundred random stuff running from a single cheapo VPS I don't have to maintain.
- konart 3y agoSounds like a scripted and slower (not trying to diminish) version of Go.
- tredre3 3y agoBut when he wants to add a feature he doesn't have to create a new microservice and a systemd file and a watchdog and setup the reverse proxy, all things needed for a go endpoint. He just drops a PHP file in a folder and be done with it, it just works.
- konart 3y agoYou don't have to create a new (micro-)service, you can just add new functions to an existing one. > it just works. Are you trying to tell me that modern PHP is so cool it does not require LAMP or whatever? I highly doubt it. You still need and use all the same stack, except you don't have to install thigs separately I guess.