Skip to content

Commit 4b83480

Browse files
committed
Declare SNMP properties
1 parent 1279984 commit 4b83480

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

ext/snmp/snmp.stub.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,22 @@ function snmp_read_mib(string $filename): bool {}
7575

7676
class SNMP
7777
{
78+
public array $info;
79+
/** @var int|null */
80+
public $max_oids;
81+
/** @var int */
82+
public $valueretrieval;
83+
/** @var bool */
84+
public $quick_print;
85+
/** @var bool */
86+
public $enum_print;
87+
/** @var int */
88+
public $oid_output_format;
89+
/** @var bool */
90+
public $oid_increasing_check = true;
91+
/** @var int */
92+
public $exceptions_enabled = 0;
93+
7894
public function __construct(int $version, string $hostname, string $community, int $timeout = -1, int $retries = -1) {}
7995

8096
/** @return bool */

ext/snmp/snmp_arginfo.h

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 08192d87d2ac5d35092cfcf4a2cdcc50f7ec4ada */
2+
* Stub hash: e413f4e60b0f04dc3f3cfd1bb90b8f896c3fd7f0 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_snmpget, 0, 3, stdClass, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_BOOL)
55
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
@@ -249,6 +249,54 @@ static zend_class_entry *register_class_SNMP(void)
249249
INIT_CLASS_ENTRY(ce, "SNMP", class_SNMP_methods);
250250
class_entry = zend_register_internal_class_ex(&ce, NULL);
251251

252+
zval property_info_default_value;
253+
ZVAL_UNDEF(&property_info_default_value);
254+
zend_string *property_info_name = zend_string_init("info", sizeof("info") - 1, 1);
255+
zend_declare_typed_property(class_entry, property_info_name, &property_info_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ARRAY));
256+
zend_string_release(property_info_name);
257+
258+
zval property_max_oids_default_value;
259+
ZVAL_NULL(&property_max_oids_default_value);
260+
zend_string *property_max_oids_name = zend_string_init("max_oids", sizeof("max_oids") - 1, 1);
261+
zend_declare_property_ex(class_entry, property_max_oids_name, &property_max_oids_default_value, ZEND_ACC_PUBLIC, NULL);
262+
zend_string_release(property_max_oids_name);
263+
264+
zval property_valueretrieval_default_value;
265+
ZVAL_NULL(&property_valueretrieval_default_value);
266+
zend_string *property_valueretrieval_name = zend_string_init("valueretrieval", sizeof("valueretrieval") - 1, 1);
267+
zend_declare_property_ex(class_entry, property_valueretrieval_name, &property_valueretrieval_default_value, ZEND_ACC_PUBLIC, NULL);
268+
zend_string_release(property_valueretrieval_name);
269+
270+
zval property_quick_print_default_value;
271+
ZVAL_NULL(&property_quick_print_default_value);
272+
zend_string *property_quick_print_name = zend_string_init("quick_print", sizeof("quick_print") - 1, 1);
273+
zend_declare_property_ex(class_entry, property_quick_print_name, &property_quick_print_default_value, ZEND_ACC_PUBLIC, NULL);
274+
zend_string_release(property_quick_print_name);
275+
276+
zval property_enum_print_default_value;
277+
ZVAL_NULL(&property_enum_print_default_value);
278+
zend_string *property_enum_print_name = zend_string_init("enum_print", sizeof("enum_print") - 1, 1);
279+
zend_declare_property_ex(class_entry, property_enum_print_name, &property_enum_print_default_value, ZEND_ACC_PUBLIC, NULL);
280+
zend_string_release(property_enum_print_name);
281+
282+
zval property_oid_output_format_default_value;
283+
ZVAL_NULL(&property_oid_output_format_default_value);
284+
zend_string *property_oid_output_format_name = zend_string_init("oid_output_format", sizeof("oid_output_format") - 1, 1);
285+
zend_declare_property_ex(class_entry, property_oid_output_format_name, &property_oid_output_format_default_value, ZEND_ACC_PUBLIC, NULL);
286+
zend_string_release(property_oid_output_format_name);
287+
288+
zval property_oid_increasing_check_default_value;
289+
ZVAL_BOOL(&property_oid_increasing_check_default_value, 1);
290+
zend_string *property_oid_increasing_check_name = zend_string_init("oid_increasing_check", sizeof("oid_increasing_check") - 1, 1);
291+
zend_declare_property_ex(class_entry, property_oid_increasing_check_name, &property_oid_increasing_check_default_value, ZEND_ACC_PUBLIC, NULL);
292+
zend_string_release(property_oid_increasing_check_name);
293+
294+
zval property_exceptions_enabled_default_value;
295+
ZVAL_LONG(&property_exceptions_enabled_default_value, 0);
296+
zend_string *property_exceptions_enabled_name = zend_string_init("exceptions_enabled", sizeof("exceptions_enabled") - 1, 1);
297+
zend_declare_property_ex(class_entry, property_exceptions_enabled_name, &property_exceptions_enabled_default_value, ZEND_ACC_PUBLIC, NULL);
298+
zend_string_release(property_exceptions_enabled_name);
299+
252300
return class_entry;
253301
}
254302

0 commit comments

Comments
 (0)