|
CInbox (Common-Inbox)
0.1
Common functionality for ingesting files for archiving.
|
Public Member Functions | |
| __construct (&$logger, $folderName, $baseFolder=null) | |
| setFolder ($folderName) | |
| moveFolder ($targetFolder) | |
| getLogger () | |
| setParentItem (&$item) | |
| getParentItem () | |
| setParentFolder (&$folder) | |
| getParentFolder () | |
| hasParent () | |
| setBaseFolder ($baseFolder) | |
| getBaseFolder () | |
| getConfig () | |
| hasOwnConfig () | |
| getConfigForFolder ($arguments=null) | |
| getSubDir () | |
| getPathname () | |
| getFilename () | |
| setTempFolder ($tempFolder) | |
| getTempFolder () | |
| getTargetFolderRaw () | |
| isTargetAbsolute () | |
| getTargetFolder ($tempMask=null) | |
| getTargetFolderTemp ($targetFolder, $tempMask) | |
Public Attributes | |
| const | CONF_TARGET_FOLDER = 'TARGET_FOLDER' |
Protected Attributes | |
| $logger | |
| $folderObj | |
| $config | |
| $tempFolder | |
| $parentItem | |
| $parentFolder | |
| $hasTargetFolder = null | |
This is a wrapper around a physical folder. It is used to provide common functionality required across folders of Items in CInbox.
It keeps track of folder hierarchies and applies them to handle the settings read from a configfile so that each folder inherits its settings properly.
Since target folders for Item subfolders can be configured individually, respecting inheritance and relative paths, this class also takes care of putting together the actual target path.
Returns the folder used as reference for relative paths.
Returns configuration CIConfig object.
| CIFolder::getConfigForFolder | ( | $ | arguments = null | ) |
Returns config array for this folder.
Configuration per folder as follows:
Returns the filename (basename) of this folder object.
Returns the logger object used in this class.
Returns the pathname + filename of this folder object.
Returns the pathname + filename of this folder object, but relative to its base folder.
| CIFolder::getTargetFolder | ( | $ | tempMask = null | ) |
Returns the actual target path for this folder.
The ruleset is as follows:
Parameter $tempMask: The parameter "$tempMask" is a printf-style format string which is applied to the basename folder on the CIFolder recursion levels where TARGET_FOLDER is set. This allows maintaining the subfolder-structure on the target, but in a temporary folder. Useful for handling errors that would occur during e.g. copying to target, so that an unfinished/erroneous task does not affect the actual target until it is successful.
Returns the unmodified value of TARGET_FOLDER setting (placeholders resolved). If it is not configured for this folder, it returns 'null'.
Returns the foldername to use for temporary files.
Returns 'true' if this folder has a parent folder object set. False if not.
Checks if the configured target path is absolute or relative.
Returns 'true' if absolute, 'false' if relative and 'NULL' if no target path is configured.
| CIFolder::moveFolder | ( | $ | targetFolder | ) |
Renames/moves the current folder while making sure that all internal things stay working. Parent folders for target must be created before. Returns 'true' on success. Throws exceptions on errors.
| CIFolder::setBaseFolder | ( | $ | baseFolder | ) |
Sets a base folder as reference to handle relative sub-dir names.
| CIFolder::setFolder | ( | $ | folderName | ) |
Set the folder that this CIFolder object represents. Populates the property "$folderObj". Returns 'true' on success. Throws exceptions on errors.
| CIFolder::setParentFolder | ( | &$ | folder | ) |
Set parent CIFolder object of that this folder is a subfolder of.
| CIFolder::setParentItem | ( | &$ | item | ) |
Set parent CIItem object of that this folder belongs to.
| CIFolder::setTempFolder | ( | $ | tempFolder | ) |
Set where temporary files are to be stored in.
Folder must already exist, be writable - and subfolders there must follow naming conventions of Common Inbox, so data can be exchanged in temporary files between different tasks - and Inbox runs.
Reimplemented in CIItem.
1.7.6.1