<?php
/**
 * i-doit
 *
 * Module initializer
 *
 * @package     i-doit
 * @subpackage  Modules
 * @copyright   synetics GmbH
 * @license     http://www.i-doit.com/license
 */

use idoit\Component\Autoloader;
use idoit\Module\QCW\ProfileDownloadType;
use idoit\Module\QCW\ProfileUploadType;
use idoit\Psr4AutoloaderClass;
use Symfony\Component\DependencyInjection\ContainerInterface;

if (class_exists(Psr4AutoloaderClass::class)) {
    Psr4AutoloaderClass::factory()
        ->addNamespace('idoit\Module\QCW', __DIR__ . '/src/');
}

if (class_exists(Autoloader::class)) {
    Autoloader::appendClassmap(require __DIR__ . '/classmap.php');
}

/** @var idoit\Component\Upload\Upload $upload */
$upload = isys_application::instance()->container->get('upload', ContainerInterface::NULL_ON_INVALID_REFERENCE);
$upload?->registerUploadType('qcw.profile-upload', new ProfileUploadType());

/** @var idoit\Component\Download\Download $download */
$download = isys_application::instance()->container->get('download', ContainerInterface::NULL_ON_INVALID_REFERENCE);
$download?->registerDownloadType('qcw.profile-download', new ProfileDownloadType());
