Blog | falk-m.de
Like other developers, I read articles, test new features, analyze code from others and so on.
Also, I have some interesting code snippets used in projects, if I need them, I always search in old projects.
This blog is my central place now, to collect interesting code snippets, features, etc. |
RSS Feed
Kirby CMS presentation
from falk-m.de
· 2025-04-19
PHPPRESENTATION
Funktionsweise Flat file CMS
blueprints
config
content managent
site-object, page-object, pages-collection
templating (templates, snippels, layout)
panel basics
extention basics (co...
MySQL, string length and a crazy behavior
from falk-m.de
· 2025-03-09
PHPMYSQL
This week I have a very crazy behavior when insert rows in a database.
Given is the following table:
CREATE TABLE IF NOT EXISTS `text_test` (
`id` INT NOT NULL AUTO_INCREMENT,
`text...
basic instruction to php unit tests
from falk-m.de
· 2025-03-05
PHP
It follows a short basic instruction to start with unit tests in PHP.
Install
There are some other ways, but the best way is to install with composer.
{
"require-dev": {
"phpunit/phpuni...
require git repos with composer
from falk-m.de
· 2025-03-04
GITPHP
As a PHP developer, you will certainly also love composer to manage dependencies.
Sometimes I need another repo in a project. There is an easy way to use other repos without a registration of them ...
PHP PDO Basics
from falk-m.de
· 2025-02-13
PHP
This little post is not about SQL or SQL syntax, only a little example about the usage of the PHP PDO adapter for database query.
Create connection
$conn = new PDO("mysql:host=mysql;dbname=db", 'db...
anonymous classes in php
from falk-m.de
· 2024-04-02
PHP
Since PHP Version 5.3., PHP supports anonymous functions and classes.
Here is an example for an anonymous function:
$add = function(int $a, int $b){
return $a + $b;
}
If you want to use a varia...
htaccess best practices
from falk-m.de
· 2024-02-16
PHPSECURITY
SEO and performance
set expiration header
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 week"
ExpiresByType text/html "access plus 600 seconds"
Expir...
Become a PHP professional developer | Part 1
from falk-m.de
· 2024-02-16
PHP
I want to ride a series to become a professional skill set in web development with PHP.
First, I check online applications searching a senior PHP developers.
Here is a list of required skills.
requ...
Post messages to Slack Channel
from falk-m.de
· 2024-02-08
PHP
find the channel id
There are many ways to find the channel id.
The simplest is, to use the Slack browser application and copy the channel id from the URL after you enter the channel.
The URL looks...
Server side events with php
from falk-m.de
· 2024-02-06
PHPJS
There are different ways for near real-time browser updates by a server message.
With a PHP website on the server side, you are very restricted, because in normal case you can't run a web socket pr...
Server side event tracking with matomo
from falk-m.de
· 2024-01-31
PHP
if you want to track events, like a click, an error or a login try,
you can do this serverside without cookies, with matomo.
First download and install matomo.
Then you need an authentification tok...
Rewrite to public folder
from falk-m.de
· 2024-01-30
PHP
If you install the symphony framework or a shopware webshop for example, you have to change the routing on our web server, because the applications require, that the webroot be pointed to the '/pub...
encrypt emails with s/mime on PHP and send with PHPMailer over smtp
from falk-m.de
· 2024-01-25
PHP
php mail can sign messages but not encrypt them.
For a project, I have to encrypt the mail Body with php.
First, I have to receive the public key from the recipient.
In my case, I test it with the ...
Mongo Light
from falk-m.de
· 2023-12-10
PHP
There is a great CRM System EspoCrm.
In Espo, you can administrate the object types, their properties and their relations in the user interface.
This schema is then automatically created in a MySQL...
URL safe encoding
from falk-m.de
· 2023-12-09
PHP
protected function urlSafeBase64Decode(string $data)
{
$value = \base64_decode(\strtr($data, '-_', '+/'));
$data = \json_decode($value);
if (\JSON_ERROR_NONE !== \json_...