| 18 |
* $Id$ |
* $Id$ |
| 19 |
* ------------------------------------------------------------------------- |
* ------------------------------------------------------------------------- |
| 20 |
* $Log$ |
* $Log$ |
| 21 |
|
* Revision 1.11 2003/03/28 06:44:51 joko |
| 22 |
|
* VERBOSE mode |
| 23 |
|
* |
| 24 |
|
* Revision 1.10 2003/03/28 03:05:54 joko |
| 25 |
|
* more fancy debugging-output |
| 26 |
|
* |
| 27 |
* Revision 1.9 2003/03/10 23:05:25 joko |
* Revision 1.9 2003/03/10 23:05:25 joko |
| 28 |
* + fixed metadata for phpDocumentor |
* + fixed metadata for phpDocumentor |
| 29 |
* |
* |
| 482 |
logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING); |
logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING); |
| 483 |
return; |
return; |
| 484 |
} |
} |
| 485 |
|
logp(get_class($this) . "->_loadRemote: getObjectByGuid", PEAR_LOG_DEBUG); |
| 486 |
$args = array( guid => $this->objectId, classname => $this->meta[classname] ); |
$args = array( guid => $this->objectId, classname => $this->meta[classname] ); |
| 487 |
$result = $this->backend->send('getObjectByGuid', $args ); |
$result = $this->backend->send('getObjectByGuid', $args ); |
| 488 |
|
|
| 491 |
logp(get_class($this) . "->_loadRemote: argument 'oid' requires valid objectId", PEAR_LOG_WARNING); |
logp(get_class($this) . "->_loadRemote: argument 'oid' requires valid objectId", PEAR_LOG_WARNING); |
| 492 |
return; |
return; |
| 493 |
} |
} |
| 494 |
|
logp(get_class($this) . "->_loadRemote: getObject", PEAR_LOG_DEBUG); |
| 495 |
$result = $this->backend->send('getObject', $this->objectId); |
$result = $this->backend->send('getObject', $this->objectId); |
| 496 |
|
|
| 497 |
} elseif ($this->meta[key]) { |
} elseif ($this->meta[key]) { |
| 505 |
return; |
return; |
| 506 |
} |
} |
| 507 |
*/ |
*/ |
| 508 |
|
//logp(get_class($this) . "->_loadRemote: $this->meta[command](" . join(' ', $this->meta[query]) . ")", PEAR_LOG_DEBUG); |
| 509 |
|
//print Dumper(array($this->meta[command], $this->meta[query])); |
| 510 |
$result = $this->backend->send($this->meta[command], $this->meta[query]); |
$result = $this->backend->send($this->meta[command], $this->meta[query]); |
| 511 |
|
|
| 512 |
} |
} |
| 513 |
|
|
| 514 |
|
//print "result: " . dumpVar($result) . "<br>"; |
| 515 |
|
|
| 516 |
|
$status = $this->backend->getStatus(); |
| 517 |
|
//print Dumper($status); |
| 518 |
|
|
| 519 |
if ($result) { |
if (constants::get('VERBOSE')) { |
| 520 |
//print "result: " . dumpVar($result) . "<br>"; |
$style = html_style("text/css", '.boxlabel_yellow { color: yellow; font-weight:bold; }'); |
| 521 |
if (count($result) == 0) { return; } |
$statusbox = html_div(); |
| 522 |
|
$statusbox->set_style('background: #558856; border: 2px black groove; width:640px; padding:10px; margin:40px;'); |
| 523 |
|
$statusbox->add( html_span('boxlabel_yellow', "Connected:"), $status[connected], html_br() ); |
| 524 |
|
foreach ($status[errors] as $error) { |
| 525 |
|
$statusbox->add( html_span('boxlabel_yellow', "Error($error[code]):"), $error[message], html_br() ); |
| 526 |
|
} |
| 527 |
|
} |
| 528 |
|
|
| 529 |
|
if (is_array($result)) { |
| 530 |
|
$good = 1; |
| 531 |
|
} else { |
| 532 |
|
$message = get_class($this) . "->_loadRemote: Error while trying to talk to remote side. Please check wire, socket or api."; |
| 533 |
|
logp($message, PEAR_LOG_CRIT); |
| 534 |
|
if (constants::get('VERBOSE')) { |
| 535 |
|
$statusbox->add( html_span('boxlabel_yellow', "Critical:"), $message, html_br() ); |
| 536 |
|
} |
| 537 |
|
} |
| 538 |
|
|
| 539 |
|
if ($good && sizeof($result)) { |
| 540 |
|
|
| 541 |
// FIXME: this is dangerous! |
// FIXME: this is dangerous! |
| 542 |
if ($_GET[debug]) { |
if ($_GET[debug]) { |
| 549 |
$this->_saveProxy(); |
$this->_saveProxy(); |
| 550 |
//print "oid: $this->objectId<br>"; |
//print "oid: $this->objectId<br>"; |
| 551 |
$this->flushState(); |
$this->flushState(); |
| 552 |
|
|
| 553 |
} else { |
} else { |
| 554 |
//print "Error in _loadRemote!!!<br>"; |
if (constants::get('VERBOSE')) { |
| 555 |
logp(get_class($this) . "->_loadRemote: error while trying to talk to remote side", PEAR_LOG_CRIT); |
print $style->render(); |
| 556 |
|
print $statusbox->render(); |
| 557 |
|
} else { |
| 558 |
|
foreach ($status[errors] as $error) { |
| 559 |
|
print Dumper($error); |
| 560 |
|
} |
| 561 |
|
} |
| 562 |
|
|
| 563 |
} |
} |
| 564 |
|
|
| 565 |
} |
} |