ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
ilAdvancedMDRecordImportFiles Class Reference
+ Collaboration diagram for ilAdvancedMDRecordImportFiles:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getImportDirectory ()
 get import directory More...
 
 getImportFileByCreationDate ($a_unix_time)
 Get import file by creation date. More...
 
 deleteFileByCreationDate ($a_unix_time)
 Delete a file. More...
 
 moveUploadedFile ($a_temp_name)
 move uploaded files More...
 

Data Fields

const IMPORT_NAME = 'ilias_adv_md_record'
 

Private Member Functions

 init ()
 init function: create import directory, delete old files More...
 

Private Attributes

 $import_dir = ''
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 32 of file class.ilAdvancedMDRecordImportFiles.php.

Constructor & Destructor Documentation

◆ __construct()

ilAdvancedMDRecordImportFiles::__construct ( )

Constructor.

public

Definition at line 44 of file class.ilAdvancedMDRecordImportFiles.php.

References ilUtil\getDataDir(), and init().

45  {
46  $this->import_dir = ilUtil::getDataDir().'/ilAdvancedMetaData/import';
47  $this->init();
48  }
init()
init function: create import directory, delete old files
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteFileByCreationDate()

ilAdvancedMDRecordImportFiles::deleteFileByCreationDate (   $a_unix_time)

Delete a file.

public

Parameters
intcreation date (unix time)

Definition at line 81 of file class.ilAdvancedMDRecordImportFiles.php.

References getImportDirectory().

82  {
83  $unix_time = (int) $a_unix_time;
84  return @unlink($this->getImportDirectory().'/'.self::IMPORT_NAME.'_'.$unix_time.'.xml');
85  }
+ Here is the call graph for this function:

◆ getImportDirectory()

ilAdvancedMDRecordImportFiles::getImportDirectory ( )

get import directory

public

Definition at line 56 of file class.ilAdvancedMDRecordImportFiles.php.

References $import_dir.

Referenced by deleteFileByCreationDate(), getImportFileByCreationDate(), and moveUploadedFile().

+ Here is the caller graph for this function:

◆ getImportFileByCreationDate()

ilAdvancedMDRecordImportFiles::getImportFileByCreationDate (   $a_unix_time)

Get import file by creation date.

public

Parameters
intcreation date (unix time)
Returns
string absolute path

Definition at line 68 of file class.ilAdvancedMDRecordImportFiles.php.

References getImportDirectory().

69  {
70  $unix_time = (int) $a_unix_time;
71  return $this->getImportDirectory().'/'.self::IMPORT_NAME.'_'.$unix_time.'.xml';
72  }
+ Here is the call graph for this function:

◆ init()

ilAdvancedMDRecordImportFiles::init ( )
private

init function: create import directory, delete old files

private

Definition at line 115 of file class.ilAdvancedMDRecordImportFiles.php.

References ilUtil\makeDirParents().

Referenced by __construct().

116  {
117  if(!@is_dir($this->import_dir))
118  {
119  ilUtil::makeDirParents($this->import_dir);
120  }
121 
122  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveUploadedFile()

ilAdvancedMDRecordImportFiles::moveUploadedFile (   $a_temp_name)

move uploaded files

public

Parameters
stringtmp name
Returns
int creation time of newly created file. 0 on error

Definition at line 95 of file class.ilAdvancedMDRecordImportFiles.php.

References getImportDirectory(), ilUtil\moveUploadedFile(), and time.

96  {
97  $creation_time = time();
98  $file_name = $this->getImportDirectory().'/'.self::IMPORT_NAME.'_'.$creation_time.'.xml';
99 
100  if(!ilUtil::moveUploadedFile($a_temp_name,'',$file_name,false))
101  {
102  return false;
103  }
104  return $creation_time;
105  }
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

Field Documentation

◆ $import_dir

ilAdvancedMDRecordImportFiles::$import_dir = ''
private

Definition at line 36 of file class.ilAdvancedMDRecordImportFiles.php.

Referenced by getImportDirectory().

◆ IMPORT_NAME

const ilAdvancedMDRecordImportFiles::IMPORT_NAME = 'ilias_adv_md_record'

Definition at line 34 of file class.ilAdvancedMDRecordImportFiles.php.


The documentation for this class was generated from the following file: