/** * Removes a option from local config * * @param string $configOption */ public function remove($configOption = "remote.origin.url") { $this->repository->cmd(sprintf('config --local --unset %s', $configOption)); //Open file Hgrc $fileConfig = fopen($this->repository->getDir() . "/.git/config", 'r'); //Get contents $contents = file_get_contents($this->repository->getDir() . "/.git/config"); //Delete [remote "origin"] $contents = str_ireplace('[remote "origin"]', null, $contents); //Delete blanc ligne $contents = trim($contents); fclose($fileConfig); //Re-write contents modify in hgrc $fileConfig = fopen($this->repository->getDir() . "/.git/config", 'w+'); fwrite($fileConfig, $contents); fclose($fileConfig); }
/** * Save the config to file * * @return boolean */ protected function save() { // write contents modify in hgrc if ($fileConfig = @fopen($this->repository->getDir() . $this->repository->getFileConfig() . "hgrc", 'w+')) { $ret = fwrite($fileConfig, $this->arr2ini($this->configuration)); fclose($fileConfig); return $ret; } return false; }