php / php/doc-en

SNMP improvements

Open
#5,852 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Extension: snmp
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Affected page

https://www.php.net/manual/en/book.snmp.php

Current issue

There are a few new functions, enums and options coming for SNMP in PHP 8.6. Some of these have already been included in the documentation, while others have not. I had a look at doing a PR, but it looks a bit daunting. I'm very happy to help describe what some of the options do if someone can help with the correct structure.

I'm also not sure if the documentation is waiting for the 8.6 release before being updated.

Suggested improvement

New enums:
Snmp\Mib - to control mib parsing
Snmp\OidOutput - to control the format of the OID in results
Snmp\Output - to control the format of values in results
Snmp\StringOutput - to control the output format of strings

New functions:
snmp_init_mib(?string $mibdirs) - Resets the loaded mib tree (unloads any MIBs loaded with snmp_read_mib). Also allows a colon separated list of mib directories to be provided to set the search path for auto-loading MIBs.
snmp_set_output_option(Snmp\Output $option, bool $enable) - Sets the SNMP library value for the given value formatting option on or off
snmp_set_string_output_format(Snmp\StringOutput $format) - Sets the SNMP library value for formatting strings to the selected value

Changed functions:
snmp_set_oid_output_format(Snmp\OidOutput|int $format) - Sets the OID output format in the SNMP library to the selected value, which can be the SNMP_OID_OUTPUT_* constant, or the Snmp\OidOutput enum

New properties for the SNMP class to control value output:
public bool $numeric_index;
public bool $numeric_timeticks;
public bool $extended_index;
public bool $dont_print_units;
public bool $escape_quotes;
public bool $print_hex_text;

New functions for the SNMP class to control OID and string output format:
public function setOidOutputFormat (Snmp\OidOutput $format): bool
public function setStringOutputFormat (Snmp\StringOutput $format): bool

Additional context (optional)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the affected SNMP page at https://www.php.net/manual/en/book.snmp.php and compare its existing functions, enums, options, and class properties with the items listed in the issue. Confirm which PHP 8.6 additions are missing and document the listed enums, functions, changed signature, properties, and methods. Done means the SNMP reference covers the applicable additions with the correct structure and release timing.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.