ILIAS
Release_4_1_x_branch Revision 61804
|
fileUtils class various functions for zip-archive handling More...
Public Member Functions | |
processZipFile ($a_directory, $a_file, $structure, $ref_id=null, $containerType=null) | |
unzips in given directory and processes uploaded zip for use as single files | |
recursive_dirscan ($dir, &$arr) | |
Recursively scans a given directory and writes path and filename into referenced array. | |
createObjects ($dir, $structure, $ref_id, $containerType) | |
Recursively scans a given directory and creates file and folder/category objects. | |
createContainer ($name, $ref_id, $containerType) | |
Creates and inserts container object (folder/category) into tree. | |
createFile ($filename, $path, $ref_id) | |
Creates and inserts file object into tree. | |
utf8_encode ($string) | |
utf8-encodes string if it is not a valid utf8-string. | |
fastBase64Decode ($filein, $fileout) | |
decodes base encoded file row by row to prevent memory exhaust | |
fastBase64Encode ($filein, $fileout) | |
decodes base encoded file row by row to prevent memory exhaust | |
fastGZip ($in, $out, $level="9") | |
fast compressing the file with the zlib-extension without memory consumption | |
fastGunzip ($in, $out) | |
fast uncompressing the file with the zlib-extension without memory consumption |
Static Public Member Functions | |
static | _lookupMimeType ($a_file) |
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 432 of file class.ilFileUtils.php.
Referenced by ilFileXMLParser\handlerEndTag().
ilFileUtils::createContainer | ( | $name, | |
$ref_id, | |||
$containerType | |||
) |
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 226 of file class.ilFileUtils.php.
Referenced by createObjects().
ilFileUtils::createFile | ( | $filename, | |
$path, | |||
$ref_id | |||
) |
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 265 of file class.ilFileUtils.php.
References $filename, $path, $ref_id, ilObjMediaObject\getMimeType(), ilUtil\stripSlashes(), and utf8_encode().
Referenced by createObjects().
ilFileUtils::createObjects | ( | $dir, | |
$structure, | |||
$ref_id, | |||
$containerType | |||
) |
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 180 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $dir, $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 328 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 350 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 408 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 377 of file class.ilFileUtils.php.
ilFileUtils::processZipFile | ( | $a_directory, | |
$a_file, | |||
$structure, | |||
$ref_id = null , |
|||
$containerType = null |
|||
) |
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 53 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, ilFileUtilsException\$DOUBLETTES_FOUND, $file, ilFileUtilsException\$INFECTED_FILE, $lng, $ref_id, createObjects(), recursive_dirscan(), ilUtil\unzip(), utf8_encode(), and ilUtil\virusHandling().
Referenced by ilObjExercise\processUploadedFile(), and ilObjFileGUI\saveUnzipObject().
ilFileUtils::recursive_dirscan | ( | $dir, | |
& | $arr | ||
) |
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 136 of file class.ilFileUtils.php.
References ilFileUtilsException\$BROKEN_FILE, $dir, $file, and $lng.
Referenced by ilSCORM13Package\dbImportSco(), ilSCORM2004Sco\exportPDF(), ilObjSCORM2004LearningModule\exportPDF(), ilObjTest\getCustomStyles(), ilObjExercise\processUploadedFile(), processZipFile(), and ilUtil\unzip().
ilFileUtils::utf8_encode | ( | $string | ) |
utf8-encodes string if it is not a valid utf8-string.
string | $string | String to encode |
Definition at line 307 of file class.ilFileUtils.php.
Referenced by createFile(), createObjects(), ilSCORM13Package\dbImportSco(), ilObjExercise\processUploadedFile(), and processZipFile().