forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export: import validation refactoring
- Loading branch information
Showing
194 changed files
with
4,132 additions
and
3,739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?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 | ||
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\Export\ImportHandler; | ||
|
||
use ILIAS\Data\Factory as DataFactory; | ||
use ILIAS\Export\ImportHandler\File\Factory as FileFactory; | ||
use ILIAS\Export\ImportHandler\I\FactoryInterface as ImportHandlerFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\File\FactoryInterface as FileFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\Parser\FactoryInterface as ParserFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\Path\FactoryInterface as PathFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\Schema\FactoryInterface as SchemaFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\Validation\FactoryInterface as ValidationFactoryInterface; | ||
use ILIAS\Export\ImportHandler\Parser\Factory as ParserFactory; | ||
use ILIAS\Export\ImportHandler\Path\Factory as PathFactory; | ||
use ILIAS\Export\ImportHandler\Schema\Factory as SchemaFactory; | ||
use ILIAS\Export\ImportHandler\Validation\Factory as ValidationFactory; | ||
use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory; | ||
use ilLanguage; | ||
use ilLogger; | ||
|
||
class Factory implements ImportHandlerFactoryInterface | ||
{ | ||
protected ilLogger $logger; | ||
protected ilLanguage $lng; | ||
protected ImportStatusFactory $import_status_factory; | ||
protected DataFactory $data_factory; | ||
|
||
public function __construct() | ||
{ | ||
global $DIC; | ||
$this->logger = $DIC->logger()->root(); | ||
$this->lng = $DIC->language(); | ||
$this->lng->loadLanguageModule("exp"); | ||
$this->import_status_factory = new ImportStatusFactory(); | ||
$this->data_factory = new DataFactory(); | ||
} | ||
|
||
public function parser(): ParserFactoryInterface | ||
{ | ||
return new ParserFactory( | ||
$this, | ||
$this->logger | ||
); | ||
} | ||
|
||
public function file(): FileFactoryInterface | ||
{ | ||
return new FileFactory( | ||
$this, | ||
$this->import_status_factory, | ||
$this->logger, | ||
$this->lng, | ||
$this->data_factory | ||
); | ||
} | ||
|
||
public function schema(): SchemaFactoryInterface | ||
{ | ||
return new SchemaFactory( | ||
$this, | ||
$this->data_factory, | ||
$this->logger | ||
); | ||
} | ||
|
||
public function path(): PathFactoryInterface | ||
{ | ||
return new PathFactory( | ||
$this->logger | ||
); | ||
} | ||
|
||
public function validation(): ValidationFactoryInterface | ||
{ | ||
return new ValidationFactory( | ||
$this->import_status_factory, | ||
$this, | ||
$this->logger | ||
); | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
components/ILIAS/Export/classes/ImportHandler/File/Factory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?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 | ||
* | ||
*********************************************************************/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ILIAS\Export\ImportHandler\File; | ||
|
||
use ILIAS\Data\Factory as DataFactory; | ||
use ILIAS\Export\ImportHandler\File\Namespace\Factory as FileNamespaceFactory; | ||
use ILIAS\Export\ImportHandler\File\XML\Factory as XMLFileFactory; | ||
use ILIAS\Export\ImportHandler\File\XSD\Factory as XSDFileFactory; | ||
use ILIAS\Export\ImportHandler\I\FactoryInterface as ImportHandlerFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\File\FactoryInterface as FileFactory; | ||
use ILIAS\Export\ImportHandler\I\File\Namespace\FactoryInterface as FileNamespaceFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\File\XML\FactoryInterface as XMLFileFactoryInterface; | ||
use ILIAS\Export\ImportHandler\I\File\XSD\FactoryInterface as XSDFileFactoryInterface; | ||
use ILIAS\Export\ImportStatus\ilFactory as ImportStatusFactory; | ||
use ilLanguage; | ||
use ilLogger; | ||
|
||
class Factory implements FileFactory | ||
{ | ||
protected ImportHandlerFactoryInterface $import_handler; | ||
protected ilLogger $logger; | ||
protected ilLanguage $lng; | ||
protected ImportStatusFactory $import_status_factory; | ||
protected DataFactory $data_factory; | ||
|
||
public function __construct( | ||
ImportHandlerFactoryInterface $import_handler, | ||
ImportStatusFactory $import_status_factory, | ||
ilLogger $logger, | ||
ilLanguage $lng, | ||
DataFactory $data_factory | ||
) { | ||
$this->import_handler = $import_handler; | ||
$this->import_status_factory = $import_status_factory; | ||
$this->logger = $logger; | ||
$this->lng = $lng; | ||
$this->data_factory = $data_factory; | ||
} | ||
|
||
public function xml(): XMLFileFactoryInterface | ||
{ | ||
return new XMLFileFactory( | ||
$this->import_handler, | ||
$this->import_status_factory, | ||
$this->logger, | ||
$this->lng, | ||
$this->data_factory | ||
); | ||
} | ||
|
||
public function xsd(): XSDFileFactoryInterface | ||
{ | ||
return new XSDFileFactory( | ||
$this->import_handler | ||
); | ||
} | ||
|
||
public function namespace(): FileNamespaceFactoryInterface | ||
{ | ||
return new FileNamespaceFactory(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.