public static function postInstall(Event $event)
    {
        $vendor_dir = $event->getComposer()->getConfig()->get('vendor-dir');
        $base_dir = dirname($vendor_dir);
        $config_file = $base_dir . '/config/public_vendor.json';
        $gitignore_file = $base_dir . '/.gitignore';

        if (file_exists($config_file)) {
            $config = json_decode(file_get_contents($config_file), true);
            if ($config === null) {
                throw new \RuntimeException('Error loading configuration file');
            }

            /*
             * Create symbolic links
             */
            foreach ($config['map'] as $map) {
                if (array_key_exists($map['vendor'], $config['vendors'])) {
                    $destiny = $base_dir . '/'
                             . $config['vendors'][$map['vendor']] . '/'
                             . trim($map['destiny'], '/');
                    $source = $vendor_dir . '/' . trim($map['source'], '/');
                    if (!file_exists(dirname($destiny))) {
                        mkdir(dirname($destiny), 0755, true);
                    }
                    if (!file_exists($destiny)) {
                        symlink($source, $destiny);
                    }
                } else {
                    throw new \RuntimeException('Undefined vendor');
                }
            }

            /*
             * Update gitignore
             */
            $gitignore = (file_exists($gitignore_file))
                ? file($gitignore_file, FILE_IGNORE_NEW_LINES)
                : ['/vendor/'];
            foreach ($config['vendors'] as $vendor_path) {
                $ignore_path = '/' . trim($vendor_path, '/') . '/';
                if (!in_array($ignore_path, $gitignore)) {
                    $gitignore[] = $ignore_path;
                }
            }
            $gitignore_handle = fopen($gitignore_file, 'w');
            fwrite($gitignore_handle, implode("\n", $gitignore) . "\n");
            fclose($gitignore_handle);
        } else {
            throw new \RuntimeException('Configuration file not found');
        }
    }