PHP

  • How to create a PHP package. Part 2: PHPUnit

    How to create a PHP package. Part 2: PHPUnit

    This is the second part of a series on creating a PHP package.

    In the previous part, we initialized a project using the composer and wrote the code itself. In this part, we will integrate the PHPUnit into our project and write tests.

    Code should be covered with tests. This will help to avoid bugs when modifying the code. When we connect the CI to the repository, tests will run automatically as pull requests are created.

  • How to create a PHP package. Part 1: Composer

    How to create a PHP package. Part 1: Composer

    If you created a useful PHP library and want to share it with others or reuse it in your other projects, it will be convenient to pack it into a separate package. In this series of articles, we'll discover how to properly organize code into a reusable package, create a structure of the project, write unit tests, create an automatic code style check, implement CI using github actions, and much more. As an example, we will write step by step a small PHP library for syntax highlighting. It will accept text and return highlighted PHP code.

  • Using AWS Lambda Layers for PHP

    Using AWS Lambda Layers for PHP

    Until recently AWS Lambda did not support PHP, but with the advent of the runtime API and layers, now we able to implement an AWS Lambda runtime in any programming language including PHP. Each layer can contain libraries, a custom runtime, or other dependencies. You can create layers, or use layers published by AWS and other AWS customers.

  • Using PHP with Apache Kafka

    Using PHP with Apache Kafka

    Apache Kafka is a fast, real-time, distributed, fault-tolerant message broker.

    Using Kafka, you can transfer streaming data to the cluster, which is generated continuously, for example, a history of website visits, financial transactions, online shopping orders, application logs, etc. This information can help to understand what is happening with the data right now, create recommendations, use machine learning or aggregate data for further analysis. All this takes seconds or minutes, instead of hours and days.