ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
12require_once("./Services/FileSystem/classes/class.ilFileData.php");
13
15{
22
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 }
40
46 function getPath()
47 {
48 return $this->import_path;
49 }
50
51 // PRIVATE METHODS
52 function __checkPath()
53 {
54 if(!@file_exists($this->getPath()))
55 {
56 return false;
57 }
58 $this->__checkReadWrite();
59
60 return true;
61 }
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 }
86 function _initDirectory()
87 {
88 if(!@file_exists($this->import_path))
89 {
90 ilUtil::makeDir($this->import_path);
91 }
92 return true;
93 }
94}
This class handles all operations on files for the exercise object.
__checkReadWrite()
check if directory is writable overwritten method from base class @access private
_initDirectory()
init directory overwritten method @access public
ilFileDataImport()
Constructor call base constructors checks if directory is writable and sets the optional obj_id.
getPath()
get exercise path @access public
This class handles all operations on files in directory /ilias_data/.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
redirection script todo: (a better solution should control the processing via a xml file)