fixes for lighttpd and php 5.4 v0.5.0
authorChristian Weiske <cweiske@cweiske.de>
Fri, 21 Mar 2014 21:20:07 +0000 (22:20 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 21 Mar 2014 21:20:07 +0000 (22:20 +0100)
build.xml
src/bdrem/Renderer/Html.php
src/phar-stub.php

index 77147639cec8413d949b14f8210aac449fd34a30..f3fd933897394a59f86d5b89c94371b6590629c4 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -62,6 +62,7 @@
   <pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR">
    <include name="PEAR/Exception.php"/>
    <include name="PEAR.php"/>
+   <include name="PEAR5.php"/>
   </pearPackageFileset>
 
   <copy todir="${libdir}">
index 91f059dc1c1156e992225650f155aa2e7f066328..e802faf17fa77288fae9394cdfa45bfc703d60ce 100644 (file)
@@ -55,6 +55,9 @@ class Renderer_Html extends Renderer
     {
         $links = '';
         if (isset($_SERVER['HTTP_HOST'])) {
+            if (!isset($_SERVER['REQUEST_SCHEME'])) {
+                $_SERVER['REQUEST_SCHEME'] = 'http';
+            }
             $links = '  <link rel="alternate" type="text/calendar" href="'
                 . $_SERVER['REQUEST_SCHEME'] . '://'
                 . $_SERVER['HTTP_HOST']
index 64c463e1b114d84418ee43a838b358822fa5add9..8535a6f4f6ae73ea3ee2d6e117dc8bde147dc314 100644 (file)
@@ -41,6 +41,13 @@ set_include_path(
     . PATH_SEPARATOR . 'phar://' . __FILE__ . '/lib/'
 );
 Phar::webPhar(null, $web, null, array(), 'rewritePath');
+
+//work around https://bugs.php.net/bug.php?id=52322
+if (php_sapi_name() == 'cgi-fcgi') {
+    require 'phar://' . __FILE__ . '/' . $web;
+    exit();
+}
+
 require 'phar://' . __FILE__ . '/' . $cli;
 __HALT_COMPILER();
 ?>