svn: /phpdoc/en/trunk/reference/snmp/ functions/snmp-get-valueretrieval.xml functions/snmp-set-valueretrieval.xml snmp.xml
| From: | Boris Lytochkin | Date: | Sun, 17 Jul 2011 17:21:54 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/snmp/ functions/snmp-get-valueretrieval.xml functions/snmp-set-valueretrieval.xml snmp.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8506@lists.php.net to get a copy of this message | ||
lytboris Sun, 17 Jul 2011 17:21:54 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=313332
Log:
changed SNMP_VALUE_* behaviour: SNMP_VALUE_OBJECT can be combined with one of SNMP_VALUE_PLAIN or
SNMP_VALUE_LIBRARY.
Changed paths:
U phpdoc/en/trunk/reference/snmp/functions/snmp-get-valueretrieval.xml
U phpdoc/en/trunk/reference/snmp/functions/snmp-set-valueretrieval.xml
U phpdoc/en/trunk/reference/snmp/snmp.xml
Modified: phpdoc/en/trunk/reference/snmp/functions/snmp-get-valueretrieval.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/functions/snmp-get-valueretrieval.xml 2011-07-17 17:18:31 UTC
(rev 313331)
+++ phpdoc/en/trunk/reference/snmp/functions/snmp-get-valueretrieval.xml 2011-07-17 17:21:54 UTC
(rev 313332)
@@ -20,7 +20,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- On of the SNMP_VALUE_LIBRARY, SNMP_VALUE_PLAIN, SNMP_VALUE_OBJECT constants.
+ OR-ed combitantion of constants ( <constant>SNMP_VALUE_LIBRARY</constant> or
+ <constant>SNMP_VALUE_PLAIN</constant> ) with
+ possible SNMP_VALUE_OBJECT set.
</para>
</refsect1>
@@ -33,7 +35,7 @@
<![CDATA[
<?php
$ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
- if (snmp_get_valueretrieval() == SNMP_VALUE_OBJECT) {
+ if (snmp_get_valueretrieval() & SNMP_VALUE_OBJECT) {
echo $ret->value;
} else {
echo $ret;
Modified: phpdoc/en/trunk/reference/snmp/functions/snmp-set-valueretrieval.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/functions/snmp-set-valueretrieval.xml 2011-07-17 17:18:31 UTC
(rev 313331)
+++ phpdoc/en/trunk/reference/snmp/functions/snmp-set-valueretrieval.xml 2011-07-17 17:21:54 UTC
(rev 313332)
@@ -46,7 +46,9 @@
<entry>SNMP_VALUE_OBJECT</entry>
<entry>
The return values will be objects with the properties "value" and
"type", where the latter
- is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants.
+ is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The
+ way "value" is returned is based on which one of constants
+ <constant>SNMP_VALUE_LIBRARY</constant>,
<constant>SNMP_VALUE_PLAIN</constant> is set.
</entry>
</row>
</tbody>
@@ -85,6 +87,23 @@
// [value] => lo
// )
+ // PHP 5.4+ examples
+ snmp_set_valueretrieval(SNMP_VALUE_OBJECT | SNMP_VALUE_PLAIN);
+ $ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
+ // stdClass Object
+ // (
+ // [type] => 4 <-- SNMP_OCTET_STR, see constants
+ // [value] => lo
+ // )
+
+ snmp_set_valueretrieval(SNMP_VALUE_OBJECT | SNMP_VALUE_LIBRARY);
+ $ret = snmpget('localhost', 'public', 'IF-MIB::ifName.1');
+ // stdClass Object
+ // (
+ // [type] => 4 <-- SNMP_OCTET_STR, see constants
+ // [value] => STRING: lo
+ // )
+
?>
]]>
</programlisting>
@@ -92,6 +111,42 @@
</para>
</refsect1>
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.4.0</entry>
+ <entry>
+ <para>
+ Constants <constant>SNMP_VALUE_PLAIN</constant> or
<constant>SNMP_VALUE_LIBRARY</constant>
+ may be combined with <constant>SNMP_VALUE_OBJECT</constant>
+ resulting different way of representing contents of
<parameter>value</parameter>
+ array element in return value of GET-function. If no
+ <constant>SNMP_VALUE_{PLAIN,LIBRARY}</constant> constant is
+ accompanying <constant>SNMP_VALUE_OBJECT</constant>,
+ <constant>SNMP_VALUE_LIBRARY</constant> is used.
+ </para>
+ <para>
+ Prior to 5.4.0 <constant>SNMP_VALUE_OBJECT</constant> effecively meant
+
<constant>SNMP_VALUE_OBJECT</constant>|<constant>SNMP_VALUE_PLAIN</constant>.
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
Modified: phpdoc/en/trunk/reference/snmp/snmp.xml
===================================================================
--- phpdoc/en/trunk/reference/snmp/snmp.xml 2011-07-17 17:18:31 UTC (rev 313331)
+++ phpdoc/en/trunk/reference/snmp/snmp.xml 2011-07-17 17:21:54 UTC (rev 313332)
@@ -169,7 +169,9 @@
<row>
<entry><constant>SNMP_VALUE_OBJECT</constant></entry><entry>
The return values will be objects with the properties "value" and
"type", where the latter
- is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants.
+ is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The
+ way "value" is returned is based on which one of
<constant>SNMP_VALUE_LIBRARY</constant>,
+ <constant>SNMP_VALUE_PLAIN</constant> is set
</entry>
</row>
</tbody>