HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/firstbrick.creativefellows.nl/src/Action/Upload/UploadAction.php
<?php

namespace App\Action\Upload;

use App\Action\Action;
use App\Domain\Upload\Service\UploadHandler;

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Container\ContainerInterface;
use Slim\Interfaces\RouteParserInterface;

final class UploadAction extends Action
{	
    protected $container;	
	
    public function __construct(
		ContainerInterface $container//,
		//UploadHandler $uploader
	) {
        $this->container 	= $container;
		//$this->uploader 	= $uploader;
		
    }
		
    public function action() : ResponseInterface
	{
		
		
		$options = array(
			"upload_dir" => "../content/upload/",
			"upload_url" => "content/upload/",
			"param_name" => "files",
			"delete_url" => "uploadfiles"
		);
	
		$upload_handler = new UploadHandler($options);

		// return to complete page
        return $this->response->withStatus(200);	
		
    }
	
	private function replaceText($template_email_name, $replacements)
	{
		$text_email = file_get_contents($this->template_path . $template_email_name);
		$keys 	= array_keys($replacements);
		$values = array_values($replacements);

		return preg_replace($keys,$values,$text_email);
	
	}
		
}