当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Config_Writer_Ini::setRenderWithoutSections方法代码示例

本文整理汇总了PHP中Zend_Config_Writer_Ini::setRenderWithoutSections方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Config_Writer_Ini::setRenderWithoutSections方法的具体用法?PHP Zend_Config_Writer_Ini::setRenderWithoutSections怎么用?PHP Zend_Config_Writer_Ini::setRenderWithoutSections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Config_Writer_Ini的用法示例。


在下文中一共展示了Zend_Config_Writer_Ini::setRenderWithoutSections方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

    /**
     * @param string $type
     */
    public function create()
    {
        /* @var $userConfig Zend_Tool_Framework_Client_Config */
        $userConfig = $this->_registry->getConfig();

        $resp = $this->_registry->getResponse();
        if ($userConfig->exists()) {
            require_once "Zend/Tool/Framework/Exception.php";
            throw new Zend_Tool_Framework_Exception(
                "A configuration already exists, cannot create a new one.");
        }

        $homeDirectory = $this->_detectHomeDirectory();

        $writer = new Zend_Config_Writer_Ini();
        $writer->setRenderWithoutSections();
        $filename = $homeDirectory."/.zf.ini";

        $config = array(
            'php' => array(
                'include_path' => get_include_path(),
            ),
        );
        $writer->write($filename, new Zend_Config($config));

        $resp = $this->_registry->getResponse();
        $resp->appendContent("Successfully written Zend Tool config.");
        $resp->appendContent("It is located at: ".$filename);
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:32,代码来源:Config.php

示例2: getConfigWriter

 /**
  * Get the config writer that corresponds to the current config file type.
  *
  * @return Zend_Config_Writer_FileAbstract
  */
 protected function getConfigWriter()
 {
     $suffix = substr($this->getConfigFilepath(), -4);
     switch ($suffix) {
         case '.ini':
             // require_once "Zend/Config/Writer/Ini.php";
             $writer = new Zend_Config_Writer_Ini();
             $writer->setRenderWithoutSections();
             break;
         case '.xml':
             // require_once "Zend/Config/Writer/Xml.php";
             $writer = new Zend_Config_Writer_Xml();
             break;
         case '.php':
             // require_once "Zend/Config/Writer/Array.php";
             $writer = new Zend_Config_Writer_Array();
             break;
         default:
             // require_once 'Zend/Tool/Framework/Client/Exception.php';
             throw new Zend_Tool_Framework_Client_Exception('Unknown config file type ' . $suffix . ' at location ' . $this->getConfigFilepath());
     }
     return $writer;
 }
开发者ID:yonetici,项目名称:pimcore-coreshop-demo,代码行数:28,代码来源:Config.php

示例3: testRenderWithoutSections2

    public function testRenderWithoutSections2()
    {
        $config = new Zend_Config_Ini(dirname(__FILE__) . '/files/allsections.ini', null, array('skipExtends' => true));
        $writer = new Zend_Config_Writer_Ini();
        $writer->setRenderWithoutSections();
        $iniString = $writer->setConfig($config)->render();
        $expected = <<<ECS
all.hostname = "all"
all.name = "thisname"
all.db.host = "127.0.0.1"
all.db.user = "username"
all.db.pass = "password"
all.db.name = "live"
all.one.two.three = "multi"
staging.hostname = "staging"
staging.db.name = "dbstaging"
staging.debug = ""
debug.hostname = "debug"
debug.debug = "1"
debug.values.changed = "1"
debug.db.name = "dbdebug"
debug.special.no = ""
debug.special.null = ""
debug.special.false = ""
other_staging.only_in = "otherStaging"
other_staging.db.pass = "anotherpwd"

ECS;
        $this->assertEquals($expected, $iniString);
    }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:30,代码来源:IniTest.php

示例4: addSettingsFile

 /**
  * For now only contains the database source environment, but can be used to add more
  * configuration that's needed at restore time.
  *
  * @return void
  */
 public function addSettingsFile()
 {
     $config = new Zend_Config(array(), true);
     $config->gumball = array();
     $config->gumball->sourceDbEnvironment = $this->_dbEnv;
     $writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => $this->_getTargetDirectoryPath() . '/application/configs/gumball.ini'));
     $writer->setRenderWithoutSections();
     $writer->write();
 }
开发者ID:grrr-amsterdam,项目名称:garp3,代码行数:15,代码来源:Gumball.php


注:本文中的Zend_Config_Writer_Ini::setRenderWithoutSections方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。