Skip to content

Instantly share code, notes, and snippets.

@klees
Created September 7, 2022 12:46
Show Gist options
  • Save klees/62396c84d0d89339d3994d7fdce2a2b7 to your computer and use it in GitHub Desktop.
Save klees/62396c84d0d89339d3994d7fdce2a2b7 to your computer and use it in GitHub Desktop.
<?php
/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/
class FileUpload implements Component
{
/** ... **/
public function init($c) {
$local = new DI\Container();
$c["upload"] = fn ($c) => new \ILIAS\FileUpload\FileUploadImpl(
$local["processor-manager"],
$c["filesystem"],
$c["http"]
);
$local["preprocessor.virusscanner"] = fn ($local) => new VirusScannerPreProcessor($c["virusscanner"]);
$local["processor-manager"] = fn ($local) => new PreProcessorManagerImpl();
/** ... **/
}
/** ... **/
}
/** INITIALISATION THEN JUST IS: **/
$DIC = new DI\Container();
foreach ($components as $c) {
$c->init($DIC);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment