ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedMDRecordImportFiles Class Reference
+ Collaboration diagram for ilAdvancedMDRecordImportFiles:

Public Member Functions

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

Data Fields

const IMPORT_NAME = 'ilias_adv_md_record'

Private Member Functions

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

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

ilAdvancedMDRecordImportFiles::__construct ( )

Constructor.

public

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

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

{
$this->import_dir = ilUtil::getDataDir().'/ilAdvancedMetaData/import';
$this->init();
}

+ Here is the call graph for this function:

Member Function Documentation

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().

{
$unix_time = (int) $a_unix_time;
return @unlink($this->getImportDirectory().'/'.self::IMPORT_NAME.'_'.$unix_time.'.xml');
}

+ Here is the call graph for this function:

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:

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().

{
$unix_time = (int) $a_unix_time;
return $this->getImportDirectory().'/'.self::IMPORT_NAME.'_'.$unix_time.'.xml';
}

+ Here is the call graph for this function:

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().

{
if(!@is_dir($this->import_dir))
{
ilUtil::makeDirParents($this->import_dir);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 $file_name, getImportDirectory(), and ilUtil\moveUploadedFile().

{
$creation_time = time();
$file_name = $this->getImportDirectory().'/'.self::IMPORT_NAME.'_'.$creation_time.'.xml';
if(!ilUtil::moveUploadedFile($a_temp_name,'',$file_name,false))
{
return false;
}
return $creation_time;
}

+ Here is the call graph for this function:

Field Documentation

ilAdvancedMDRecordImportFiles::$import_dir = ''
private

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

Referenced by getImportDirectory().

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: