如何访问 Beanstalkd 库版本 1.13+1+g91c54fc 中的“storage:ArrayObject:private”属性?

问题描述 投票:0回答:1

我正在使用 beanstalks 1.13+1+g91c54fc,但从这里获取私有存储阵列时遇到问题

Pheanstalk\Response\ArrayResponse Object
(
    [name:Pheanstalk\Response\ArrayResponse:private] => OK
    [storage:ArrayObject:private] => Array
        (
            [name] => 'transaction_processing'
            [current-jobs-urgent] => 0
            [current-jobs-ready] => 1
            [current-jobs-reserved] => 0
            [current-jobs-delayed] => 0
            [current-jobs-buried] => 0
            [total-jobs] => 1
            [current-using] => 0
            [current-watching] => 0
            [current-waiting] => 0
            [cmd-delete] => 0
            [cmd-pause-tube] => 0
            [pause] => 0
            [pause-time-left] => 0
        )
)

我想从 [storage:ArrayObject:private] => Array 获取数据

php beanstalkd
1个回答
0
投票

根据https://github.com/pheanstalk/pheanstalk/blob/1459f2f62dddfe28902e0584708417dddd79bd70/src/Response/ArrayResponse.php#L34的代码 - 该对象可用作数组,

因此,类似

var_dump($response['total-jobs']);
的内容将输出(给定样本数据)-“1”。

该代码不再在最新(现在是 v5)版本的库中使用,但您可以在 https://github.com/pheanstalk/pheanstalk/tree/v4 - 您下载的代码中查看旧代码.

© www.soinside.com 2019 - 2024. All rights reserved.