You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote this issue using chatgpt voice transcription, there are some inaccuracies I'll polish later.
Description
We need to add helper functions to manage php.ini entries.
Let's remove php.setPhpIniEntry and php.setPhpIniPath to keep the PHP module api small.
Details
Default php.ini Path
PHP should load a php.ini file from /internal/shared/php.ini.
This path should be set in the C module during PHP runtime initialization.
There should be no exported C methods to customize this path or to overwrite in-memory PHP INI entries. All entries should be loaded from the php.ini file.
The php.ini file should have precedence over any defaults provided in the C code.
Exported Helper Methods
We need to implement the following helper methods to manage php.ini entries:
I wrote this issue using chatgpt voice transcription, there are some inaccuracies I'll polish later.
Description
We need to add helper functions to manage
php.ini
entries.Let's remove php.setPhpIniEntry and php.setPhpIniPath to keep the PHP module api small.
Details
Default
php.ini
Pathphp.ini
file from/internal/shared/php.ini
.php.ini
file.php.ini
file should have precedence over any defaults provided in the C code.Exported Helper Methods
We need to implement the following helper methods to manage
php.ini
entries:set.php.ini.entry: Set a specific
php.ini
entry.entry
(string): Thephp.ini
entry to set.value
(string): The value to set for the entry.set.php.ini.entry('memory_limit', '256M');
set.php.ini.entries: Set multiple
php.ini
entries.entries
(object): An object where keys arephp.ini
entries and values are the respective values to set.set.php.ini.entries({ 'memory_limit': '256M', 'upload_max_filesize': '64M' });
get.php.ini.entry: Get a specific
php.ini
entry.entry
(string): Thephp.ini
entry to retrieve.value
(string): The value of the specifiedphp.ini
entry.get.php.ini.entry('memory_limit'); // Returns '256M'
Internal Utility Functions
To support these helper methods, we need to implement internal utility functions to parse
.ini
files and serialize them:parseIniFile: Convert a
.ini
file to JSON.filePath
(string): Path to the.ini
file.json
(object): JSON representation of the.ini
file.parseIniFile('./.internal/.shared/.php.ini');
serializeIniFile: Convert JSON to a
.ini
file.json
(object): JSON object representing the.ini
configuration.filePath
(string): Path where the.ini
file should be saved.serializeIniFile(jsonConfig, './.internal/.shared/.php.ini');
Tasks
set.php.ini.entry
method.set.php.ini.entries
method.get.php.ini.entry
method.parseIniFile
utility function.serializeIniFile
utility function.Notes
php.ini
file is always loaded from the fixed path (./.internal/.shared/.php.ini
).php.ini
file has precedence over any defaults provided in the C code.This feature will enhance the configurability of PHP within the WordPress Playground and simplify the management of
php.ini
settings.The text was updated successfully, but these errors were encountered: