Commit Graph

157 Commits

Author SHA1 Message Date
Nikita Popov
9bbbc9e7e9 Add support for union types in stubs
This is the MVP for supporting union types in PHP stubs. Return
types with only builtin types work, which is the part we mainly
need.

Closes GH-4895.
2019-11-08 17:32:18 +01:00
Nikita Popov
5ca46572e6 Allow generating stubs for directory 2019-11-01 16:54:20 +01:00
Nikita Popov
82f74ce3f2 Improve bless tests script to minimize diffs
Compute the diff between the old EXPECTF and the new output and
don't touch lines that still match the old EXPECTF. This reduces
the amount of manual fixup necessary after running bless_tests.php.
2019-10-01 15:00:22 +02:00
Nikita Popov
34e7c2daf0 Merge branch 'PHP-7.4' 2019-09-27 10:49:25 +02:00
Nikita Popov
a6c9c7c2b8 Handle resources used as array keys consistently
Resources used as array keys are generally handled by throwing a
notice and converting the resource to the resource handle. The only
exception is the [$resource => null] syntax, where this was treated
as an illegal offset type instead. However, this also only happened
for VM evaluations, the AST evaluator did handle resources correctly.
2019-09-27 10:40:41 +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
Nikita Popov
a98307df87 Make arginfo printing of prefer-ref arguments nicer 2019-08-26 15:39:39 +02:00
Nikita Popov
0c2d4d698c Make sure that params with null default are marked nullable 2019-08-26 14:34:28 +02:00
Theodore Brown
d5f42d68c8 Convert remaining array function arginfo to PHP stubs 2019-08-26 12:53:00 +02:00
Tyson Andre
0c09089caf Fix escapes for namespaced classes in gen_stub.php
Fix the string generated when the `ns\class` is passed to a macro

    #define ESCAPE(x) #x
    // puts(ESCAPE(ns\class));  // warning: unknown escape sequence: \c
    puts(ESCAPE(ns\\class));  // Properly prints ns\class to stdout.
2019-08-23 12:29:55 +02:00
Nikita Popov
37a8408e83 Support typed variadic args in gen_stubs 2019-08-15 22:07:49 +02:00
Craig Duncan
288442716e Add a prefix to differeniate between class methods and functions
Closes GH-4528
2019-08-12 20:57:18 +01:00
Nikita Popov
7c49951769 Support regenerating all stubs 2019-08-12 10:27:22 +02:00
Stephen Reay
44de46ab69 Add support for callable to the stub generator [ci skip] 2019-08-11 18:37:35 +02:00
Nikita Popov
ae721c488d Handle preprocessor conditions inside classes
Also remove the dead parseClass() function.
2019-08-10 16:29:45 +02:00
Stephen Reay
9c02c58481 Fallback to curl in gen_stub if wget fails
Closes GH-4502.
2019-08-10 16:21:03 +02:00
Nikita Popov
17987da884 Expand preprocessor support in gen_stubs
Support #ifdef, #ifndef, #else and nested #if's.
2019-08-10 15:07:54 +02:00
Nikita Popov
3b2f2ce474 Make uninitialized DateTime an Error
This avoids many spurious false return values.
2019-08-09 14:51:25 +02:00
Nikita Popov
33886f710c Generate arginfo from PHP stub files
Signature stubs for internal functions are specified in xyz.stub.php,
from which we generate actual arginfo structures in xyz_arginfo.h.
This file then needs to be included in the implementation appropriately.

Arginfo from stubs can be regenerated using scripts/dev/gen_stub.php.
However, this should also automatically happen when the stub file is
modified.
2019-08-09 14:51:25 +02:00
Nikita Popov
1cbcf0f4f1 Throw notice for plain wrapper fread/fwrite errors
Similar to what is done for socket read/write errors.
2019-07-25 10:42:10 +02:00
Nikita Popov
0146bab449 Merge branch 'PHP-7.4' 2019-07-12 12:55:21 +02:00
Nikita Popov
9a274de4f4 Improve bless_tests
If a string var_dump contains a wildcard, also make the length a
wildcard.
2019-07-12 12:54:01 +02:00
Peter Kokot
7239925213 Merge branch 'PHP-7.4'
* PHP-7.4:
  Set Computer English language for credits sorting
2019-06-26 22:38:35 +02:00
Peter Kokot
537844cb1d Set Computer English language for credits sorting
This makes the script a bit more portable when used on systems with
different LC_ALL and LANG settings.
2019-06-26 22:35:55 +02:00
Nikita Popov
1df8175b61 Convert fetch_resource warnings into TypeErrors
More type checks that are not part of zpp and should generate a
TypeError in PHP 8.
2019-06-03 09:17:12 +02:00
Peter Kokot
29bff939c7 Enhance makedist script
This enhances the makidst script:
- integrate both snapshot and makedist scripts together
- add help and options
- generated files are created in the php-src repository directly
- other minor enhancemenets such as CS fixes
- functionality moved from the Makefile to only shell script
- Add missed patching of the Zend Parsers to the main build step
- Add all *.tmp files to gitignore
2019-05-18 02:05:59 +02:00
Peter Kokot
4eb67310a0 Remove vcsclean script
The vcsclean script is really only a wrapper for a git clean command.
Developers should use the more proper and clear native Git command
directly instead:
`git clean -Xfd`
2019-05-08 21:51:01 +02:00
Peter Kokot
e58fddf7a3 Remove phpextdist
This script hasn't been used since using PEAR as a package manager for
PHP extensions since it is using Makefile.in as an indicator if the
current directory is extension. Instead of this script extensions can
be packaged differently and more properly with either current PEAR
or with some other manual method.
2019-05-06 00:15:20 +02:00
Peter Kokot
c79eb107a0 Simplify checking of *nix build tools
The buildmk.stamp file has been created by the *nix build checking step
to run the check step only once. Instead of poluting the project root
directory, the stamp file can be also omitted. Performance difference is
very minimal to not justify having the stamp check at all today anymore.

This patch integrates the buildcheck.sh to buildconf script directly.
2019-04-29 01:30:27 +02:00
Peter Kokot
3207741df0 Refactor PHP_PROG_BISON and PHP_PROG_RE2C
This patch refactors these macros to also checks for the required given
versions of bison and re2c.

- PHP_PROG_RE2C and PHP_PROG_BISON take optional args - minmimum version
  required, and bison also excluded versions.
- Instead of caching values this uses manual checking and messaging
  outputs.
- It looks like the minimum version of RE2C 0.13.4 is working ok so far.

The genfiles script improvements:
- Add make override in genfiles
- Move checkings from makedist to genfiles
- Refactored output messages
- Various minor enhancements
2019-03-30 02:01:02 +01:00
Peter Kokot
864366ef20 Upgrade deprecated directives and use non-posix bison
With Bison 3.0 some directives are deprecated:
- %name-prefix "x" should be %define api.prefix {x}
- %error-verbose should be %define parse.error verbose

Bison 3.3 also started emiting more warnings and since PHP souce parsers
are not POSIX compliant this patch fixes this as pointed out via
495a46aa1d.
2019-03-19 20:29:20 +01:00
Peter Kokot
abfab2148d Leave bundled generated files untouched
When building lexer and parser files leave bundled files untouched as
are tracked in the Git. *.orig files also don't need to be cleaned
anymore.
2019-03-18 23:02:57 +01:00
Peter Kokot
e525ce30a5 Move distribution generator script to scripts/dev
The more proper place for shell scripts dedicated for development, and
releasing PHP should be the scripts/dev directory. Having a cleaner root
project directory helps find the main README.md and files relevant to
install PHP.

These scripts are also used by the release managers mostly who create
release packages and aren't used often by the majority of developers
working on and installing PHP.
2019-03-16 23:51:05 +01:00
Peter Kokot
78596973b3 Make credits script executable from other paths 2019-03-16 01:37:34 +01:00
Nikita Popov
e53e753c0e Support passing single file to bless_tests.php
Or a mix of multiple directories/files. Also make the file executable.
2019-02-20 12:45:27 +01:00
Nikita Popov
cc0e01a2fa Handle exception patterns in bless_tests.php 2019-02-18 11:03:38 +01:00
Peter Kokot
e0c88039b6 Move some scripts from root directory to scripts/dev/
At the time of this commit, there is a dedicated folder for development
related tools and such scripts might fit better there to not bloat the
project root directory too much.

Move snapshot to scripts/dev/snapshot
2019-02-16 16:58:48 +01:00
Nikita Popov
7a17be7f31 Add bless_tests.php
Helper script to perform certain kinds of trivial test updates.
2019-02-11 15:35:34 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
8eeb1102d0 Avoid mention of php7 in credits script 2019-01-28 11:26:45 +01:00
Peter Kokot
066b5b7881 Remove some obsolete config_vars.mk occurrences
The `config_vars.mk` file was a part of previous *nix build system and
has been removed via 9d9d39a0de.
2018-10-16 18:05:06 +02:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Peter Kokot
02294f0c84 Make PHP development tools files and scripts executable
This patch makes several scripts and PHP development tools files
executable and adds more proper shebangs to the PHP scripts.

The `#!/usr/bin/env php` shebang provides running the script via
`./script.php` and uses env to find PHP script location on the system.
At the same time it still provides running the script with a user
defined PHP location using `php script.php`.
2018-08-29 20:58:17 +02:00
Christoph M. Becker
23aa355bf2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Remove some old parts of the php
2018-08-25 11:58:50 +02:00
Peter Kokot
fcf4088d3f Remove some old parts of the php
Since ba138a3746 the generate-phpt library
has been unbundled from the php-src. This patch cleans two remaining
parts.
2018-08-25 11:58:17 +02:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Kalle Sommer Nielsen
ba138a3746 Removed the generated-tests library, this is a left Zöe's phpruntests repository it seems and never fully implemented. The only times this part of the code has been touched throughout the years has been minor PRs and entire php-src grep commits.
If anything this belongs to the phpruntests.git repository.
2018-07-23 17:38:26 +02:00
Christoph M. Becker
3f16a43d74 [ci skip] Remove trailing WS
Since commit 2238403 removed respective trailing WS in files generated
by this script, we remove the trailing WS in the first place, to avoid
further mundane merge conflicts.

[1] http://git.php.net/?p=php-src.git;a=commit;h=2238403892ccf87143a59814538d9f764509d9e7
2018-06-05 00:21:36 +02:00
Gabriel Caruso
2d48d734a2 Fix some misspellings 2018-02-06 16:59:00 +01:00
Gabriel Caruso
c0ef58e9fe Simplify returns in generate-phpt 2018-01-26 22:19:08 +01:00
Xinchen Hui
0e62639d28 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Happy new year (Update copyright to 2018)
2018-01-03 16:00:34 +08:00
Lior Kaplan
fbfdd1e1c4 Happy new year (Update copyright to 2018) 2018-01-02 23:42:29 +02:00
Danilo Correa
8c36588ee8 Set default value for some properties in generate-phpt 2017-12-13 21:28:29 +01:00
Joe Watkins
ef7e5e0d69
fix stub to accept user properly 2017-01-09 15:57:46 +00:00
Nikita Popov
1a39b6e3c0 More check_parameters improvements
* Switch default REPORT_LEVEL to 1 to cut down on the noise
* Make initialization of 'C' variable always required
* Don't require init of lLdb variable if ! is used
* Don't throw error about missing init of not detected parameters
  (This was a regression in the last changeset)
* Support method_parameters and throw variations
2015-10-02 09:05:39 +02:00
Nikita Popov
5c1b627458 More check_parameters improvements
* Allow / on everything but lLdb (on which it will work, but makes
  no sense).
* For ! on lLdb add additional zend_bool* parameter.
* For optional s and p only require one of the variables to be
  initialized. The length is usually not initialized.
2015-10-01 20:42:57 +02:00
Sean DuBois
06dde16a6a Update scripts/dev/check_parameters.php for PHP 7
Also fix deprecation errors and move from preg_replace
-> preg_replace_callback.
2015-10-01 20:08:05 +02:00
Anatol Belski
ef063dcb05 one new line too much 2015-08-20 13:32:30 +02:00
Anatol Belski
3708d9c1b4 use the bare tarball filename for the stub, no path elements 2015-08-19 10:51:15 +02:00
Christoph M. Becker
f9744a36a2 Merge branch 'pull-request/1454'
* pull-request/1454:
  Docs for find_tested.php
