ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilFileDataImport Class Reference

This class handles all operations on files for the exercise object. More...

+ Inheritance diagram for ilFileDataImport:
+ Collaboration diagram for ilFileDataImport:

Public Member Functions

 ilFileDataImport ()
 Constructor call base constructors checks if directory is writable and sets the optional obj_id. More...
 
 getPath ()
 get exercise path @access public More...
 
 __checkPath ()
 
 __checkReadWrite ()
 check if directory is writable overwritten method from base class @access private More...
 
- Public Member Functions inherited from ilFileData
 ilFileData ()
 Constructor class bas constructor and read path of directory from ilias.ini setup an mail object @access public. More...
 
 checkPath ($a_path)
 check if path exists and is writable More...
 
 getPath ()
 get Path @access public More...
 
- Public Member Functions inherited from ilFile
 ilFile ()
 Constructor get ilias object @access public. More...
 
 deleteTrailingSlash ($a_path)
 delete trailing slash of path variables More...
 

Static Public Member Functions

 _initDirectory ()
 init directory overwritten method @access public More...
 

Data Fields

 $import_path
 
- Data Fields inherited from ilFile
 $path
 
 $ilias
 

Detailed Description

This class handles all operations on files for the exercise object.

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

Definition at line 14 of file class.ilFileDataImport.php.

Member Function Documentation

◆ __checkPath()

ilFileDataImport::__checkPath ( )

Definition at line 52 of file class.ilFileDataImport.php.

53 {
54 if(!@file_exists($this->getPath()))
55 {
56 return false;
57 }
58 $this->__checkReadWrite();
59
60 return true;
61 }
__checkReadWrite()
check if directory is writable overwritten method from base class @access private
getPath()
get exercise path @access public

References __checkReadWrite(), and getPath().

+ Here is the call graph for this function:

◆ __checkReadWrite()

ilFileDataImport::__checkReadWrite ( )

check if directory is writable overwritten method from base class @access private

Returns
bool

Reimplemented in ilFileDataImportGroup, and ilFileDataImportMail.

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

69 {
70 if(is_writable($this->import_path) && is_readable($this->import_path))
71 {
72 return true;
73 }
74 else
75 {
76 $this->ilias->raiseError("Import directory is not readable/writable by webserver",$this->ilias->error_obj->FATAL);
77 }
78 }
redirection script todo: (a better solution should control the processing via a xml file)

Referenced by __checkPath().

+ Here is the caller graph for this function:

◆ _initDirectory()

ilFileDataImport::_initDirectory ( )
static

init directory overwritten method @access public

Returns
string path

Reimplemented in ilFileDataImportGroup, and ilFileDataImportMail.

Definition at line 86 of file class.ilFileDataImport.php.

87 {
88 if(!@file_exists($this->import_path))
89 {
90 ilUtil::makeDir($this->import_path);
91 }
92 return true;
93 }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...

References ilUtil\makeDir().

Referenced by ilFileDataImport().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPath()

ilFileDataImport::getPath ( )

get exercise path @access public

Returns
string path

Reimplemented from ilFileData.

Reimplemented in ilFileDataImportGroup, and ilFileDataImportMail.

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

References $import_path.

Referenced by __checkPath().

+ Here is the caller graph for this function:

◆ ilFileDataImport()

ilFileDataImport::ilFileDataImport ( )

Constructor call base constructors checks if directory is writable and sets the optional obj_id.

Parameters
integeregerobj_id @access public

Definition at line 30 of file class.ilFileDataImport.php.

31 {
32 define('IMPORT_PATH','import');
33 parent::ilFileData();
34 $this->import_path = parent::getPath()."/".IMPORT_PATH;
35
36 // IF DIRECTORY ISN'T CREATED CREATE IT
37 // STATIC CALL TO AVOID OVERWRITE PROBLEMS
39 }
_initDirectory()
init directory overwritten method @access public

References _initDirectory().

+ Here is the call graph for this function:

Field Documentation

◆ $import_path

ilFileDataImport::$import_path

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

Referenced by getPath().


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