404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.216.71.10: ~ $
<?php

namespace Google\Protobuf\Internal;

/**
 * Base class for Google\Protobuf\Any, this contains hand-written convenience
 * methods like pack() and unpack().
 */
class AnyBase extends \Google\Protobuf\Internal\Message
{
    const TYPE_URL_PREFIX = 'type.googleapis.com/';

    /**
     * This method will try to resolve the type_url in Any message to get the
     * targeted message type. If failed, an error will be thrown. Otherwise,
     * the method will create a message of the targeted type and fill it with
     * the decoded value in Any.
     * @return Message unpacked message
     * @throws \Exception Type url needs to be type.googleapis.com/fully-qualified.
     * @throws \Exception Class hasn't been added to descriptor pool.
     * @throws \Exception cannot decode data in value field.
     */
    public function unpack()
    {
        // Get fully qualified name from type url.
        $url_prifix_len = strlen(GPBUtil::TYPE_URL_PREFIX);
        if (substr($this->type_url, 0, $url_prifix_len) !=
                GPBUtil::TYPE_URL_PREFIX) {
            throw new \Exception(
                "Type url needs to be type.googleapis.com/fully-qulified");
        }
        $fully_qualifed_name =
            substr($this->type_url, $url_prifix_len);

        // Create message according to fully qualified name.
        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
        $desc = $pool->getDescriptorByProtoName($fully_qualifed_name);
        if (is_null($desc)) {
            throw new \Exception("Class ".$fully_qualifed_name
                                     ." hasn't been added to descriptor pool");
        }
        $klass = $desc->getClass();
        $msg = new $klass();

        // Merge data into message.
        $msg->mergeFromString($this->value);
        return $msg;
    }

    /**
     * The type_url will be created according to the given message’s type and
     * the value is encoded data from the given message..
     * @param message: A proto message.
     */
    public function pack($msg)
    {
        if (!$msg instanceof Message) {
            trigger_error("Given parameter is not a message instance.",
                          E_USER_ERROR);
            return;
        }

        // Set value using serialized message.
        $this->value = $msg->serializeToString();

        // Set type url.
        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
        $desc = $pool->getDescriptorByClassName(get_class($msg));
        $fully_qualifed_name = $desc->getFullName();
        $this->type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name;
    }

    /**
     * This method returns whether the type_url in any_message is corresponded
     * to the given class.
     * @param klass: The fully qualified PHP class name of a proto message type.
     */
    public function is($klass)
    {
        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
        $desc = $pool->getDescriptorByClassName($klass);
        $fully_qualifed_name = $desc->getFullName();
        $type_url = GPBUtil::TYPE_URL_PREFIX . $fully_qualifed_name;
        return $this->type_url === $type_url;
    }
}

Filemanager

Name Type Size Permission Actions
DescriptorProto Folder 0755
EnumDescriptorProto Folder 0755
FieldDescriptorProto Folder 0755
FieldOptions Folder 0755
FileOptions Folder 0755
GeneratedCodeInfo Folder 0755
MethodOptions Folder 0755
SourceCodeInfo Folder 0755
UninterpretedOption Folder 0755
AnyBase.php File 3.13 KB 0644
CodedInputStream.php File 11.78 KB 0644
CodedOutputStream.php File 5.24 KB 0644
Descriptor.php File 5.95 KB 0644
DescriptorPool.php File 6.44 KB 0644
DescriptorProto.php File 11.29 KB 0644
DescriptorProto_ExtensionRange.php File 619 B 0644
DescriptorProto_ReservedRange.php File 614 B 0644
EnumBuilderContext.php File 2.35 KB 0644
EnumDescriptor.php File 2.53 KB 0644
EnumDescriptorProto.php File 6.78 KB 0644
EnumDescriptorProto_EnumReservedRange.php File 654 B 0644
EnumOptions.php File 5.35 KB 0644
EnumValueDescriptorProto.php File 3.42 KB 0644
EnumValueOptions.php File 4.17 KB 0644
ExtensionRangeOptions.php File 2.23 KB 0644
FieldDescriptor.php File 8.08 KB 0644
FieldDescriptorProto.php File 21.08 KB 0644
FieldDescriptorProto_Label.php File 599 B 0644
FieldDescriptorProto_Type.php File 594 B 0644
FieldOptions.php File 21.48 KB 0644
FieldOptions_CType.php File 559 B 0644
FieldOptions_JSType.php File 564 B 0644
FileDescriptor.php File 2.84 KB 0644
FileDescriptorProto.php File 15.01 KB 0644
FileDescriptorSet.php File 1.87 KB 0644
FileOptions.php File 39.09 KB 0644
FileOptions_OptimizeMode.php File 589 B 0644
GPBDecodeException.php File 1.95 KB 0644
GPBJsonWire.php File 10.58 KB 0644
GPBLabel.php File 1.75 KB 0644
GPBType.php File 2.12 KB 0644
GPBUtil.php File 21.1 KB 0644
GPBWire.php File 17.71 KB 0644
GPBWireType.php File 1.87 KB 0644
GeneratedCodeInfo.php File 2.6 KB 0644
GeneratedCodeInfo_Annotation.php File 609 B 0644
GetPublicDescriptorTrait.php File 1.82 KB 0644
HasPublicDescriptorTrait.php File 1.81 KB 0644
MapEntry.php File 2.61 KB 0644
MapField.php File 8.38 KB 0644
MapFieldIter.php File 3.91 KB 0644
Message.php File 73.85 KB 0644
MessageBuilderContext.php File 4.03 KB 0644
MessageOptions.php File 15.12 KB 0644
MethodDescriptorProto.php File 7.42 KB 0644
MethodOptions.php File 5.33 KB 0644
MethodOptions_IdempotencyLevel.php File 619 B 0644
OneofDescriptor.php File 2.55 KB 0644
OneofDescriptorProto.php File 2.59 KB 0644
OneofField.php File 2.34 KB 0644
OneofOptions.php File 2.21 KB 0644
RawInputStream.php File 1.87 KB 0644
RepeatedField.php File 7.79 KB 0644
RepeatedFieldIter.php File 3.27 KB 0644
ServiceDescriptorProto.php File 3.62 KB 0644
ServiceOptions.php File 4.14 KB 0644
SourceCodeInfo.php File 11.76 KB 0644
SourceCodeInfo_Location.php File 584 B 0644
TimestampBase.php File 763 B 0644
UninterpretedOption.php File 8.37 KB 0644
UninterpretedOption_NamePart.php File 609 B 0644