2015-08-13 20:33:59 +02:00
Nikhil Vimal
1e4742d5cd Docs for find_tested.php
Initial Pass, also fixing the extra space before the extract_tests function name to keep with standards.
2015-08-04 16:46:47 -05:00
Anatol Belski
df71933bd2 make use of PHPROOT for possible mkdist integration 2015-08-10 09:57:05 +02:00
Anatol Belski
c0b3665f37 make scripts/dev/gen_verify_stub executable 2015-08-10 09:50:54 +02:00
Anatol Belski
7600f5246c initial add verification stub generator 2015-08-10 09:48:28 +02:00
Dmitry Stogov
ed418312a5 Revert "Fix arginfo for built-in engine functions"
This reverts commit d2356541d0.
2015-06-22 11:44:57 +03:00
Dmitry Stogov
9a68fe51d7 Revert "Fix genarginfo to respect by-ref passing"
This reverts commit db6990a91b.
2015-06-22 11:44:13 +03:00
Bob Weinand
db6990a91b Fix genarginfo to respect by-ref passing 2015-06-22 10:17:35 +02:00
Rasmus Lerdorf
d2356541d0 Fix arginfo for built-in engine functions 2015-06-21 21:50:09 -04:00
Veres Lajos
4b9535341a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-19 20:23:00 +00:00
Florian MARGAINE
8eb7e7bf7f Merge branch 'master' into issue-67910
Conflicts:
	README.PARAMETER_PARSING_API
	ext/gmp/tests/001.phpt
2014-09-20 10:09:21 +02:00
Florian MARGAINE
cf0303e782 Replaces php5 with php7, without whitespace changes. 2014-09-20 10:01:44 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Lior Kaplan
56d02d564e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  typofixes
2014-08-17 15:51:15 +03:00
Veres Lajos
3f42f2f5d1 typofixes 2014-08-17 15:44:02 +03:00
Stanislav Malyshev
68e8326e0e Merge branch 'PHP-5.5'
* PHP-5.5:
  non living code related typo fixes
2013-08-04 16:07:13 -07:00
Veres Lajos
8d86597d73 non living code related typo fixes 2013-08-04 16:05:36 -07:00
Johannes Schlüter
2a13fb106d Remove PHP3 conversion scripts 2013-07-17 23:32:23 +02:00
Veres Lajos
e9a95d78ef typo fixes 2013-07-15 00:23:03 -07:00
Veres Lajos
1b06e0be96 typo fixes 2013-07-15 00:19:49 -07:00
Veres Lajos
04145dc2aa typo fixes (argument) 2013-06-10 13:36:17 -07:00
Pierrick Charron
1368364469 Fix common typos in the source code (Reported in Bug #54065)
# External libraries were excluded
# Thanks eitan at eitanadler dot com for the first patch :)
2011-04-03 21:46:52 +00:00
Johannes Schlüter
2d63af8c60 Make the credits script more verbose 2010-05-27 22:50:31 +00:00
Zoe Slattery
f2cc5467da fixing missing semi-colon 2009-05-07 13:26:00 +00:00
Zoe Slattery
cba448a9d3 Replacing generate script with a new version 2009-05-07 09:21:43 +00:00
Steve Seear
d88eb15159 Added a script that generates phpt test coverage information for functions and methods. 2008-05-09 13:21:49 +00:00
Zoe Slattery
0a3a57bc05 Changes to the code that generates variations (Robin & Josie) 2008-04-15 19:50:13 +00:00
Zoe Slattery
fbd21a5d01 Fixing:
(1) remove proto from start
(2)substitute "Done" with ===DONE== after closing tag in FILE section and at end of EXPECTF.
(3) Remove "add comment here..."
2008-04-13 10:46:12 +00:00
Zoe Slattery
0f13364729 Fixing typo arg->arglist at line 195. Thanks Chris J! 2008-02-14 10:15:44 +00:00
Zoe Slattery
d7fd465bae Fixing bug 44042 2008-02-06 10:56:22 +00:00
Zoe Slattery
70c629cdae Moving the the phpt generation script to scripts/dev directory at Jani's suggestion. 2008-02-03 09:34:59 +00:00
Ilia Alshanetsky
2df7386475 Update copyright year
# The rest of the files were already updated by Sebastian
2007-01-01 19:32:10 +00:00
Antony Dovgal
299af46146 more improvements 2006-09-10 11:44:51 +00:00
Antony Dovgal
42d4e3533e MFH: improve the script 2006-09-10 11:26:53 +00:00
Nuno Lopes
b860e9a3c2 add the script to run diagnostic tests on zend_parse_parameters*() usage, per Andrei's request 2006-09-08 16:35:17 +00:00
foobar
9b01900321 MFH 2006-01-01 19:00:53 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
foobar
2c9bf19823 Moved phpextdist to dev/ 2005-04-30 02:40:19 +00:00