ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 {
21  public $import_path;
22 
27  public 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  public function getPath()
44  {
45  return $this->import_path;
46  }
47 
48  // PRIVATE METHODS
49  public function __checkPath()
50  {
51  if (!@file_exists($this->getPath())) {
52  return false;
53  }
54  $this->__checkReadWrite();
55 
56  return true;
57  }
64  public function __checkReadWrite()
65  {
66  if (is_writable($this->import_path) && is_readable($this->import_path)) {
67  return true;
68  } else {
69  $this->ilias->raiseError("Import directory is not readable/writable by webserver", $this->ilias->error_obj->FATAL);
70  }
71  }
79  public function _initDirectory()
80  {
81  if (!@file_exists($this->import_path)) {
82  ilUtil::makeDir($this->import_path);
83  }
84  return true;
85  }
86 }
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 ...