<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-config-ini.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yaf-config-ini.set.php',
    1 => 'Yaf_Config_Ini::set',
    2 => 'Set a configuration value',
  ),
  'up' => 
  array (
    0 => 'class.yaf-config-ini.php',
    1 => 'Yaf_Config_Ini',
  ),
  'prev' => 
  array (
    0 => 'yaf-config-ini.rewind.php',
    1 => 'Yaf_Config_Ini::rewind',
  ),
  'next' => 
  array (
    0 => 'yaf-config-ini.toarray.php',
    1 => 'Yaf_Config_Ini::toArray',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_config_ini/set.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-config-ini.set" class="refentry">
 <div class="refnamediv">
<h1 class="refname">Yaf_Config_Ini::set</h1>
<p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Config_Ini::set</span> &mdash; <span class="dc-title">Set a configuration value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-config-ini.set-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Config_Ini::set</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">Attempts to set a configuration value. Since <span class="classname"><a href="class.yaf-config-ini.php" class="classname">Yaf_Config_Ini</a></span> is always read-only, this method always fails and emits a warning.</p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-config-ini.set-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">name</code></dt>
    <dd>
<p class="simpara">The configuration key to set.</p>
    </dd>
   
   
    <dt><code class="parameter">value</code></dt>
    <dd>
<p class="simpara">The value to assign.</p>
    </dd>
   
  </dl>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-yaf-config-ini.set-returnvalues">
  <h3 class="title">Return Values</h3>
<p class="simpara">Always returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> and emits a warning, because <span class="classname"><a href="class.yaf-config-ini.php" class="classname">Yaf_Config_Ini</a></span> is read-only.</p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-config-ini.set-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="methodname"><strong>Yaf_Config_Ini::set()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
</span><span style="color: #FF8000">/**
 * Assume /etc/myapp/application.ini contains:
 * [common]
 * application.name = "MyApp"
 * database.host    = "localhost"
 * database.port    = 3306
 */
</span><span style="color: #0000BB">$config </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Config_Ini</span><span style="color: #007700">(</span><span style="color: #DD0000">'/etc/myapp/application.ini'</span><span style="color: #007700">, </span><span style="color: #DD0000">'common'</span><span style="color: #007700">);

</span><span style="color: #FF8000">// Read-only: the assignment always fails, and a warning is emitted
</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #DD0000">'database.host'</span><span style="color: #007700">, </span><span style="color: #DD0000">'192.0.2.10'</span><span style="color: #007700">));

echo </span><span style="color: #0000BB">$config</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get</span><span style="color: #007700">(</span><span style="color: #DD0000">'database.host'</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>The above example will output
something similar to:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">bool(false)
localhost</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-config-ini.set-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="yaf-config-ini.get.php" class="methodname" rel="rdfs-seeAlso">Yaf_Config_Ini::get()</a> - Retrieve a configuration value</span></li>
   <li><span class="methodname"><a href="yaf-config-ini.readonly.php" class="methodname" rel="rdfs-seeAlso">Yaf_Config_Ini::readonly()</a> - Check if configuration is read-only</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>