git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Work around bug in twig 1
[phorkie.git]
/
src
/
stub-phar.php
diff --git
a/src/stub-phar.php
b/src/stub-phar.php
index ac82a382c1d8baa33220913ae357c86b6f240b22..859152bf8c6d6e3993ec3ef00ab64efb83bc0f5d 100644
(file)
--- a/
src/stub-phar.php
+++ b/
src/stub-phar.php
@@
-9,7
+9,7
@@
* @author Christian Weiske <cweiske@cweiske.de>
* @copyright 2014 Christian Weiske
* @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
* @author Christian Weiske <cweiske@cweiske.de>
* @copyright 2014 Christian Weiske
* @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
- * @link http
://phorkie.sf.net/
+ * @link http
s://cweiske.de/phorkie.htm
*/
if (!in_array('phar', stream_get_wrappers()) || !class_exists('Phar', false)) {
echo "Phar extension not avaiable\n";
*/
if (!in_array('phar', stream_get_wrappers()) || !class_exists('Phar', false)) {
echo "Phar extension not avaiable\n";
@@
-47,7
+47,10
@@
function rewritePath($path)
$path = rewriteWithHtaccess($path);
$path = rewriteWithHtaccess($path);
- if (substr($path, -4) == '.css' || substr($path, -3) == '.js') {
+ if (substr($path, -4) == '.css'
+ || substr($path, -3) == '.js'
+ || substr($path, 0, 9) == '/phorkie/'
+ ) {
header('Expires: ' . date('r', time() + 86400 * 7));
}
return 'www' . $path;
header('Expires: ' . date('r', time() + 86400 * 7));
}
return 'www' . $path;
@@
-55,10
+58,10
@@
function rewritePath($path)
function rewriteWithHtaccess($path)
{
function rewriteWithHtaccess($path)
{
- //remove the
trail
ing slash /
+ //remove the
lead
ing slash /
$cpath = substr($path, 1);
$bFoundMatch = false;
$cpath = substr($path, 1);
$bFoundMatch = false;
- $map = include(
__DIR__ . '/..
/src/gen-rewritemap.php');
+ $map = include(
'phar://' . __FILE__ . '
/src/gen-rewritemap.php');
foreach ($map as $pattern => $replace) {
if (preg_match($pattern, $cpath, $matches)) {
$bFoundMatch = true;
foreach ($map as $pattern => $replace) {
if (preg_match($pattern, $cpath, $matches)) {
$bFoundMatch = true;