ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Class ilFileUtils. More...
Public Member Functions | |
fastBase64Encode ($filein, $fileout) | |
decodes base encoded file row by row to prevent memory exhaust More... | |
fastGunzip ($in, $out) | |
fast uncompressing the file with the zlib-extension without memory consumption More... | |
Static Public Member Functions | |
static | processZipFile ($a_directory, $a_file, $structure, $ref_id=null, $containerType=null, $tree=null, $access_handler=null) |
unzips in given directory and processes uploaded zip for use as single files More... | |
static | recursive_dirscan ($dir, &$arr) |
Recursively scans a given directory and writes path and filename into referenced array. More... | |
static | createObjects ($dir, $structure, $ref_id, $containerType, $tree=null, $access_handler=null) |
Recursively scans a given directory and creates file and folder/category objects. More... | |
static | createContainer ($name, $ref_id, $containerType, $tree=null, $access_handler=null) |
Creates and inserts container object (folder/category) into tree. More... | |
static | createFile ($filename, $path, $ref_id, $tree=null, $access_handler=null) |
Creates and inserts file object into tree. More... | |
static | getNewObjects () |
static | utf8_encode ($string) |
utf8-encodes string if it is not a valid utf8-string. More... | |
static | fastBase64Decode ($filein, $fileout) |
decodes base encoded file row by row to prevent memory exhaust More... | |
static | lookupContentMimeType ($content) |
static | lookupFileMimeType ($a_file) |
static | _lookupMimeType ($a_file) |
static | getValidExtensions () |
Valid extensions. More... | |
static | getDefaultValidExtensionWhiteList () |
Valid extensions. More... | |
static | getValidFilename ($a_filename) |
Get valid filename. More... | |
static | hasValidExtension ($a_filename) |
static | rename ($a_source, $a_target) |
Rename a file. More... | |
Static Protected Attributes | |
static | $new_files = array() |
Private Member Functions | |
fastGZip ($in, $out, $level="9") | |
fast compressing the file with the zlib-extension without memory consumption More... | |
Class ilFileUtils.
Definition at line 38 of file class.ilFileUtils.php.
|
static |
string | file absolute path to file |
Definition at line 535 of file class.ilFileUtils.php.
Referenced by ilFileXMLParser\handlerEndTag().
|
static |
Creates and inserts container object (folder/category) into tree.
string | $name | Name of the object |
integer | $ref_id | ref_id of parent |
string | $containerType | Fold or Cat |
Definition at line 236 of file class.ilFileUtils.php.
References $DIC, $lng, $name, and $tree.
Referenced by createObjects().
|
static |
Creates and inserts file object into tree.
string | $filename | Name of the object |
string | $path | Path to file |
integer | $ref_id | ref_id of parent |
Definition at line 296 of file class.ilFileUtils.php.
References $DIC, $filename, $ilErr, $lng, $path, $tree, ilObjMediaObject\getMimeType(), ilUtil\stripSlashes(), and utf8_encode().
Referenced by createObjects().
|
static |
Recursively scans a given directory and creates file and folder/category objects.
Calls createContainer & createFile to store objects in tree
string | $dir | Directory to start from |
boolean | structure True if archive structure is to be overtaken (otherwise flat inclusion) | |
integer | $ref_id | ref_id of parent object, if null, files won�t be included in system (just checked) |
string | containerType object type of created containerobjects (folder or category) |
ilFileUtilsException |
Definition at line 198 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $lng, $tree, createContainer(), createFile(), and utf8_encode().
Referenced by processZipFile().
|
static |
decodes base encoded file row by row to prevent memory exhaust
string | $filename | name of file to read |
string | $fileout | name where to put decoded file |
Definition at line 388 of file class.ilFileUtils.php.
Referenced by ilFileXMLParser\handlerEndTag().
ilFileUtils::fastBase64Encode | ( | $filein, | |
$fileout | |||
) |
decodes base encoded file row by row to prevent memory exhaust
string | $filename | name of file to read |
Definition at line 415 of file class.ilFileUtils.php.
ilFileUtils::fastGunzip | ( | $in, | |
$out | |||
) |
fast uncompressing the file with the zlib-extension without memory consumption
string | $in | filename |
string | $out | filename |
Definition at line 478 of file class.ilFileUtils.php.
Referenced by ilFileXMLParser\handlerEndTag().
|
private |
fast compressing the file with the zlib-extension without memory consumption
string | $in | filename |
string | $out | filename |
string | $level | compression level from 1 to 9 |
Definition at line 443 of file class.ilFileUtils.php.
|
static |
Valid extensions.
Definition at line 583 of file class.ilFileUtils.php.
Referenced by ilObjFileAccessSettingsGUI\initUploadSettingsForm().
|
static |
Definition at line 348 of file class.ilFileUtils.php.
Referenced by ilObjFileGUI\uploadFiles().
|
static |
Valid extensions.
Definition at line 546 of file class.ilFileUtils.php.
Referenced by ILIAS\Filesystem\Security\Sanitizing\FilenameSanitizerImpl\__construct(), ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator\__construct(), and ilObjFileAccessSettingsGUI\initUploadSettingsForm().
|
static |
Get valid filename.
string | filename |
ilFileUtilsException |
Definition at line 837 of file class.ilFileUtils.php.
Referenced by ilFileVersionTableGUI\__construct(), ilFileDataMail\deliverAttachmentsAsZip(), ilPortfolioCertificateFileService\deliverCertificate(), ilObjFile\determineFileSize(), ilFileVersionsTableGUI\fillRow(), ilWebDAVRepositoryHelper\getFilenameWithSanitizedFileExtension(), ilObjFileDAV\getName(), ilObjFileDAV\getPathToFile(), ilCertificateFileUtilsHelper\getValidFilename(), ilWebDAVObjDAVHelper\isValidFileNameWithValidFileExtension(), ILIAS\File\Sanitation\FilePathSanitizer\needsSanitation(), ILIAS\File\Sanitation\FilePathSanitizer\santitizeFilename(), assFileUpload\saveWorkingData(), ilObjFile\storeUnzipedFile(), ilFSStorageExercise\uploadFile(), ilExSubmission\uploadFile(), ilBadgeImageTemplate\uploadImage(), and ilUtil\virusHandling().
|
static |
string | $a_filename |
Definition at line 864 of file class.ilFileUtils.php.
Referenced by ilObjFileGUI\uploadFiles().
|
static |
string | $content |
Definition at line 507 of file class.ilFileUtils.php.
Referenced by ilQtiMatImageSecurity\determineMimeType().
|
static |
string | $a_file |
Definition at line 520 of file class.ilFileUtils.php.
|
static |
unzips in given directory and processes uploaded zip for use as single files
string | $a_directory | Directory to unzip |
string | $a_file | Filename of archive |
boolean | structure True if archive structure is to be overtaken | |
integer | $ref_id | ref_id of parent object, if null, files wont be included in system (just checked) |
string | containerType object type of created containerobjects (folder or category) |
ilFileUtilsException | |
ilException |
Definition at line 62 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $DIC, ilFileUtilsException\$DOUBLETTES_FOUND, ilFileUtilsException\$INFECTED_FILE, $key, $lng, $tree, createObjects(), ilUtil\delDir(), recursive_dirscan(), ilUtil\unzip(), utf8_encode(), and ilUtil\virusHandling().
Referenced by ilCloudPluginUploadGUI\handleFileUpload(), ilExSubmission\processUploadedZipFile(), ilObjFileGUI\saveUnzip(), and ilObjFileGUI\uploadFiles().
|
static |
Recursively scans a given directory and writes path and filename into referenced array.
string | $dir | Directory to start from |
array | &$arr | Referenced array which is filled with Filename and path |
ilFileUtilsException |
Definition at line 156 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $DIC, and $lng.
Referenced by ilObjFileBasedLMGUI\afterSave(), ilSCORM13Package\dbImportSco(), ilSCORM2004Asset\exportPDF(), ilObjSCORM2004LearningModule\exportPDF(), ilObjTest\getCustomStyles(), ilExSubmission\processUploadedZipFile(), processZipFile(), ilUtil\unzip(), and ilFileSystemGUI\unzipFile().
|
static |
Rename a file.
$a_source | |
$a_target |
ilFileUtilsException |
Definition at line 881 of file class.ilFileUtils.php.
Referenced by ilAssFileUploadUploadsExporter\createFileUploadCollectionZipFile(), ilPhantomJSRenderer\generatePDF(), ilFileDataForum\getForumPath(), ilScorm2004DataSet\getXmlRecord(), ilScorm2004DataSet\importRecord(), ilScormAiccImporter\importXmlRepresentation(), assFlashQuestion\moveAppletIfExists(), ilObjSCORMLearningModuleGUI\newModuleVersionUpload(), ilFileSystemGUI\renameFile(), ilFileXMLParser\setFileContents(), ilObjFile\storeUnzipedFile(), and ilObjSAHSLearningModuleGUI\uploadObject().
|
static |
utf8-encodes string if it is not a valid utf8-string.
string | $string | String to encode |
Definition at line 363 of file class.ilFileUtils.php.
Referenced by createFile(), createObjects(), ilSCORM13Package\dbImportSco(), ilExSubmission\processUploadedZipFile(), and processZipFile().
|
staticprotected |
Definition at line 44 of file class.ilFileUtils.php.