From 224c7763076bc6c59aaddaa6fb47091b95ffb46e Mon Sep 17 00:00:00 2001 From: Michael Save Date: Thu, 15 Mar 2012 22:16:26 +1100 Subject: [PATCH] pass command line arguments to http client --- tools/inc/cli.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/inc/cli.php b/tools/inc/cli.php index 8fdb6c39..1dcf12a6 100644 --- a/tools/inc/cli.php +++ b/tools/inc/cli.php @@ -30,7 +30,7 @@ if(!getenv('TINYBOARD_PATH')) { chdir(realpath('inc') . '/..'); } -echo 'Tinyboard: ' . getcwd() . "\n"; +putenv('TINYBOARD_PATH=' . getcwd()); require 'inc/functions.php'; require 'inc/display.php'; @@ -47,7 +47,7 @@ $mod = Array( ); function get_httpd_privileges() { - global $config, $shell_path; + global $config, $shell_path, $argv; if(php_sapi_name() != 'cli') die("get_httpd_privileges(): invoked from HTTP client.\n"); @@ -65,15 +65,18 @@ function get_httpd_privileges() { // replace "/inc/cli.php" with its new filename passthru("cat " . escapeshellarg($shell_path . '/' . $_SERVER['PHP_SELF']) . " | sed \"s/'\/inc\/cli\.php'/'\/{$inc_filename}'/\" > {$filename}"); - // copy environment $inc_header = "