/** * @param string $type */ public function create() { /* @var $userConfig Zend\Tool\Framework\Client\Config */ $userConfig = $this->_registry->getConfig(); $resp = $this->_registry->getResponse(); if ($userConfig->exists()) { throw new Exception\RuntimeException('A configuration already exists; cannot create a new one'); } $homeDirectory = $this->_detectHomeDirectory(); $writer = new IniConfigWriter(); $writer->setRenderWithoutSections(); $filename = $homeDirectory . '/.zf.ini'; $config = array('php' => array('include_path' => get_include_path())); $writer->write($filename, new Configuration($config)); $resp = $this->_registry->getResponse(); $resp->appendContent("Successfully written Zend Tool config."); $resp->appendContent("It is located at: " . $filename); }
/** * @group ZF-6521 */ public function testNoDoubleQuoutesInValue() { $config = new Config(array('default' => array('test' => 'fo"o'))); $this->setExpectedException('Zend\Config\Exception\RuntimeException', 'Value can not contain double quotes'); $writer = new Ini(array('config' => $config, 'filename' => $this->_tempName)); $writer->write(); }