Jump to content
Froxlor Forum
  • 0

PHP Version Switch


julianlampert

Question

Hi,

 

I've tried to develop a module in which customers can change the PHP configuration for their domain & subdomain. The problem is I am new to froxlor and do not understand the code.

 

My first attempt was: I edited the 'formfields.domain_edit.php' - File for 'customer -> domains' and added the following code:

'section_b' => array(
'title' => $lng['admin']['phpserversettings'],
'image' => 'icons/domain_edit.png',
'fields' => array(
'phpsettingid' => array(
'visible' => (((int)Settings::Get('system.mod_fcgid') == 1 || (int)Settings::Get('phpfpm.enabled') == 1) ? true : false),
'label' => $lng['admin']['phpsettings']['title'],
'type' => 'select',
'select_var' => $phpconfigs
)
)
)

I copied the code from the admin template. But I don't know how where to add the $phpconfigs, I mean in which block of the file 'customer_domains.php' and how to customize it.

 

I tried this snippet:

$phpconfigs = '';
$phpconfigs_result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_PHPCONFIGS . "`");

while ($phpconfigs_row = $phpconfigs_result_stmt->fetch(PDO::FETCH_ASSOC)) {
$phpconfigs .= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true);
}

But I don't know how to fill the $result['phpsettingid'] - Value (the $result - Array).

 

Please can anybody give me a clue where I have to add the code snippets and how froxlor edits values in the database.

 

Thank you very much!

 

Regards,

Julian

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

well you have to process the form after the POST, right now, you are only displaying the select-box, the formfields describe the forms, the other snipped just fills the select-box with options.

 

Also, TABLE_PANEL_PHPCONFIGS only holds different php-versions when using FCGID (because you can specify the php-binary there). It won't work for mod_php or php-fpm that way

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...