Tag Archives: php

Missing ~/.valet folder?

Earlier today I updated my Valet installation from version 2.0.x to 2.1.1. To my surprise the ~/.valet/ folder had gone missing, immediately making me think the update process somehow had gone wrong (even though Valet kept on serving sites). Turns … Continue reading

Original Content , 1 Comment

Swoole – PHP asynchronous programming framework

Swoole is an high-performance network framework using an event-driven, asynchronous, non-blocking I/O model which makes it scalable and efficient. It is written in C language without 3rd party libraries as PHP extension. It enables PHP developers to write high-performance, scalable, … Continue reading

Elsewhere , , Leave a comment

30 seconds of PHP code

A curated collection of useful PHP snippets that you can understand in 30 seconds or less. These functions – like endsWith and startsWith for strings – should be part of the PHP core. 30 seconds of PHP code → (via … Continue reading

Elsewhere , Leave a comment

Switching PHP versions with Laravel Valet

⚠️ Switching to a PHP version lower van 7.1 with Valet 2.0 won’t work at the time of writing, as Valet 2.0 does not work with PHP < 7.1 until this issue is resolved. ℹ️ UPDATE 2018.10.23: Freek has developed … Continue reading

Elsewhere , , Leave a comment

Destructuring arrays in PHP: Practical examples

Being more focussed on JavaScript nowadays, I kinda forgot that it’s possible to destructure arrays in PHP ever since the release of PHP 7.1. Frank de Jonge provides us with some practical examples such as this simple one: // JavaScript … Continue reading

Elsewhere , , , Leave a comment

IoC containers beyond constructor injection

Talk by Hannes Van De Vreken, as given at the recent phpCE conference in Poland: Did you know your IoC container can do a whole lot more than just constructor injection? Besides that it is actually packed with features. Inflectors, … Continue reading

Elsewhere , , Leave a comment

Easily set Content Security Policy headers in Laravel with laravel-csp

Speaking of Content Security Policy, the folks at Spatie – who else? – have created a Laravel Package to easily take care or your CSP needs in a Laravel-based app. Even without knowing the inner workings of the packge, the … Continue reading

Elsewhere , , , Leave a comment

PHP Session Locking: How to Prevent Blocking Requests

Today I learned about “PHP Session Locking”: PHP writes its session data to a file by default. When a request is made to a PHP script that starts the session (session_start()), this session file is locked. What this means is … Continue reading

Elsewhere , , Leave a comment

Browsershot: Convert a webpage to an image or PDF using headless Chrome

The folks over at Spatie have just release Browsershot v3: Browsershot is a PHP package which can convert a webpage to an image or pdf. The conversion is done behind the scenes by Puppeteer which controls a headless version of … Continue reading

Elsewhere , , , , Leave a comment

Macroable – A Trait to Dynamically add Methods to a PHP Class

New package by the folks from Spatie: We recently released our newest package called macroable. It contains a trait that, when applied to class, can dynamically add methods to that class. This trait is basically a stand alone version of … Continue reading

Elsewhere , Leave a comment