public function updatePickleSection(array $dlls_add, array $dlls_del = array())
{
$before = '';
$after = '';
$pickleSection = $this->rebuildPickleParts($this->getPickleSection(), $dlls_add, $dlls_del);
$before = substr($this->raw, 0, $this->pickleHeaderStartPos);
/* If the footer end pos is < 0, there was no footer in php.ini. In this case the footer start pos
means the end of the last extension directive after the header start, where the footer should be */
if ($this->pickleFooterEndPos > 0) {
$after = substr($this->raw, $this->pickleFooterEndPos);
} else {
$after = substr($this->raw, $this->pickleFooterStartPos);
}
$before = rtrim($before);
$after = ltrim($after);
$this->raw = $before . "\n\n" . self::PICKLE_HEADER . "\n" . trim($pickleSection) . "\n" . self::PICKLE_FOOTER . "\n\n" . $after;
if (!@file_put_contents($this->path, $this->raw)) {
throw new \Exception('Cannot update php.ini');
}
}