BladeOne Error [Compiling]:
Unable to save the file [/var/www/html/szablon1/views_cache/f04deb4554467c2fbb0bc80fb0d5b246f29236fa.bladec]. Check the compile folder is defined and has the right permission
Whoops! There was an error.
Whoops \ Exception \ ErrorException (E_WARNING)
include(/var/www/html/szablon1/views_cache/f04deb4554467c2fbb0bc80fb0d5b246f29236fa.bladec): Failed to open stream: No such file or directory Whoops\Exception\ErrorException thrown with message "include(/var/www/html/szablon1/views_cache/f04deb4554467c2fbb0bc80fb0d5b246f29236fa.bladec): Failed to open stream: No such file or directory" Stacktrace: #7 Whoops\Exception\ErrorException in /var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php:1484 #6 include in /var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php:1484 #5 eftec\bladeone\BladeOne:evaluatePath in /var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php:1138 #4 eftec\bladeone\BladeOne:runInternal in /var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php:2042 #3 eftec\bladeone\BladeOne:run in /var/www/html/szablon1/index.php:17 #2 view in /var/www/html/szablon1/app/Controllers/VoucherController.php:17 #1 App\Controllers\VoucherController:getFrontend in /var/www/html/szablon1/app/Routing/Router.php:65 #0 App\Routing\Router:handle in /var/www/html/szablon1/index.php:24
Stack frames (8)
7
Whoops\Exception\ErrorException
/vendor/eftec/bladeone/lib/BladeOne.php1484
6
include
/vendor/eftec/bladeone/lib/BladeOne.php1484
5
eftec\bladeone\BladeOne evaluatePath
/vendor/eftec/bladeone/lib/BladeOne.php1138
4
eftec\bladeone\BladeOne runInternal
/vendor/eftec/bladeone/lib/BladeOne.php2042
3
eftec\bladeone\BladeOne run
/index.php17
2
view
/app/Controllers/VoucherController.php17
1
App\Controllers\VoucherController getFrontend
/app/Routing/Router.php65
0
App\Routing\Router handle
/index.php24
/var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php
 
    /**
     * Evaluates a compiled file using the current variables
     *
     * @param string $compiledFile full path of the compile file.
     * @param array  $variables
     * @return string
     * @throws Exception
     */
    protected function evaluatePath($compiledFile, $variables): string
    {
        \ob_start();
        // note, the variables are extracted locally inside this method,
        // they are not global variables :-3
        \extract($variables);
        // We'll evaluate the contents of the view inside a try/catch block, so we can
        // flush out any stray output that might get out before an error occurs or
        // an exception is thrown. This prevents any partial views from leaking.
        try {
            include $compiledFile;
        } catch (Exception $e) {
            $this->handleViewException($e);
        }
        return \ltrim(\ob_get_clean());
    }
 
    /**
     * @param array $views array of views
     * @param array $value
     * @return string
     * @throws Exception
     */
    public function includeFirst($views = [], $value = []): string
    {
        foreach ($views as $view) {
            if ($this->templateExist($view)) {
                return $this->runChild($view, $value);
            }
        }
        return '';
/var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php
 
    /**
     * Evaluates a compiled file using the current variables
     *
     * @param string $compiledFile full path of the compile file.
     * @param array  $variables
     * @return string
     * @throws Exception
     */
    protected function evaluatePath($compiledFile, $variables): string
    {
        \ob_start();
        // note, the variables are extracted locally inside this method,
        // they are not global variables :-3
        \extract($variables);
        // We'll evaluate the contents of the view inside a try/catch block, so we can
        // flush out any stray output that might get out before an error occurs or
        // an exception is thrown. This prevents any partial views from leaking.
        try {
            include $compiledFile;
        } catch (Exception $e) {
            $this->handleViewException($e);
        }
        return \ltrim(\ob_get_clean());
    }
 
    /**
     * @param array $views array of views
     * @param array $value
     * @return string
     * @throws Exception
     */
    public function includeFirst($views = [], $value = []): string
    {
        foreach ($views as $view) {
            if ($this->templateExist($view)) {
                return $this->runChild($view, $value);
            }
        }
        return '';
/var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php
            //$this->variablesGlobal = []; // used so we delete it.
        } else {
            $this->variables = $variables;
        }
        if (!$runFast) {
            // a) if the "compile" is forced then we compile the original file, then save the file.
            // b) if the "compile" is not forced then we read the datetime of both file, and we compared.
            // c) in both cases, if the compiled doesn't exist then we compile.
            if ($view) {
                $this->fileName = $view;
            }
            $result = $this->compile($view, $forced);
            if (!$this->isCompiled) {
                return $this->evaluateText($result, $this->variables);
            }
        } elseif ($view) {
            $this->fileName = $view;
        }
        $this->isRunFast = $runFast;
        return $this->evaluatePath($this->getCompiledFile(), $this->variables);
    }
 
    protected function evalComposer($view): void
    {
        foreach ($this->composerStack as $viewKey => $fn) {
            if ($this->wildCardComparison($view, $viewKey)) {
                if (is_callable($fn)) {
                    $fn($this);
                } elseif ($this->methodExistsStatic($fn, 'composer')) {
                    // if the method exists statically then $fn is the class and 'composer' is the name of the method
                    $fn::composer($this);
                } elseif (is_object($fn) || class_exists($fn)) {
                    // if $fn is an object, or it is a class and the class exists.
                    $instance = (is_object($fn)) ? $fn : new $fn();
                    if (method_exists($instance, 'composer')) {
                        // and the method exists inside the instance.
                        $instance->composer($this);
                    } else {
                        if ($this->mode === self::MODE_DEBUG) {
                            $this->showError('evalComposer', "BladeOne: composer() added an incorrect method [$fn]", true, true);
/var/www/html/szablon1/vendor/eftec/bladeone/lib/BladeOne.php
    public function run($view = null, $variables = []): string
    {
        $mode = $this->getMode();
 
        if ($view === null) {
            $view = $this->viewStack;
        }
        $this->viewStack = null;
        if ($view === null) {
            $this->showError('run', 'BladeOne: view not set', true);
            return '';
        }
 
        $forced = $mode & 1; // mode=1 forced:it recompiles no matter if the compiled file exists or not.
        $runFast = $mode & 2; // mode=2 runfast: the code is not compiled neither checked, and it runs directly the compiled
        $this->sections = [];
        if ($mode == 3) {
            $this->showError('run', "we can't force and run fast at the same time", true);
        }
        return $this->runInternal($view, $variables, $forced, true, $runFast);
    }
 
    /**
     * It sets the current view<br>
     * This value is cleared when it is used (method run).<br>
     * <b>Example:<b><br>
     * <pre>
     * $this->setView('folder.view')->share(['var1'=>20])->run(); // or $this->run('folder.view',['var1'=>20]);
     * </pre>
     *
     * @param string $view
     * @return BladeOne
     */
    public function setView($view): BladeOne
    {
        $this->viewStack = $view;
        return $this;
    }
 
    /**
/var/www/html/szablon1/index.php
<?php

/**
 * Created with love by: Patryk Vizauer (wizjoner.dev)
 * Date: 02.11.2022 13:50
 * Using: PhpStorm
 */

require_once __DIR__ . '/vendor/autoload.php';
$config = require_once __DIR__ . '/app/config.php';
require_once __DIR__ . '/app/WhoopsHandler.php';
require_once __DIR__ . '/app/Routing/routes.php';
$blade = new \eftec\bladeone\BladeOne(__DIR__ . '/views', __DIR__ . '/views_cache', \eftec\bladeone\BladeOne::MODE_AUTO);
function view(string $view, array $variables = [])
{
    global $blade, $config;
    return $blade->run($view, $variables + ['config' => $config]);
}

date_default_timezone_set('Europe/Warsaw');
session_name('spaceis-v4-template-session');
session_start();

echo $router->handle($_SERVER, $config);
 
/var/www/html/szablon1/app/Controllers/VoucherController.php
<?php

/**
 * Created with love by: Patryk Vizauer (wizjoner.dev)
 * Date: 02.11.2022 16:17
 * Using: PhpStorm
 */

namespace App\Controllers;

use App\Validation\Validator;

class VoucherController extends BaseController
{
    public function getFrontend()
    {
        return view('voucher');
    }

    public function execute()
    {
        Validator::make([
            'nick' => 'required|minecraftNick',
            'code' => 'required',
        ], $_POST);

        $apiRequest = $this->apiRequest('voucher', 'POST', [
            'nick' => $_POST['nick'],
            'code' => $_POST['code'],
        ], false);

        $status = $apiRequest->getStatusCode();
        $json = json_decode($apiRequest->getBody());

        if ($status == 200) {
            return redirect('/transaction_status/' . $json->data->transactionId);
        } else if ($status == 403) {
            $_SESSION['error'] = 'Voucher został już wykorzystany.';
        } else {
            $_SESSION['error'] = 'Błędny kod vouchera.';
/var/www/html/szablon1/app/Routing/Router.php
            if(empty($_POST['_token']) || $_POST['_token'] != getCsrf()) {
                $_SESSION['error'] = 'Błędny token CSRF';

                return redirect($route);
            }
        }

        try {
            [$controller, $args] = $this->routeManager->resolve($httpMethod, $route);

            [$controllerName, $function] = $controller;

            $controller = new $controllerName;
            if (!$controller instanceof BaseController) {
                throw new \LogicException(sprintf('%s must be an instance of BaseController', $controllerName));
            }

            $controller->setConfig($config);

            return $controller->$function(...$args);
        } catch (RouteNotFoundException) {
            http_response_code(404);
            return view('404');
        }
    }
}
/var/www/html/szablon1/index.php
 * Date: 02.11.2022 13:50
 * Using: PhpStorm
 */

require_once __DIR__ . '/vendor/autoload.php';
$config = require_once __DIR__ . '/app/config.php';
require_once __DIR__ . '/app/WhoopsHandler.php';
require_once __DIR__ . '/app/Routing/routes.php';
$blade = new \eftec\bladeone\BladeOne(__DIR__ . '/views', __DIR__ . '/views_cache', \eftec\bladeone\BladeOne::MODE_AUTO);
function view(string $view, array $variables = [])
{
    global $blade, $config;
    return $blade->run($view, $variables + ['config' => $config]);
}

date_default_timezone_set('Europe/Warsaw');
session_name('spaceis-v4-template-session');
session_start();

echo $router->handle($_SERVER, $config);
 

Environment & details:

empty
empty
empty
Key Value
spaceis-v4-template-session 808bfb32cd53d724bb1b75777989d55f
empty
Key Value
USER www-data
HOME /var/www
SCRIPT_NAME /index.php
REQUEST_URI /voucher
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /voucher
REMOTE_PORT 35926
SCRIPT_FILENAME //var/www/html/szablon1/index.php
SERVER_ADMIN [no address given]
CONTEXT_DOCUMENT_ROOT /var/www/html/szablon1
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /var/www/html/szablon1
REMOTE_ADDR 216.73.216.43
SERVER_PORT 443
SERVER_ADDR 57.128.227.149
SERVER_NAME cloudfun.pl
SERVER_SOFTWARE Apache/2.4.63 (Ubuntu)
SERVER_SIGNATURE <address>Apache/2.4.63 (Ubuntu) Server at cloudfun.pl Port 443</address>
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/snap/bin
HTTP_HOST cloudfun.pl
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_COOKIE spaceis-v4-template-session=808bfb32cd53d724bb1b75777989d55f
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
proxy-nokeepalive 1
SSL_TLS_SNI cloudfun.pl
HTTPS on
REDIRECT_STATUS 200
REDIRECT_SSL_TLS_SNI cloudfun.pl
REDIRECT_HTTPS on
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1770004552.5419
REQUEST_TIME 1770004552
empty
0. Whoops\Handler\PrettyPageHandler