ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
fileUtils class various functions for zip-archive handling More...
Public Member Functions | |
fastBase64Decode ($filein, $fileout) | |
decodes base encoded file row by row to prevent memory exhaust More... | |
fastBase64Encode ($filein, $fileout) | |
decodes base encoded file row by row to prevent memory exhaust More... | |
fastGZip ($in, $out, $level="9") | |
fast compressing the file with the zlib-extension without memory consumption 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 | lookupContentMimeType ($content) |
static | lookupFileMimeType ($a_file) |
static | _lookupMimeType ($a_file) |
static | getValidExtensions () |
static | getDefaultValidExtensionWhiteList () |
Valid extensions. More... | |
static | getValidFilename ($a_filename) |
Get valid filename. More... | |
static | rename ($a_source, $a_target) |
Rename a file. More... | |
Static Protected Attributes | |
static | $new_files = array() |
fileUtils class various functions for zip-archive handling
Definition at line 38 of file class.ilFileUtils.php.
|
static |
string | file absolute path to file |
Definition at line 524 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 249 of file class.ilFileUtils.php.
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 310 of file class.ilFileUtils.php.
References $filename, $ilErr, $lng, $path, $ref_id, 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) |
Definition at line 203 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $file, $lng, $ref_id, createContainer(), createFile(), and utf8_encode().
Referenced by processZipFile().
ilFileUtils::fastBase64Decode | ( | $filein, | |
$fileout | |||
) |
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 395 of file class.ilFileUtils.php.
References $fh.
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 417 of file class.ilFileUtils.php.
References $fh.
ilFileUtils::fastGunzip | ( | $in, | |
$out | |||
) |
fast uncompressing the file with the zlib-extension without memory consumption
string | $in | filename |
string | $out | filename |
Definition at line 475 of file class.ilFileUtils.php.
Referenced by ilFileXMLParser\handlerEndTag().
ilFileUtils::fastGZip | ( | $in, | |
$out, | |||
$level = "9" |
|||
) |
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 444 of file class.ilFileUtils.php.
|
static |
Valid extensions.
Definition at line 562 of file class.ilFileUtils.php.
References array.
Referenced by ilObjFileAccessSettingsGUI\initUploadSettingsForm().
|
static |
Definition at line 361 of file class.ilFileUtils.php.
Referenced by ilObjFileGUI\handleFileUpload().
|
static |
Definition at line 533 of file class.ilFileUtils.php.
References $ilSetting.
Referenced by ilObjFileAccessSettingsGUI\initUploadSettingsForm().
|
static |
Get valid filename.
string | filename |
ilFileUtilsException |
Definition at line 789 of file class.ilFileUtils.php.
Referenced by ilFileVersionTableGUI\fillRow(), ilObjFile\getUploadFile(), ilObjFileGUI\handleFileUpload(), ilUtil\moveUploadedFile(), ilDAVServer\PUT(), assFileUpload\saveWorkingData(), ilFSStorageExercise\uploadFile(), ilExSubmission\uploadFile(), and ilBadgeImageTemplate\uploadImage().
|
static |
string | $content |
Definition at line 500 of file class.ilFileUtils.php.
Referenced by ilQtiMatImageSecurity\determineMimeType().
|
static |
string | $a_file |
Definition at line 510 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 |
Definition at line 55 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, ilFileUtilsException\$DOUBLETTES_FOUND, $file, ilFileUtilsException\$INFECTED_FILE, $lng, $ref_id, array, createObjects(), ilUtil\delDir(), ilUtil\moveUploadedFile(), recursive_dirscan(), ilUtil\unzip(), utf8_encode(), and ilUtil\virusHandling().
Referenced by ilCloudPluginUploadGUI\handleFileUpload(), ilObjFileGUI\handleFileUpload(), ilExSubmission\processUploadedZipFile(), and ilObjFileGUI\saveUnzip().
|
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 |
Definition at line 159 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $file, 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 823 of file class.ilFileUtils.php.
Referenced by ilAssFileUploadUploadsExporter\createFileUploadCollectionZipFile(), ilFileDataForum\getForumPath(), 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 374 of file class.ilFileUtils.php.
Referenced by createFile(), createObjects(), ilSCORM13Package\dbImportSco(), ilExSubmission\processUploadedZipFile(), and processZipFile().
|
staticprotected |
Definition at line 40 of file class.ilFileUtils.php.