lxcenter/hypervm — comment on commit a5bf9953b95e7c4cee30b0e5e3d73ad93ce1cdd9
File: hypervm/httpdocs/lib/vps/driver/vps__xenlib.php line 786
By shakaran:

-What means $pygrub_r? The name is confusing.
-You should use brackets too for single if lines.
- Use PHP_EOL instead of /n.
- Is really needed that kernel, root and bootloader assignments are in the same line?
- Change double quotes by single quotes.

For the moment (expecting more data from you) this should be the right code:

// Add pygrub configuration if template name contains pygrub
$pygrub_r = explode('-', $this->main->ostemplate);
if (stripos($pygrub_r[3], 'pygrub') !== FALSE) {
$string .= 'kernel = \'\';root = \'\';bootloader = \'/usr/bin/pygrub\'' . PHP_EOL;
}