removeOldFeeds

The removeOldFeeds hook is triggered when old XML files are being removed from the Contao root directory. It does not pass an argument and expects an array of file names to preserve as return value.

Return Values

Return an array of XML file names (do not include file extension!) that must not be removed from the root directory. Return an empty array if you have nothing to keep.

Example

// src/EventListener/RemoveOldFeedsListener.php
namespace App\EventListener;

use Contao\CoreBundle\ServiceAnnotation\Hook;
use Terminal42\ServiceAnnotationBundle\ServiceAnnotationInterface;

class RemoveOldFeedsListener implements ServiceAnnotationInterface
{
    /**
     * @Hook("removeOldFeeds")
     */
    public function onRemoveOldFeeds(): array
    {
        // Return the names of your custom feeds which should not be removed
        return ['custom'];
    }
}

References