<?php
/**
 * @package   Essentials YOOtheme Pro 2.2.16 build 0813.1608
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials\Storage;

use ZOOlanders\YOOessentials\Config\ConfigUpdater;

return [
    'routes' => [['post', StorageAdapterController::PRESAVE_ENDPOINT, StorageAdapterController::class . '@presave']],

    'events' => [
        'customizer.init' => [
            Listener\LoadCustomizerData::class => ['@handle', -10],
        ],

        'theme.init' => [
            Listener\RegisterStorages::class => ['@handle', -10],
        ],

        'yooessentials.config.load' => [
            Listener\ValidateStorages::class => ['@load'],
        ],
    ],

    'loaders' => [
        'yooessentials-storages' => new StorageAdapterLoader(),
    ],

    'services' => [
        StorageService::class => '',
    ],

    'extend' => [
        ConfigUpdater::class => function (ConfigUpdater $updater) {
            $updater->addGlobals(require __DIR__ . '/updates.php');
        },
    ],

    'yooessentials-bootstrap' => [
        __DIR__ . '/adapters/Local/bootstrap.php',
        __DIR__ . '/adapters/FTP/bootstrap.php',
        __DIR__ . '/adapters/S3/bootstrap.php',
    ],
];
