<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ --> 

<refentry xml:id="yar-client.setopt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Yar_Client::setOpt</refname>
  <refpurpose>Set calling contexts</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type class="union"><type>Yar_Client</type><type>false</type></type><methodname>Yar_Client::setOpt</methodname>
   <methodparam><type>int</type><parameter>name</parameter></methodparam>
   <methodparam><type>mixed</type><parameter>value</parameter></methodparam>
  </methodsynopsis>
  <para>

  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>name</parameter></term>
    <listitem>
     <para>
      it can be:
        <constant>YAR_OPT_PACKAGER</constant>,
        <constant>YAR_OPT_PERSISTENT</constant> (Need server support),
        <constant>YAR_OPT_TIMEOUT</constant>,
        <constant>YAR_OPT_CONNECT_TIMEOUT</constant>,
        <constant>YAR_OPT_HEADER</constant> (as of 2.0.4),
        <constant>YAR_OPT_PROXY</constant> (as of 2.2.0)
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>value</parameter></term>
    <listitem>
     <para>
      
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns <varname>$this</varname> on success&return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><function>Yar_Client::setOpt</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php

$cient = new Yar_Client("http://host/api/");

//Set timeout to 1s
$client->SetOpt(YAR_OPT_CONNECT_TIMEOUT, 1000);

//Set packager to JSON
$client->SetOpt(YAR_OPT_PACKAGER, "json");

//Set Custom headers
$client->SetOpt(YAR_OPT_HEADER, array("hr1: val1", "hd2: val2"));

// Set Http Proxy
$client->SetOpt(YAR_OPT_PROXY, "127.0.0.1:8888");

/* call remote service */
$result = $client->some_method("parameter");
?>
]]>
   </programlisting>
   &example.outputs.similar;
   <screen>
<![CDATA[
]]>
   </screen>
  </example>
 </refsect1>


 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><methodname>Yar_Client::__call</methodname></member>
  </simplelist>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
