ErrorHandler

It’s time for a custom error handler. The PHP core error handler is ok, but we want more. We will implement two error handlers. For production For development Of course you can use the production error handler in your development environment, but you will have less information 😉 You never should use the development error […]

Summary 1

The PHPluz library should look like this:

Config

It’s time to have a config class, so we can configure our project without changing code. You should change your code only if you have to fix bugs or expand/adjust your logic, but not if you want to have other configurations (e.g. path to logfile, debug mode, etc…). In this class we will read the configuration from […]

CsvIterator

Many websites must read csv files, to import customer data, to read some custom settings, etc… We will expand this class later to set the csv options from an xml config file or a database, but for now see examples below.

Functions class

Today I want to provide some (more or less) useful functions. You will need the external libraries Monolog and Psr Log. The documentation in the class should be sufficient to understand what the individual functions do.

Singleton

When designing web applications, it often makes sense conceptually and architecturally to allow access to one and only one instance of a particular class. The singleton pattern enables us to do this. The singleton pattern is useful when we need to make sure we only have a single instance of a class for the entire […]

Autoload

Let’s start with the Autoloader. We will create two classes: Autoload.php vendor/Psr/PsrAutoloader.php