4include_once 
'./Services/FileSystem/classes/class.ilFileSystemStorage.php';
 
   29        $this->logger = 
$DIC->logger()->wsrv();
 
   30        $this->logger->logStack();
 
   48        $settings = 
$DIC->settings();
 
   49        if (!$settings->get(
'soap_user_administration', 0)) {
 
   50            $this->logger->warning(
'Webservices disabled in administration.');
 
   53                ->withHeader(
'Content-Type', 
'text/html')
 
   54                ->withStatus(\
Slim\Http\StatusCode::HTTP_FORBIDDEN)
 
   55                ->write(
'Webservice not enabled.');
 
   66        return 'ilRestFileStorage';
 
   98        $file_id = 
$request->getParam(
'name');
 
  100        $this->logger->debug(
'Original file name: ' . $file_id);
 
  104            $this->logger->warning(
'No realpath found for ' . $this->
getPath() . 
'/' . $file_id);
 
  108        $this->logger->debug(
'Translated name: ' . $this->
getPath() . 
'/' . $file_name);
 
  111            is_file($this->
getPath() . 
'/' . $file_name) &&
 
  112            file_exists($this->
getPath() . 
'/' . $file_name)
 
  114            $this->logger->info(
'Delivering file: ' . $this->
getPath() . 
'/' . $file_name);
 
  115            $return = file_get_contents($this->
getPath() . 
'/' . $file_name);
 
  117            $this->logger->dump($return);
 
  120                ->withStatus(\
Slim\Http\StatusCode::HTTP_OK)
 
  121                ->withHeader(
'Content-Type', 
'application/json')
 
  137            ->withHeader(
'Content-Type', 
'text/html')
 
  138            ->withStatus(\
Slim\Http\StatusCode::HTTP_NOT_FOUND)
 
  139            ->write(
'File not found');
 
  157        $request_body = 
$request->getParam(
'content');
 
  163        $return = basename($tmpname);
 
  166            ->withHeader(
'ContentType', 
'application/json')
 
  178        return basename($tmpname);
 
  187        return $this->
getPath() . 
'/' . $tmpname;
 
  195        $max_age = time() - self::AVAILABILITY_IN_DAYS * 24 * 60 * 60;
 
  196        $ite = 
new DirectoryIterator($this->
getPath());
 
  197        foreach ($ite as $file) {
 
  198            if ($file->getCTime() <= $max_age) {
 
  200                    @unlink($file->getPathname());
 
  201                } 
catch (Exception $e) {
 
  202                    $this->logger->warning($e->getMessage());
 
foreach($paths as $path) $request
while(count($oldTaskList) > 0) foreach(array_keys( $newTaskList) as $task) init()
An exception for terminatinating execution or to throw for unit testing.
create()
Create directory.
writeToFile($a_data, $a_absolute_path)
Write data to file.
checkWebserviceActivation(\Slim\Http\Request $request, \Slim\Http\Response $response)
getPathPrefix()
Get path prefix.
getFile(\Slim\Http\Request $request, \Slim\Http\Response $response)
getStoredFilePath($tmpname)
getPathPostfix()
Get path prefix.
init()
init and create directory
createFile(\Slim\Http\Request $request, \Slim\Http\Response $response)
Create new file from post.
const AVAILABILITY_IN_DAYS
storeFileForRest($content)
deleteDeprecated()
Delete deprecated files.
__construct()
Constructor.
responeNotFound(\Slim\Http\Response $response)
Send 403.
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
Slim Framework (https://slimframework.com)