PHP Fundamentals

Good to know

Training goal

To make the participants acquire the fundamental bases of creation of a Web application with the PHP language. Knowledge of the communication between the client and the server.

Detailed contents

The content is updated regularly. The pedagogical course is presented in the form of an Internet application project created by each participant. Practical work takes place throughout the training, which gradually leads the participants to correct their mistakes. The emphasis is on best practices.

Matériel pédagogique fourni

The trainer will distribute the training materials in electronic format at the end of the training.

In addition, the work done during these 3 days will result in the creation of a step-by-step versioned web application. Each participant is invited to keep on their machine the code of the training project, which they will have written themselves with the help of the trainer, because this code can be used as a technical base for future projects.

Prerequisites

In order to fully benefit from the training, participants must have previous professional experience in the following areas :

  • object-oriented PHP development
  • use of a relational database

Participants should have a computer with a LAMP environment, including preferably the following elements :

  • An internet connection allowing the installation of PHP extensions and packages from packagist and working with ease (if the training is held outside our premises),
  • An IDE they master (PHPStorm, SublimeText, VSCode, ...),
  • A UNIX shell,
  • A currently supported version of PHP (https://www.php.net/supported-versions.php),
  • Git installed (useful for composer dependencies),
  • One MySql/MariaDB server per person,
  • Administrator rights on the machine,

It is recommended for the participants to use a text editor they are comfortable with, so that they can focus on the training.

If the training is held in the Client's premises, we require for the Client to provide a separate room for the training to take place, big enough to accommodate all participants and the trainer, for the whole duration of the training. A video projector or wide screen TV must be provided so that the participants can see the trainer's laptop computer screen. A paperboard or whiteboard, and Internet access would be appreciated.

Training course

  1. History

    1. Static vs dynamic site

    2. Client / Server

    3. Interpreted language != compiled

    4. Reputation

      1. Performance comparison between versions

  2. Prepare your working environment

    1. Setup Apache / PHP / Mysql

      1. Windows

      2. Mac

      3. Linux

    2. The editors

      1. PHPStorm

      2. Vscode

  3. Error reporting: php.ini

  4. The syntax of the language

    1. Variables

    2. Control structures

    3. Arrays

    4. Functions

    5. PHP specificity

      1. == vs ===

  5. Object Oriented Programming (OOP)

    1. Class

      1. Variables

      2. Methods

      3. Constructor

      4. Visibility

      5. Abstract class

      6. Inheritance

      7. Interface

      8. Feature

      9. Specific syntax (instanceof, magic methods)

    2. Refactoring of current code to object

    3. Namespace

    4. Autoloading

      1. Make your own autoloading

    5. Composer

    6. Packagist

      1. Version

      2. composer.lock

      3. boostrap composer + use composer autoloading + install and use a lib

  6. Data transmission

    1. Via Form

      1. Form in GET method

      2. Practical: Searching via URL

    2. Via Form

      1. Form in POST method

      2. Adding an element

    3. The super globals

    4. Session and Cookies

      1. Practical: Connecting with a cookie

    5. Read / Write file

      1. Practical: Persistence via a json file

  7. Data management (via PDO)

    1. SQL script to provide and execute

    2. phpMyAdmin

      1. Install

    3. Reading

      1. Make a class responsible for reading elements

    4. Writing

      1. Make a class responsible for writing elements <= end of morning 3

    5. Making a small opening with Symfony

      1. Example of what is facilitated with Sf

      2. Autoloading

      3. Config

  8. Advanced

    1. Tools (PHPStan, php-cs-fixer, PHPUnit)

    2. Design patterns

    3. Reflection

They recommend our trainings