Commit Graph

229 Commits

Author SHA1 Message Date
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Máté Kocsis
811f6dd8e5
Review parameter names in ext/enchant
Closes GH-6258
2020-10-02 11:55:46 +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
1fb66b8114
Promote warning to exception in ext/enchant
Closes GH-6022
2020-08-24 17:37:20 +02:00
George Peter Banyard
9a71d47d73 Throw ValueError on empty tag in enchant_broker_request_dict() 2020-07-31 14:35:14 +01:00
Máté Kocsis
0d330e1a02
Add a few missing parameter types in stubs
Related to GH-5627
2020-07-30 14:26:45 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Nikita Popov
9b41f22fb2 Remove leftover debug comment 2020-07-02 11:51:51 +02:00
Nikita Popov
4500309f10 Skip enchant test under asan
There is a known memory leak here:
https://bugs.launchpad.net/ubuntu/+source/enchant/+bug/305468
2020-07-02 11:37:09 +02:00
Fabien Villepinte
0c6d06ecfa Replace EXPECTF when possible
Closes GH-5779
2020-06-29 21:31:44 +02:00
Nikita Popov
653e4ea1c5 Add flag to forbid dynamic property creation on internal classes
While performing resource -> object migrations, we're adding
defensive classes that are final, non-serializable and non-clonable
(unless they are, of course). This path adds a ZEND_ACC_NO_DYNAMIC_PROPERTIES
flag, that also forbids the creation of dynamic properties on these objects.
This is a subset of #3931 and targeted at internal usage only
(though may be extended to userland at some point in the future).

It's already possible to achieve this (what the removed
WeakRef/WeakMap code does), but there's some caveats: First, this
simple approach is only possible if the class has no declared
properties, otherwise it's necessary to special-case those
properties. Second, it's easy to make it overly strict, e.g. by
forbidding isset($obj->prop) as well. And finally, it requires a
lot of boilerplate code for each class.

Closes GH-5572.
2020-06-24 11:52:36 +02:00
Nikita Popov
c9b9f525a9 Include stub hash in generated arginfo files
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.
2020-06-24 09:55:19 +02:00
Máté Kocsis
ba434fb5a6
Remove outdated PHPDoc from ext/enchant's stub 2020-06-23 22:35:27 +02:00
Nikita Popov
607567b9cd Call zpp in enchant_broker_*_dict_path with libenchant-2
Even if the function is a dummy, we still need to call zpp to
comply with arginfo.
2020-06-18 17:10:22 +02:00
Máté Kocsis
cd3e04dff3
Convert enchant resources to opaque objects
Additionally, deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants.
Closes GH-5577

Co-authored-by: Remi Collet <remi@php.net>
2020-05-29 14:51:41 +02:00
Nikita Popov
a01b6e5787 Return empty array instead of null from enchant APIs
Closes GH-5566.
2020-05-27 10:12:21 +02:00
Remi Collet
5318971bc5 Revert "convert enchant resources to objects of new classes - EnchantBroker - EnchantDict add OO interface deprecate enchant_broker_free* (use unset instead) deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants"
This reverts commit 7db4c24a37.
2020-05-13 15:56:14 +02:00
Remi Collet
ea1bebbd41 Revert "add myself as enchant maintainer"
This reverts commit f987219c69.
2020-05-13 15:56:10 +02:00
Remi Collet
7db4c24a37 convert enchant resources to objects of new classes - EnchantBroker - EnchantDict add OO interface deprecate enchant_broker_free* (use unset instead) deprecate ENCHANT_MYSPELL and ENCHANT_ISPELL constants 2020-05-13 15:14:50 +02:00
Remi Collet
f987219c69 add myself as enchant maintainer 2020-05-06 13:18:35 +02:00
Christoph M. Becker
c1ad9163b8 Fix enchant stub 2020-05-06 13:16:50 +02:00
Remi Collet
5f5dd994d4 enchant: bump license version 2020-05-06 13:13:19 +02:00
Máté Kocsis
3ebce8e9fc
Fix UNKNOWN default values in various extensions
Closes GH-5514
2020-05-05 19:08:20 +02:00
Christoph M. Becker
54cf9a26c1 Use libenchant2 if available on Windows
This is basically the same as commit 3427545[1], but for Windows.

