Bug #45178

Reconsider passed-by ini file on subprocess command execution

Added by Adrian Föder over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2013-02-05
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:-
Target version:TYPO3 Flow Base Distribution - 2.0
PHP Version: Complexity:
Has patch:No Affected Flow version:(any)

Description

currently, the subprocess is executed with the currently loaded ini,

Core\Booting\Scripts #541
1$command .= sprintf('%s -c %s %s %s', $phpBinaryPathAndFilename, escapeshellarg(php_ini_loaded_file()), ...

This results into, for example,

FLOW_ROOTPATH='/var/www/vhosts/acme.com/' FLOW_CONTEXT='Development' XDEBUG_CONFIG='idekey=FLOW_SUBREQUEST remote_port=9001' "/usr/bin/php" -c '/etc/php5/apache2/php.ini' '/var/www/vhosts/acme.com/Packages/Framework/TYPO3.Flow/Classes/TYPO3/Flow/Core/../../../../Scripts/flow.php' 'typo3.flow:core:compile'

see, apache2/php.ini is included and used as ini for the subprocess.
In default cases, especially in apache's ini config a memory_limit is set; which therefore also engages CLI with a memory limit; which is surely not intended.

I think we should make this ini file configurable. Any ideas where and with what naming?

Associated revisions

Revision 577d51cc
Added by Adrian Föder over 2 years ago

[FEATURE] Allow influencing ini usage for sub process

With a newly introduced configuration directive
``TYPO3.Flow.core.subRequestPhpIniPathAndFilename`` it
is now possible to control whether to use an ini file
or not for sub processes. The allowed values for this
setting might either be NULL or not set to use the
parent process' ini file; or might be a path to a
specific ini file.

If this setting is set to ``false``, no explicit ini file
will be used for sub processes.

Additionally, this patch refactory the actual command
generation out of the execution method in order to make
it unit-testable, which is also included in this patch.

Change-Id: I7bae89d46ef7ed017526a1a2f7c5f328e62a0c76
Resolves: #45178
Releases: master

Revision 8c6aab2b
Added by Adrian Föder over 2 years ago

[FEATURE] Allow influencing ini usage for sub process

With a newly introduced configuration directive
``TYPO3.Flow.core.subRequestPhpIniPathAndFilename`` it
is now possible to control whether to use an ini file
or not for sub processes. The allowed values for this
setting might either be NULL or not set to use the
parent process' ini file; or might be a path to a
specific ini file.

If this setting is set to ``false``, no explicit ini file
will be used for sub processes.

Additionally, this patch refactors the actual command
generation out of the execution method in order to make
it unit-testable, which is also included in this patch.

Change-Id: I7bae89d46ef7ed017526a1a2f7c5f328e62a0c76
Resolves: #45178
Releases: 2.0, master

History

#1 Updated by Adrian Föder over 2 years ago

How could the configuration for this look like?
IMO we have three states to cover:

  • don't use any INI file explicitly
  • use a defined path to an INI file
  • use the php_ini_loaded_file() (default)

We could introduce a core setting similar to core.phpBinaryPathAndFilename, where

1  core:
2     # true: use the one from the current request, usually apache's
3    subprocessIniFile: true
4
5     # anything !== true: consider it a path
6    subprocessIniFile: '/my/deriving/php.ini'

If not set at all or FALSE, don't use this setting...

I'm a bit unlucky of this of course because of the type flagging.

// edit: most logical, if at all, would be:
FALSE: don't use the setting
string: use that path
not set: behave like before

#2 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18024

#3 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18024

#4 Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18024

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18024

#6 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18024

#7 Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19829

#8 Updated by Adrian Föder over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF