History log of /php-src/sapi/cli/php_cli.c (Results 1 – 25 of 435)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 706bcdbc 18-Sep-2024 Ilija Tovilo

Fix printing backtrace of fake generator frame

Fixes GH-15851
Closes GH-15952


# e016e352 29-Aug-2024 Peter Kokot

Remove redundant HAVE_LIBREADLINE check (#15623)

The HAVE_LIBREADLINE is at this point only defined by Autotools and this
check is for Windows only where only HAVE_LIBEDIT is defined.


# afc57381 13-Aug-2024 Calvin Buckley

Show build provider and unify version information printing (#14657)

* Show build provider information in "php -v"

Vendors such as distributions can set the `PHP_BUILD_PROVIDER`

Show build provider and unify version information printing (#14657)

* Show build provider information in "php -v"

Vendors such as distributions can set the `PHP_BUILD_PROVIDER`
variable, that gets printed in phpinfo. However, I find that users check
`php -v` more often than phpinfo to see what PHP they're running. The
problem with this is that it does not show that build provider
information.

This change makes the build provider information printed on an
additional line of the version information.

* Put on same line so it works with or without env var

Unbreaks build without PHP_BUILD_PROVIDER set.

* change wording in provider version text

better grammatically; many different possibilities here though

* Unify SAPI version printing

This makes it so that all of the SAPIs share the same code for printing
version information. This is useful in case of any future changes to the
version information, such as i.e. adding build provider to the output.

* Make include for php_print_version explicit

* Preserve phpdbg version and output channel

php_printf doesn't have same semantics, as phpdbg_out could be on a
different output than stdout/err. Also add the phpdbg version (in case
it differs from PHP's, to keep similar output before this PR)

* remove size variables

we don't use them and CI doesn't like unused variables

* Fix format string insecurity

show more ...


# 15470bd1 22-Jul-2024 lwlinux <1053317536@qq.com>

sapi/cli/php_cli.c: fix typos (#15057)


# 61a0e3bd 11-Jun-2024 Peter Kokot

Sync HAVE_OPENSSL* symbols (#14333)

This syncs few inconsistencies between the Windows and Autotools build
systems:
- HAVE_OPENSSL_EXT is now defined in the same style on both system

Sync HAVE_OPENSSL* symbols (#14333)

This syncs few inconsistencies between the Windows and Autotools build
systems:
- HAVE_OPENSSL_EXT is now defined in the same style on both systems
(undefined - extension is not available, defined to 1 - extension is
available)
- HAVE_OPENSSL removed as it was only defined on Windows

show more ...


# 10a6f0bd 10-Jun-2024 Tim Düsterhus

cli: Clean up formatting in `do_cli()` (#14531)

* cli: Add spaces around operators in do_cli()

* cli: Unify `switch()` body indentation in `do_cli()`


# bca0c084 10-Jun-2024 Tim Düsterhus

Make the CLI mode available via the SAPI globals (#14479)

* Remove tautologically false condition in php_cli.c

* Make the CLI mode available via the SAPI globals

When hooki

Make the CLI mode available via the SAPI globals (#14479)

* Remove tautologically false condition in php_cli.c

* Make the CLI mode available via the SAPI globals

When hooking into RINIT it is currently pretty much impossible to determine
whether a file will actually be executed or if it just will be linted,
highlighted, or comments stripped: The startup is identical for all of them and
the chosen mode is not currently exposed to other extensions.

The `SG(server_context)` is currently entirely unused for the `cli` SAPI. It
appears to be appropriate to store the mode as a SAPI-specific information
inside of it.

show more ...


# c3388c18 10-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (#14512)

These are either undefined or defined to 1:
- HAVE_LIBEDIT
- HAVE_LIBREADLINE
- ZEND_MAX_EXECUTION_TIMERS

Follow up of GH-5526 (-Wundef)


# 84a0da15 09-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (#14508)

This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRE

Sync #if/ifdef/defined (#14508)

This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRENT_H
- HAVE_DLFCN_H
- HAVE_GETTIMEOFDAY
- HAVE_LIBDL
- HAVE_POLL_H
- HAVE_PWD_H
- HAVE_SCANDIR
- HAVE_SYS_FILE_H
- HAVE_SYS_PARAM_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_TIME_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_WAIT_H
- HAVE_UNISTD_H
- PHP_WIN32
- ZEND_WIN32

These are either undefined or defined to 1 in Autotools and Windows.

Follow up of GH-5526 (-Wundef).

show more ...


# 8e62e2b8 22-May-2024 Cristian Rodríguez

Mark multple functions as static (#13864)

* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

st

Mark multple functions as static (#13864)

* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

struct sigaction act, old_term, old_quit, old_int;
all unused.

* optimizer: minXOR and maxXOR are unused

show more ...


# a95d001a 13-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Change calls to setmode to _setmode (#14220)

setmode is the deprecated alias of _setmode [1].

[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/posix-setmode?vie

Change calls to setmode to _setmode (#14220)

setmode is the deprecated alias of _setmode [1].

[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/posix-setmode?view=msvc-170

show more ...


# 1a0ef2c1 06-Jul-2023 Ilija Tovilo

Revert "Remove name field from the zend_constant struct (#10954)"

This reverts commit f42992f580343931434dff2e4b2042ff945b48a1.

Closes GH-11604


# f16b34f1 26-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement GH-10024: support linting multiple files at once using php -l

This is supported in both the CLI and CGI modes. For CLI this required
little changes.

For CGI, the trick

Implement GH-10024: support linting multiple files at once using php -l

This is supported in both the CLI and CGI modes. For CLI this required
little changes.

For CGI, the tricky part was that the options parsing happens inside the
loop. This means that options passed after the -l flag were previously
simply ignored. As we now re-enter the loop we would parse the options
again, and if they are handled but don't set the script name, then CGI
will think you want to read from standard in. To keep the same "don't
parse options" behaviour I simply wrapped the options handling inside an
if.

Closes GH-10024.
Closes GH-10710.

show more ...


# ad1b70d6 04-Jul-2023 Ilija Tovilo

Revert "Revert "Remove name field from the zend_constant struct (#10954)""

This reverts commit 9f4bd3040d2809f209d73f696b21302f311665b7.


# 9f4bd304 03-Jul-2023 Máté Kocsis

Revert "Remove name field from the zend_constant struct (#10954)"

This reverts commit f42992f580343931434dff2e4b2042ff945b48a1.

Fix GH-11423


# 1111a951 22-Jun-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix interrupted CLI output causing the process to exit

When writing the output in the CLI is interrupted by a signal, the
writing will fail in sapi_cli_single_write(), causing an exit la

Fix interrupted CLI output causing the process to exit

When writing the output in the CLI is interrupted by a signal, the
writing will fail in sapi_cli_single_write(), causing an exit later in
sapi_cli_ub_write(). This was the other part of the issue in GH-11498.
The solution is to restart the write if an EINTR has been observed.

Closes GH-11510.

show more ...


# d5ad7510 08-Jun-2023 George Peter Banyard

More usage of known zend_str instead of C string (#11381)


# ac5920f9 29-Apr-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-11141: Could not open input file: should be sent to stderr

I grepped for php_printf cases in main/ and sapi/ and converted the
cases which clearly indicate errors to fprintf(stder

Fix GH-11141: Could not open input file: should be sent to stderr

I grepped for php_printf cases in main/ and sapi/ and converted the
cases which clearly indicate errors to fprintf(stderr, ...), like
suggested in the linked issue.

Closes GH-11163.

show more ...


# f6c0c60e 30-Apr-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix GH-11104: STDIN/STDOUT/STDERR is not available for CLI without a script

I found no reason why this is done this way.
Of course this will allow users to do stupid stuff like
`fclo

Fix GH-11104: STDIN/STDOUT/STDERR is not available for CLI without a script

I found no reason why this is done this way.
Of course this will allow users to do stupid stuff like
`fclose(STDOUT);` etc. but if they type in that code they clearly know
what they're doing...

Close GH-11169.

show more ...


# f42992f5 03-Apr-2023 Máté Kocsis

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.


# f247e48d 28-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Remove always-false check in CLI (#10723)

This is the case c == 'i', so c == '?' is always false, hence the result
is always 0.


# c8955c07 16-Jan-2023 Christoph M. Becker

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07

Revert GH-10220

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491d66081298a16634629f149459706a9.
This reverts commit 588a07f7371ee2b5fac17de147926780e427fae6.
This reverts commit f377e15751d3aa48b69cd9bcc366ede7803d511f.
This reverts commit b4ba16fe189b109144aff669e11d81365160104b.
This reverts commit 694ec1deea36e366b28b6349a52be49824e1a1a8.
This reverts commit 6b34de8eba9f66882ae16e6073af28783670ac53.
This reverts commit aa1cd02a4367834026ea2205ea13a2f904455aa1.
This reverts commit 308fd311ea6fcf3094b448df7f2b264f08e4fe4f.
This reverts commit 16203b53e1822a37b6ba6f2ab198bb435d05fdad.
This reverts commit 738fb5ca5412f5e833a7fab82b11519e635a3357.
This reverts commit 9fdbefacd3c382d731aa175b7bdc002ec9cb2b30.
This reverts commit cd4a7c1d90562ebb5f89caf94d00d579631b9fbe.
This reverts commit 928685eba2b2f0ded90e7f78fd806ea164002f6e.
This reverts commit 01e5ffc85cd4357fd7b5b7ceefa29f2d10ca26b7.

show more ...


# 6b34de8e 04-Jan-2023 Max Kellermann

sapi/*: add missing includes


# 77ee92a5 28-Nov-2022 Jorg Adam Sowa

Remove unnecessary usage of CONST_CS

Closes GH-9685.


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1
# 0a4a55fd 20-Jun-2022 Jakub Zelenka

Allow to not close stream on rscr dtor in php cli sapi

12345678910>>...18