ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Manager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
33class Manager extends BaseManager
34{
38 public function upload(
39 UploadResult $result,
40 ResourceStakeholder $stakeholder,
41 ?string $revision_title = null
43 if ($result->isOK()) {
44 $info_resolver = new UploadInfoResolver(
45 $result,
46 1,
47 $stakeholder->getOwnerOfNewResources(),
48 $revision_title ?? $result->getName()
49 );
50
51 $resource = $this->resource_builder->new(
52 $result,
53 $info_resolver
54 );
55 $resource->addStakeholder($stakeholder);
56 $this->resource_builder->store($resource);
57
58 return $resource->getIdentification();
59 }
60 throw new \LogicException("Can't handle UploadResult: " . $result->getStatus()->getMessage());
61 }
62
63 public function stream(
64 FileStream $stream,
65 ResourceStakeholder $stakeholder,
66 ?string $revision_title = null
69 $stream,
70 $stakeholder,
71 ResourceType::SINGLE_FILE,
72 $revision_title
73 );
74 }
75
76}
newStreamBased(FileStream $stream, ResourceStakeholder $stakeholder, ResourceType $type, ?string $revision_title=null)
Definition: BaseManager.php:79
upload(UploadResult $result, ResourceStakeholder $stakeholder, ?string $revision_title=null)
@description Creates a new resource from an upload, the status in this case is always PUBLISHED.
Definition: Manager.php:38
stream(FileStream $stream, ResourceStakeholder $stakeholder, ?string $revision_title=null)
Definition: Manager.php:63
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
The base interface for all filesystem streams.
Definition: FileStream.php:32
if(!file_exists('../ilias.ini.php'))