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 […]
The PHPluz library should look like this:
... (Monolog library)
... (Psr Log library)
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 […]
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.
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.
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 […]
Let’s start with the Autoloader. We will create two classes: Autoload.php vendor/Psr/PsrAutoloader.php