Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In #2206263: drupal_is_cli() returns FALSE on PHP CLI we removed most logic of drupal_is_cli().
In #2228341: Objectify session management functions + remove session.inc SessionManager duplicated its one line logic, to keep it unit-testable.
It has no value anymore, we should just check PHP_SAPI
directly.
One less drupal_*
function to learn
Comment | File | Size | Author |
---|---|---|---|
#4 | drupal-is_cli-2294161-3.patch | 2.16 KB | ParisLiakos |
#1 | drupal-is_cli-2294161-1.patch | 2.17 KB | ParisLiakos |
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedComment #2
ParisLiakos CreditAttribution: ParisLiakos commentedComment #4
ParisLiakos CreditAttribution: ParisLiakos commented-.-
Comment #5
sunAwesome.
Comment #6
alexpottCommitted 8074550 and pushed to 8.x. Thanks!
Comment #8
chx CreditAttribution: chx commentedThat was great... except now we can't implement phpdbg support in drupal_is_cli() because there's no API function to fix.
Comment #9
chx CreditAttribution: chx commentedalexpott asked for clarification. phpdbg is a php debugger that has been included in PHP 5.6. https://wiki.php.net/rfc/phpdbg
the way to support it is
PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg'
but now there's no place to put this.Comment #10
ParisLiakos CreditAttribution: ParisLiakos commentedi do not see why we should specialcase for phpdbg.
Did you try something on it and it didnt work?
If there is an issue with phpdbg support, and we need to add checks like that, then an issue should be opened, which adds a method to the
Enviroment
component.Keeping
drupal_is_cli()
around just in case we might need it, is something i disagree withComment #11
chx CreditAttribution: chx commentedw/e
Comment #12
jbrown CreditAttribution: jbrown commentedThe change record is not correct - drupal_is_cli() hasn't been deprecated, it has been removed.
Comment #14
fubhy CreditAttribution: fubhy commentedSorry, but why exactly was this issue closed? It's impossible currently to run the Drupal testsuite with phpdbg. Checking just for 'cli' is simply wrong if we want to support phpdbg and I am pretty sure we want that.
Comment #15
cilefen CreditAttribution: cilefen as a volunteer commentedIt was closed for having met its goals at the time.
Comment #16
cilefen CreditAttribution: cilefen as a volunteer commentedPlus it's been closed so long, your follow up issue is fine.