- Fixed Memory caching interfacing.

- Fixed a bug within UrlExtension which was triggered only in IIS
This commit is contained in:
Dave Mc Nicoll 2020-01-29 16:13:05 -05:00
parent ddc3ae704a
commit e8d81222ff
2 changed files with 10 additions and 19 deletions

View File

@ -2,21 +2,12 @@
namespace Picea\Caching;
use Picea\Compiler\Context;
class Memory implements Cache {
public function compiled(string $viewPath) : bool { return false; }
public function handle(string $fileName) : bool
{
#if ( file_exists($path = $this->filePath($fileName)) ) {
# require_once($path);
#}
public function load(string $viewPath, ...$arguments) : object { return new \StdClass(); }
return false;
}
public function load() {}
public function saveFile(string $fileName) : bool
{
}
public function save(Context $context) : bool { return true; }
}

View File

@ -15,7 +15,7 @@ class UrlExtension implements Extension {
public array $tokens = [ "url" , "route", "asset" ];
public function __construct(Context $context, string $urlBase = "", string $assetToken = "") {
$this->urlBase = $urlBase;
$this->urlBase = trim($urlBase, "/");
$this->assetToken = $assetToken;
$this->register($context);
}
@ -110,7 +110,7 @@ class UrlExtension implements Extension {
protected function base() : string
{
return $this->urlBase ? $this->urlBase . "/" : "";
return $this->urlBase ? "/" . $this->urlBase : "";
}
/**
@ -143,9 +143,9 @@ class UrlExtension implements Extension {
]));
return $header
|| ( "443" === $_SERVER['SERVER_PORT'] ?? "" )
|| ( "https" === $_SERVER['REQUEST_SCHEME'] ?? "http" )
|| ( "off" !== strtolower($_SERVER['HTTPS'] ?? "off") );
|| ( "443" === ( $_SERVER['SERVER_PORT'] ?? "" ) )
|| ( "https" === ( $_SERVER['REQUEST_SCHEME'] ?? "http") )
|| ( "off" !== ( strtolower($_SERVER['HTTPS'] ?? "off")) );
}
protected function prepareRoute(string $route, array &$arguments)