aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorMaZderMind2016-12-18 10:37:58 +0100
committerMaZderMind2016-12-18 10:37:58 +0100
commit23c70f3042251675796ebff7f3568005a335fa73 (patch)
tree547688e0ef964adb2eb28e1419e62f796f28ddd6 /index.php
parent738878b8b060b3cfcdde2d88a1a28d5ce83e4aa7 (diff)
parentda739f3b60a30d5dd5c7877742f8b5c292f25f46 (diff)
Merge branch 'feature/20-declarative-downloading'
fixes #20
Diffstat (limited to '')
-rw-r--r--index.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/index.php b/index.php
index ef3944c..ca0a6d4 100644
--- a/index.php
+++ b/index.php
@@ -1,7 +1,10 @@
<?php
if(!ini_get('short_open_tag'))
- die('`short_open_tag = On` is required');
+ die("`short_open_tag = On` is required\n");
+
+$GLOBALS['BASEDIR'] = dirname(__FILE__);
+chdir($GLOBALS['BASEDIR']);
require_once('config.php');
require_once('lib/helper.php');
@@ -27,6 +30,22 @@ require_once('model/Upcoming.php');
ob_start();
+if(isset($argv) && isset($argv[1]))
+{
+ require('lib/command-helper.php');
+
+ switch($argv[1])
+ {
+ case 'download':
+ require('command/download.php');
+ exit(0);
+ }
+
+ stderr("Unknown Command: %s", $argv[1]);
+ exit(1);
+}
+
+
try {
if(isset($_GET['htaccess']))
{