<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Schedules the addition of an item in a working directory</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.svn.html">SVN Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.svn-auth-get-parameter.html">svn_auth_get_parameter</a></div> <div class="up"><a href="ref.svn.html">SVN Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.svn-add" class="refentry"> <div class="refnamediv"> <h1 class="refname">svn_add</h1> <p class="verinfo">(PECL svn >= 0.1.0)</p><p class="refpurpose"><span class="refname">svn_add</span> — <span class="dc-title">Schedules the addition of an item in a working directory</span></p> </div> <div class="refsect1 description" id="refsect1-function.svn-add-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>svn_add</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span> [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$recursive</code><span class="initializer"> = true</span></span> [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$force</code><span class="initializer"> = false</span></span> ]] )</div> <p class="para rdfs-comment"> Adds the file, directory or symbolic link at <em><code class="parameter">path</code></em> to the working directory. The item will be added to the repository the next time you call <span class="function"><a href="function.svn-commit.html" class="function">svn_commit()</a></span> on the working copy. </p> </div> <div class="refsect1 parameters" id="refsect1-function.svn-add-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">path</code></em></span> <dd> <p class="para"> Path of item to add. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">Relative paths will be resolved as if the current working directory was the one that contains the PHP binary. To use the calling script's working directory, use <span class="function"><a href="function.realpath.html" class="function">realpath()</a></span> or dirname(__FILE__).</span></p></blockquote> </dd> </dt> <dt> <span class="term"><em><code class="parameter">recursive</code></em></span> <dd> <p class="para"> If item is directory, whether or not to recursively add all of its contents. Default is <strong><code>TRUE</code></strong> </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">force</code></em></span> <dd> <p class="para"> If true, Subversion will recurse into already versioned directories in order to add unversioned files that may be hiding in those directories. Default is <strong><code>FALSE</code></strong> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.svn-add-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 notes" id="refsect1-function.svn-add-notes"> <h3 class="title">Notes</h3> <div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function is <em class="emphasis">EXPERIMENTAL</em>. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk. </p></div> </div> <div class="refsect1 examples" id="refsect1-function.svn-add-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4656"> <p><strong>Example #1 <span class="function"><strong>svn_add()</strong></span> example</strong></p> <div class="example-contents"><p> In a working directory where <strong class="userinput"><code>svn status</code></strong> returns: </p></div> <div class="example-contents screen"> <div class="examplescode"><pre class="examplescode">$ svn status ? foobar.txt</pre> </div> </div> <div class="example-contents"><p>...this code:</p></div> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />svn_add</span><span style="color: #007700">(</span><span style="color: #DD0000">'foobar.txt'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p> ...will schedule <var class="filename">foobar.txt</var> for addition into the repository. </p></div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.svn-add-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="http://svnbook.red-bean.com/en/1.2/svn.ref.svn.c.add.html" class="link external">» SVN documentation on svn add</a></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="ref.svn.html">SVN Functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.svn-auth-get-parameter.html">svn_auth_get_parameter</a></div> <div class="up"><a href="ref.svn.html">SVN Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>