<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-application.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'yaf-application.construct.php',
    1 => 'Yaf_Application::__construct',
    2 => 'Yaf_Application constructor',
  ),
  'up' => 
  array (
    0 => 'class.yaf-application.php',
    1 => 'Yaf_Application',
  ),
  'prev' => 
  array (
    0 => 'yaf-application.clearlasterror.php',
    1 => 'Yaf_Application::clearLastError',
  ),
  'next' => 
  array (
    0 => 'yaf-application.environ.php',
    1 => 'Yaf_Application::environ',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_application/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-application.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Application::__construct</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Application::__construct</span> &mdash; <span class="dc-title">Yaf_Application constructor</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-application.construct-description">
  <h3 class="title">Açıklama</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Application::__construct</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.array.php" class="type array">array</a></span></span> <code class="parameter">$config</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$environ</code><span class="initializer"> = null</span></span>)</div>

  <p class="simpara">
   Instantiate a <span class="classname"><a href="class.yaf-application.php" class="classname">Yaf_Application</a></span>. The constructor
   also initializes the singleton application, the
   <span class="classname"><a href="class.yaf-loader.php" class="classname">Yaf_Loader</a></span> and the
   <span class="classname"><a href="class.yaf-dispatcher.php" class="classname">Yaf_Dispatcher</a></span>, so it must be called before any
   of those are used.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-application.construct-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">config</code></dt>
    <dd>
     <p class="simpara">
      An INI configuration file path, or a configuration array.
     </p>
     <p class="simpara">
      If it is an INI configuration file, there should be a section named
      as the one defined by
      <a href="yaf.configuration.php#ini.yaf.environ" class="link">yaf.environ</a>, which is
      <code class="literal">&quot;product&quot;</code> by default.
     </p>
     <p class="simpara">
      The application configuration entries (and their default values) are
      documented in
      <a href="yaf.appconfig.php" class="link">Application Configuration</a>:
     </p>
     <p class="para">
      <div class="example" id="example-1">
       <p><strong>Örnek 1 An ini config file example</strong></p>
       <div class="example-contents">
<div class="inicode"><pre class="inicode">[product]
;this one should always be defined, and has no default value
application.directory=APPLICATION_PATH

;following configs have default values, you may not need to define them
application.library = APPLICATION_PATH . &quot;/library&quot;
application.dispatcher.throwException=1
application.dispatcher.catchException=1

application.baseUri=&quot;&quot;

;the php script ext name
application.ext=php

;the view template ext name
application.view.ext=phtml

application.dispatcher.defaultModule=Index
application.dispatcher.defaultController=Index
application.dispatcher.defaultAction=index

;defined modules
application.modules=Index</pre>
</div>
       </div>

      </div>
     </p>
    </dd>
   
   
    <dt><code class="parameter">environ</code></dt>
    <dd>
     <p class="simpara">
      Which section will be loaded as the final configuration. If it is
      not given, the value of the
      <a href="yaf.configuration.php#ini.yaf.environ" class="link">yaf.environ</a> directive is
      used.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 errors" id="refsect1-yaf-application.construct-errors">
  <h3 class="title">Hatalar/İstisnalar</h3>
  <p class="simpara">
   Throws a <span class="exceptionname"><a href="class.yaf-exception-startuperror.php" class="exceptionname">Yaf_Exception_StartupError</a></span> exception
   (or triggers a <strong><code><a href="yaf.constants.php#constant.yaf-err-startup-failed">YAF_ERR_STARTUP_FAILED</a></code></strong> error, when
   <span class="methodname"><a href="yaf-dispatcher.throwexception.php" class="methodname">Yaf_Dispatcher::throwException()</a></span> is off) if a
   <span class="classname"><a href="class.yaf-application.php" class="classname">Yaf_Application</a></span> has already been instantiated,
   or if the configuration is invalid.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-application.construct-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-2">
   <p><strong>Örnek 2 <span class="function"><strong>Yaf_Application::__construct()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'APPLICATION_PATH'</span><span style="color: #007700">)                  </span><span style="color: #FF8000">// APPLICATION_PATH will be used in the ini config file
    </span><span style="color: #007700">|| </span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'APPLICATION_PATH'</span><span style="color: #007700">, </span><span style="color: #0000BB">__DIR__</span><span style="color: #007700">);

</span><span style="color: #0000BB">$application </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">APPLICATION_PATH</span><span style="color: #007700">.</span><span style="color: #DD0000">'/conf/application.ini'</span><span style="color: #007700">);
</span><span style="color: #0000BB">$application</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">bootstrap</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

  </div>
  <div class="example" id="example-3">
   <p><strong>Örnek 3 <span class="function"><strong>Yaf_Application::__construct()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$config </span><span style="color: #007700">= array(
    </span><span style="color: #DD0000">"application" </span><span style="color: #007700">=&gt; array(
        </span><span style="color: #DD0000">"directory" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"/application"</span><span style="color: #007700">,
    ),
);

</span><span style="color: #FF8000">/** Yaf_Application */
</span><span style="color: #0000BB">$application </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);
</span><span style="color: #0000BB">$application</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">bootstrap</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-application.construct-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="classname"><a href="class.yaf-config-ini.php" class="classname">Yaf_Config_Ini</a></span></li>
    <li><a href="yaf.appconfig.php" class="link">Application Configuration</a></li>
   </ul>
  </p>
 </div>


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