Commit Graph

536 Commits

Author SHA1 Message Date
Máté Kocsis
148ac364e9 Customize the link of some constants in the manual
These changes are necessary because the links which are generated by default are already taken.
2023-01-19 09:05:32 +01:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Máté Kocsis
2fd5e82e19
Declare ext/snmp constants in stubs (#9113) 2022-07-26 14:48:16 +02:00
George Peter Banyard
9f06bb3bb6
Drop remaining usage of u_char in favour of standard C99 uint8_t (#8611)
Plus minor drive-by fixes
2022-05-23 21:57:31 +01:00
Christoph M. Becker
97ea6ad0e6
Test snmp on Windows CI
We use the snmpd which is now bundled with the net-snmp dependency, and
the MIBS which are also shipped with it.

We also fix the tests/snmpd.conf, and mark two failing tests as XFAIL.

Closes GH-8503.
2022-05-11 13:24:23 +02:00
George Peter Banyard
62ab9293ae Fix [-Wundef] warnings in SNMP extension 2022-04-01 15:45:44 +01:00
Nikita Popov
e32642c541 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default
2021-12-05 21:04:10 +01:00
Nikita Popov
26e424465c Fix bug #81598: Use C.UTF-8 as LC_CTYPE locale by default
Unfortunately, libedit is locale based and does not accept UTF-8
input when the C locale is used. This patch switches the default
locale to C.UTF-8 instead (if it is available). This makes libedit
work and I believe it shouldn't affect behavior of single-byte
locale-dependent functions that PHP otherwise uses.

Closes GH-7635.
2021-12-05 21:03:27 +01:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Kamil Tekiela
10f102d790
Fix 'can not' in error messages 2021-10-05 09:51:58 +01:00
Remi Collet
718e91343f
add SHA256 and SHA512 for security protocol 2021-08-11 13:02:18 +02:00
Nikita Popov
c289f5241d Fix snmp test for ipv6
Just check that the port is present, not the exact form of the
IP address.
2021-07-20 15:01:51 +02:00
Nikita Popov
a4db74364d Remove THREAD_LS
This sounds like it will give you a thread local storage, but in
truth ... it does absolutely nothing.
2021-07-19 16:15:31 +02:00
Nikita Popov
b5a14e6c04 Port skipif.inc files to EXTENSIONS 2021-06-11 16:27:50 +02:00
Máté Kocsis
dd83ced6bd
Declare tentative return types for ext/snmp
Closes GH-7064
2021-05-28 12:45:33 +02:00
Máté Kocsis
5e8bdafae4
Merge branch 'PHP-8.0'
* Fix the return types in ext/snmp (#7068)
2021-05-28 12:44:15 +02:00
Máté Kocsis
15ec7404f1
Fix the return types in ext/snmp (#7068) 2021-05-28 12:34:46 +02:00
Nikita Popov
92dfd97315 Use early return in snmp
This avoids the odd dangling elses.
2021-05-27 15:03:59 +02:00
Remi Collet
2237102b74
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix snmp build without DES
2021-05-27 14:59:51 +02:00
Remi Collet
f9fd3595ec
Fix snmp build without DES 2021-05-27 14:58:07 +02:00
Máté Kocsis
87e4970ebc
Declare SNMP properties
Additionally, convert them to typed properties.

Closes GH-6742
2021-05-14 17:03:05 +02:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
George Peter Banyard
dc402cb0fc
Fix SNMP
This one had objid_query->array_output = ( (st & SNMP_CMD_SET) ? false : true ); initially
which means that if it was equal to 0 it would be equal to true.
2021-04-09 18:53:31 +01:00
George Peter Banyard
633319586a
Refactor SNMP extension a bit
Use RETURN_* macros instead of RETVAL_* + return;
Use proper boolean types
Use zend_string instead of char* to prevent unnecessary strlen calculation

Closes GH-6846
2021-04-09 17:12:54 +01:00
Máté Kocsis
bf0f6aaf18
Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Máté Kocsis
a730dc0cf9
Generate class entries for snmp, soap, sockets, sodium, sqlite3, sysv*, tidy
Closes GH-6696
2021-02-15 11:45:26 +01:00
Nikita Popov
e591cc7575 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove unnecessary cast in snmp_set_oid_output_format
2021-02-02 16:44:12 +01:00
Nikita Popov
b20362c24b Remove unnecessary cast in snmp_set_oid_output_format
This cast isn't needed, and could result in the ValueError being
skipped due to truncation.
2021-02-02 16:43:43 +01:00
Christoph M. Becker
34041e6c57 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing stub for SNMPException
2021-01-24 17:58:51 +01:00
Christoph M. Becker
a86443f5a3 Add missing stub for SNMPException 2021-01-24 17:58:26 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Nikita Popov
422d1665a2 Make convert_to_*_ex simple aliases of convert_to_*
Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.
2021-01-14 12:11:11 +01:00
Christoph M. Becker
6fc2cab254 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #70461: disable md5 code when it is not supported in net-snmp
2020-11-02 11:41:37 +01:00
Christoph M. Becker
0123f75b5d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70461: disable md5 code when it is not supported in net-snmp
2020-11-02 11:39:42 +01:00
Christoph M. Becker
9690ded288 Fix #70461: disable md5 code when it is not supported in net-snmp
Patch contributed by Alexander Bergmann.

Closes GH-6389.
2020-11-02 11:36:26 +01:00
Nikita Popov
5836e3ed97 Update ext/snmp parameter names
Closes GH-6298.
2020-10-08 17:10:52 +02:00
Nikita Popov
5480e6b13d Accept bool in snmp_set_(quick|enum)_print()
The integer parameter here is actually a boolean.
snmp_set_quick_print() already documented it as such, and
snmp_get_quick_print() was already returning a boolean.
2020-10-08 11:11:51 +02:00
Máté Kocsis
e950ca13ea
Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Nikita Popov
c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00
Máté Kocsis
36fd95b524
Generate arginfos 2020-09-16 21:28:27 +02:00
Máté Kocsis
de912821e0
Display string default values in stubs more uniformly
Settling on using quoted string
2020-09-16 21:27:01 +02:00
George Peter Banyard
62c20c662a Promote warnings to Error in SNMP extension 2020-09-15 13:08:07 +02:00
Máté Kocsis
c98d47696f
Consolidate new union type ZPP macro names
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112
2020-09-11 11:00:18 +02:00
Nikita Popov
79efbb1579 Fix leak in snmp 2020-09-10 23:20:46 +02:00
Nikita Popov
41f4e912bb Mark snmp tests as conflicting 2020-09-09 11:24:06 +02:00
Nikita Popov
712c914fd5 Suppress uninitialized variable warning in snmp
These are false positive warnings.
2020-09-09 11:23:34 +02:00
Máté Kocsis
9975986b7e
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00