|
ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
|
Every resource of the mail stakeholder belongs to exactly one collection (pool, compose stage, draft, scheduled or sent mail). More...
Inheritance diagram for ilFileDataMail:
Collaboration diagram for ilFileDataMail:Public Member Functions | |
| __construct (public int $user_id=0) | |
| getUploadLimit () | |
| getAttachmentsTotalSizeLimit () | |
| getMailPath () | |
| getAbsoluteAttachmentPoolPathPrefix () | |
| getAttachmentPathAndFilenameByMd5Hash (string $md5FileHash, int $mail_id) | |
| hasLegacyAttachmentDirectory (int $mail_id) | |
| checkReadWrite () | |
| uploadToPool (UploadResult $result) | |
| getUserPoolRcid () | |
| getUserPoolFilesData () | |
| isLegacyPoolItemIdentifier (string $identifier) | |
| legacyPoolFilenameFromIdentifier (string $identifier) | |
| migrateLegacyPoolFilenameToResource (string $filename) | |
| resolvePoolIdentifiersToResources (array $identifiers) | |
| isInUserPool (ResourceIdentification $identification) | |
| adoptPoolResourcesToCollection (?ResourceCollectionIdentification $rcid, array $resource_identifications) | |
| removeFromPool (ResourceIdentification $rid) | |
| poolResourceHash (ResourceIdentification $rid) | |
| isCollectionReferenced (ResourceCollectionIdentification $rcid) | |
| A Mail collection is referenced as long as a mail (sent, received, draft, outbox), a compose stage or a user's attachment pool points to it. More... | |
| releaseCollectionIfUnreferenced (ResourceCollectionIdentification $rcid) | |
| Removes a Mail collection nobody references anymore, together with its resources. More... | |
| isCollectionExclusivelyOwnedByMail (ResourceCollectionIdentification $rcid) | |
| True if the collection can be handed over to delivered mails without copying it: it is Mail-owned and nobody references it. More... | |
| unlinkFile (string $a_filename) | |
| getAbsoluteAttachmentPoolPathByFilename (string $filename) | |
| Resolves a path for a passed filename in regards of a user's mail attachment pool, meaning attachments not being sent. More... | |
| checkFilesExist (array $a_files) | |
| assignAttachmentsToCollection (int $mail_id, ResourceCollectionIdentification $rcid) | |
| replaceMailAttachmentCollection (int $mail_id, ?ResourceCollectionIdentification $rcid) | |
| Points a mail (draft, outbox) to the passed collection (or to none). More... | |
| getRcidForMail (int $mail_id) | |
| deassignAttachmentFromDirectory (int $a_mail_id) | |
| deliverAttachmentsAsZip (string $basename, int $mail_id, array $files=[], bool $is_draft=false) | |
| getStakeholder () | |
| canUseResourceInCompose (ResourceIdentification $identification) | |
| The compose form only shows files of the user's compose stage. More... | |
| addResourceToStage (ResourceIdentification $identification) | |
| Adds a just uploaded resource to the compose stage. More... | |
| removeFromStage (ResourceIdentification $identification) | |
| restrictStageTo (array $rid_strings) | |
| Removes all files from the compose stage which are not part of the submitted form. More... | |
| streamFromPath (string $absolute_path, ?string $revision_title=null) | |
| uploadToIrss (UploadResult $result) | |
| createCollectionFromPoolFilenames (array $filenames) | |
| migrateLegacyPoolAttachments (MailAttachments $attachments) | |
| adoptPoolFilenamesToCollection (?ResourceCollectionIdentification $rcid, array $filenames) | |
| createStageFromLegacyMailAttachments (int $mail_id, array $filenames) | |
| Creates a stage collection from a not yet migrated (directory based) mail, e.g. More... | |
| createCollectionFromContent (string $name, string $content) | |
| copyCollection (ResourceCollectionIdentification $source) | |
| Copies all files of the passed collection (of the mail system or of another component) into a new collection of the mail system. More... | |
| applyPoolSelectionToStage (array $selected_pool_resources) | |
| Applies a selection of the attachment pool to the compose stage: pool files are matched by their hashed name, selected files missing in the stage are copied into it, deselected ones are removed. More... | |
| getPoolResourcesInStage (ResourceCollectionIdentification $stage_rcid) | |
| getCollection (ResourceCollectionIdentification $rcid) | |
| getResourceIdByHash (ResourceCollectionIdentification $rcid, string $hash) | |
| getRidsFromCollection (ResourceCollectionIdentification $rcid) | |
| getAttachmentListing (ResourceCollectionIdentification $rcid) | |
| Keyed by resource id. More... | |
| deliverFile (ResourceCollectionIdentification $rcid, string $md5_hash) | |
| deliverCollectionAsZip (ResourceCollectionIdentification $rcid, string $zip_basename) | |
| removeCollection (ResourceCollectionIdentification $rcid, bool $delete_resources=false) | |
| Removes the collection. More... | |
| releaseSourceCollectionAfterDelivery (ResourceCollectionIdentification $rcid) | |
| Drops the source collection after it has been delivered. More... | |
| getIrssMimeAttachments (ResourceCollectionIdentification $rcid) | |
Public Member Functions inherited from ilFileData | |
| __construct () | |
| checkPath (string $a_path) | |
| getPath () | |
Public Member Functions inherited from ilFile | |
| deleteTrailingSlash (string $a_path) | |
| delete trailing slash of path variables More... | |
Data Fields | |
| const string | POOL_RCID_PREF_KEY = 'mail_attachment_pool_rcid' |
| const string | LEGACY_POOL_ITEM_PREFIX = 'legacy:' |
| string | $mail_path |
Protected Member Functions | |
| initAttachmentMaxUploadSize () | |
Protected Attributes | |
| int | $mail_max_upload_file_size |
| Filesystem | $tmp_directory |
| Filesystem | $storage_directory |
| ilDBInterface | $db |
| ILIAS | $ilias |
Protected Attributes inherited from ilFile | |
| string | $path |
Private Attributes | |
| readonly Services | $irss |
| readonly ilMailAttachmentStakeholder | $stakeholder |
Every resource of the mail stakeholder belongs to exactly one collection (pool, compose stage, draft, scheduled or sent mail).
Collections are copied when they change hands, so releasing a collection that no mail, stage or pool references removes its resources as well.
Definition at line 37 of file class.ilFileDataMail.php.
| ilFileDataMail::__construct | ( | public int | $user_id = 0 | ) |
Definition at line 51 of file class.ilFileDataMail.php.
References $DIC, ILIAS\GlobalScreen\Provider\__construct(), checkReadWrite(), ilFileData\getPath(), initAttachmentMaxUploadSize(), and MAILPATH.
Here is the call graph for this function:
|
private |
Adds a resource to the user's pool.
A pool file with the same name is replaced, like the legacy pool overwrote files with the same name.
Definition at line 224 of file class.ilFileDataMail.php.
References adoptPoolResourcesToCollection(), deleteResource(), getCollection(), persistUserPoolRcid(), poolResourceHash(), removeFromPool(), resolveUserPoolRcid(), resourceIdByHashInCollection(), and ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Referenced by uploadToPool().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::addResourceToStage | ( | ResourceIdentification | $identification | ) |
Adds a just uploaded resource to the compose stage.
The returned collection must be persisted as stage if it was created.
Definition at line 1014 of file class.ilFileDataMail.php.
| ilFileDataMail::adoptPoolFilenamesToCollection | ( | ?ResourceCollectionIdentification | $rcid, |
| array | $filenames | ||
| ) |
| list<string> | $filenames Pool filenames without user prefix |
Definition at line 1136 of file class.ilFileDataMail.php.
| ilFileDataMail::adoptPoolResourcesToCollection | ( | ?ResourceCollectionIdentification | $rcid, |
| array | $resource_identifications | ||
| ) |
| list<ResourceIdentification> | $resource_identifications |
Definition at line 420 of file class.ilFileDataMail.php.
Referenced by addResourceToPool().
Here is the caller graph for this function:| ilFileDataMail::applyPoolSelectionToStage | ( | array | $selected_pool_resources | ) |
Applies a selection of the attachment pool to the compose stage: pool files are matched by their hashed name, selected files missing in the stage are copied into it, deselected ones are removed.
| list<ResourceIdentification> | $selected_pool_resources |
Definition at line 1267 of file class.ilFileDataMail.php.
|
private |
Definition at line 1550 of file class.ilFileDataMail.php.
| ilFileDataMail::assignAttachmentsToCollection | ( | int | $mail_id, |
| ResourceCollectionIdentification | $rcid | ||
| ) |
Definition at line 633 of file class.ilFileDataMail.php.
|
private |
Unique per resource: equal file names in one collection must stay distinguishable.
Definition at line 1443 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Here is the call graph for this function:| ilFileDataMail::canUseResourceInCompose | ( | ResourceIdentification | $identification | ) |
The compose form only shows files of the user's compose stage.
Definition at line 1005 of file class.ilFileDataMail.php.
| ilFileDataMail::checkFilesExist | ( | array | $a_files | ) |
| list<string> | $a_files |
Definition at line 620 of file class.ilFileDataMail.php.
| ilFileDataMail::checkReadWrite | ( | ) |
Definition at line 171 of file class.ilFileDataMail.php.
Referenced by __construct().
Here is the caller graph for this function:
|
private |
Definition at line 295 of file class.ilFileDataMail.php.
|
private |
Definition at line 1406 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Referenced by resolveUserPoolRcid().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::copyCollection | ( | ResourceCollectionIdentification | $source | ) |
Copies all files of the passed collection (of the mail system or of another component) into a new collection of the mail system.
The source stays untouched.
Definition at line 1247 of file class.ilFileDataMail.php.
|
private |
| list<ResourceIdentification> | $resource_identifications |
Definition at line 1347 of file class.ilFileDataMail.php.
| ilFileDataMail::createCollectionFromContent | ( | string | $name, |
| string | $content | ||
| ) |
Definition at line 1217 of file class.ilFileDataMail.php.
References ilFileUtils\_sanitizeFilemame().
Here is the call graph for this function:| ilFileDataMail::createCollectionFromPoolFilenames | ( | array | $filenames | ) |
| list<string> | $filenames Pool filenames without user prefix |
Definition at line 1113 of file class.ilFileDataMail.php.
|
private |
| list<ResourceIdentification> | $resource_identifications Resources not yet part of any collection |
Definition at line 1097 of file class.ilFileDataMail.php.
| ilFileDataMail::createStageFromLegacyMailAttachments | ( | int | $mail_id, |
| array | $filenames | ||
| ) |
Creates a stage collection from a not yet migrated (directory based) mail, e.g.
when forwarding it.
| list<string> | $filenames |
Definition at line 1184 of file class.ilFileDataMail.php.
References $filename.
| ilFileDataMail::deassignAttachmentFromDirectory | ( | int | $a_mail_id | ) |
Definition at line 710 of file class.ilFileDataMail.php.
References $res, and ILIAS\Repository\int().
Here is the call graph for this function:
|
private |
Definition at line 759 of file class.ilFileDataMail.php.
References ilFileUtils\delDir().
Here is the call graph for this function:
|
private |
Definition at line 551 of file class.ilFileDataMail.php.
Referenced by addResourceToPool().
Here is the caller graph for this function:| ilFileDataMail::deliverAttachmentsAsZip | ( | string | $basename, |
| int | $mail_id, | ||
| array | $files = [], |
||
| bool | $is_draft = false |
||
| ) |
| list<string> | $files |
Definition at line 930 of file class.ilFileDataMail.php.
| ilFileDataMail::deliverCollectionAsZip | ( | ResourceCollectionIdentification | $rcid, |
| string | $zip_basename | ||
| ) |
Definition at line 1513 of file class.ilFileDataMail.php.
| ilFileDataMail::deliverFile | ( | ResourceCollectionIdentification | $rcid, |
| string | $md5_hash | ||
| ) |
Definition at line 1503 of file class.ilFileDataMail.php.
| ilFileDataMail::getAbsoluteAttachmentPoolPathByFilename | ( | string | $filename | ) |
Resolves a path for a passed filename in regards of a user's mail attachment pool, meaning attachments not being sent.
Definition at line 600 of file class.ilFileDataMail.php.
References $filename.
| ilFileDataMail::getAbsoluteAttachmentPoolPathPrefix | ( | ) |
Definition at line 92 of file class.ilFileDataMail.php.
|
private |
Definition at line 1394 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Here is the call graph for this function:| ilFileDataMail::getAttachmentListing | ( | ResourceCollectionIdentification | $rcid | ) |
Keyed by resource id.
Equal display titles must not collapse two download hashes.
Definition at line 1480 of file class.ilFileDataMail.php.
Referenced by ilMailFolderGUI\getAttachmentHashes().
Here is the caller graph for this function:| ilFileDataMail::getAttachmentPathAndFilenameByMd5Hash | ( | string | $md5FileHash, |
| int | $mail_id | ||
| ) |
| OutOfBoundsException |
Definition at line 101 of file class.ilFileDataMail.php.
References $files, $info, ilFile\$path, $res, ilFileUtils\getDir(), getMailPath(), getRcidForMailOfUser(), and getResourceIdByHash().
Here is the call graph for this function:
|
private |
Definition at line 153 of file class.ilFileDataMail.php.
Referenced by hasLegacyAttachmentDirectory().
Here is the caller graph for this function:| ilFileDataMail::getAttachmentsTotalSizeLimit | ( | ) |
Definition at line 77 of file class.ilFileDataMail.php.
| ilFileDataMail::getCollection | ( | ResourceCollectionIdentification | $rcid | ) |
Definition at line 1365 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Referenced by addResourceToPool().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::getIrssMimeAttachments | ( | ResourceCollectionIdentification | $rcid | ) |
Definition at line 1586 of file class.ilFileDataMail.php.
References $info.
| ilFileDataMail::getMailPath | ( | ) |
Definition at line 87 of file class.ilFileDataMail.php.
References $mail_path.
Referenced by getAttachmentPathAndFilenameByMd5Hash().
Here is the caller graph for this function:| ilFileDataMail::getPoolResourcesInStage | ( | ResourceCollectionIdentification | $stage_rcid | ) |
Definition at line 1310 of file class.ilFileDataMail.php.
| ilFileDataMail::getRcidForMail | ( | int | $mail_id | ) |
Definition at line 689 of file class.ilFileDataMail.php.
References $res.
|
private |
Definition at line 674 of file class.ilFileDataMail.php.
References $res, and ilDBConstants\T_INTEGER.
Referenced by getAttachmentPathAndFilenameByMd5Hash().
Here is the caller graph for this function:| ilFileDataMail::getResourceIdByHash | ( | ResourceCollectionIdentification | $rcid, |
| string | $hash | ||
| ) |
Definition at line 1411 of file class.ilFileDataMail.php.
Referenced by getAttachmentPathAndFilenameByMd5Hash().
Here is the caller graph for this function:| ilFileDataMail::getRidsFromCollection | ( | ResourceCollectionIdentification | $rcid | ) |
Definition at line 1463 of file class.ilFileDataMail.php.
| ilFileDataMail::getStakeholder | ( | ) |
Definition at line 997 of file class.ilFileDataMail.php.
| ilFileDataMail::getUploadLimit | ( | ) |
Definition at line 72 of file class.ilFileDataMail.php.
References $mail_max_upload_file_size.
| ilFileDataMail::getUserPoolFilesData | ( | ) |
Definition at line 322 of file class.ilFileDataMail.php.
References $files, $info, and ILIAS\Repository\int().
Here is the call graph for this function:| ilFileDataMail::getUserPoolRcid | ( | ) |
Definition at line 250 of file class.ilFileDataMail.php.
References resolveUserPoolRcid().
Here is the call graph for this function:
|
private |
Definition at line 1333 of file class.ilFileDataMail.php.
| ilFileDataMail::hasLegacyAttachmentDirectory | ( | int | $mail_id | ) |
Definition at line 166 of file class.ilFileDataMail.php.
References getAttachmentPathByMailId().
Here is the call graph for this function:
|
protected |
Definition at line 764 of file class.ilFileDataMail.php.
References ILIAS\Repository\int().
Referenced by __construct().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::isCollectionExclusivelyOwnedByMail | ( | ResourceCollectionIdentification | $rcid | ) |
True if the collection can be handed over to delivered mails without copying it: it is Mail-owned and nobody references it.
Definition at line 560 of file class.ilFileDataMail.php.
| ilFileDataMail::isCollectionReferenced | ( | ResourceCollectionIdentification | $rcid | ) |
A Mail collection is referenced as long as a mail (sent, received, draft, outbox), a compose stage or a user's attachment pool points to it.
Definition at line 491 of file class.ilFileDataMail.php.
References $res, ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.
Here is the call graph for this function:| ilFileDataMail::isInUserPool | ( | ResourceIdentification | $identification | ) |
Definition at line 412 of file class.ilFileDataMail.php.
| ilFileDataMail::isLegacyPoolItemIdentifier | ( | string | $identifier | ) |
Definition at line 354 of file class.ilFileDataMail.php.
|
private |
|
private |
Definition at line 309 of file class.ilFileDataMail.php.
| ilFileDataMail::legacyPoolFilenameFromIdentifier | ( | string | $identifier | ) |
Definition at line 359 of file class.ilFileDataMail.php.
|
private |
Definition at line 1378 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Here is the call graph for this function:| ilFileDataMail::migrateLegacyPoolAttachments | ( | MailAttachments | $attachments | ) |
Definition at line 1118 of file class.ilFileDataMail.php.
References ILIAS\Mail\Attachments\MailAttachments\isLegacy(), and ILIAS\Mail\Attachments\MailAttachments\legacyFilenames().
Here is the call graph for this function:| ilFileDataMail::migrateLegacyPoolFilenameToResource | ( | string | $filename | ) |
Definition at line 364 of file class.ilFileDataMail.php.
References $filename.
|
private |
Definition at line 473 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.
Referenced by addResourceToPool().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::poolResourceHash | ( | ResourceIdentification | $rid | ) |
Definition at line 468 of file class.ilFileDataMail.php.
Referenced by addResourceToPool().
Here is the caller graph for this function:| ilFileDataMail::releaseCollectionIfUnreferenced | ( | ResourceCollectionIdentification | $rcid | ) |
Removes a Mail collection nobody references anymore, together with its resources.
Collections containing resources of other components are never touched.
Definition at line 529 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Here is the call graph for this function:| ilFileDataMail::releaseSourceCollectionAfterDelivery | ( | ResourceCollectionIdentification | $rcid | ) |
Drops the source collection after it has been delivered.
Foreign collections (Exercise, Test, …), the user pool and collections still referenced by mails or a compose stage stay untouched.
Definition at line 1545 of file class.ilFileDataMail.php.
| ilFileDataMail::removeCollection | ( | ResourceCollectionIdentification | $rcid, |
| bool | $delete_resources = false |
||
| ) |
Removes the collection.
Resources are only deleted if explicitly requested; prefer releaseCollectionIfUnreferenced() which respects references of mails, stage and pool.
Definition at line 1527 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().
Here is the call graph for this function:| ilFileDataMail::removeFromPool | ( | ResourceIdentification | $rid | ) |
Definition at line 450 of file class.ilFileDataMail.php.
Referenced by addResourceToPool().
Here is the caller graph for this function:| ilFileDataMail::removeFromStage | ( | ResourceIdentification | $identification | ) |
Definition at line 1027 of file class.ilFileDataMail.php.
| ilFileDataMail::replaceMailAttachmentCollection | ( | int | $mail_id, |
| ?ResourceCollectionIdentification | $rcid | ||
| ) |
Points a mail (draft, outbox) to the passed collection (or to none).
A previously referenced collection is released if nothing else references it anymore.
Definition at line 648 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.
Here is the call graph for this function:| ilFileDataMail::resolvePoolIdentifiersToResources | ( | array | $identifiers | ) |
| list<string> | $identifiers |
Definition at line 388 of file class.ilFileDataMail.php.
|
private |
Definition at line 275 of file class.ilFileDataMail.php.
References $res, and ilDBConstants\T_INTEGER.
|
private |
Definition at line 260 of file class.ilFileDataMail.php.
References ilObjUser\_lookupPref(), and collectionIsKnown().
Referenced by addResourceToPool(), and getUserPoolRcid().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1570 of file class.ilFileDataMail.php.
|
private |
Definition at line 1448 of file class.ilFileDataMail.php.
References ILIAS\ResourceStorage\Collection\ResourceCollection\getResourceIdentifications().
Referenced by addResourceToPool().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::restrictStageTo | ( | array | $rid_strings | ) |
Removes all files from the compose stage which are not part of the submitted form.
| list<string> | $rid_strings |
Definition at line 1047 of file class.ilFileDataMail.php.
| ilFileDataMail::streamFromPath | ( | string | $absolute_path, |
| ?string | $revision_title = null |
||
| ) |
Definition at line 1074 of file class.ilFileDataMail.php.
| ilFileDataMail::unlinkFile | ( | string | $a_filename | ) |
Definition at line 582 of file class.ilFileDataMail.php.
| ilFileDataMail::uploadToIrss | ( | UploadResult | $result | ) |
Definition at line 1085 of file class.ilFileDataMail.php.
References ILIAS\FileUpload\DTO\UploadResult\getName().
Referenced by uploadToPool().
Here is the call graph for this function:
Here is the caller graph for this function:| ilFileDataMail::uploadToPool | ( | UploadResult | $result | ) |
Definition at line 213 of file class.ilFileDataMail.php.
References addResourceToPool(), and uploadToIrss().
Here is the call graph for this function:
|
protected |
Definition at line 46 of file class.ilFileDataMail.php.
|
protected |
Definition at line 47 of file class.ilFileDataMail.php.
|
private |
Definition at line 48 of file class.ilFileDataMail.php.
|
protected |
Definition at line 43 of file class.ilFileDataMail.php.
Referenced by getUploadLimit().
| string ilFileDataMail::$mail_path |
Definition at line 42 of file class.ilFileDataMail.php.
Referenced by getMailPath().
|
private |
Definition at line 49 of file class.ilFileDataMail.php.
|
protected |
Definition at line 45 of file class.ilFileDataMail.php.
|
protected |
Definition at line 44 of file class.ilFileDataMail.php.
| const string ilFileDataMail::LEGACY_POOL_ITEM_PREFIX = 'legacy:' |
Definition at line 40 of file class.ilFileDataMail.php.
| const string ilFileDataMail::POOL_RCID_PREF_KEY = 'mail_attachment_pool_rcid' |
Definition at line 39 of file class.ilFileDataMail.php.
Referenced by ilMailAttachmentStakeholder\collectionsOfUser().