/** * Logs the current command * * @access public * @param resource $rpc_conn The connection resource * @param array $auth Array of authentication information (email, password) * @param string $command The command used to run this script. */ function log($rpc_conn, $auth, $command) { $command = base64_encode($command); $msg = new XML_RPC_Message("logCommand", array(new XML_RPC_Value($auth[0], 'string'), new XML_RPC_Value($auth[1], 'string'), new XML_RPC_Value($command, 'string'))); $result = $rpc_conn->send($msg); if ($result->faultCode()) { Command_Line::quit($result->faultString()); } }
if (count($argv) != 4) { Command_Line::quit('Wrong parameter count'); } Command_Line::lookupCustomer($client, $auth, $argv[2], $argv[3]); } elseif ($argv[1] == 'weekly-report' || $argv[1] == 'wr') { if (count(@$argv) >= 4 and $argv[3] != '--separate-closed') { $separate_closed = @$argv[4] == '--separate-closed'; // date range Command_Line::getWeeklyReport($client, $auth, 0, $argv[2], $argv[3], $separate_closed); } else { // weekly if (@$argv[2] == '') { $separate_closed = false; @($argv[2] = 0); } else { $separate_closed = (@$argv[3] == '--separate-closed' or @$argv[2] == '--separate-closed'); } Command_Line::getWeeklyReport($client, $auth, $argv[2], '', '', $separate_closed); } } elseif ($argv[1] == 'clock') { Command_Line::timeClock($client, $auth, @$argv[2]); } else { Command_Line::quit("Unknown parameter '" . $argv[1] . "'"); } } } catch (Eventum_RPC_Exception $e) { print 'ERROR: ' . $e->getMessage() . "\n"; if ($debug) { print $e->getTraceAsString(); } }