<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.svn.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'tr',
  ),
  'this' => 
  array (
    0 => 'function.svn-diff.php',
    1 => 'svn_diff',
    2 => 'Recursively diffs two paths',
  ),
  'up' => 
  array (
    0 => 'ref.svn.php',
    1 => 'SVN İşlevleri',
  ),
  'prev' => 
  array (
    0 => 'function.svn-delete.php',
    1 => 'svn_delete',
  ),
  'next' => 
  array (
    0 => 'function.svn-export.php',
    1 => 'svn_export',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/svn/functions/svn-diff.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.svn-diff" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">svn_diff</h1>
  <p class="verinfo">(PECL svn &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">svn_diff</span> &mdash; <span class="dc-title">Recursively diffs two paths</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.svn-diff-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>svn_diff</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path1</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$rev1</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path2</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$rev2</code></span><br>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="simpara">
   Recursively diffs two paths, <code class="parameter">path1</code> and
   <code class="parameter">path2</code>.
  </p>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
   <span class="simpara">
    This is not a general-purpose diff utility. Only local files
    that are versioned may be diffed: other files will fail.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.svn-diff-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">path1</code></dt>
    <dd>
     <span class="simpara">
      First path to diff. This can be a URL to a file/directory in an SVN
      repository or a local file/directory path.
     </span>
     <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
<span class="simpara">Göreli yollar, geçerli çalışma dizini PHP çalıştırılabilirini içeren
dizinlerden biriymiş gibi çözümlenir. Betiğin çalıştırıldığı dizini kullanmak
için <span class="function"><a href="function.realpath.php" class="function">realpath()</a></span> işlevi veya
dirname(__FILE__) kullanılır.</span></p></blockquote>
     <div class="warning"><strong class="warning">Uyarı</strong>
      <p class="simpara">
       If a local file path has only backslashes and no forward slashes,
       this extension will fail to find the path. Always
       replace all backslashes with forward slashes when using this
       function.
      </p>
     </div>
    </dd>
   
   
    <dt><code class="parameter">rev1</code></dt>
    <dd>
     <span class="simpara">
      First path&#039;s revision number. Use <strong><code><a href="svn.constants.php#constant.svn-revision-head">SVN_REVISION_HEAD</a></code></strong>
      to specify the most recent revision.
     </span>
    </dd>
   
   
    <dt><code class="parameter">path2</code></dt>
    <dd>
     <span class="simpara">
      Second path to diff. See <code class="parameter">path1</code> for description.
     </span>
    </dd>
   
   
    <dt><code class="parameter">rev2</code></dt>
    <dd>
     <span class="simpara">
      Second path&#039;s revision number. See <code class="parameter">rev1</code>
      for description.
     </span>
    </dd>
   
  </dl>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.svn-diff-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="simpara">
   Returns an array-list consisting of two streams: the first is the diff output
   and the second contains error stream output. The streams can be
   read using <span class="function"><a href="function.fread.php" class="function">fread()</a></span>. Returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> on
   error.
  </p>
  <p class="simpara">
   The diff output will, by default, be in the form of Subversion&#039;s
   custom unified diff format, but an
   <a href="http://svnbook.red-bean.com/en/1.2/svn.advanced.externaldifftools.html" class="link external">&raquo;&nbsp;external
   diff engine</a> may be
   used depending on Subversion&#039;s configuration.
  </p>
 </div>


 

 

 <div class="refsect1 examples" id="refsect1-function.svn-diff-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="example-1">
   <p><strong>Örnek 1 Basic example</strong></p>
   <div class="example-contents"><p>
    This example demonstrates the basic usage of this function, and
    the retrieval of contents from the stream:
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">list(</span><span style="color: #0000BB">$diff</span><span style="color: #007700">, </span><span style="color: #0000BB">$errors</span><span style="color: #007700">) = </span><span style="color: #0000BB">svn_diff</span><span style="color: #007700">(<br />    </span><span style="color: #DD0000">'http://www.example.com/svnroot/trunk/foo'</span><span style="color: #007700">, </span><span style="color: #0000BB">SVN_REVISION_HEAD</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'http://www.example.com/svnroot/branches/dev/foo'</span><span style="color: #007700">, </span><span style="color: #0000BB">SVN_REVISION_HEAD<br /></span><span style="color: #007700">);<br />if (!</span><span style="color: #0000BB">$diff</span><span style="color: #007700">) exit;<br /></span><span style="color: #0000BB">$contents </span><span style="color: #007700">= </span><span style="color: #DD0000">''</span><span style="color: #007700">;<br />while (!</span><span style="color: #0000BB">feof</span><span style="color: #007700">(</span><span style="color: #0000BB">$diff</span><span style="color: #007700">)) {<br />  </span><span style="color: #0000BB">$contents </span><span style="color: #007700">.= </span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$diff</span><span style="color: #007700">, </span><span style="color: #0000BB">8192</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$diff</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$errors</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$contents</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>
Yukarıdaki örneğin çıktısı:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Index: http://www.example.com/svnroot/trunk/foo
===================================================================
--- http://www.example.com/svnroot/trunk/foo        (.../foo) (revision 23)
+++ http://www.example.com/svnroot/branches/dev/foo (.../foo) (revision 27)
 // further diff output</pre>
</div>
   </div>
  </div>
  <div class="example" id="example-2">
   <p><strong>Örnek 2 Diffing two revisions of a repository path</strong></p>
   <div class="example-contents"><p>
    This example implements a wrapper function that allows a user
    to easily diff two revisions of the same item using an external
    repository path (the default syntax is somewhat verbose):
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">svn_diff_same_item</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev1</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev2</span><span style="color: #007700">) {<br />    return </span><span style="color: #0000BB">svn_diff</span><span style="color: #007700">(</span><span style="color: #0000BB">$path</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev1</span><span style="color: #007700">, </span><span style="color: #0000BB">$path</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev2</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <div class="example" id="example-3">
   <p><strong>Örnek 3 Portably diffing two local files</strong></p>
   <div class="example-contents"><p>
    This example implements a wrapper function that portably
    diffs two local files, compensating for the <span class="function"><a href="function.realpath.php" class="function">realpath()</a></span>
    fix and the backslashes bug:
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">svn_diff_local</span><span style="color: #007700">(</span><span style="color: #0000BB">$path1</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev1</span><span style="color: #007700">, </span><span style="color: #0000BB">$path2</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev2</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$path1 </span><span style="color: #007700">= </span><span style="color: #0000BB">str_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'\\'</span><span style="color: #007700">, </span><span style="color: #DD0000">'/'</span><span style="color: #007700">, </span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">$path1</span><span style="color: #007700">));<br />    </span><span style="color: #0000BB">$path2 </span><span style="color: #007700">= </span><span style="color: #0000BB">str_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'\\'</span><span style="color: #007700">, </span><span style="color: #DD0000">'/'</span><span style="color: #007700">, </span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">$path2</span><span style="color: #007700">));<br />    return </span><span style="color: #0000BB">svn_diff</span><span style="color: #007700">(</span><span style="color: #0000BB">$path1</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev1</span><span style="color: #007700">, </span><span style="color: #0000BB">$path2</span><span style="color: #007700">, </span><span style="color: #0000BB">$rev2</span><span style="color: #007700">);<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-function.svn-diff-notes">
  <h3 class="title">Notlar</h3>
  <div class="warning"><strong class="warning">Uyarı</strong><p class="simpara">Bu işlev
<em>DENEYSELDİR</em>. Bu işlevin davranışı, ismi
ve belgeleri PHP&#039;nin sonraki sürümlerinde hiçbir duyuru yapılmaksızın
değiştirilebilir. Bu risk göze alınamayacaksa bu işlev
kullanılmamalıdır.</p></div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.svn-diff-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <ul class="simplelist">
   <li><a href="http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.diff.html" class="link external">&raquo;&nbsp;SVN documentation on svn diff</a></li>
  </ul>
 </div>


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