1
0
mirror of https://github.com/lrsjng/h5ai.git synced 2025-08-09 07:16:40 +02:00

Minor tweaks.

This commit is contained in:
Lars Jung
2015-05-12 22:25:59 +02:00
parent b1f88f28f4
commit 4889290d3e
4 changed files with 7 additions and 25 deletions

View File

@@ -72,7 +72,7 @@ class Context {
public function is_info_request() {
return $this->get_current_path() === $this->setup->get('APP_PATH') . '/public';
return Util::starts_with($this->setup->get('REQUEST_HREF') . '/', $this->setup->get('APP_HREF'));
}
public function to_href($path, $trailing_slash = true) {
@@ -166,7 +166,7 @@ class Context {
public function get_current_path() {
$current_href = Util::normalize_path(parse_url($this->setup->get('REQUEST_URI'), PHP_URL_PATH), true);
$current_href = Util::normalize_path($this->setup->get('REQUEST_HREF'), true);
$current_path = $this->to_path($current_href);
if (!is_dir($current_path)) {

View File

@@ -59,7 +59,7 @@ class Setup {
$this->set('PASSHASH', PASSHASH);
$this->set('REQUEST_METHOD', getenv('REQUEST_METHOD'));
$this->set('REQUEST_URI', getenv('REQUEST_URI'));
$this->set('REQUEST_HREF', parse_url(getenv('REQUEST_URI'), PHP_URL_PATH));
$this->set('SCRIPT_NAME', getenv('SCRIPT_NAME'));
$this->set('SERVER_SOFTWARE', getenv('SERVER_SOFTWARE'));
}

View File

@@ -18,28 +18,10 @@ AddDefaultCharset utf-8
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 week"
# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!)
ExpiresByType image/x-icon "access plus 1 week"
# HTML
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
# JavaScript
ExpiresByType text/css "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
# Media
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
# Web fonts
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 week"
</IfModule>

View File

@@ -4,7 +4,7 @@ define('MIN_PHP_VERSION', '5.4.0');
if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '<')) {
header('Content-type: text/plain;charset=utf-8');
echo '[{{pkg.name}} {{pkg.version}}] PHP ' . MIN_PHP_VERSION . '+ required, only found PHP ' . PHP_VERSION;
echo '[err] {{pkg.name}} requires PHP ' . MIN_PHP_VERSION . ' or later, but found PHP ' . PHP_VERSION;
exit;
}