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

<refentry xml:id="v8js.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>V8Js::__construct</refname>
  <refpurpose>Construct a new <classname>V8Js</classname> object</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <constructorsynopsis>
   <modifier>public</modifier> <methodname>V8Js::__construct</methodname>
   <methodparam choice="opt"><type>string</type><parameter>object_name</parameter><initializer>"PHP"</initializer></methodparam>
   <methodparam choice="opt"><type>array</type><parameter>variables</parameter><initializer>array()</initializer></methodparam>
   <methodparam choice="opt"><type>array</type><parameter>extensions</parameter><initializer>array()</initializer></methodparam>
   <methodparam choice="opt"><type>bool</type><parameter>report_uncaught_exceptions</parameter><initializer>&true;</initializer></methodparam>
  </constructorsynopsis>
  <para>
   Constructs a new <classname>V8Js</classname> object.
  </para>

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>object_name</parameter></term>
    <listitem>
     <para>
      The name of the object passed to Javascript.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>variables</parameter></term>
    <listitem>
     <para>
      Map of PHP variables that will be available in Javascript. Must be an associative <type>array</type>
      in format <literal>array("name-for-js" =&gt; "name-of-php-variable")</literal>. Defaults to empty array.
     </para> 
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>extensions</parameter></term>
    <listitem>
     <para>
      List of extensions registered using <function>V8Js::registerExtension</function> which should be available 
      in the Javascript context of the created <classname>V8Js</classname> object.
      <note>
       <para>
        Extensions registered to be enabled automatically do not need to be listed in this array.
        Also if an extension has dependencies, those dependencies can be omitted as well. Defaults to empty array.
       </para>
      </note>
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term><parameter>report_uncaught_exceptions</parameter></term>
    <listitem>
     <para>
      Controls whether uncaught Javascript exceptions are reported immediately or not. Defaults to &true;. If set to &false;
      the uncaught exception can be accessed using <function>V8Js::getPendingException</function>.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </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
-->