[1] <http://git.php.net/?p=php-src.git;a=commitdiff;h=342754575237da912874f781a24eefe76434ce5a>
2020-05-04 11:27:00 +02:00
Remi Collet
3427545752 Use libenchant-2 when available 2020-05-04 08:27:31 +02:00
Remi Collet
66d42e9884 remove deprecated call and deprecate function to be removed in libenchant v2
add LIBENCHANT_VERSION constant
2020-04-30 09:32:00 +02:00
Máté Kocsis
7c3078737f
Generate function entries from stubs for a couple of extensions
Closes GH-5347
2020-04-04 20:41:48 +02:00
Christoph M. Becker
3a74d7a725 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79311: enchant_dict_suggest() fails on big endian architecture
2020-02-28 15:46:17 +01:00
Christoph M. Becker
0bffee4a35 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79311: enchant_dict_suggest() fails on big endian architecture
2020-02-28 15:44:52 +01:00
Christoph M. Becker
6adb885966 Fix #79311: enchant_dict_suggest() fails on big endian architecture
For obvious reasons, we must not assign a `size_t` value to an `int`
variable using memcpy().  However, there is actually no need for the
intermediate `n_sugg_st` here, if we use the proper types in the first
place.

A regression test is not necessary, because dict_suggest.phpt already
exhibits the erroneous behavior on big endian architectures.
2020-02-28 15:43:44 +01:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis
99db00b1f2
Fix #78880 Another round 2020-01-19 18:28:43 +01:00
Máté Kocsis
aadd3aaed9
Use RETURN_THROWS() in various places 2020-01-03 21:10:24 +01:00
Máté Kocsis
d9ac1ca8de
Use ZEND_THROWS() during ZPP in the GD, gettext, GMP, and hash extensions 2019-12-31 00:21:38 +01:00
Máté Kocsis
382a038e05
Use ZEND_THROWS() during ZPP in enchant, exif, fileinfo, filter, and FTP extensions 2019-12-31 00:21:37 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs 2019-11-11 14:54:55 +01:00
Fabien Villepinte
08b7279036 Merge branch 'PHP-7.4' 2019-10-19 22:12:18 +02:00
Fabien Villepinte
4b3e041f5b Fix proto of enchant_broker_list_dicts() 2019-10-19 22:11:34 +02:00
Fabien Villepinte
6daa54d3be Fix grammar in skipif messages 2019-10-12 23:18:56 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
1f49b1df50 Don't explicitly set return value on ZPP failure
Failing ZPP throws as of PHP 8.0.0, so explicitly setting a return
value is useless, and also slightly confusing.
2019-08-16 17:52:42 +02:00
Victor Gazotti
75a3213d19 creating stubs for echant ext 2019-08-15 15:16:56 +02:00
Christoph M. Becker
218c18530a Show actual enchant version if possible
As of libenchant 1.6.0 there is enchant_get_version()[1], so we use it,
if available, to show the actual enchant version in the PHP info.  We
also drop the fake ENCHANT_VERSION_STRING altogether, but stick with
showing version 1.5.x if at least HAVE_ENCHANT_BROKER_SET_PARAM is
defined.

Future scope: we may consider requiring enchant 1.6.0 (or later), since
this has been released in April 2010, and likely is available
everywhere.

[1] <https://www.abisource.com/projects/enchant/>
2019-06-27 13:04:49 +02:00
Hugh McMaster
d39638a4ac ext/enchant: Pass $ENCHANT_LIBS to PHP_CHECK_LIBRARY to fix shared builds
Closes GH-4216.
2019-06-03 09:18:51 +02:00
Remi Collet
1f8b9b8de6 enchant: fix shared build 2019-05-21 16:14:52 +02:00
Hugh McMaster
0655191a9c Use PKG_CHECK_MODULES to detect the Enchant library 2019-05-17 19:31:30 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Dmitry Stogov
5aa1176238 Cleanup unused module globals 2019-03-12 13:44:05 +03:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00