Exemplo n.º 1
0
 /**
  * @brief Inspect the state of the request
  */
 static function inspect()
 {
     debug::inspect($_REQUEST);
 }
Exemplo n.º 2
0
 public function inspect()
 {
     debug::inspect($this->data);
 }
Exemplo n.º 3
0
 /**
  * @brief Inspect the state of the request
  */
 static function inspect()
 {
     debug::inspect(self::$cookies);
 }
Exemplo n.º 4
0
 static function inspect()
 {
     debug::inspect(view::$_viewdata);
 }
Exemplo n.º 5
0
 /**
  * @brief Inspect the state of the request
  */
 static function inspect()
 {
     debug::inspect($_SESSION);
 }
Exemplo n.º 6
0
 function main($argc, $argv)
 {
     if ($this->getParameterCount() == 0) {
         $this->usage();
         return 1;
     }
     switch ($this->getParameter(0)) {
         case 'call':
             if ($this->hasArgument('u')) {
                 $user = $this->getArgument('u');
                 $pass = null;
                 if ($this->hasArgument('p')) {
                     printf('Password: '******':', $paramlistitem . ':');
                 $data[$k] = $v;
             }
             $site = $this->conf->vs_siteurl;
             $xc = new XmlrpcClient($site . '/api/xmlrpc', $user, $pass);
             $ret = $xc->call($this->getParameter(1), $data);
             if ($ret) {
                 if (arr::hasKey($ret, 'faultCode')) {
                     printf("Error %d: %s\n", $ret['faultCode'], $ret['faultString']);
                 } else {
                     debug::inspect($ret, false, false);
                 }
             } else {
                 printf("Server error.\n");
             }
             break;
         case 'config':
             $editor = new ConfigEditor();
             $editor->loop();
             break;
         case 'set':
             $key = $this->getParameter(1);
             $defs = $this->conf->getDefs($key);
             $val = $this->getParameter(2);
             $this->printValue($key, $val);
             switch ($defs['vartype']) {
                 case 'boolean':
                     if ($val == "1") {
                         $this->conf->{$key} = true;
                     } else {
                         $this->conf->{$key} = false;
                     }
                     break;
                 case 'integer':
                     $this->conf->{$key} = intval($val);
                     break;
                 case 'float':
                     $this->conf->{$key} = floatval($val);
                     break;
                 default:
                     $this->conf->{$key} = $val;
             }
             break;
         case 'get':
             if ($this->getParameterCount() > 1) {
                 $key = $this->getParameter(1);
                 $val = $this->conf->{$key};
                 $this->printValue($key, $val);
             } else {
                 $keys = $this->conf->getAll();
                 ksort($keys);
                 foreach ($keys as $key => $val) {
                     if ($key) {
                         $this->printValue($key, $val);
                     }
                 }
             }
             break;
         case 'backup':
             $filename = $this->getParameter(1);
             printf("Backing up to %s...\n", $filename);
             $keys = $this->conf->getAll();
             file_put_contents($filename, serialize($keys));
             break;
         case 'restore':
             $filename = $this->getParameter(1);
             printf("Restoring from %s...\n", $filename);
             $keys = unserialize(file_get_contents($filename));
             foreach ($keys as $key => $value) {
                 printf("  %s: ", $key);
                 $this->conf->{$key} = $value;
                 printf("Ok\n");
             }
             break;
         case 'unset':
             $keys = $this->getParameters();
             $keys = array_slice($keys, 1);
             foreach ($keys as $key) {
                 printf("Unset key: %s\n", $key);
                 $this->conf->{$key} = null;
             }
             break;
         default:
             $params = $this->getParameters();
             $cmd = $params[0];
             $params = array_slice($params, 1);
             $cmdm = 'cmd_' . $cmd;
             if (is_callable(array($this, $cmdm))) {
                 call_user_func_array(array($this, $cmdm), $params);
             } else {
                 printf("Unknown command: %s, try -h\n", $cmd);
             }
             break;
     }
 }
Exemplo n.º 7
0
 public function debug()
 {
     $debug = array('Current step' => $this->getCurrentStepKey(), 'Step keys' => $this->getStepKeys(), 'Current step index' => $this->getCurrentStepIndex(), 'Form was submitted' => $this->getFormSubmitted() ? 'True' : 'False', 'Form was completed' => $this->getFormCompleted() ? 'True' : 'False', 'Form token' => $this->getFormToken());
     debug::inspect($debug, false);
 }
Exemplo n.º 8
0
 function siteinfo()
 {
     $xc = new XmlrpcClient('http://ebooks.noccylabs.info/api/xmlrpc');
     debug::inspect($xc->call('vs.siteinfo'));
 }