ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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

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

Static Public Member Functions

 _initDirectory ()
 init directory overwritten method 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.

Constructor & Destructor Documentation

◆ __construct()

ilFileDataImport::__construct ( )

Constructor call base constructors.

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

References _initDirectory().

28  {
29  define('IMPORT_PATH','import');
30  parent::__construct();
31  $this->import_path = parent::getPath()."/".IMPORT_PATH;
32 
33  // IF DIRECTORY ISN'T CREATED CREATE IT
34  // STATIC CALL TO AVOID OVERWRITE PROBLEMS
36  }
_initDirectory()
init directory overwritten method public
+ Here is the call graph for this function:

Member Function Documentation

◆ __checkPath()

ilFileDataImport::__checkPath ( )

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

References __checkReadWrite(), and getPath().

50  {
51  if(!@file_exists($this->getPath()))
52  {
53  return false;
54  }
55  $this->__checkReadWrite();
56 
57  return true;
58  }
getPath()
get exercise path public
__checkReadWrite()
check if directory is writable overwritten method from base class private
+ Here is the call graph for this function:

◆ __checkReadWrite()

ilFileDataImport::__checkReadWrite ( )

check if directory is writable overwritten method from base class private

Returns
bool

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

Referenced by __checkPath().

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

◆ _initDirectory()

ilFileDataImport::_initDirectory ( )
static

init directory overwritten method public

Returns
string path

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

References ilUtil\makeDir().

Referenced by __construct().

84  {
85  if(!@file_exists($this->import_path))
86  {
87  ilUtil::makeDir($this->import_path);
88  }
89  return true;
90  }
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPath()

ilFileDataImport::getPath ( )

get exercise path public

Returns
string path

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

References $import_path.

Referenced by __checkPath().

44  {
45  return $this->import_path;
46  }
+ Here is the caller 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: