Skip to main content

One min read
Christophe

Sticky scroll in vscode

https://dev.to/amrsamy/vs-code-sticky-scroll-2jcd

vscode has recently added a really useful new feature: sticky scroll.

This function allows you to scroll through a document such as a Markdown file, a source code written in PHP or JavaScript or any other supported language and, as you scroll, block contextual information such as the name of the class, the name of the function, the start of the loop, etc. in the upper part of the editor.

5 min read
Christophe

Working with Laravel events

When I started developing for the Joomla CMS (that was 15 years ago, in 2009), one of the things I liked most was the notion of events.

For example An article is about to be posted, An article has been posted, A user has registered, ... i.e. actions that are announced by the CMS and to which you can react.

When An article is about to be displayed is generated, you can have one (or more) pieces of code interact with this event. You can add dynamic content, you can also deny the article to be displayed if certain conditions are not met.

12 min read
Christophe

Using volumes with Docker, use cases

When working with a Docker container, data can be persistent or not. Imagine you're creating a localhost website with Joomla, Wordpress or any other tool (Laravel, Symfony, etc.).

You've perfectly created the various Docker files needed to run the local site, you've run the command docker compose up --detach to start the containers and now you're busy installing the site. After a few moments, your local site is up and you can start developing its functionalities.

By default, if you haven't taken any precautions, the moment you stop the container (docker compose down), you'll kill your site, i.e. by default, having not taken care to save your data (your site, your database), everything will be lost and reset the next time you run docker compose up --detach. Well... Maybe that was your wish (something totally ephemeral); maybe not;

4 min read
Christophe

FrankenPHP

Version updated on November 21, 2023 after a discussion with Alexandre about making his Docker image available on hub.docker.com

Based on their documentation, FrankenPHP is 3.5 faster than PHP FPM.

It is still fairly young for use on production sites, but because it's so promising, it's certainly worth playing with when developing locally.

Alexandre Elis茅 has written a script to use FrankenPHP with Joomla. You can find the source here: https://github.com/alexandreelise/frankenphp-joomla.

4 min read
Christophe

Share data between your running Docker container and your computer

If you don't have Docker yet, please consult my Install Docker and play with PHP post first.

When running Docker without specifying a volume, everything done during the execution of Docker is done in memory. In other words: if the PHP script you run from Docker creates folders or files, these will never be created on your disk. They will be created exclusively in memory.