ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilFileDataImport.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
12 require_once("./Services/FileSystem/classes/class.ilFileData.php");
13 
15 {
22 
27  function __construct()
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  }
37 
43  function getPath()
44  {
45  return $this->import_path;
46  }
47 
48  // PRIVATE METHODS
49  function __checkPath()
50  {
51  if(!@file_exists($this->getPath()))
52  {
53  return false;
54  }
55  $this->__checkReadWrite();
56 
57  return true;
58  }
65  function __checkReadWrite()
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  }
83  function _initDirectory()
84  {
85  if(!@file_exists($this->import_path))
86  {
87  ilUtil::makeDir($this->import_path);
88  }
89  return true;
90  }
91 }
This class handles all operations on files for the exercise object.
_initDirectory()
init directory overwritten method public
__construct()
Constructor call base constructors.
This class handles all operations on files in directory /ilias_data/.
getPath()
get exercise path public
__checkReadWrite()
check if directory is writable overwritten method from base class private
redirection script todo: (a better solution should control the processing via a xml file) ...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...