Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 50 lines (44 sloc) 1.29 KB
#!/usr/bin/env php
<?php
/**
* Zookeeper Online
*
* @author Jim Mason <jmason@ibinx.com>
* @copyright Copyright (C) 1997-2018 Jim Mason <jmason@ibinx.com>
* @link https://zookeeper.ibinx.com/
* @license GPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License,
* version 3, along with this program. If not, see
* http://www.gnu.org/licenses/
*
*/
chdir(__DIR__);
if($argc == 1) {
echo "Usage: zk TARGET [NAME=VALUE...]\n";
exit -1;
}
/**
* parse out zero or more NAME=VALUE pairs from the argument list
*/
$_REQUEST = [];
foreach($argv as $arg) {
$tuple = explode('=', $arg);
if(sizeof($tuple) == 2)
$_REQUEST[$tuple[0]] = $tuple[1];
}
/**
* by default, TARGET is the first argument, unless explicitly specified
*/
if(!array_key_exists('target', $_REQUEST))
$_REQUEST['target'] = $argv[1];
require('index.php');
You can’t perform that action at this time.