fix dates in ical and add calendar title
[bdrem.git] / src / phar-stub.php
index 326b5cf046d3a493dbd31e5aa2f0fec1f8caed96..64c463e1b114d84418ee43a838b358822fa5add9 100644 (file)
@@ -1,12 +1,32 @@
 <?php
+/**
+ * Phar stub file for bdrem. Handles startup of the .phar file.
+ *
+ * PHP version 5
+ *
+ * @category  Tools
+ * @package   Bdrem
+ * @author    Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link      http://cweiske.de/bdrem.htm
+ */
 if (!in_array('phar', stream_get_wrappers()) || !class_exists('Phar', false)) {
     echo "Phar extension not avaiable\n";
     exit(255);
 }
 
 $web = 'www/index.php';
-$cli = 'bin/bdrem.php';
+$cli = 'bin/phar-bdrem.php';
 
+/**
+ * Rewrite the HTTP request path to an internal file.
+ * Maps "" and "/" to "www/index.php".
+ *
+ * @param string $path Path from the browser, relative to the .phar
+ *
+ * @return string Internal path.
+ */
 function rewritePath($path)
 {
     if ($path == '' || $path == '/') {
@@ -21,6 +41,6 @@ set_include_path(
     . PATH_SEPARATOR . 'phar://' . __FILE__ . '/lib/'
 );
 Phar::webPhar(null, $web, null, array(), 'rewritePath');
-include 'phar://' . __FILE__ . '/' . $cli;
+require 'phar://' . __FILE__ . '/' . $cli;
 __HALT_COMPILER();
 ?>