From 198afa0a1d61c4db2cf6b66e5801af506462ab9b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 20 Jun 2009 14:58:47 -0700 Subject: change scripts to take server and path from commandline --- scripts/synctwitterfriends.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts/synctwitterfriends.php') diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php index bd08ba58d..dea3f9700 100755 --- a/scripts/synctwitterfriends.php +++ b/scripts/synctwitterfriends.php @@ -30,6 +30,11 @@ define('LACONICA', true); // Uncomment this to get useful console output //define('SCRIPT_DEBUG', true); +// Preset the server at the command line + +$server = ($argc > 1) ? $argv[1] : null; +$path = ($argc > 2) ? $argv[2] : null; + require_once(INSTALLDIR . '/lib/common.php'); // Make a lockfile -- cgit v1.2.3-54-g00ecf From 1951246d67dfe41f2dfa722d1487baedf74c3081 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 22 Jun 2009 16:31:13 -0700 Subject: synctwitterfriends.php uses commandline.inc --- scripts/synctwitterfriends.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'scripts/synctwitterfriends.php') diff --git a/scripts/synctwitterfriends.php b/scripts/synctwitterfriends.php index 7f418894e..fe53ff44d 100755 --- a/scripts/synctwitterfriends.php +++ b/scripts/synctwitterfriends.php @@ -18,24 +18,16 @@ * along with this program. If not, see . */ -// Abort if called from a web server -if (isset($_SERVER) && array_key_exists('REQUEST_METHOD', $_SERVER)) { - print "This script must be run from the command line\n"; - exit(); -} - define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); -define('LACONICA', true); // Uncomment this to get useful console output -//define('SCRIPT_DEBUG', true); -// Preset the server at the command line +$helptext = << 1) ? $argv[1] : null; -$path = ($argc > 2) ? $argv[2] : null; +END_OF_TWITTER_HELP; -require_once(INSTALLDIR . '/lib/common.php'); +require_once INSTALLDIR.'/scripts/commandline.inc'; // Make a lockfile $lockfilename = lockFilename(); -- cgit v1.2.3-54-g00ecf