Commit graph

541 commits

Author SHA1 Message Date
Ilija Tovilo
efc73f24c3
Revert "Call cast_object handler from get_properties_for"
This reverts commit 4182813ebf.
2023-08-07 12:58:12 +02:00
Ilija Tovilo
4182813ebf
Call cast_object handler from get_properties_for
Fixes GH-11547
Closes GH-11583
2023-07-25 17:59:44 +02:00
Ilija Tovilo
1a0ef2c1cc
Revert "Remove name field from the zend_constant struct (#10954)"
This reverts commit f42992f580.

Closes GH-11604
2023-07-17 22:32:41 +02:00
Ilija Tovilo
ad1b70d67e
Revert "Revert "Remove name field from the zend_constant struct (#10954)""
This reverts commit 9f4bd3040d.
2023-07-04 16:42:40 +02:00
Máté Kocsis
9f4bd3040d
Revert "Remove name field from the zend_constant struct (#10954)"
This reverts commit f42992f580.

Fix GH-11423
2023-07-03 15:16:24 +02:00
Máté Kocsis
f42992f580
Remove name field from the zend_constant struct (#10954)
As global constant names are case-sensitive now, we don't have to store them separately above the constant table.
2023-04-03 22:13:47 +02:00
Niels Dossche
dcc3255b18
Fix GH-10489: run-tests.php does not escape path when building cmd (#10560)
Multiple tests had to be changed to escape the arguments in shell
commands. Some tests are skipped because they behave differently with
spaces in the path versus without. One notable example of this is the
hashbang test which does not work because spaces in hashbangs paths are
not supported in Linux.

Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
2023-02-25 14:02:06 +00:00
Max Kellermann
d5c649b36b
zend_compiler, ...: use uint8_t instead of zend_uchar (#10621)
`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers.  This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical.  This change is only about code readability.
2023-02-23 14:56:54 +00:00
Jorg Adam Sowa
77ee92a50c
Remove unnecessary usage of CONST_CS
Closes GH-9685.
2022-11-28 17:12:07 +01:00
Tim Düsterhus
03fd405423
Use php_info_print_table_header for actual column headers only (#9485)
Using php_info_print_table_header() for "Foo: bar" looks odd and out of place,
because the whole line is colored. It is also questionable from a HTML
semantics point of view, because it does not described the columns that follow.

The use of this across extensions is inconsistent. It was part of the skeleton,
but ext/date or ext/json already use a regular row.
2022-09-06 08:48:22 +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
e328c68305
Rename @cname to @cvalue in stubs (#9043)
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.
2022-07-19 15:11:42 +02:00
Christoph M. Becker
56804e3221
Fix GH-8750: Can not create VT_ERROR variant type
We add support for creating `VT_ERROR` variants via `__construct()`,
and allow casting to int via `variant_cast()` and `variant_set_type()`.
We do not, however, allow type conversion by other means, to avoid
otherwise easily introduced type confusion.  VB(A) also only allows
explicit type conversion.

We also introduce `DISP_E_PARAMNOTFOUND` which might be the most
important `scode` for this purpose, since this allows to skip optional
parameters in method calls.

Closes GH-8886.
2022-07-12 16:43:14 +02:00
Christoph M. Becker
84c160dd90
Increase test portability
The test as is can only work if com_dotnet is built dynamically, and
not already loaded via the php.ini file.  While this is given on
AppVeyor, it may not be given in other environments.

Closes GH-8879.
2022-06-27 17:12:42 +02:00
Ilija Tovilo
3b92a96610
Convert return type of various object handlers from int to zend_result (#8755) 2022-06-26 01:00:19 +02:00
Christoph M. Becker
790be97fc9
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8778: Integer arithmethic with large number variants fails
2022-06-18 11:51:52 +02:00
Christoph M. Becker
5869e8a0ca
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8778: Integer arithmethic with large number variants fails
2022-06-18 11:50:14 +02:00
Christoph M. Becker
651e0cc187
Fix GH-8778: Integer arithmethic with large number variants fails
When casting a `variant` to `int`, we need to heed the proper `zval`
type, which is an signed 64bit integer on x64, while `VT_INT` is only
a signed 32bit integer.

Closes GH-8779.
2022-06-18 11:48:49 +02:00
Pierrick Charron
1bcd8d394a
Update gen_stub to support #if around classes 2022-06-13 16:34:12 -04:00
Pierrick Charron
6fd2b39397
Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Máté Kocsis
7d6ce85aa9
Declare ext/com_dotnet constants in stubs (#8675) 2022-06-06 15:56:24 +02:00
Christoph M. Becker
057737c92f
Merge branch 'PHP-8.1'
* PHP-8.1:
  Prevent strict interpretation of tentative definition
2021-12-26 16:43:34 +01:00
Christoph M. Becker
0cd1741004
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Prevent strict interpretation of tentative definition
2021-12-26 16:42:33 +01:00
Christoph M. Becker
e76ddbd2f6
Prevent strict interpretation of tentative definition
This header declaration is never supposed to be interpreted as
definition; otherwise, the handlers are not properly initialized, what
happens, for instance, with ASan instrumented MSVC builds.

Closes GH-7827.
2021-12-26 16:41:25 +01:00
George Peter Banyard
f6616846e1
Revert "Refactor php_com_cache_typelib()"
As php_com_typelibraries is a persistent HashTable we need to insert
a persistent string, therefore initialising a new one.

This reverts commit 0497b2bf4b.
2021-11-03 20:44:12 +00:00
DmitryMaksimov
2b32cafd88
Use neutral language instead of default on Windows
Most notably, this affects some Windows specific error messages, which
are no longer in the default language of the system, to better match
error messages provided by PHP which are not localized anyway.

This also affects the com_dotnet extension, where it could fix some
DCOM related issues.  Furthermore, the constant `LOCALE_NEUTRAL` is
added, which can be used for `variant_cmp()`.

Closes GH-7613.
2021-11-03 19:39:20 +01:00
George Peter Banyard
0497b2bf4b
Refactor php_com_cache_typelib() 2021-11-03 17:58:18 +00:00
George Peter Banyard
da012ba324
Refactor php_com_locate_typeinfo()
Use zend_string pointers
Use bool
2021-09-29 13:17:20 +01:00
George Peter Banyard
816d4ac7a8
Voidify php_com_saproxy_create() 2021-09-29 13:17:20 +01:00
George Peter Banyard
68702b7e78
Voidify php_com_persist_minit() 2021-09-29 13:17:19 +01:00
George Peter Banyard
bc8703d861
Use standard bool/zend_result instead of int 2021-09-29 13:17:16 +01:00
George Peter Banyard
9409c8f11b
Refactor php_com_olestring_to_string()
Return a zend_string* instead of a char* with an out-param for the length
2021-09-29 13:16:26 +01:00
George Peter Banyard
3dc4863f2b
Refactor php_com_get_id_of_name()
Use zend_string*
2021-09-29 13:11:51 +01:00
George Peter Banyard
f3ca081379
Refactor php_com_do_invoke()
Use zend_string*
Return zend_result
2021-09-29 13:11:50 +01:00
Máté Kocsis
ad471fb22d
Merge branch 'PHP-8.1'
* PHP-8.1:
  Remove extra space before param default values
  Fix class synopsis generation for interfaces
2021-09-08 12:25:13 +02:00
Máté Kocsis
a5e5483439
Remove extra space before param default values 2021-09-08 12:24:47 +02:00
Nikita Popov
768265cd22 Fix some more CLEAN sections 2021-09-06 17:03:35 +02:00
DmitryMaksimov
bdf53cc91f
Dispatch using LANG_NEUTRAL instead of LOCALE_SYSTEM_DEFAULT
This is relevant wrt. case insensitive identifiers.

Closes GH-7391.
2021-08-23 14:07:23 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Christoph M. Becker
139a73b5a4
Improve performance of AppVeyor test runs
We only load a minimum set of extensions, and rely on dynamic loading
of others due to `--EXTENSION--` triggers.  We do not run the imap,
ldap and snmp test suites, because most of the tests would be skipped
after timeouts anyway.

Closes GH-7150.
2021-06-14 23:36:17 +02:00
Máté Kocsis
532c60cb92
Add support for tentative return types of internal methods
RFC: https://wiki.php.net/rfc/internal_method_return_types

Closses GH-6971
2021-05-14 15:55:25 +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
Max Semenik
56f90492d6 Migrate skip checks to --EXTENSIONS--, p1
For rationale, see https://github.com/php/php-src/pull/6787

Extensions migrated in this part:
* bcmath
* bz2
* calendar
* com_dotnet
* ctype

Closes GH-6797.
2021-03-22 17:51:02 +01:00
George Peter Banyard
a74e248c43 Use zend_string_equals() API instead of strcmp() in COM extension 2021-03-17 16:36:16 +00:00
Máté Kocsis
4c6533c257
Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend
Closes GH-6706
2021-02-22 15:24:03 +01:00
Christoph M. Becker
062a891be7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing stub for com_exception
2021-01-24 16:07:34 +01:00
Christoph M. Becker
bff7761653 Add missing stub for com_exception 2021-01-24 16:06:49 +01:00