Recursively delete directories Gau Frette FTP adapter

To with FTP recursively delete files and directories adapter Gau Frette, you can apply following trick to avoid the error message:

ftp_rmdir(): Directory not empty.

1. just delete all files

2. then delete the lowest directories up to the top:

 * @param Filesystem $fileSystem
function deleteAllFilesInDirectory(Filesystem $fileSystem)
    // delete files first, than directories
    foreach ($fileSystem->keys() as $key) {
        if (!$fileSystem->isDirectory($key)) {
    $keys = $fileSystem->keys();
    usort($keys, function (string $a, string $b){
        $aCount = substr_count($a, '/');
        $bCount = substr_count($b, '/');
        return $bCount <=> $aCount;
    foreach ($keys as $key) {

Successfully passed certification to become a Zend certified engineer

At the 1. March I made successfully the examination for which I learned the last few months. As was to be expected, were the questions very, very tricky, but the preparation has paid off.



I can anyone recommend before from the Book PHP7 Zend Certification Study Guideto read:

In addition, you should all tests on the page to 80% can successfully answer, then you're ready for the exam.

Sign up for the exam

You can be on the login page for the examination , take one then nearby in a testing center of their choice can under strictest conditions.

Annually there is a voucher for the exam, If you're lucky.

PHP: Parse Error: syntax error, unexpected ‘:’, expecting ‘;’ or ‘{‘

The very cryptic error message

Parse Error: syntax error, unexpected ':', expecting ';' or '{'

It is in most cases a PHP7 incompatibility.

The code contains a language feature, What is only available at PHP7:

Return type definitions (Definition of the return value). Example:

function myFuntion($input): array
    return ['foo'];

This can strength enable, the function must return an array, otherwise an TypeErrror is thrown.

To make the code less PHP version running, muss man die Return Type Definition entfernen:

function myFuntion($input)
    return ['foo'];

Special case: composer more…

Project: baby

The just completed project baby deals with the issues relating to the development of the own child:

  • How great my child be in x years
  • My child is like in x years
  • Is my child too hard or too thin
  • What dress size is wear it when?

The Web page is to help parents find out, When you need to buy what dress size, the approaching winter/summer home to have the appropriate.

Parents can thus einschätzne, If the child is too thin or too thick for your age/size/weight ratio.

The following technologies were used for the realization:

Symfony 3, Docker, MySQL, PHP, GIT, Google material design, Amazon AWS

Amazon automatic price adjustment tool

I developed a tool just for a customer, with the one the prices of own goods at Amazon can automatically adapt. In the competition to Goth are determined analyzes reliability and therefore a fair price condition of the product and seller for the goods. There are all the data, about the API are available for the determination of price with used, as e.g.. Seller feedback (Reviews of the dealer), whether Amazon itself sent, Shipping time and much more.

The tool compares the rates between the various Amazon optional platforms in Europe (DE, UK, IT, IT, FR) Platforms but also outside Europe, like Japan or America and händelt the different currencies.

The result can be sent directly to Amazon via the API and the prices will be immediately updated.

Amazon Preisanpassung

Screenshot Preisanpassungs Tool


The application is in PHP with symfony 3 written and has a front end with Twitter bootstrap 3 and a MySQL database. There's also a vagrant environment for developing with PHP7. 1 and nginx. Be carried out can the whole thing with a simple XAMPP environment or vagrant virtual box at the customer locally on a PC.

If you are also interested in such a tool, allows you to Contact.

PHP How to debug Segmentation Faults

To Segementation faults, like PHP7 currently occurring in to determine and analyze, can you proceed in the following way

1. Specifying the location for the core dumps

echo '/tmp/coredump_%e_%p' > /proc/sys/kernel/core_pattern

2. enable core dumps in PHP-FPM

in the file: PHP-fpm.conf:

rlimit_core = unlimited     ; vorher: 0

3. Restart PHP FPM

service php-fpm restart

4. Analyzing the core dumps with gdb more…

PHP 7 – the new features at a glance – Part 2


Expactations can mark places in your code, which should not be reached actually, But if it is, can leave a message in the production environment, to other programmers to debug and understand the codes to help. The parameter expression is evaluated and a false value will raise an AssertionException thrown.


void assert (mixed $expression [, mixed $message]);

The php.ini configuration variable Zend.assertions can 3 Value be more…