29 if (isset($args[0]) && !empty($args[0]) && isset($args[1]) && !empty($args[1])) {
30 $onContent =
'extension=' . $args[0];
31 $offContent =
';extension=' . $args[0];
33 $phpiniContent = file_get_contents(
$bearsamppBins->getPhp()->getConf());
34 if ($args[1] == self::SWITCH_ON) {
35 $phpiniContent = str_replace($offContent, $onContent, $phpiniContent);
36 } elseif ($args[1] == self::SWITCH_OFF) {
37 $phpiniContent = str_replace($onContent, $offContent, $phpiniContent);
40 $phpiniContentOr = file_get_contents(
$bearsamppBins->getPhp()->getConf());
41 if ($phpiniContent == $phpiniContentOr && file_exists(
$bearsamppBins->getPhp()->getSymlinkPath() .
'/ext/php_' . $args[0] .
'.dll')) {
43 $latestExt = (end($extsIni) ==
'0' ?
';' :
'');
44 $latestExt .=
'extension=' . key($extsIni);
45 $phpiniContent = str_replace(
47 $latestExt . PHP_EOL . $onContent,
52 file_put_contents(
$bearsamppBins->getPhp()->getConf(), $phpiniContent);