Amazing PHP
9.32K subscribers
11 photos
84 links
Welcome to the Amazing PHP Channel! Here you can find a lot of interesting articles/news about PHP, frameworks, tools and development.

Support the channel: https://www.paypal.com/donate?hosted_button_id=FAYP5QJH5LVRL
Download Telegram
​​Prooph: CQRS+ES in PHP. How to use.
Pattern CQRS and Event Sourcing become more and more popular every day in PHP community. You can easily find lot libraries to store events, to execute commands, to manage repositories, etc. The leader there doesn’t exist yet, but prooph as the most complex solution is close to that position. They have only one problem, documentation.
​​Properly passing data from outer layers of a PHP application to the use case layer
Lately, I've been digging a lot in different ways of improving software architecture. Mainly subjects like Clean Architecture, Domain Driven Design, and such.
Injectables vs. Newables
Many projects I join - even those that claim to already do dependency injection - suffer from issues that result from mixing injectable and newable classes. Keeping these two appart seems to be challenging for many developers so that I try to give them a handy guide with Do's and Dont's in this blog post.
​​How to Optimize MySQL: Indexes, Slow Queries, Configuration
MySQL is still the world’s most popular relational database, and yet, it’s still the most unoptimized – many people leave it at default values, not bothering to investigate further. In this article, we’ll look at some MySQL optimization tips we’ve covered previously, and combine them with novelties that came out since.
​​The Repositories Pattern in Lumen
The repositories pattern is widely used pattern whose main point is that the application does not have to know data is implemented. This makes it easier to switch to another data source or implement structural changes to the existing data source.
The Magic Behind Async PHP
Async PHP allows a massive speedup of applications by leveraging non-blocking I/O. It allows making multiple HTTP requests in parallel or any other way of I/O multiplexing. But what’s the magic behind it? How does it actually work?
How to Read Big Files with PHP (Without Killing Your Server)
It’s not often that we, as PHP developers, need to worry about memory management. The PHP engine does a stellar job of cleaning up after us, and the web server model of short-lived execution contexts means even the sloppiest code has no long-lasting effects.
Extending ReactPHP's Child Processes Part Two
react/child-process is very flexible and can work a lot of ways but sometimes you don't want to be bothered with the details of how it works and just want a simpler API to do that.
PHP 7.2's "switch" optimisations
PHP 7.2 is around the corner soon, and comes with many optimisations. Many new optimisations are implemented in opcache, but some others are implemented in PHP itself. One optimisation that falls in the latter category is an optimisation of the switch/case construct.
How to Deploy With Deployer
Automated workflow for deployment is a great tool that every software development team must have. The release process, when it is fast, secure and fault tolerant, can save time for developing more great things. And the good news that there are many great tools for creating an automated release cycle.
PHP 7.2.0 Released
The PHP development team announces the immediate availability of PHP 7.2.0. This release marks the second feature update to the PHP 7 series.
​​We are 300, my friends. Thank you.
Adding a GraphQL API to your Symfony Flex application
I've been using GraphQL for some API thingamajigs, and it's been working fine. Now with Symfony 4 out, I figured a write-up on how to use GraphQL with Symfony Flex could be useful for someone.
We'll expand on a previous demo app that I built. That app already uses Doctrine ORM as storage, so let's bridge that to a GraphQL API.
​​ReactPHP PromiseStream: From Promise To Stream And Vice Versa
One of the patterns that are used to deal with streams is spooling: we need the entire resource data available before we start processing it. One approach is to collect each chunk of data received from the stream:
PHP-FPM tuning: Using β€˜pm static’ for Max Performance
Let’s take a very quick look at how best to set up PHP-FPM for high throughput, low latency, and a more stable use of CPU and memory. By default, most setups have PHP-FPM’s PM (process manager) string set to dynamic and there’s also the common advice to use ondemand if you suffer from available memory issues.
Case Study: Optimizing CommonMark Markdown Parser with Blackfire.io
This last goal is perhaps the most challenging, especially from a performance perspective. Other popular Markdown parsers are built using single classes with massive regex functions. As you can see from this benchmark, it makes them lightning fast:
​​Keeping your code clean
I settled down in my sit, cranking the solution with my team members. β€œWe must win this” I said, burying myself deep down to develop a working prototype within the given two daysβ€Šβ€”β€ŠThe competitive nature in every human had just been ignited and guys must simply compete for 1st, 2nd, and 3rd place.
​​Happy New Year my friends.
How to Optimize Docker-based CI Runners with Shared Package Caches
At Unleashed Technologies we use Gitlab CI with Docker runners for our continuous integration testing. We’ve put significant effort into speeding up the build execution speeds. One of the optimizations we made was to share a cache volume across all the CI jobs, allowing them to share files like package download caches.
How to Optimize SQL Queries for Faster Sites
You know that a fast site == happier users, improved ranking from Google, and increased conversions. Maybe you even think your WordPress site is as fast as it can be: you’ve looked at site performance, from the best practices of setting up a server, to troubleshooting slow code, and offloading your images to a CDN, but is that everything?