39        $this->file_storage->create();
 
   50            $version_subdir = sprintf(
"%03d", $a_version);
 
   53        return $this->file_storage->getAbsolutePath() . 
'/' . $version_subdir;
 
   83        if ($a_hist_entry_ids == 
null || count($a_hist_entry_ids) < 1) {
 
   88            $actualVersionDeleted = 
false;
 
   94            foreach ($a_hist_entry_ids as $hist_id) {
 
   99                    if (
$version[
"hist_entry_id"] == $hist_id) {
 
  109                            $actualVersionDeleted = 
true;
 
  120            if ($actualVersionDeleted) {
 
  132    public function sendFile($a_hist_entry_id = 
null)
 
  134        if (is_null($a_hist_entry_id)) {
 
  143        if ($this->file_storage->fileExists($file)) {
 
  144            $ilClientIniFile = 
$DIC[
'ilClientIniFile'];
 
  149            $ilFileDelivery = new \ilFileDelivery($file);
 
  151            $ilFileDelivery->setConvertFileNameToAsci((
bool) !$ilClientIniFile->readVariable(
 
  157            if ($ilClientIniFile->readVariable(
'file_access', 
'download_with_uploaded_filename')
 
  159                && is_null($a_hist_entry_id)
 
  168                $parts = explode(DIRECTORY_SEPARATOR, $file);
 
  169                $download_file_name = end($parts);
 
  171                $ilFileDelivery->setDownloadFileName($download_file_name);
 
  173            $ilFileDelivery->deliver();
 
  198        return (
int) $v2[
"version"] - (int) $v1[
"version"];
 
  201    public function export(
string $target_dir) : void
 
  203        $subdir = 
"il_" . 
IL_INST_ID . 
"_file_" . $this->getId();
 
  208        if (@!is_dir($filedir)) {
 
  212        ilUtil::rCopy($filedir, $target_dir . 
"/objects/" . $subdir);
 
  241        if ($version_ids != 
null && count($version_ids) > 0) {
 
  243                if (!in_array(
$version[
"hist_entry_id"], $version_ids, 
true)) {
 
  256        usort($versions, array($this, 
"compareVersions"));
 
  258        $version_objects = [];
 
  261            $filesize = @filesize($file);
 
  266        return $version_objects;
 
  277        $data = explode(
",", $entry[
"info_params"]);
 
  281        if (empty(
$data[1])) {
 
  285        if (empty(
$data[2])) {
 
  291        if (
sizeof(
$data) > 2) {
 
  292            $last = 
sizeof(
$data) - 1;
 
  293            for (
$n = 1; 
$n < $last - 1; 
$n++) {
 
  299            if (strpos(
$data[$last - 1], 
".") !== 
false) {
 
  311            "filename" => 
$data[0],
 
  312            "version" => 
$data[1],
 
  313            "max_version" => 
$data[2],
 
  314            "rollback_version" => 
"",
 
  315            "rollback_user_id" => 
"",
 
  319        if ($entry[
"action"] == 
"rollback") {
 
  320            $tokens = explode(
"|", 
$result[
"max_version"]);
 
  321            if (count($tokens) > 1) {
 
  322                $result[
"max_version"] = $tokens[0];
 
  323                $result[
"rollback_version"] = $tokens[1];
 
  325                if (count($tokens) > 2) {
 
  326                    $result[
"rollback_user_id"] = $tokens[2];
 
  339        include_once(
"./Services/History/classes/class.ilHistory.php");
 
  355        return array_merge(
$version, $params);
 
  361    public function getFile($a_hist_entry_id = 
null)
 
  363        if (is_null($a_hist_entry_id)) {
 
  366            require_once(
"./Services/History/classes/class.ilHistory.php");
 
  369            if ($entry === 
false) {
 
An exception for terminatinating execution or to throw for unit testing.
Class FileNotFoundException Indicates that a file is missing or not found.
static getValidFilename($a_filename)
Get valid filename.
static _removeEntryByHistoryID($a_hist_entry_id)
Removes a single entry from the history.
static _removeEntriesForObject($a_obj_id)
remove all history entries for an object
static _getEntriesForObject($a_obj_id, $a_obj_type="")
get all history entries for an object
static _getEntryByHistoryID($a_hist_entry_id)
returns a single history entry
static _getFileExtension($a_file_name)
Gets the file extension of the specified file name.
static _isFileInline($a_file_name)
Returns true, if the specified file shall be displayed inline in the browser.
Class ilObjFileImplementationAbstract.
Class ilObjFileImplementationLegacy.
getFile($a_hist_entry_id=null)
@inheritDoc
getDirectory($a_version=0)
@inheritDoc
getSpecificVersion($version_id)
@inheritDoc
export(string $target_dir)
@depracated
getFileExtension()
@inheritDoc
handleChangedObjectTitle(string $new_title)
compareVersions($v1, $v2)
Compares two file versions.
static parseInfoParams($entry)
Parses the info parameters ("info_params") of the specified history entry.
createDirectory()
@inheritDoc
deleteVersions($a_hist_entry_ids=null)
@inheritDoc
clearDataDirectory()
@inheritDoc
__construct(int $obj_id, int $version, string $file_name)
ilObjFileImplementationAbstract constructor.
getVersions($version_ids=null)
@inheritDoc array ( 0 => array ( 'date' => '2020-11-05 09:49:18', 'user_id' => '6',...
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
Interface ilObjFileImplementationInterface.
sendFile($a_hist_entry_id=null)