Bug #50080

Broken concept for CLI/Web separation

Added by Philipp Gampe over 8 years ago. Updated over 8 years ago.

Status:
Needs Feedback
Priority:
Should have
Category:
Core
Target version:
-
Start date:
2013-07-16
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:
medium

Description

Currently Flow tries to detect a CLI request by looking into the PHP_SAPI constant. This is a wrong approach and completely breaks on host that use CGI for both web and console requests.

The German hoster Domainfactory is such a hoster. The PHP_SAPI in both web and console is cgi-fcgi, thus there is no way to distinguish a web from a cli request.

I tried to fix it myself in the code, but got lost in the various bootstrap methods (and their orders) and the sub-request cycles: https://notes.typo3.org/p/neos-domainfactory

@see http://www.php.net/manual/en/function.php-sapi-name.php#89858

IMHO Flow should take advantage of the different entry scripts and set a constant very early in the entry point that distinguishes the request types. Then it could also separate cli from cli-sub and web requests.
It would be cheaper in terms of processing time and less error prone.

Also available in: Atom PDF