ILIAS  release_7 Revision v7.30-3-g800a261c036
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
27 public function __construct()
28 {
29 define('IMPORT_PATH', 'import');
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}
An exception for terminatinating execution or to throw for unit testing.
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
getPath()
get exercise path @access public
__construct()
Constructor call base constructors.
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 ...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)