public function prepareLegacyHack()
    {
        $logger = $this->logger;

        // Add Contao hack.
        $this->enumLoader->add(function ($class) use ($logger) {
            if (substr($class, 0, 7) !== 'Contao\\') {
                try {
                    class_exists('Contao\\' . $class);
                } catch (ParentClassNotFoundException $exception) {
                    return null;
                }
                if (EnumeratingClassLoader::isLoaded('Contao\\' . $class)
                    && !EnumeratingClassLoader::isLoaded($class)
                ) {
                    class_alias('Contao\\' . $class, $class);

                    $logger->warning(
                        'Loaded class {class} as {alias} from deprecated Contao hack. ' .
                        'Please specify a custom loader hack if you want to keep this class loaded.',
                        array('class' => 'Contao\\' . $class, 'alias' => $class)
                    );

                    return true;
                }
            }

            return null;
        }, 'contao.hack');
    }