package.xml 0000664 0001750 0001750 00000016266 13160164434 011314 0 ustar jan jan
Horde_Scribepear.horde.orgScribePackaged version of the PHP Scribe client.Chuck Hagenbuchchuckchuck@horde.orgyes2017-09-192.0.31.0.0stablestableApache 2.0
* [jan] Mark PHP 7 as supported.
5.3.08.0.0alpha18.0.0alpha11.7.0Horde_Thriftpear.horde.org1.0.0alpha11.0.0alphaalpha2011-03-08Apache 2.0
* First alpha release for Horde 4.
* Initial packaging of autogenerated Scribe thrift code
1.0.0beta11.0.0betabeta2011-03-16Apache 2.0
* First beta release for Horde 4.
1.0.0RC11.0.0betabeta2011-03-22Apache 2.0
* First release candidate for Horde 4.
1.0.0RC21.0.0betabeta2011-03-29Apache 2.0
* Second release candidate for Horde 4.
1.0.01.0.0stablestable2011-04-06Apache 2.0
* First stable release for Horde 4.
1.0.11.0.0stablestable2011-07-27Apache 2.0
* [cjh] Add dependency on Horde_Thrift.
1.0.21.0.0stablestable2012-04-10Apache 2.0
* [rla] Add license file.
2.0.0alpha11.0.0alphastable2012-07-05Apache 2.0
* First alpha release for Horde 5.
2.0.0beta11.0.0betastable2012-07-19Apache 2.0
* First beta release for Horde 5.
2.0.01.0.0stablestable2012-10-30Apache 2.0
* First stable release for Horde 5.
2.0.11.0.0stablestable2012-11-22Apache 2.0
* [jan] Re-packaged 2.0.0 release.
2.0.21.0.0stablestable2015-01-09Apache 2.0
* [jan] Add Composer definition.
2.0.31.0.0stablestable2017-09-19Apache 2.0
* [jan] Mark PHP 7 as supported.
Horde_Scribe-2.0.3/doc/Horde/Scribe/examples/scribe.php 0000664 0001750 0001750 00000000414 13160164434 020764 0 ustar jan jan connect('localhost', 1463);
$scribe->log('keyword', 'This is a message for the keyword category');
Horde_Scribe-2.0.3/doc/Horde/Scribe/COPYING 0000664 0001750 0001750 00000004136 13160164434 016226 0 ustar jan jan Version 1.0
Copyright 1999-2017 Horde LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if
any, must include the following acknowledgment:
"This product includes software developed by Horde LLC
(http://www.horde.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Horde" and "Horde LLC" must not be used to
endorse or promote products derived from this software without prior
written permission. For written permission, please contact
core@horde.org.
5. Products derived from this software may not be called "Horde", nor
may "Horde" appear in their name, without prior written permission of
Horde LLC.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE HORDE PROJECT OR ITS CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many
individuals on behalf of Horde LLC. For more information on
Horde LLC, please see .
Horde_Scribe-2.0.3/lib/Horde/Scribe/Client.php 0000664 0001750 0001750 00000002045 13160164434 017120 0 ustar jan jan _transport = new TFramedTransport($socket);
$protocol = new TBinaryProtocol($this->_transport, false, false);
$this->_client = new scribeClient($protocol, $protocol);
}
public function log($category, $message)
{
$this->logMulti(array($this->makeEntry($category, $message)));
}
public function logMulti(array $messages)
{
$this->_transport->open();
$this->_client->Log($messages);
$this->_transport->close();
}
public function makeEntry($category, $message)
{
return new LogEntry(array('category' => $category, 'message' => $message));
}
}
Horde_Scribe-2.0.3/lib/Horde/Thrift/thrift_root/packages/scribe/scribe_types.php 0000664 0001750 0001750 00000005164 13160164434 026023 0 ustar jan jan 0,
'TRY_LATER' => 1,
);
final class ResultCode {
const OK = 0;
const TRY_LATER = 1;
public static $__names = array(
0 => 'OK',
1 => 'TRY_LATER',
);
}
class LogEntry {
static $_TSPEC;
public $category = null;
public $message = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
1 => array(
'var' => 'category',
'type' => TType::STRING,
),
2 => array(
'var' => 'message',
'type' => TType::STRING,
),
);
}
if (is_array($vals)) {
if (isset($vals['category'])) {
$this->category = $vals['category'];
}
if (isset($vals['message'])) {
$this->message = $vals['message'];
}
}
}
public function getName() {
return 'LogEntry';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true)
{
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid)
{
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->category);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->message);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output) {
$xfer = 0;
$xfer += $output->writeStructBegin('LogEntry');
if ($this->category !== null) {
$xfer += $output->writeFieldBegin('category', TType::STRING, 1);
$xfer += $output->writeString($this->category);
$xfer += $output->writeFieldEnd();
}
if ($this->message !== null) {
$xfer += $output->writeFieldBegin('message', TType::STRING, 2);
$xfer += $output->writeString($this->message);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}
?>
Horde_Scribe-2.0.3/lib/Horde/Thrift/thrift_root/scribe.php 0000664 0001750 0001750 00000016566 13160164434 021562 0 ustar jan jan send_Log($messages);
return $this->recv_Log();
}
public function send_Log($messages)
{
$args = new scribe_Log_args();
$args->messages = $messages;
$bin_accel = ($this->output_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
{
thrift_protocol_write_binary($this->output_, 'Log', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
}
else
{
$this->output_->writeMessageBegin('Log', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_Log()
{
$bin_accel = ($this->input_ instanceof TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, 'scribe_Log_result', $this->input_->isStrictRead());
else
{
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new scribe_Log_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new Exception("Log failed: unknown result");
}
}
// HELPER FUNCTIONS AND STRUCTURES
class scribe_Log_args {
static $_TSPEC;
public $messages = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
1 => array(
'var' => 'messages',
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => 'LogEntry',
),
),
);
}
if (is_array($vals)) {
if (isset($vals['messages'])) {
$this->messages = $vals['messages'];
}
}
}
public function getName() {
return 'scribe_Log_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true)
{
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid)
{
case 1:
if ($ftype == TType::LST) {
$this->messages = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4)
{
$elem5 = null;
$elem5 = new LogEntry();
$xfer += $elem5->read($input);
$this->messages []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output) {
$xfer = 0;
$xfer += $output->writeStructBegin('scribe_Log_args');
if ($this->messages !== null) {
if (!is_array($this->messages)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('messages', TType::LST, 1);
{
$output->writeListBegin(TType::STRUCT, count($this->messages));
{
foreach ($this->messages as $iter6)
{
$xfer += $iter6->write($output);
}
}
$output->writeListEnd();
}
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}
class scribe_Log_result {
static $_TSPEC;
public $success = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
0 => array(
'var' => 'success',
'type' => TType::I32,
),
);
}
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName() {
return 'scribe_Log_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true)
{
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid)
{
case 0:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->success);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output) {
$xfer = 0;
$xfer += $output->writeStructBegin('scribe_Log_result');
if ($this->success !== null) {
$xfer += $output->writeFieldBegin('success', TType::I32, 0);
$xfer += $output->writeI32($this->success);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}
class scribeProcessor extends FacebookServiceProcessor {
public function __construct($handler) {
parent::__construct($handler);
}
public function process($input, $output) {
$rseqid = 0;
$fname = null;
$mtype = 0;
$input->readMessageBegin($fname, $mtype, $rseqid);
$methodname = 'process_'.$fname;
if (!method_exists($this, $methodname)) {
$input->skip(TType::STRUCT);
$input->readMessageEnd();
$x = new TApplicationException('Function '.$fname.' not implemented.', TApplicationException::UNKNOWN_METHOD);
$output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid);
$x->write($output);
$output->writeMessageEnd();
$output->getTransport()->flush();
return;
}
$this->$methodname($rseqid, $input, $output);
return true;
}
protected function process_Log($seqid, $input, $output) {
$args = new scribe_Log_args();
$args->read($input);
$input->readMessageEnd();
$result = new scribe_Log_result();
$result->success = $this->handler_->Log($args->messages);
$output->writeMessageBegin('Log', TMessageType::REPLY, $seqid);
$result->write($output);
$output->getTransport()->flush();
}
}
?>
Horde_Scribe-2.0.3/lib/Horde/Scribe.php 0000664 0001750 0001750 00000000262 13160164434 015701 0 ustar jan jan