Run Composer Scripts in Parallel with veewee/composer-run-parallel

Nice addition to Composer by Toon Verwerft which allows you to run your custom commands in parallel This composer plugin allows you to run the tasks inside your composer file in parallel. No more waiting on one specific task! Say you have these two custom commands: { "scripts": { "php1": "@php -r 'sleep(3); echo \"1\";'", …

ibis — A PHP tool that helps you write eBooks in markdown and convert to PDF

Mohamed Said recently wrote the book “Laravel Queues in Action”. To create the book he wrote it Markdown and then used his self-created tool ibis to generated the PDF and ePub versions. Installation per Composer: composer global require themsaid/ibis After which you start a new project with ibis init Check out the preview of “Laravel …

Front Line PHP – Building modern web applications with PHP 8

The folks over at Spatie are at it again, this time with Front Line PHP. An ebook on cutting edge tactics in PHP 8, accompanied by videos and practical examples. The videos covering the new additions to PHP 8 are free to watch, and should give you an idea of what you can expect. At …

Convert Guzzle requests to curl commands with namshi/cuzzle

The other day the namshi/cuzzle PHP pacakge came in really handy. This library let’s you dump a Guzzle request to a cURL command for debug and log purposes This way I could test some things on the CLI, and easily share these tests with all my colleagues, including those without PHP installed. use Namshi\Cuzzle\Formatter\CurlFormatter; use …

Legacy to Laravel: How to Modernize an Aging PHP Application

The folks at Tighten: In this post, I’ll present some strategies we use at Tighten to convert legacy apps to Laravel gradually over time, without needing to perform a full rewrite. Whether you’re upgrading from an old framework or moving to a framework for the first time, following these steps will let you start benefitting …

PHP: Convert a Geolocation (Latitude / Longitude Coordinates) to a Timezone identifier

Part of a PHP project I’m working contains a list of sites/buildings. For each site/building we monitor some data, for example its energy usage. We decided that we wanted to generate a daily/weekly/monthly reports of the data, by aggregating the datapoints. As our sites/buildings are spread across the globe – and thus timezones – we …

PHP 8 in 8 Code Blocks

Brent has been following the PHP releases and featured up close. In this post he highlights 8 of the features that will make it into PHP 8 Attributes (aka Annotations) Union types The static return type The just-in-time Compiler throw in Expressions Non-capturing catches Trailing commas in parameter lists New str_* functions As a bonus …

PHPUnit: A Security Risk?

The author of PHPUnit was a bit surprised when he received a mail stating that PHPUnit was a security risk and hackers could remotely execute PHP code through a file named eval-stdin.php that ships used to ship with PHPUnit. // eval-stdin.php eval ('?>'. \file_get_contents('php://input')); Even though the eval-stdin.php file itself indeed was vulnerable, it never …

Sharing PHP-CS-Fixer Rules Across Projects and Teams

Tim MacDonald shares a way to sharing PHP-CS-Fixer rules across your projects. It involves in setting up on repo/package that contains the rules and a little helper class that takes in a PhpCsFixer\Finder instance (along with optional extra rules). <?php namespace TiMacDonald; use PhpCsFixer\Config; use PhpCsFixer\Finder; function styles(Finder $finder, array $rules = []): Config { …