ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestExportFilename Class Reference
+ Collaboration diagram for ilTestExportFilename:

Public Member Functions

 __construct (ilObjTest $test)
 getTimestamp ()
 getPathname ($extension, $additional= '')

Protected Attributes

 $test
 $timestamp = 0

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 11 of file class.ilTestExportFilename.php.

Constructor & Destructor Documentation

ilTestExportFilename::__construct ( ilObjTest  $test)
Parameters
ilObjTest$test

Definition at line 26 of file class.ilTestExportFilename.php.

References $test.

{
$this->test = $test;
$this->timestamp = time();
}

Member Function Documentation

ilTestExportFilename::getPathname (   $extension,
  $additional = '' 
)
Parameters
string$extension
string$additional
Returns
string
Exceptions
ilException

Definition at line 46 of file class.ilTestExportFilename.php.

References $additional, and getTimestamp().

{
if(!is_string($extension) || !strlen($extension))
{
throw new ilException('Missing file extension! Please pass a file extension of type string.');
}
else if(substr_count($extension, '.') > 1 || (strpos($extension, '.') !== false && strpos($extension, '.') !== 0))
{
throw new ilException('Please use at most one dot in your file extension.');
}
else if(strpos($extension, '.') === 0)
{
$extension = substr($extension, 1);
}
if(!is_string($additional))
{
}
else if(strlen($additional))
{
if(strpos($additional, '__') === 0)
{
throw new ilException('The additional file part may not contain __ at the beginning!');
}
$additional = '__' . $additional . '_';
}
else
{
$additional = '_';
}
return $this->test->getExportDirectory() . DIRECTORY_SEPARATOR . $this->getTimestamp() . '__' . IL_INST_ID . '__' . $this->test->getType() . $additional . $this->test->getId() . '.' . $extension;
}

+ Here is the call graph for this function:

ilTestExportFilename::getTimestamp ( )
Returns
int

Definition at line 35 of file class.ilTestExportFilename.php.

References $timestamp.

Referenced by getPathname().

{
}

+ Here is the caller graph for this function:

Field Documentation

ilTestExportFilename::$test
protected

Definition at line 16 of file class.ilTestExportFilename.php.

Referenced by __construct().

ilTestExportFilename::$timestamp = 0
protected

Definition at line 21 of file class.ilTestExportFilename.php.

Referenced by getTimestamp().


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