cvs: phpdoc /kr/functions crack.xml cybermut.xml cyrus.xml dbplus.xml dbx.xml dio.xml dotnet.xml fbsql.xml fribidi.xml iconv.xml iisfunc.xml ircg.xml
java.xml mailparse.xml mbstring.xml ming.xml msession.xml muscat.xml ncurses.xml notes.xml overload.xml pcntl.xml printer.xml qtdom.xml vpopmail.xml
w32api.xml xmlrpc.xml zip.xml

From: Date: Sat, 05 Jan 2002 17:01:29 +0000
Subject: cvs: phpdoc /kr/functions crack.xml cybermut.xml cyrus.xml dbplus.xml dbx.xml dio.xml dotnet.xml fbsql.xml fribidi.xml iconv.xml iisfunc.xml ircg.xml
java.xml mailparse.xml mbstring.xml ming.xml msession.xml muscat.xml ncurses.xml notes.xml overload.xml pcntl.xml printer.xml qtdom.xml vpopmail.xml
w32api.xml xmlrpc.xml zip.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969340775@lists.php.net to get a copy of this message
fuzzy74 Sat Jan 5 12:01:29 2002 EDT Added files: /phpdoc/kr/functions crack.xml cybermut.xml cyrus.xml dbplus.xml dbx.xml dio.xml dotnet.xml fbsql.xml fribidi.xml iconv.xml iisfunc.xml ircg.xml java.xml mailparse.xml mbstring.xml ming.xml msession.xml muscat.xml ncurses.xml notes.xml overload.xml pcntl.xml printer.xml qtdom.xml vpopmail.xml w32api.xml xmlrpc.xml zip.xml Log: add function files to korean translate docs

Index: phpdoc/kr/functions/crack.xml +++ phpdoc/kr/functions/crack.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.crack"> <title>Crack functions</title> <titleabbrev>Crack functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.crack-opendict"> <refnamediv> <refname>crack_opendict</refname> <refpurpose>Opens a new cracklib dictionary</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>crack_opendict</function></funcdef> <paramdef>string <parameter>dictionary</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.crack-closedict"> <refnamediv> <refname>crack_closedict</refname> <refpurpose>Closes an open cracklib dictionary </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>crack_closedict</function></funcdef> <paramdef>int <parameter><optional>link_identifier</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.crack-check"> <refnamediv> <refname>crack_check</refname> <refpurpose>] string password) Performs an obscure check with the given password </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>crack_check</function></funcdef> <paramdef>int <parameter><optional>dictionary</optional></parameter> </paramdef> <paramdef>string <parameter>password</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.crack-getlastmessage"> <refnamediv> <refname>crack_getlastmessage</refname> <refpurpose>Returns the message from the last obscure check</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>crack_getlastmessage</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/cybermut.xml +++ phpdoc/kr/functions/cybermut.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.cybermut"> <title>Cr&eacute;dit Mutuel CyberMUT functions</title> <titleabbrev>CyberMUT</titleabbrev> <partintro> <simpara> This extension allows you to process credit cards transactions using Cr&eacute;dit Mutuel CyberMUT system ( <ulink url="&url.cybermut;">&url.cybermut;</ulink>). </simpara> <simpara> CyberMUT is a popular Web Payment Service in France, provided by the Cr&eacute;dit Mutuel bank. If you are foreign in France, these functions will not be useful for you. </simpara> <simpara> These functions are only available if PHP has been compiled with the <link linkend="install.configure.with-cybermut"><option role="configure"> --with-cybermut[=DIR]</option></link> option, where DIR is the location of <filename>libcm-mac.a</filename> and <filename>cm-mac.h</filename>. You will require the appropriate SDK for your platform, which may be sent to you after your CyberMUT's subscription (contact them via Web, or go to the nearest Cr&eacute;dit Mutuel). </simpara> <simpara> The use of these functions is almost identical to the original functions, except for the parameters of return for <function>cybermut_creerformulairecm</function> and <function>cybermut_creerreponsecm</function>, which are returned directly by functions PHP, whereas they had passed in reference in the original functions. </simpara> <simpara> These functions have been added in PHP 4.0.6. </simpara> <note> <para> These functions only provide a link to CyberMUT SDK. Be sure to read the CyberMUT Developers Guide for full details of the required parameters. </para> </note> </partintro> <refentry id="function.cybermut-creerformulairecm"> <refnamediv> <refname>cybermut_creerformulairecm</refname> <refpurpose>Generate HTML form of request for payment</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>cybermut_creerformulairecm</function></funcdef> <paramdef>string <parameter>url_CM</parameter></paramdef> <paramdef>string <parameter>version</parameter></paramdef> <paramdef>string <parameter>TPE</parameter></paramdef> <paramdef>string <parameter>montant</parameter></paramdef> <paramdef>string <parameter>ref_commande</parameter></paramdef> <paramdef>string <parameter>texte_libre</parameter></paramdef> <paramdef>string <parameter>url_retour</parameter></paramdef> <paramdef>string <parameter>url_retour_ok</parameter></paramdef> <paramdef>string <parameter>url_retour_err</parameter></paramdef> <paramdef>string <parameter>langue</parameter></paramdef> <paramdef>string <parameter>code_societe</parameter></paramdef> <paramdef>string <parameter>texte_bouton</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>cybermut_creerformulairecm</function> is used to generate the HTML form of request for payment. </para> <example> <title>First step of payment (equiv cgi1.c)</title> <programlisting role="php"> <![CDATA[ <?php // Directory where are located the keys putenv("CMKEYDIR=/var/creditmut/cles"); // Version number $VERSION="1.2"; $retour = creditmut_creerformulairecm( "https://www.creditmutuel.fr/test/telepaiement/paiement.cgi", $VERSION, "1234567890", "300FRF", $REFERENCE, $TEXTE_LIBRE, $URL_RETOUR, $URL_RETOUR_OK, $URL_RETOUR_ERR, "francais", "company", "Paiement par carte bancaire"); echo $retour; ?> ]]> </programlisting> </example> <para> See also <function>cybermut_testmac</function> and <function>cybermut_creerreponsecm</function>. </para> </refsect1> </refentry> <refentry id="function.cybermut-testmac"> <refnamediv> <refname>cybermut_testmac</refname> <refpurpose> Make sure that there no was data diddling contained in the received message of confirmation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>cybermut_testmac</function></funcdef> <paramdef>string <parameter>code_MAC</parameter></paramdef> <paramdef>string <parameter>version</parameter></paramdef> <paramdef>string <parameter>TPE</parameter></paramdef> <paramdef>string <parameter>cdate</parameter></paramdef> <paramdef>string <parameter>montant</parameter></paramdef> <paramdef>string <parameter>ref_commande</parameter></paramdef> <paramdef>string <parameter>texte_libre</parameter></paramdef> <paramdef>string <parameter>code-retour</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>cybermut_testmac</function> is used to make sure that there was not data diddling contained in the received message of confirmation. Pay attention to parameters code-retour and texte-libre, which cannot be evaluated as is, because auf the dash. You must retrieve them by using: <programlisting role="php"> <![CDATA[ <?php $code_retour=$HTTP_GET_VARS["code-retour"]; $texte_libre=$HTTP_GET_VARS["texte-libre"]; ?> ]]> </programlisting> </para> <example> <title>Last step of payment (equiv cgi2.c)</title> <programlisting role="php"> <![CDATA[ <?php // Make sure that Enable Track Vars is ON. // Directory where are located the keys putenv("CMKEYDIR=/var/creditmut/cles"); // Version number $VERSION="1.2"; $texte_libre = $HTTP_GET_VARS["texte-libre"]; $code_retour = $HTTP_GET_VARS["code-retour"]; $mac_ok = creditmut_testmac($MAC,$VERSION,$TPE,$date,$montant,$reference,$texte_libre,$code_retour); if ($mac_ok) { // // insert data processing here // // $result=creditmut_creerreponsecm("OK"); } else { $result=creditmut_creerreponsecm("Document Falsifie"); } ?> ]]> </programlisting> </example> <para> See also <function>cybermut_creerformulairecm</function> and <function>cybermut_creerreponsecm</function>. </para> </refsect1> </refentry> <refentry id="function.cybermut-creerreponsecm"> <refnamediv> <refname>cybermut_creerreponsecm</refname> <refpurpose> Generate the acknowledgement of delivery of the confirmation of payment </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>cybermut_creerreponsecm</function></funcdef> <paramdef>string <parameter>phrase</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>cybermut_creerreponsecm</function> returns a string containing delivery aknowledgement message. </para> <para> The parameter is "OK" if the message of confirmation of the payment were correctly auhentified by <function>cybermut_testmac</function>. Any other chain is regarded as an error message. </para> <para> See also <function>cybermut_creerformulairecm</function> and <function>cybermut_testmac</function>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/cyrus.xml +++ phpdoc/kr/functions/cyrus.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.cyrus"> <title>Cyrus IMAP administration functions</title> <titleabbrev>Cyradm functions</titleabbrev> <partintro> <para> undocumented </para> </partintro> <refentry id="function.cyrus-connect"> <refnamediv> <refname>cyrus_connect</refname> <refpurpose>Connect to a Cyrus IMAP server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>cyrus_connect</function></funcdef> <paramdef>string <parameter><optional>host</optional></parameter> </paramdef> <paramdef>string <parameter><optional>port</optional></parameter> </paramdef> <paramdef>int <parameter><optional>flags</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.cyrus-authenticate"> <refnamediv> <refname>cyrus_authenticate</refname> <refpurpose>Authenticate agaings a Cyrus IMAP server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>cyrus_authenticate</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter><optional>mechlist</optional></parameter> </paramdef> <paramdef>string <parameter><optional>service</optional></parameter> </paramdef> <paramdef>string <parameter><optional>user</optional></parameter> </paramdef> <paramdef>int <parameter><optional>minssf</optional></parameter> </paramdef> <paramdef>int <parameter><optional>maxssf</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.cyrus-bind"> <refnamediv> <refname>cyrus_bind</refname> <refpurpose>Bind callbacks to a Cyrus IMAP connection </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>cyrus_bind</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>array <parameter>callbacks</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.cyrus-unbind"> <refnamediv> <refname>cyrus_unbind</refname> <refpurpose>Unbind ... </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>cyrus_unbind</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>trigger_name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.cyrus-query"> <refnamediv> <refname>cyrus_query</refname> <refpurpose>Send a query to a Cyrus IMAP server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>cyrus_query</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>query</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.cyrus-close"> <refnamediv> <refname>cyrus_close</refname> <refpurpose>Close connection to a cyrus server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>cyrus_close</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: --> Index: phpdoc/kr/functions/dbplus.xml +++ phpdoc/kr/functions/dbplus.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.dbplus"> <title>DB++ Functions</title> <titleabbrev>DB++</titleabbrev> <partintro> &warn.experimental; <section id="dbplus.intro"> <title>DB++ Database Functions</title> <para> db++, made by the german company <ulink url="&url.dbplus.company;">Concept asa</ulink>, is a relational database system with high performance and low memory and disk usage in mind. While providing SQL as an additional language interface it is not really a SQL database in the first place but provides its own AQL query language which is much more influenced by the relational algebra then SQL is. </para> <para> Concept asa always had an interest in supporting open source languages, db++ has had Perl and Tcl call interfaces for years now and uses Tcl as its internal stored procedure language. </para> </section> <section id="dbplus.requirenments"> <title>Requirements</title> <para> You need the developement libraries and header files included in every db++ installaion archive. <ulink url="&url.dbplus.company;">Concept asa</ulink> provides additional <ulink url="&url.dbplus.documentation;">documentation</ulink> and <ulink url="&url.dbplus.download;">Demo versions</ulink> of db++ for Linux, some other UNIX versions and Windows95/NT. </para> </section> <section id="dbplus.installation"> <title>Installation</title> <para> Creation and installation of this extension requires the db++ client libraries and header files to be installed on your system. You have to run <command>configure</command> with option <option>--with-dbplus</option> to build this extension. </para> <para> <command>configure</command> looks for the client libraries and header files under the default pathes <filename>/usr/dbplus</filename>, <filename>/usr/local/dbplus</filename> and <filename>/opt/dblus</filename>. If you have installed db++ in a different place you have add the installation path to the <command>configure</command> option like this: <option>--with-dbplus=/your/installation/path</option>. </para> </section> <section id="dbplus.errorcodes"> <title>db++ error codes</title> <para> <table> <title>DB++ Error Codes</title> <tgroup cols="3"> <thead> <row> <entry>PHP Constant</entry> <entry>db++ constant</entry> <entry>meaning</entry> </row> </thead> <tbody> <row> <entry>DBPLUS_ERR_NOERR</entry> <entry>ERR_NOERR</entry> <entry>Null error condition</entry> </row> <row> <entry>DBPLUS_ERR_DUPLICATE</entry> <entry>ERR_DUPLICATE</entry> <entry>Tried to insert a duplicate tuple</entry> </row> <row> <entry>DBPLUS_ERR_EOSCAN</entry> <entry>ERR_EOSCAN</entry> <entry>End of scan from rget()</entry> </row> <row> <entry>DBPLUS_ERR_EMPTY</entry> <entry>ERR_EMPTY</entry> <entry>Relation is empty (server)</entry> </row> <row> <entry>DBPLUS_ERR_CLOSE</entry> <entry>ERR_CLOSE</entry> <entry>The server can't close</entry> </row> <row> <entry>DBPLUS_ERR_WLOCKED</entry> <entry>ERR_WLOCKED</entry> <entry>The record is write locked</entry> </row> <row> <entry>DBPLUS_ERR_LOCKED</entry> <entry>ERR_LOCKED</entry> <entry>Relation was already locked</entry> </row> <row> <entry>DBPLUS_ERR_NOLOCK</entry> <entry>ERR_NOLOCK</entry> <entry>Relation cannot be locked</entry> </row> <row> <entry>DBPLUS_ERR_READ</entry> <entry>ERR_READ</entry> <entry>Read error on relation</entry> </row> <row> <entry>DBPLUS_ERR_WRITE</entry> <entry>ERR_WRITE</entry> <entry>Write error on relation</entry> </row> <row> <entry>DBPLUS_ERR_CREATE</entry> <entry>ERR_CREATE</entry> <entry>Create() system call failed</entry> </row> <row> <entry>DBPLUS_ERR_LSEEK</entry> <entry>ERR_LSEEK</entry> <entry>Lseek() system call failed</entry> </row> <row> <entry>DBPLUS_ERR_LENGTH</entry> <entry>ERR_LENGTH</entry> <entry>Tuple exceeds maximum length</entry> </row> <row> <entry>DBPLUS_ERR_OPEN</entry> <entry>ERR_OPEN</entry> <entry>Open() system call failed</entry> </row> <row> <entry>DBPLUS_ERR_WOPEN</entry> <entry>ERR_WOPEN</entry> <entry>Relation already opened for writing</entry> </row> <row> <entry>DBPLUS_ERR_MAGIC</entry> <entry>ERR_MAGIC</entry> <entry>File is not a relation</entry> </row> <row> <entry>DBPLUS_ERR_VERSION</entry> <entry>ERR_VERSION</entry> <entry>File is a very old relation</entry> </row> <row> <entry>DBPLUS_ERR_PGSIZE</entry> <entry>ERR_PGSIZE</entry> <entry>Relation uses a different page size</entry> </row> <row> <entry>DBPLUS_ERR_CRC</entry> <entry>ERR_CRC</entry> <entry>Invalid crc in the superpage</entry> </row> <row> <entry>DBPLUS_ERR_PIPE</entry> <entry>ERR_PIPE</entry> <entry>Piped relation requires lseek()</entry> </row> <row> <entry>DBPLUS_ERR_NIDX</entry> <entry>ERR_NIDX</entry> <entry>Too many secondary indices</entry> </row> <row> <entry>DBPLUS_ERR_MALLOC</entry> <entry>ERR_MALLOC</entry> <entry>Malloc() call failed</entry> </row> <row> <entry>DBPLUS_ERR_NUSERS</entry> <entry>ERR_NUSERS</entry> <entry>Error use of max users</entry> </row> <row> <entry>DBPLUS_ERR_PREEXIT</entry> <entry>ERR_PREEXIT</entry> <entry>Caused by invalid usage</entry> </row> <row> <entry>DBPLUS_ERR_ONTRAP</entry> <entry>ERR_ONTRAP</entry> <entry>Caused by a signal</entry> </row> <row> <entry>DBPLUS_ERR_PREPROC</entry> <entry>ERR_PREPROC</entry> <entry>Error in the preprocessor</entry> </row> <row> <entry>DBPLUS_ERR_DBPARSE</entry> <entry>ERR_DBPARSE</entry> <entry>Error in the parser</entry> </row> <row> <entry>DBPLUS_ERR_DBRUNERR</entry> <entry>ERR_DBRUNERR</entry> <entry>Run error in db</entry> </row> <row> <entry>DBPLUS_ERR_DBPREEXIT</entry> <entry>ERR_DBPREEXIT</entry> <entry>Exit condition caused by prexit() * procedure</entry> </row> <row> <entry>DBPLUS_ERR_WAIT</entry> <entry>ERR_WAIT</entry> <entry>Wait a little (Simple only)</entry> </row> <row> <entry>DBPLUS_ERR_CORRUPT_TUPLE</entry> <entry>ERR_CORRUPT_TUPLE</entry> <entry>A client sent a corrupt tuple</entry> </row> <row> <entry>DBPLUS_ERR_WARNING0</entry> <entry>ERR_WARNING0</entry> <entry> The Simple routines encountered a non fatal error which was corrected </entry> </row> <row> <entry>DBPLUS_ERR_PANIC</entry> <entry>ERR_PANIC</entry> <entry> The server should not really die but after a disaster send ERR_PANIC to all its clients </entry> </row> <row> <entry>DBPLUS_ERR_FIFO</entry> <entry>ERR_FIFO</entry> <entry>Can't create a fifo</entry> </row> <row> <entry>DBPLUS_ERR_PERM</entry> <entry>ERR_PERM</entry> <entry>Permission denied</entry> </row> <row> <entry>DBPLUS_ERR_TCL</entry> <entry>ERR_TCL</entry> <entry>TCL_error</entry> </row> <row> <entry>DBPLUS_ERR_RESTRICTED</entry> <entry>ERR_RESTRICTED</entry> <entry>Only two users</entry> </row> <row> <entry>DBPLUS_ERR_USER</entry> <entry>ERR_USER</entry> <entry> An error in the use of the library by an application programmer </entry> </row> <row> <entry>DBPLUS_ERR_UNKNOWN</entry> <entry>ERR_UNKNOWN</entry> <entry></entry> </row> </tbody> </tgroup> </table> </para> </section> </partintro> <refentry id="function.dbplus-add"> <refnamediv> <refname>dbplus_add</refname> <refpurpose>Add a tuple to a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_add</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> This function will add a tuple to a relation. The <parameter>tuple</parameter> data is an array of attribute/value pairs to be inserted into the given <parameter>relation</parameter>. After successfull execution the <parameter>tuple</parameter> array will contain the complete data of the newly created tuple, including all implicitly set domain fields like sequences. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> </refsect1> </refentry> <refentry id="function.dbplus-aql"> <refnamediv> <refname>dbplus_aql</refname> <refpurpose>Perform AQL query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_aql</function></funcdef> <paramdef>string <parameter>query</parameter></paramdef> <paramdef>string <parameter><optional>server</optional></parameter> </paramdef> <paramdef>string <parameter><optional>dbpath</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_aql</function> will execute an AQL <parameter>query</parameter> on the given <parameter>server</parameter> and <parameter>dbpath</parameter>. </para> <para> On success it will return a relation handle. The result data may be fetched from this relation by calling <function>dbplus_next</function> and <function>dbplus_current</function>. Other relation access functions will not work on a result relation. </para> <para> Further information on the AQL A... Query Language is provided in the opriginal db++ manual. </para> </refsect1> </refentry> <refentry id="function.dbplus-chdir"> <refnamediv> <refname>dbplus_chdir</refname> <refpurpose>Get/Set database virtual current directory</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dbplus_chdir</function></funcdef> <paramdef>string <parameter><optional>newdir</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_chdir</function> will change the virtual current directory where relation files will be looked for by <function>dbplus_open</function>. <function>dbplus_chdir</function> will return the absolute path of the current directory. Calling <function>dbplus_chdir</function> without giving any <parameter>newdir</parameter> may be used to query the current working directory. </para> </refsect1> </refentry> <refentry id="function.dbplus-close"> <refnamediv> <refname>dbplus_close</refname> <refpurpose>Close a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_close</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Calling <function>dbplus_close</function> will close a relation previously opened by <function>dbplus_open</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-curr"> <refnamediv> <refname>dbplus_curr</refname> <refpurpose>Get current tuple from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_curr</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_curr</function> will read the data for the current tuple for the given <parameter>relation</parameter> and will pass it back as an associative array in <parameter>tuple</parameter>. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> <para> See also <function>dbplus_first</function>, <function>dbplus_prev</function>, <function>dbplus_next</function>, and <function>dbplus_last</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-errcode"> <refnamediv> <refname>dbplus_errcode</refname> <refpurpose> Get error string for given errorcode or last error </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dbplus_errcode</function></funcdef> <paramdef>int <parameter>errno</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_errcode</function> returns a cleartext error string for the error code passed as <parameter>errno</parameter> of for the result code of the last db++ operation if no parameter is given. </para> </refsect1> </refentry> <refentry id="function.dbplus-errno"> <refnamediv> <refname>dbplus_errno</refname> <refpurpose>Get error code for last operation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_errno</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_errno</function> will return the error code returned by the last db++ operation. </para> <para> See also <function>dbplus_errcode</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-find"> <refnamediv> <refname>dbplus_find</refname> <refpurpose>Set a constraint on a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_find</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>constraints</parameter></paramdef> <paramdef>mixed <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_find</function> will place a constraint on the given relation. Further calls to functions like <function>dbplus_curr</function> or <function>dbplus_next</function> will only return tuples matching the given constraints. </para> <para> Constraints are triplets of strings containing of a domain name, a comparison operator and a comparison value. The <parameter>constraints</parameter> parameter array may consist of a collection of string arrays, each of which contains a domain, an operator and a value, or of a single string array containing a multiple of three elements. </para> <para> The comparison operator may be one of the following strings: '==', '&gt;', '&gt;=', '&lt;', '&lt;=', '!=', '~' for a regular expression match and 'BAND' or 'BOR' for bitwise operations. </para> <para> See also <function>dbplus_unselect</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-first"> <refnamediv> <refname>dbplus_first</refname> <refpurpose>Get first tuple from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_first</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_curr</function> will read the data for the first tuple for the given <parameter>relation</parameter>, make it the current tuple and pass it back as an associative array in <parameter>tuple</parameter>. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> <para> See also <function>dbplus_curr</function>, <function>dbplus_prev</function>, <function>dbplus_next</function>, and <function>dbplus_last</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-flush"> <refnamediv> <refname>dbplus_flush</refname> <refpurpose>Flush all changes made on a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_flush</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_flush</function> will write all changes applied to <parameter>relation</parameter> since the last flush to disk. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> </refsect1> </refentry> <refentry id="function.dbplus-freealllocks"> <refnamediv> <refname>dbplus_freealllocks</refname> <refpurpose>Free all locks held by this client</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_freealllocks</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_freeaalllocks</function> will free all tuple locks held by this client. </para> <para> See also <function>dbplus_getlock</function>, <function>dbplus_freelock</function>, and <function>dbplus_freerlocks</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-freelock"> <refnamediv> <refname>dbplus_freelock</refname> <refpurpose>Release write lock on tuple</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_freelock</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>string <parameter>tname</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_freelock</function> will release a write lock on the given <parameter>tuple</parameter> previously obtained by <function>dbplus_getlock</function>. </para> <para> See also <function>dbplus_getlock</function>, <function>dbplus_freerlocks</function>, and <function>dbplus_freealllocks</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-freerlocks"> <refnamediv> <refname>dbplus_freerlocks</refname> <refpurpose>Free all tuple locks on given relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_freerlocks</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_freerlocks</function> will free all tuple locks held on the given <parameter>relation</parameter>. </para> <para> See also <function>dbplus_getlock</function>, <function>dbplus_freelock</function>, and <function>dbplus_freealllocks</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-getlock"> <refnamediv> <refname>dbplus_getlock</refname> <refpurpose>Get a write lock on a tuple</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_getlock</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>string <parameter>tname</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_getlock</function> will request a write lock on the speified <parameter>tuple</parameter>. It will return zero on success or a non-zero error code, especially DBPLUS_ERR_WLOCKED, on failure. </para> <para> See also <function>dbplus_freelock</function>, <function>dbplus_freerlocks</function>, and <function>dbplus_freealllocks</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-getunique"> <refnamediv> <refname>dbplus_getunique</refname> <refpurpose>Get a id number unique to a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_getunique</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>int <parameter>uniqueid</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_getunique</function> will obtain a number guaranteed to be unique for the given <parameter>relation</parameter> and will pass it back in the variable given as <parameter>uniqueid</parameter>. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> </refsect1> </refentry> <refentry id="function.dbplus-info"> <refnamediv> <refname>dbplus_info</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_info</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>string <parameter>key</parameter></paramdef> <paramdef>array <parameter></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-last"> <refnamediv> <refname>dbplus_last</refname> <refpurpose>Get last tuple from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_last</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_curr</function> will read the data for the last tuple for the given <parameter>relation</parameter>, make it the current tuple and pass it back as an associative array in <parameter>tuple</parameter>. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> <para> See also <function>dbplus_first</function>, <function>dbplus_curr</function>, <function>dbplus_prev</function>, and <function>dbplus_next</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-lockrel"> <refnamediv> <refname>dbplus_lockrel</refname> <refpurpose>Request write lock on relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_lockrel</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_lockrel</function> will request a write lock on the given relation. Other clients may still query the relation, but can't alter it while it is locked. </para> </refsect1> </refentry> <refentry id="function.dbplus-next"> <refnamediv> <refname>dbplus_next</refname> <refpurpose>Get next tuple from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_next</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_curr</function> will read the data for the next tuple for the given <parameter>relation</parameter>, will make it the current tuple and will pass it back as an associative array in <parameter>tuple</parameter>. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> <para> See also <function>dbplus_first</function>, <function>dbplus_curr</function>, <function>dbplus_prev</function>, and <function>dbplus_last</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-open"> <refnamediv> <refname>dbplus_open</refname> <refpurpose>Open relation file</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_open</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> The relation file <parameter>name</parameter> will be opened. <parameter>name</parameter> can be either a file name or a relative or absolute path name. This will be mapped in any case to an absolute relation file path on a specific host machine and server. </para> <para> On success a relation file resource (cursor) is returned which must be used in any subsequent commanads referencing the relation. Failure leads to a zero return value, the actual error code may be asked for by calling <function>dbplus_errno</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-prev"> <refnamediv> <refname>dbplus_prev</refname> <refpurpose>Get previous tuple from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_prev</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_curr</function> will read the data for the next tuple for the given <parameter>relation</parameter>, will make it the current tuple and will pass it back as an associative array in <parameter>tuple</parameter>. </para> <para> The function will return zero (aka. DBPLUS_ERR_NOERR) on success or a db++ error code on failure. See <function>dbplus_errcode</function> or the introduction to this chapter for more information on db++ error codes. </para> <para> See also <function>dbplus_first</function>, <function>dbplus_curr</function>, <function>dbplus_next</function>, and <function>dbplus_last</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-rchperm"> <refnamediv> <refname>dbplus_rchperm</refname> <refpurpose>Change relation permissions</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_rchperm</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>int <parameter>mask</parameter></paramdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>group</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rchperm</function> will change access permissions as specified by <parameter>mask</parameter>, <parameter>user</parameter> and <parameter>group</parameter>. The values for these are operating system specific. </para> </refsect1> </refentry> <refentry id="function.dbplus-rcreate"> <refnamediv> <refname>dbplus_rcreate</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_rcreate</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>mixed <parameter>domlist</parameter></paramdef> <paramdef>boolean <parameter><optional>overwrite</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rcreate</function> will create a new relation named <parameter>name</parameter>. An existing relation by the same name will only be overwritten if the relation is currently not in use and <parameter>overwrite</parameter> is set to TRUE. </para> <para> <parameter>domlist</parameter> should contain the domain specification for the new relation within an array of domain description strings. ( <function>dbplus_rcreate</function> will also accept a string with space delimited domain description strings, but it is recommended to use an array). A domain description string consists of a domain name unique to this relation, a slash and a type specification character. See the db++ documentatiion, especially the dbcreate(1) manpage, for a description of available type specifiers and their meanings. </para> </refsect1> </refentry> <refentry id="function.dbplus-rcrtexact"> <refnamediv> <refname>dbplus_rcrtexact</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_rcrtexact</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>boolean <parameter>overwrite</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rcrtexact</function> will create an exact but empty copy of the given <parameter>relation</parameter> under a new <parameter>name</parameter>. An existing relation by the same <parameter>name</parameter> will only be overwritten if <parameter>overwrite</parameter> is TRUE and no other process is currently using the relation. </para> </refsect1> </refentry> <refentry id="function.dbplus-rcrtlike"> <refnamediv> <refname>dbplus_rcrtlike</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_rcrtlike</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>int <parameter>flag</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rcrtexact</function> will create an empty copy of the given <parameter>relation</parameter> under a new <parameter>name</parameter>, but with default indices. An existing relation by the same <parameter>name</parameter> will only be overwritten if <parameter>overwrite</parameter> is TRUE and no other process is currently using the relation. </para> </refsect1> </refentry> <refentry id="function.dbplus-resolve"> <refnamediv> <refname>dbplus_resolve</refname> <refpurpose>Resolve host information for relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_resolve</function></funcdef> <paramdef>string <parameter>relation_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_resolve</function> will try to resolve the given <parameter>relation_name</parameter> and find out internal server id, real hostname and the database path on this host. The function will return an array containing these values under the keys 'sid', 'host' and 'host_path' or &false; on error. </para> <para> See also <function>dbplus_tcl</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-rkeys"> <refnamediv> <refname>dbplus_rkeys</refname> <refpurpose>Specify new primary key for a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_rkeys</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>mixed <parameter>domlist</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rkeys</function> will replace the current primary key for <parameter>relation</parameter> with the combination of domains specified by <parameter>domlist</parameter>. </para> <para> <parameter>domlist</parameter> may be passed as a single domain name string or as an array of domain names. </para> </refsect1> </refentry> <refentry id="function.dbplus-restorepos"> <refnamediv> <refname>dbplus_restorepos</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_restorepos</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-ropen"> <refnamediv> <refname>dbplus_ropen</refname> <refpurpose>Open relation file local</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_ropen</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_ropen</function> will open the relation <parameter>file</parameter> localy for quick access without any client/server overhead. Access is read only and only <function>dbplus_current</function> and <function>dbplus_next</function> may be applied to the returned relation. </para> </refsect1> </refentry> <refentry id="function.dbplus-rquery"> <refnamediv> <refname>dbplus_rquery</refname> <refpurpose>Perform local (raw) AQL query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_rquery</function></funcdef> <paramdef>string <parameter>query</parameter></paramdef> <paramdef>string <parameter>dbpath</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rquery</function> performs a local (raw) AQL query using an AQL interpreter embedded into the db++ client library. <function>dbplus_rquery</function> is faster than <function>dbplus_aql</function> but will work on local data only. </para> </refsect1> </refentry> <refentry id="function.dbplus-rrename"> <refnamediv> <refname>dbplus_rrename</refname> <refpurpose>Rename a relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_rrename</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rrename</function> will change the name of <parameter>relation</parameter> to <parameter>name</parameter>. </para> </refsect1> </refentry> <refentry id="function.dbplus-rsecindex"> <refnamediv> <refname>dbplus_rsecindex</refname> <refpurpose> Create a new secondary index for a relation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_rsecindex</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>mixed <parameter>domlist</parameter></paramdef> <paramdef>int <parameter>type</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rsecindex</function> will create a new secondary index for <parameter>relation</parameter> with consists of the domains specified by <parameter>domlist</parameter> and is of type <parameter>type</parameter> </para> <para> <parameter>domlist</parameter> may be passed as a single domain name string or as an array of domain names. </para> </refsect1> </refentry> <refentry id="function.dbplus-runlink"> <refnamediv> <refname>dbplus_runlink</refname> <refpurpose>Remove relation from filesystem</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_runlink</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_unlink</function> will close and remove the <parameter>relation</parameter>. </para> </refsect1> </refentry> <refentry id="function.dbplus-rzap"> <refnamediv> <refname>dbplus_rzap</refname> <refpurpose>Remove all tuples from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_rzap</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_rzap</function> will remove all tuples from <parameter>relation</parameter>. </para> </refsect1> </refentry> <refentry id="function.dbplus-savepos"> <refnamediv> <refname>dbplus_savepos</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_savepos</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-setindex"> <refnamediv> <refname>dbplus_setindex</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_setindex</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>string <parameter>idx_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-setindexbynumber"> <refnamediv> <refname>dbplus_setindexbynumber</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_setindexbynumber</function> </funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>int <parameter>idx_number</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-sql"> <refnamediv> <refname>dbplus_sql</refname> <refpurpose>Perform SQL query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dbplus_sql</function></funcdef> <paramdef>string <parameter>query</parameter></paramdef> <paramdef>string <parameter>server</parameter></paramdef> <paramdef>string <parameter>dbpath</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-tcl"> <refnamediv> <refname>dbplus_tcl</refname> <refpurpose>Execute TCL code on server side</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_tcl</function></funcdef> <paramdef>int <parameter>sid</parameter></paramdef> <paramdef>string <parameter>script</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> A db++ server will prepare a TCL interpreter for each client connection. This interpreter will enable the server to execute TCL code provided by the client as a sort of stored procedures to improve the performance of database operations by avoiding client/server data transfers and context switches. </para> <para> <function>dbplus_tcl</function> needs to pass the client connection id the TCL <parameter>script</parameter> code should be executed by. <function>dbplus_resolve</function> will provide this connection id. The function will return whatever the TCL code returns or a TCL error message if the TCL code fails. </para> <para> See also <function>dbplus_resolve</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-tremove"> <refnamediv> <refname>dbplus_tremove</refname> <refpurpose>Remove tuple and return new current tuple</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_tremove</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>tuple</parameter></paramdef> <paramdef>array <parameter><optional>current</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_tremove</function> removes <parameter>tuple</parameter> from <parameter>relation</parameter> if it perfectly matches a tuple within the relation. <parameter>current</parameter>, if given, will contain the data of the new current tuple after calling <function>dbplus_tremove</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-undo"> <refnamediv> <refname>dbplus_undo</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_undo</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-undoprepare"> <refnamediv> <refname>dbplus_undoprepare</refname> <refpurpose>???</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_undoprepare</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Not implemented yet. </para> </refsect1> </refentry> <refentry id="function.dbplus-unlockrel"> <refnamediv> <refname>dbplus_unlockrel</refname> <refpurpose>Give up write lock on relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_unlockrel</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_unlockrel</function> will release a write lock previously obtained by <function>dbplus_lockrel</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-unselect"> <refnamediv> <refname>dbplus_unselect</refname> <refpurpose>Remove a constraint from relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_unselect</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Calling <function>dbplus_unselect</function> will remove a constraint previously set by <function>dbplus_find</function> on <parameter>relation</parameter>. </para> </refsect1> </refentry> <refentry id="function.dbplus-update"> <refnamediv> <refname>dbplus_update</refname> <refpurpose>Update specified tuple in relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_update</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> <paramdef>array <parameter>old</parameter></paramdef> <paramdef>array <parameter>new</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_update</function> replaces the tuple given by <parameter>old</parameter> with the data from <parameter>new</parameter> if and only if <parameter>old</parameter> completely matches a tuple within <parameter>relation</parameter>. </para> </refsect1> </refentry> <refentry id="function.dbplus-xlockrel"> <refnamediv> <refname>dbplus_xlockrel</refname> <refpurpose>Request exclusive lock on relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_xlockrel</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_xlockrel</function> will request an exclusive lock on <parameter>relation</parameter> preventing even read access from other clients. </para> <para> See also <function>dbplus_xunlockrel</function>. </para> </refsect1> </refentry> <refentry id="function.dbplus-xunlockrel"> <refnamediv> <refname>dbplus_xunlockrel</refname> <refpurpose>Free exclusive lock on relation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbplus_xunlockrel</function></funcdef> <paramdef>resource <parameter>relation</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>dbplus_xunlockrel</function> will release an exclusive lock on <parameter>relation</parameter> previously obtained by <function>dbplus_xlockrel</function>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/dbx.xml +++ phpdoc/kr/functions/dbx.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.dbx"> <title>dbx functions</title> <titleabbrev>dbx</titleabbrev> <partintro> &warn.experimental; <simpara> The dbx module is a database abstraction layer (db 'X', where 'X' is a supported database). The dbx functions allow you to access all supported databases using a single calling convention. In order to have these functions available, you must compile PHP with dbx support by using the <link linkend="install.configure.enable-dbx"> <option role="configure">--enable-dbx</option></link> option and all options for the databases that will be used, e.g. for MySQL you must also specify <link linkend="install.configure.with-mysql"> <option role="install.configure.with-mysql">--with-mysql</option></link>. The dbx-functions themselves do not interface directly to the databases, but interface to the modules that are used to support these databases. To be able to use a database with the dbx-module, the module must be either linked or loaded into PHP, and the database module must be supported by the dbx-module. Currently, MySQL, PostgreSQL, Microsoft SQL Server, FrontBase and ODBC are supported, but others will follow (soon, I hope :-). </simpara> <simpara> Documentation for adding additional database support to dbx can be found at <ulink url="&url.dbx.docs;">&url.dbx.docs;</ulink>. </simpara> </partintro> <refentry id="function.dbx-close"> <refnamediv> <refname>dbx_close</refname> <refpurpose>Close an open connection/database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>dbx_close</function></funcdef> <paramdef>dbx_link_object <parameter>link_identifier</parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Returns &true; on success, &false; on error. </para> <example> <title><function>dbx_close</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = dbx_connect ("mysql", "localhost", "db", "username", "password") or die ("Could not connect"); print("Connected successfully"); dbx_close($link); ?> ]]> </programlisting> </example> <note> <para> Always refer to the module-specific documentation as well. </para> </note> <para> See also: <function>dbx_connect</function>. </para> </refsect1> </refentry> <refentry id="function.dbx-connect"> <refnamediv> <refname>dbx_connect</refname> <refpurpose>Open a connection/database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>dbx_link_object <function>dbx_connect</function></funcdef> <paramdef>string <parameter>module</parameter></paramdef> <paramdef>string <parameter>host</parameter></paramdef> <paramdef>string <parameter>database</parameter></paramdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> <paramdef>int <parameter><optional>persistent</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Returns: a dbx_link_object on success, &false; on error. If a connection has been made but the database could not be selected, the connection is closed and &false; is returned. The 'persistent' parameter can be set to DBX_PERSISTENT so a persistent connection will be created. </para> <para> The <parameter>module</parameter> parameter can be either a string or a constant. The possible values are given below, but keep in mind that they only work if the module is actually loaded. </para> <para> <itemizedlist> <listitem> <simpara> module DBX_MYSQL : "mysql" </simpara> </listitem> <listitem> <simpara> module DBX_ODBC : "odbc" </simpara> </listitem> <listitem> <simpara> module DBX_PGSQL : "pgsql" </simpara> </listitem> <listitem> <simpara> module DBX_MSSQL : "mssql" </simpara> </listitem> <listitem> <simpara> module DBX_FBSQL : "fbsql" (CVS only) </simpara> </listitem> </itemizedlist> </para> <para> The dbx_link_object has three members, a 'handle', a 'module' and a 'database'. The 'database' member is the name of the currently selected database. The 'module' member is for internal use by dbx only, and is actually the module number mentioned above. The 'handle' member is a valid handle for the connected database, and as such can be used in module-specific functions (if required), e.g. </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ <?php $link = dbx_connect ("mysql", "localhost", "db", "username", "password"); mysql_close ($link->handle); // dbx_close($link) would be better here ?> ]]> </programlisting> </informalexample> </para> <para> Host, database, username and password parameters are expected, but not always used, depending on the connect-functions for the abstracted module. </para> <para> <example> <title><function>dbx_connect</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = dbx_connect ("odbc", "", "db", "username", "password", DBX_PERSISTENT) or die ("Could not connect"); print ("Connected successfully"); dbx_close ($link); ?> ]]> </programlisting> </example> <note> <para> Always refer to the module-specific documentation as well. </para> </note> </para> <para> See also: <function>dbx_close</function>. </para> </refsect1> </refentry> <refentry id="function.dbx-error"> <refnamediv> <refname>dbx_error</refname> <refpurpose> Report the error message of the latest function call in the module (not just in the connection) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dbx_error</function></funcdef> <paramdef>dbx_link_object <parameter>link_identifier</parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Returns a string containing the error-message from the last function call of the module (e.g. mysql-module). If there are multiple connections on the same module, just the last error is given. If there are connections on different modules, the latest error is returned for the specified module (specified by the link parameter, that is). Note that the ODBC-module doesn't support an error_reporting function at the moment. </para> <example> <title><function>dbx_error</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = dbx_connect ("mysql", "localhost", "db", "username", "password") or die ("Could not connect"); $result = dbx_query ($link, "select id from nonexistingtbl"); if ($result==0) { echo dbx_error ($link); } dbx_close ($link); ?> ]]> </programlisting> </example> <note> <para> Always refer to the module-specific documentation as well. </para> <para> The error-message for Microsoft SQL Server is actually the result of the <function>mssql_get_last_message</function> function. </para> </note> </refsect1> </refentry> <refentry id="function.dbx-query"> <refnamediv> <refname>dbx_query</refname> <refpurpose>Send a query and fetch all results (if any)</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>dbx_result_object <function>dbx_query</function></funcdef> <paramdef>dbx_link_object <parameter>link_identifier</parameter> </paramdef> <paramdef>string <parameter>sql_statement</parameter></paramdef> <paramdef>long <parameter><optional>flags</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Returns a dbx_result_object or 1 on success (a result object is only returned for sql-statements that return results) or 0 on failure. The <parameter>flags</parameter> parameter is used to control the amount of information that is returned. It may be any combination of the constants DBX_RESULT_INFO, DBX_RESULT_INDEX, DBX_RESULT_ASSOC, OR-ed together. DBX_RESULT_INFO provides info about columns, such as field names and field types. DBX_RESULT_INDEX returns the results in a 2d indexed array (e.g. data[2][3], where 2 is the row (or record) number and 3 is the column (or field) number), where the first row and column are indexed at 0. DBX_RESULT_ASSOC associates the column indices with field names. Note that DBX_RESULT_INDEX is always returned, regardless of the <parameter>flags</parameter> parameter. If DBX_RESULT_ASSOC is specified, DBX_RESULT_INFO is also returned even if it wasn't specified. This means that effectively only the combinations DBX_RESULT_INDEX, DBX_RESULT_INDEX | DBX_RESULT_INFO and DBX_RESULT_INDEX | DBX_RESULT_INFO | DBX_RESULT_ASSOC are possible. This last combination is the default if the <parameter>flags</parameter> parameter isn't specified. Associated results are actual references to the indexed data, so if you modify <literal>data[0][0]</literal>, then <literal>data[0]['fieldnameforfirstcolumn']</literal> is modified as well. </para> <para> A dbx_result_object has five members (possibly four depending on <parameter>flags</parameter>), 'handle', 'cols', 'rows', 'info' (optional) and 'data'. Handle is a valid result identifier for the specified module, and as such can be used in module-specific functions, as seen in the example: </para> <para> <informalexample role="php"> <programlisting> <![CDATA[ $result = dbx_query ($link, "SELECT id FROM tbl"); mysql_field_len ($result->handle, 0); ]]> </programlisting> </informalexample> </para> <para> The cols and rows members contain the number of columns (or fields) and rows (or records) respectively, e.g. </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ $result = dbx_query ($link, "SELECT id FROM tbl"); echo "result size: " . $result->rows . " x " . $result->cols . "<br>\n"; ]]> </programlisting> </informalexample> </para> <para> The info member is only returned if DBX_RESULT_INFO and/or DBX_RESULT_ASSOC are specified in the <parameter>flags</parameter> parameter. It is a 2d array, that has two named rows ("name" and "type") to retrieve column information, e.g. </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ $result = dbx_query ($link, "SELECT id FROM tbl"); echo "column name: " . $result->info["name"][0] . "<br>\n"; echo "column type: " . $result->info["type"][0] . "<br>\n"; ]]> </programlisting> </informalexample> </para> <para> The data member contains the actual resulting data, possibly associated with column names as well. If DBX_RESULT_ASSOC is set, it is possible to use <literal>$result->data[2]["fieldname"]</literal>. </para> <example> <title><function>dbx_query</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = dbx_connect ("odbc", "", "db", "username", "password") or die ("Could not connect"); $result = dbx_query ($link, "SELECT id, parentid, description FROM tbl"); if ($result==0) echo "Query failed\n<br>"; elseif ($result==1) { echo "Query executed successfully\n<br>"; } else { $rows=$result->rows; $cols=$result->cols; echo "<p>table dimension: {$result->rows} x {$result->cols}<br><table border=1>\n"; echo "<tr>"; for ($col=0; $col<$cols; ++$col) { echo "<td>-{$result->info["name"][$col]}-<br>-{$result->info["type"][$col]}-</td>"; } echo "</tr>\n"; for ($row=0; $row<$rows; ++$row){ echo "<tr>"; for ($col=0; $col<$cols; ++$col) { echo "<td>-{$result->data[$row][$col]}-</td>"; } echo "</tr>\n"; } echo "</table><p>\n"; echo "table dimension: {$result->rows} x id, parentid, description<br><table border=1>\n"; for ($row=0; $row<$rows; ++$row) { echo "<tr>"; echo "<td>-{$result->data[$row]["id"]}-</td>"; echo "<td>-{$result->data[$row]["parentid"]}-</td>"; echo "<td>-{$result->data[$row]["description"]}-</td>"; echo "</tr>\n"; } echo "</table><p>\n"; } dbx_close($link); ?> ]]> </programlisting> </example> <note> <para> Always refer to the module-specific documentation as well. </para> </note> <para> See also: <function>dbx_connect</function>. </para> </refsect1> </refentry> <refentry id="function.dbx-sort"> <refnamediv> <refname>dbx_sort</refname> <refpurpose> Sort a result from a dbx_query by a custom sort function </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>dbx_sort</function></funcdef> <paramdef>dbx_result_object <parameter>result</parameter></paramdef> <paramdef>string <parameter>user_compare_function</parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Returns &true; on success, &false; on error. </para> <example> <title><function>dbx_sort</function> example</title> <programlisting role="php"> <![CDATA[ <?php function user_re_order ($a, $b) { $rv = dbx_compare ($a, $b, "parentid", DBX_CMP_DESC); if (!$rv) $rv = dbx_compare ($a, $b, "id"); return $rv; } $link = dbx_connect ("odbc", "", "db", "username", "password") or die ("Could not connect"); $result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id"); echo "resulting data is now ordered by id<br>"; dbx_sort ($result, "user_re_order"); echo "resulting data is now ordered by parentid (descending), then by id<br>"; dbx_close ($link); ?> ]]> </programlisting> </example> <para> See also <function>dbx_compare</function>. </para> </refsect1> </refentry> <refentry id="function.dbx-compare"> <refnamediv> <refname>dbx_compare</refname> <refpurpose>Compare two rows for sorting purposes</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dbx_compare</function></funcdef> <paramdef>array <parameter>row_a</parameter></paramdef> <paramdef>array <parameter>row_b</parameter></paramdef> <paramdef>string <parameter>columnname_or_index</parameter></paramdef> <paramdef>int <parameter><optional>flags</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Returns 0 if row_a[$columnname_or_index] is equal to row_b[$columnname_or_index], 1 if it is greater and -1 if it is smaller (or vice versa if the DBX_CMP_DESC flag is set). </para> <para> The <parameter>flags</parameter> can be set to specify comparison direction (whether sorting is ascending or descending) and comparison type (force string or numeric compare by converting the data). The constants for direction are DBX_CMP_ASC and DBX_CMP_DESC. The constants for comparison type are DBX_CMP_NATIVE (no conversion), DBX_CMP_TEXT and DBX_CMP_NUMBER. These constants can be OR-ed together. The default value for the <parameter>flags</parameter> parameter is DBX_CMP_ASC | DBX_CMP_NATIVE. </para> <example> <title><function>dbx_compare</function> example</title> <programlisting role="php"> <![CDATA[ <?php function user_re_order ($a, $b) { $rv = dbx_compare ($a, $b, "parentid", DBX_CMP_DESC); if (!$rv) { $rv = dbx_compare ($a, $b, "id"); return $rv; } } $link = dbx_connect ("odbc", "", "db", "username", "password") or die ("Could not connect"); $result = dbx_query ($link, "SELECT id, parentid, description FROM tbl ORDER BY id"); echo "resulting data is now ordered by id<br>"; dbx_sort ($result, "user_re_order"); echo "resulting data is now ordered by parentid (descending), then by id<br>"; dbx_close ($link); ?> ]]> </programlisting> </example> <para> See also <function>dbx_sort</function>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/dio.xml +++ phpdoc/kr/functions/dio.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.dio"> <title>Direct IO functions</title> <titleabbrev>DIO functions</titleabbrev> <partintro> <para> Undocumented </para> </partintro> <refentry id="function.dio-open"> <refnamediv> <refname>dio_open</refname> <refpurpose>Open a new filename with specified permissions of flags and creation permissions of mode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>dio_open</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>int <parameter>flags</parameter></paramdef> <paramdef>int <parameter><optional>mode</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-read"> <refnamediv> <refname>dio_read</refname> <refpurpose>Read n bytes from fd and return them, if n is not specified, read 1k </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>dio_read</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> <paramdef>int <parameter><optional>n</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-write"> <refnamediv> <refname>dio_write</refname> <refpurpose>Write data to fd with optional truncation at length </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dio_write</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> <paramdef>string <parameter>data</parameter></paramdef> <paramdef>int <parameter><optional>len</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-truncate"> <refnamediv> <refname>dio_truncate</refname> <refpurpose>Truncate file descriptor fd to offset bytes </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>dio_truncate</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> <paramdef>int <parameter>offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-stat"> <refnamediv> <refname>dio_stat</refname> <refpurpose>Get stat information about the file descriptor fd </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>dio_stat</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-seek"> <refnamediv> <refname>dio_seek</refname> <refpurpose>Seek to pos on fd from whence </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dio_seek</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> <paramdef>int <parameter>pos</parameter></paramdef> <paramdef>int <parameter>whence</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-fcntl"> <refnamediv> <refname>dio_fcntl</refname> <refpurpose>Perform a c library fcntl on fd </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>dio_fcntl</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> <paramdef>int <parameter>cmd</parameter></paramdef> <paramdef>mixed <parameter><optional>arg</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.dio-close"> <refnamediv> <refname>dio_close</refname> <refpurpose>Close the file descriptor given by fd </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>dio_close</function></funcdef> <paramdef>resource <parameter>fd</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: --> Index: phpdoc/kr/functions/dotnet.xml +++ phpdoc/kr/functions/dotnet.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.dotnet"> <title>.NET functions</title> <titleabbrev>.NET functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.dotnet-load"> <refnamediv> <refname>dotnet_load</refname> <refpurpose>Loads a DOTNET module</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>dotnet_load</function></funcdef> <paramdef>string <parameter>assembly_name</parameter></paramdef> <paramdef>string <parameter><optional>datatype_name</optional></parameter> </paramdef> <paramdef>int <parameter><optional>codepage</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/fbsql.xml +++ phpdoc/kr/functions/fbsql.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.fbsql"> <title>FrontBase Functions</title> <titleabbrev>FrontBase</titleabbrev> <partintro> <simpara> These functions allow you to access FrontBase database servers. In order to have these functions available, you must compile php with fbsql support by using the <option role="configure">--with-fbsql</option> option. If you use this option without specifying the path to fbsql, php will search for the fbsql client libraries in the default installation location for the platform. Users who installed FrontBase in a non standard directory should always specify the path to fbsql: <option role="configure">--with-fbsql=/path/to/fbsql</option>. This will force php to use the client libraries installed by FrontBase, avoiding any conflicts. </simpara> <simpara> More information about FrontBase can be found at <ulink url="&url.fbsql;">&url.fbsql;</ulink>. </simpara> <simpara> Documentation for FrontBase can be found at <ulink url="&url.fbsql.docs;">&url.fbsql.docs;</ulink>. </simpara> <simpara> Frontbase support has been added to PHP 4.0.6. </simpara> </partintro> <refentry id="function.fbsql-affected-rows"> <refnamediv> <refname>fbsql_affected_rows</refname> <refpurpose> Get number of affected rows in previous FrontBase operation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_affected_rows</function></funcdef> <paramdef>int <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_affected_rows</function> returns the number of rows affected by the last INSERT, UPDATE or DELETE query associated with <parameter>link_identifier</parameter>. If the link identifier isn't specified, the last link opened by <function>fbsql_connect</function> is assumed. </para> <note> <para> If you are using transactions, you need to call <function>fbsql_affected_rows</function> after your INSERT, UPDATE, or DELETE query, not after the commit. </para> </note> <para> If the last query was a DELETE query with no WHERE clause, all of the records will have been deleted from the table but this function will return zero. </para> <note> <para> When using UPDATE, FrontBase will not update columns where the new value is the same as the old value. This creates the possiblity that <function>fbsql_affected_rows</function> may not actually equal the number of rows matched, only the number of rows that were literally affected by the query. </para> </note> <para> If the last query failed, this function will return -1. </para> <para> See also: <function>fbsql_num_rows</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-autocommit"> <refnamediv> <refname>fbsql_autocommit</refname> <refpurpose>Enable or disable autocommit.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_autocommit</function></funcdef> <paramdef>resource <parameter>link_identifier</parameter> </paramdef> <paramdef>bool <parameter> <optional>OnOff</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_autocommit</function> returns the current autocommit status. if the optional OnOff parameter is given the auto commit status will be changed. With OnOff set to &true; each statement will be commited automatically, if no errors was found. With OnOff set to &false; the user must commit or rollback the transaction using either <function>fbsql_commit</function> or <function>fbsql_rollback</function>. </para> <para> See also: <function>fbsql_commit</function> and <function>fbsql_rollback</function> </para> </refsect1> </refentry> <refentry id="function.fbsql-change-user"> <refnamediv> <refname>fbsql_change_user</refname> <refpurpose> Change logged in user of the active connection </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_change_user</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> <paramdef>string <parameter> <optional>database</optional> </parameter> </paramdef> <paramdef>int <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_change_user</function> changes the logged in user of the current active connection, or the connection given by the optional parameter link_identifier. If a database is specified, this will default or current database after the user has been changed. If the new user and password authorization fails, the current connected user stays active. </para> </refsect1> </refentry> <refentry id="function.fbsql-close"> <refnamediv> <refname>fbsql_close</refname> <refpurpose>Close FrontBase connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>fbsql_close</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on error. </para> <para> <function>fbsql_close</function> closes the connection to the FrontBase server that's associated with the specified link identifier. If <parameter>link_identifier</parameter> isn't specified, the last opened link is used. </para> <para> Using <function>fbsql_close</function> isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution. </para> <example> <title><function>fbsql_close</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_connect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); print ("Connected successfully"); fbsql_close ($link); ?> ]]> </programlisting> </example> <para> See also: <function>fbsql_connect</function> and <function>fbsql_pconnect</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-commit"> <refnamediv> <refname>fbsql_commit</refname> <refpurpose>Commits a transaction to the database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_commit</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on failure. </para> <para> <function>fbsql_commit</function> ends the current transaction by writing all insertsm updates and deletes to the disk and unlucking all row and table locks held by the transaction. This command is only needed if autocommit is set to false. </para> <para> See also: <function>fbsql_autocommit</function> and <function>fbsql_rollback</function> </para> </refsect1> </refentry> <refentry id="function.fbsql-connect"> <refnamediv> <refname>fbsql_connect</refname> <refpurpose>Open a connection to a FrontBase Server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_connect</function></funcdef> <paramdef>string <parameter> <optional>hostname </optional> </parameter> </paramdef> <paramdef>string <parameter> <optional>username</optional> </parameter> </paramdef> <paramdef>string <parameter> <optional>password</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns a positive FrontBase link identifier on success, or an error message on failure. </para> <para> <function>fbsql_connect</function> establishes a connection to a FrontBase server. The following defaults are assumed for missing optional parameters: <parameter>hostname</parameter> = '&null;', <parameter>username</parameter> = '_SYSTEM' and <parameter>password</parameter> = empty password. </para> <para> If a second call is made to <function>fbsql_connect</function> with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. </para> <para> The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling <function>fbsql_close</function>. </para> <example> <title><function>fbsql_connect</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_connect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); print ("Connected successfully"); fbsql_close ($link); ?> ]]> </programlisting> </example> <para> See also <function>fbsql_pconnect</function> and <function>fbsql_close</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-create-db"> <refnamediv> <refname>fbsql_create_db</refname> <refpurpose>Create a FrontBase database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_create_db</function></funcdef> <paramdef>string <parameter>database name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_create_db</function> attempts to create a new database on the server associated with the specified link identifier. </para> <example> <title><function>fbsql_create_db</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); if (fbsql_create_db ("my_db")) { print("Database created successfully\n"); } else { printf("Error creating database: %s\n", fbsql_error ()); } ?> ]]> </programlisting> </example> <para> See also: <function>fbsql_drop_db</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-create-blob"> <refnamediv> <refname>fbsql_create_blob</refname> <refpurpose>Create a BLOB</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_create_blob</function></funcdef> <paramdef>string <parameter>blob_data</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: A resource handle to the newly created blob. </para> <para> <function>fbsql_create_blob</function> creates a blob from blob_data. The returned resource handle can be used with insert and update commands to store the blob in the database. </para> <example> <title><function>fbsql_create_blob</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); $filename = "blobfile.bin"; $fp = fopen($filename, "rb"); $blobdata = fread($fp, filesize($filename)); fclose($fp); $blobHandle = fbsql_create_blob($blobdata, $link); $sql = "INSERT INTO BLOB_TABLE (BLOB_COLUMN) VALUES ($blobHandle);"; $rs = fbsql_query($sql, $link); ?> ]]> </programlisting> </example> <para> See also: <function>fbsql_create_clob</function>, <function>fbsql_read_blob</function>, <function>fbsql_read_clob</function>, and <function>fbsql_set_lob_mode</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-create-clob"> <refnamediv> <refname>fbsql_create_clob</refname> <refpurpose>Create a CLOB</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_create_clob</function></funcdef> <paramdef>string <parameter>clob_data</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: A resource handle to the newly created CLOB. </para> <para> <function>fbsql_create_clob</function> creates a clob from clob_data. The returned resource handle can be used with insert and update commands to store the clob in the database. </para> <example> <title><function>fbsql_create_clob</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); $filename = "clob_file.txt"; $fp = fopen($filename, "rb"); $clobdata = fread($fp, filesize($filename)); fclose($fp); $clobHandle = fbsql_create_clob($clobdata, $link); $sql = "INSERT INTO CLOB_TABLE (CLOB_COLUMN) VALUES ($clobHandle);"; $rs = fbsql_query($sql, $link); ?> ]]> </programlisting> </example> <para> See also: <function>fbsql_create_blob</function>, <function>fbsql_read_blob</function>, <function>fbsql_read_clob</function>, and <function>fbsql_set_lob_mode</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-database-password"> <refnamediv> <refname>fbsql_database_password</refname> <refpurpose> Sets or retreives the password for a FrontBase database </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_database_password</function> </funcdef> <paramdef>resource <parameter>link_identifier</parameter></paramdef> <paramdef>string <parameter> <optional>database_password</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: The database password for the database represented by the link identifier. </para> <para> <function>fbsql_database_password</function> sets and retreives the database password for the current database. if the second optional parameter is given the function sets the database password for the database on the server that's associated with the specified link identifier. If no link identifier is specified, the last opened link is assumed. If no link is open, the function will try to establish a link as if <function>fbsql_connect</function> was called, and use it. </para> <para> See also: <function>fbsql_connect</function> and <function>fbsql_pconnect</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-data-seek"> <refnamediv> <refname>fbsql_data_seek</refname> <refpurpose>Move internal result pointer</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_data_seek</function></funcdef> <paramdef>resource <parameter>result_identifier</parameter> </paramdef> <paramdef>int <parameter>row_number</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on failure. </para> <para> <function>fbsql_data_seek</function> moves the internal row pointer of the FrontBase result associated with the specified result identifier to point to the specified row number. The next call to <function>fbsql_fetch_row</function> would return that row. </para> <para> <parameter>Row_number</parameter> starts at 0. </para> <example> <title><function>fbsql_data_seek</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); fbsql_select_db ("samp_db") or die ("Could not select database"); $query = "SELECT last_name, first_name FROM friends;"; $result = fbsql_query ($query) or die ("Query failed"); # fetch rows in reverse order for ($i = fbsql_num_rows ($result) - 1; $i >=0; $i--) { if (!fbsql_data_seek ($result, $i)) { printf ("Cannot seek to row %d\n", $i); continue; } if(!($row = fbsql_fetch_object ($result))) continue; printf("%s %s<BR>\n", $row->last_name, $row->first_name); } fbsql_free_result ($result); ?> ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.fbsql-db-query"> <refnamediv> <refname>fbsql_db_query</refname> <refpurpose>Send a FrontBase query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_db_query</function></funcdef> <paramdef>string <parameter>database</parameter></paramdef> <paramdef>string <parameter>query</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: A positive FrontBase result identifier to the query result, or &false; on error. </para> <para> <function>fbsql_db_query</function> selects a database and executes a query on it. If the optional link identifier isn't specified, the function will try to find an open link to the FrontBase server and if no such link is found it'll try to create one as if <function>fbsql_connect</function> was called with no arguments </para> <para> See also <function>fbsql_connect</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-db-status"> <refnamediv> <refname>fbsql_db_status</refname> <refpurpose>Get the status for a given database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_db_status</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: An integer value with the current status. </para> <para> <function>fbsql_db_status</function> requests the current status of the database specified by <parameter>database_name</parameter>. If the <parameter>link_identifier</parameter> is omitted the default link_identifier will be used. </para> <para> The return value can be one of the following constants: <itemizedlist> <listitem> <simpara> &false; - The exec handler for the host was invalid. This error will ocour when the link_identifier connects directly to a database by using a port number. FBExec can be available on the server but no connection has been made for it. </simpara> </listitem> <listitem> <simpara> FBSQL_UNKNOWN - The Status is unknown. </simpara> </listitem> <listitem> <simpara> FBSQL_STOPPED - The database is not running. Use <function>fbsql_start_db</function> to start the database. </simpara> </listitem> <listitem> <simpara> FBSQL_STARTING - The database is starting. </simpara> </listitem> <listitem> <simpara> FBSQL_RUNNING - The database is running and can be used to perform SQL operations. </simpara> </listitem> <listitem> <simpara> FBSQL_STOPPING - The database is stopping. </simpara> </listitem> <listitem> <simpara> FBSQL_NOEXEC - FBExec is not running on the server and it is not possible to get the status of the database. </simpara> </listitem> </itemizedlist> </para> <para> See also: <function>fbsql_start_db</function> and <function>fbsql_stop_db</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-drop-db"> <refnamediv> <refname>fbsql_drop_db</refname> <refpurpose>Drop (delete) a FrontBase database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_drop_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on failure. </para> <para> <function>fbsql_drop_db</function> attempts to drop (remove) an entire database from the server associated with the specified link identifier. </para> </refsect1> </refentry> <refentry id="function.fbsql-errno"> <refnamediv> <refname>fbsql_errno</refname> <refpurpose> Returns the numerical value of the error message from previous FrontBase operation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_errno</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns the error number from the last fbsql function, or <literal>0</literal> (zero) if no error occurred. </para> <para> Errors coming back from the fbsql database backend dont issue warnings. Instead, use <function>fbsql_errno</function> to retrieve the error code. Note that this function only returns the error code from the most recently executed fbsql function (not including <function>fbsql_error</function> and <function>fbsql_errno</function>), so if you want to use it, make sure you check the value before calling another fbsql function. <informalexample> <programlisting role="php"> <![CDATA[ <?php fbsql_connect("marliesle"); echo fbsql_errno().": ".fbsql_error()."<BR>"; fbsql_select_db("nonexistentdb"); echo fbsql_errno().": ".fbsql_error()."<BR>"; $conn = fbsql_query("SELECT * FROM nonexistenttable;"); echo fbsql_errno().": ".fbsql_error()."<BR>"; ?> ]]> </programlisting> </informalexample> </para> <para> See also: <function>fbsql_error</function> and <function>fbsql_warnings</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-error"> <refnamediv> <refname>fbsql_error</refname> <refpurpose> Returns the text of the error message from previous FrontBase operation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_error</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns the error text from the last fbsql function, or <literal>''</literal> (the empty string) if no error occurred. </para> <para> Errors coming back from the fbsql database backend dont issue warnings. Instead, use <function>fbsql_error</function> to retrieve the error text. Note that this function only returns the error text from the most recently executed fbsql function (not including <function>fbsql_error</function> and <function>fbsql_errno</function>), so if you want to use it, make sure you check the value before calling another fbsql function. <informalexample> <programlisting role="php"> <![CDATA[ <?php fbsql_connect("marliesle"); echo fbsql_errno().": ".fbsql_error()."<BR>"; fbsql_select_db("nonexistentdb"); echo fbsql_errno().": ".fbsql_error()."<BR>"; $conn = fbsql_query("SELECT * FROM nonexistenttable;"); echo fbsql_errno().": ".fbsql_error()."<BR>"; ?> ]]> </programlisting> </informalexample> </para> <para> See also: <function>fbsql_errno</function> and <function>fbsql_warnings</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-fetch-array"> <refnamediv> <refname>fbsql_fetch_array</refname> <refpurpose> Fetch a result row as an associative array, a numeric array, or both </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fbsql_fetch_array</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter> <optional>result_type</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns an array that corresponds to the fetched row, or &false; if there are no more rows. </para> <para> <function>fbsql_fetch_array</function> is an extended version of <function>fbsql_fetch_row</function>. In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. </para> <para> If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you must the numeric index of the column or make an alias for the column. <informalexample> <programlisting> <![CDATA[ select t1.f1 as foo t2.f1 as bar from t1, t2 ]]> </programlisting> </informalexample> </para> <para> An important thing to note is that using <function>fbsql_fetch_array</function> is NOT significantly slower than using <function>fbsql_fetch_row</function>, while it provides a significant added value. </para> <para> The optional second argument <parameter>result_type</parameter> in <function>fbsql_fetch_array</function> is a constant and can take the following values: FBSQL_ASSOC, FBSQL_NUM, and FBSQL_BOTH. </para> <para> For further details, see also <function>fbsql_fetch_row</function> and <function>fbsql_fetch_assoc</function>. </para> <example> <title><function>fbsql_fetch_array</function> example</title> <programlisting role="php"> <![CDATA[ <?php fbsql_connect ($host, $user, $password); $result = fbsql_db_query ("database","select user_id, fullname from table"); while ($row = fbsql_fetch_array ($result)) { echo "user_id: ".$row["user_id"]."<br>\n"; echo "user_id: ".$row[0]."<br>\n"; echo "fullname: ".$row["fullname"]."<br>\n"; echo "fullname: ".$row[1]."<br>\n"; } fbsql_free_result ($result); ?> ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.fbsql-fetch-assoc"> <refnamediv> <refname>fbsql_fetch_assoc</refname> <refpurpose> Fetch a result row as an associative array </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fbsql_fetch_assoc</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns an associative array that corresponds to the fetched row, or &false; if there are no more rows.</para> <para> <function>fbsql_fetch_assoc</function> is equivalent to calling <function>fbsql_fetch_array</function> with FBSQL_ASSOC for the optional second parameter. It only returns an associative array. This is the way <function>fbsql_fetch_array</function> originally worked. If you need the numeric indices as well as the associative, use <function>fbsql_fetch_array</function>. </para> <para> If two or more columns of the result have the same field names, the last column will take precedence. To access the other column(s) of the same name, you must use <function>fbsql_fetch_array</function> and have it return the numeric indices as well. </para> <para> An important thing to note is that using <function>fbsql_fetch_assoc</function> is NOT significantly slower than using <function>fbsql_fetch_row</function>, while it provides a significant added value. </para> <para> For further details, see also <function>fbsql_fetch_row</function> and <function>fbsql_fetch_array</function>. </para> <example> <title><function>fbsql_fetch_assoc</function> example</title> <programlisting role="php"> <![CDATA[ <?php fbsql_connect ($host, $user, $password); $result = fbsql_db_query ("database","select * from table"); while ($row = fbsql_fetch_assoc ($result)) { echo $row["user_id"]; echo $row["fullname"]; } fbsql_free_result ($result); ?> ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.fbsql-fetch-field"> <refnamediv> <refname>fbsql_fetch_field</refname> <refpurpose> Get column information from a result and return as an object </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>object <function>fbsql_fetch_field</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter> <optional>field_offset</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns an object containing field information. </para> <para> <function>fbsql_fetch_field</function> can be used in order to obtain information about fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by <function>fbsql_fetch_field</function> is retrieved. </para> <para> The properties of the object are: <itemizedlist> <listitem> <simpara> name - column name </simpara> </listitem> <listitem> <simpara> table - name of the table the column belongs to </simpara> </listitem> <listitem> <simpara> max_length - maximum length of the column </simpara> </listitem> <listitem> <simpara> not_null - 1 if the column cannot be &null; </simpara> </listitem> <listitem> <simpara> type - the type of the column </simpara> </listitem> </itemizedlist> </para> <example> <title><function>fbsql_fetch_field</function> example</title> <programlisting role="php"> <![CDATA[ <?php fbsql_connect ($host, $user, $password) or die ("Could not connect"); $result = fbsql_db_query ("database", "select * from table") or die ("Query failed"); # get column metadata $i = 0; while ($i < fbsql_num_fields ($result)) { echo "Information for column $i:<BR>\n"; $meta = fbsql_fetch_field ($result); if (!$meta) { echo "No information available<BR>\n"; } echo "<PRE> max_length: $meta->max_length name: $meta->name not_null: $meta->not_null table: $meta->table type: $meta->type </PRE>"; $i++; } fbsql_free_result ($result); ?> ]]> </programlisting> </example> <para> See also <function>fbsql_field_seek</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-fetch-lengths"> <refnamediv> <refname>fbsql_fetch_lengths</refname> <refpurpose> Get the length of each output in a result </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fbsql_fetch_lengths</function></funcdef> <paramdef>resource <parameter><optional>result</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: An array that corresponds to the lengths of each field in the last row fetched by <function>fbsql_fetch_row</function>, or &false; on error. </para> <para> <function>fbsql_fetch_lengths</function> stores the lengths of each result column in the last row returned by <function>fbsql_fetch_row</function>, <function>fbsql_fetch_array</function> and <function>fbsql_fetch_object</function> in an array, starting at offset 0. </para> <para> See also: <function>fbsql_fetch_row</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-fetch-object"> <refnamediv> <refname>fbsql_fetch_object</refname> <refpurpose>Fetch a result row as an object</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>object <function>fbsql_fetch_object</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter> <optional>result_type</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns an object with properties that correspond to the fetched row, or &false; if there are no more rows. </para> <para> <function>fbsql_fetch_object</function> is similar to <function>fbsql_fetch_array</function>, with one difference - an object is returned, instead of an array. Indirectly, that means that you can only access the data by the field names, and not by their offsets (numbers are illegal property names). </para> <para> The optional argument <parameter>result_type</parameter> is a constant and can take the following values: FBSQL_ASSOC, FBSQL_NUM, and FBSQL_BOTH. </para> <para> Speed-wise, the function is identical to <function>fbsql_fetch_array</function>, and almost as quick as <function>fbsql_fetch_row</function> (the difference is insignificant). <example> <title><function>fbsql_fetch_object</function> example</title> <programlisting role="php"> <![CDATA[ <?php fbsql_connect ($host, $user, $password); $result = fbsql_db_query ("database", "select * from table"); while ($row = fbsql_fetch_object ($result)) { echo $row->user_id; echo $row->fullname; } fbsql_free_result ($result); ?> ]]> </programlisting> </example> </para> <para> See also: <function>fbsql_fetch_array</function> and <function>fbsql_fetch_row</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-fetch-row"> <refnamediv> <refname>fbsql_fetch_row</refname> <refpurpose>Get a result row as an enumerated array</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fbsql_fetch_row</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns: An array that corresponds to the fetched row, or &false; if there are no more rows. </para> <para> <function>fbsql_fetch_row</function> fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0. </para> <para> Subsequent call to <function>fbsql_fetch_row</function> would return the next row in the result set, or &false; if there are no more rows. </para> <para> See also: <function>fbsql_fetch_array</function>, <function>fbsql_fetch_object</function>, <function>fbsql_data_seek</function>, <function>fbsql_fetch_lengths</function>, and <function>fbsql_result</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-field-flags"> <refnamediv> <refname>fbsql_field_flags</refname> <refpurpose> Get the flags associated with the specified field in a result </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_field_flags</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_field_flags</function> returns the field flags of the specified field. The flags are reported as a single word per flag separated by a single space, so that you can split the returned value using <function>explode</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-field-name"> <refnamediv> <refname>fbsql_field_name</refname> <refpurpose> Get the name of the specified field in a result </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_field_name</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_index</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_field_name</function> returns the name of the specified field index. <parameter>result</parameter> must be a valid result identifier and <parameter>field_index</parameter> is the numerical offset of the field. </para> <note> <para> <parameter>field_index</parameter> starts at 0. </para> <para> e.g. The index of the third field would actually be 2, the index of the fourth field would be 3 and so on. </para> </note> <para> <example> <title><function>fbsql_field_name</function> example</title> <programlisting role="php"> <![CDATA[ // The users table consists of three fields: // user_id // username // password. $res = fbsql_db_query("users", "select * from users", $link); echo fbsql_field_name($res, 0) . "\n"; echo fbsql_field_name($res, 2); ]]> </programlisting> </example> </para> <para> The above example would produce the following output: <informalexample> <programlisting> <![CDATA[ user_id password ]]> </programlisting> </informalexample> </para> </refsect1> </refentry> <refentry id="function.fbsql-field-len"> <refnamediv> <refname>fbsql_field_len</refname> <refpurpose> Returns the length of the specified field </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_field_len</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_field_len</function> returns the length of the specified field. </para> </refsect1> </refentry> <refentry id="function.fbsql-field-seek"> <refnamediv> <refname>fbsql_field_seek</refname> <refpurpose> Set result pointer to a specified field offset </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_field_seek</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Seeks to the specified field offset. If the next call to <function>fbsql_fetch_field</function> doesn't include a field offset, the field offset specified in <function>fbsql_field_seek</function> will be returned. </para> <para> See also: <function>fbsql_fetch_field</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-field-table"> <refnamediv> <refname>fbsql_field_table</refname> <refpurpose> Get name of the table the specified field is in </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_field_table</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the name of the table that the specifed field is in. </para> </refsect1> </refentry> <refentry id="function.fbsql-field-type"> <refnamediv> <refname>fbsql_field_type</refname> <refpurpose> Get the type of the specified field in a result </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_field_type</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>field_offset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_field_type</function> is similar to the <function>fbsql_field_name</function> function. The arguments are identical, but the field type is returned instead. The field type will be one of "int", "real", "string", "blob", and others as detailed in the <ulink url="&url.fbsql.docs;">FrontBase documentation</ulink>. <example> <title><function>fbsql_field_type</function> example</title> <programlisting role="php"> <![CDATA[ <?php fbsql_connect ("localhost", "_SYSTEM", ""); fbsql_select_db ("wisconsin"); $result = fbsql_query ("SELECT * FROM onek;"); $fields = fbsql_num_fields ($result); $rows = fbsql_num_rows ($result); $i = 0; $table = fbsql_field_table ($result, $i); echo "Your '".$table."' table has ".$fields." fields and ".$rows." records <BR>"; echo "The table has the following fields <BR>"; while ($i < $fields) { $type = fbsql_field_type ($result, $i); $name = fbsql_field_name ($result, $i); $len = fbsql_field_len ($result, $i); $flags = fbsql_field_flags ($result, $i); echo $type." ".$name." ".$len." ".$flags."<BR>"; $i++; } fbsql_close(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.fbsql-free-result"> <refnamediv> <refname>fbsql_free_result</refname> <refpurpose>Free result memory</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_free_result</function></funcdef> <paramdef>int <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_free_result</function> will free all memory associated with the result identifier <parameter>result</parameter>. </para> <para> <function>fbsql_free_result</function> only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution. </para> </refsect1> </refentry> <refentry id="function.fbsql-insert-id"> <refnamediv> <refname>fbsql_insert_id</refname> <refpurpose> Get the id generated from the previous INSERT operation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_insert_id</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_insert_id</function> returns the ID generated for an column defined as DEFAULT UNIQUE by the previous INSERT query using the given <parameter>link_identifier</parameter>. If <parameter>link_identifier</parameter> isn't specified, the last opened link is assumed. </para> <para> <function>fbsql_insert_id</function> returns 0 if the previous query does not generate an DEFAULT UNIQUE value. If you need to save the value for later, be sure to call fbsql_insert_id() immediately after the query that generates the value. </para> <note> <para> The value of the FrontBase SQL function <literal>LAST_INSERT_ID()</literal> always contains the most recently generated DEFAULT UNIQUE value, and is not reset between queries. </para> </note> </refsect1> </refentry> <refentry id="function.fbsql-list-dbs"> <refnamediv> <refname>fbsql_list_dbs</refname> <refpurpose> List databases available on a FrontBase server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_list_dbs</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_list_dbs</function> will return a result pointer containing the databases available from the current fbsql daemon. Use the <function>fbsql_tablename</function> function to traverse this result pointer. </para> <para> <example> <title><function>fbsql_list_dbs</function> example</title> <programlisting role="php"> <![CDATA[ $link = fbsql_connect('localhost', 'myname', 'secret'); $db_list = fbsql_list_dbs($link); while ($row = fbsql_fetch_object($db_list)) { echo $row->Database . "\n"; } ]]> </programlisting> </example> </para> <para> The above example would produce the following output: <informalexample> <programlisting> <![CDATA[ database1 database2 database3 ... ]]> </programlisting> </informalexample> </para> <note> <para> The above code would just as easily work with <function>fbsql_fetch_row</function> or other similar functions. </para> </note> </refsect1> </refentry> <refentry id="function.fbsql-list-fields"> <refnamediv> <refname>fbsql_list_fields</refname> <refpurpose>List FrontBase result fields</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_list_fields</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>table_name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_list_fields</function> retrieves information about the given tablename. Arguments are the database name and the table name. A result pointer is returned which can be used with <function>fbsql_field_flags</function>, <function>fbsql_field_len</function>, <function>fbsql_field_name</function>, and <function>fbsql_field_type</function>. </para> <para> A result identifier is a positive integer. The function returns -1 if a error occurs. A string describing the error will be placed in <literal>$phperrmsg</literal>, and unless the function was called as <literal>@fbsql()</literal> then this error string will also be printed out. </para> <para> <example> <title><function>fbsql_list_fields</function> example</title> <programlisting role="php"> <![CDATA[ $link = fbsql_connect('localhost', 'myname', 'secret'); $fields = fbsql_list_fields("database1", "table1", $link); $columns = fbsql_num_fields($fields); for ($i = 0; $i < $columns; $i++) { echo fbsql_field_name($fields, $i) . "\n";; } ]]> </programlisting> </example> </para> <para> The above example would produce the following output: <informalexample> <programlisting> <![CDATA[ field1 field2 field3 ... ]]> </programlisting> </informalexample> </para> </refsect1> </refentry> <refentry id="function.fbsql-list-tables"> <refnamediv> <refname>fbsql_list_tables</refname> <refpurpose>List tables in a FrontBase database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_list_tables</function></funcdef> <paramdef>string <parameter>database</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_list_tables</function> takes a database name and returns a result pointer much like the <function>fbsql_db_query</function> function. The <function>fbsql_tablename</function> function should be used to extract the actual table names from the result pointer. </para> </refsect1> </refentry> <refentry id="function.fbsql-next-result"> <refnamediv> <refname>fbsql_next_result</refname> <refpurpose> Move the internal result pointer to the next result </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_next_result</function> </funcdef> <paramdef>int <parameter>result_id</parameter></paramdef> </funcprototype> </funcsynopsis> <para> When sending more than one SQL statement to the server or executing a stored procedure with multiple results will cause the server to return multiple result sets. This function will test for additional results available form the server. If an additional result set exists it will free the existing result set and prepare to fetch the words from the new result set. The function will return &true; if an additional result set was available or &false; otherwise. </para> <example> <title><function>fbsql_next_result</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_connect ("localhost", "_SYSTEM", "secret"); fbsql_select_db("MyDB", $link); $SQL = "Select * from table1; select * from table2;"; $rs = fbsql_query($SQL, $link); do { while ($row = fbsql_fetch_row($rs)) { } } while (fbsql_next_result($rs)); fbsql_free_result($rs); fbsql_close ($link); ?> ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.fbsql-num-fields"> <refnamediv> <refname>fbsql_num_fields</refname> <refpurpose>Get number of fields in result</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_num_fields</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_num_fields</function> returns the number of fields in a result set. </para> <para> See also: <function>fbsql_db_query</function>, <function>fbsql_query</function>, <function>fbsql_fetch_field</function>, and <function>fbsql_num_rows</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-num-rows"> <refnamediv> <refname>fbsql_num_rows</refname> <refpurpose>Get number of rows in result</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>fbsql_num_rows</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_num_rows</function> returns the number of rows in a result set. This command is only valid for SELECT statements. To retrieve the number of rows returned from a INSERT, UPDATE or DELETE query, use <function>fbsql_affected_rows</function>. <example> <title><function>fbsql_num_rows</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_connect("localhost", "username", "password"); fbsql_select_db("database", $link); $result = fbsql_query("SELECT * FROM table1;", $link); $num_rows = fbsql_num_rows($result); echo "$num_rows Rows\n"; ?> ]]> </programlisting> </example> </para> <para> See also: <function>fbsql_affected_rows</function>, <function>fbsql_connect</function>, <function>fbsql_select_db</function>, and <function>fbsql_query</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-pconnect"> <refnamediv> <refname>fbsql_pconnect</refname> <refpurpose> Open a persistent connection to a FrontBase Server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_pconnect</function></funcdef> <paramdef>string <parameter><optional>hostname</optional></parameter> </paramdef> <paramdef>string <parameter><optional>username</optional></parameter> </paramdef> <paramdef>string <parameter><optional>password</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: A positive FrontBase persistent link identifier on success, or &false; on error. </para> <para> <function>fbsql_pconnect</function> establishes a connection to a FrontBase server. The following defaults are assumed for missing optional parameters: <parameter>host</parameter> = 'localhost', <parameter>username</parameter> = "_SYSTEM" and <parameter>password</parameter> = empty password. </para> <para> <function>fbsql_pconnect</function> acts very much like <function>fbsql_connect</function> with two major differences. </para> <para> To set Frontbase server port number, use <function>fbsql_select_db</function>. </para> <para> First, when connecting, the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection. </para> <para> Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use. </para> <para> This type of links is therefore called 'persistent'. </para> </refsect1> </refentry> <refentry id="function.fbsql-query"> <refnamediv> <refname>fbsql_query</refname> <refpurpose>Send a FrontBase query</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>fbsql_query</function></funcdef> <paramdef>string <parameter>query</parameter></paramdef> <paramdef>resource <parameter><optional>link_identifier</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_query</function> sends a query to the currently active database on the server that's associated with the specified link identifier. If <parameter>link_identifier</parameter> isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if <function>fbsql_connect</function> was called with no arguments, and use it. </para> <note> <para> The query string shall always end with a semicolon. </para> </note> <para> <function>fbsql_query</function> returns &true; (non-zero) or &false; to indicate whether or not the query succeeded. A return value of &true; means that the query was legal and could be executed by the server. It does not indicate anything about the number of rows affected or returned. It is perfectly possible for a query to succeed but affect no rows or return no rows. </para> <para> The following query is syntactically invalid, so <function>fbsql_query</function> fails and returns &false;: <example> <title><function>fbsql_query</function> example</title> <programlisting role="php"> <![CDATA[ <?php $result = fbsql_query ("SELECT * WHERE 1=1") or die ("Invalid query"); ?> ]]> </programlisting> </example> </para> <para> The following query is semantically invalid if <literal>my_col</literal> is not a column in the table <literal>my_tbl</literal>, so <function>fbsql_query</function> fails and returns &false;: <example> <title><function>fbsql_query</function> example</title> <programlisting role="php"> <![CDATA[ <?php $result = fbsql_query ("SELECT my_col FROM my_tbl") or die ("Invalid query"); ?> ]]> </programlisting> </example> </para> <para> <function>fbsql_query</function> will also fail and return &false; if you don't have permission to access the table(s) referenced by the query. </para> <para> Assuming the query succeeds, you can call <function>fbsql_num_rows</function> to find out how many rows were returned for a SELECT statment or <function>fbsql_affected_rows</function> to find out how many rows were affected by a DELETE, INSERT, REPLACE, or UPDATE statement. </para> <para> For SELECT statements, <function>fbsql_query</function> returns a new result identifier that you can pass to <function>fbsql_result</function>. When you are done with the result set, you can free the resources associated with it by calling <function>fbsql_free_result</function>. Although, the memory will automatically be freed at the end of the script's execution. </para> <para> See also: <function>fbsql_affected_rows</function>, <function>fbsql_db_query</function>, <function>fbsql_free_result</function>, <function>fbsql_result</function>, <function>fbsql_select_db</function>, and <function>fbsql_connect</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-read-blob"> <refnamediv> <refname>fbsql_read_blob</refname> <refpurpose>Read a BLOB from the database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_read_blob</function></funcdef> <paramdef>string <parameter>blob_handle</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: A string containing the BLOB specified by blob_handle. </para> <para> <function>fbsql_read_blob</function> reads BLOB data from the database. If a select statement contains BLOB and/or BLOB columns FrontBase will return the data directly when data is fetched. This default behavior can be changed with <function>fbsql_set_lob_mode</function> so the fetch functions will return handles to BLOB and CLOB data. If a handle is fetched a user must call <function>fbsql_read_blob</function> to get the actual BLOB data from the database. </para> <example> <title><function>fbsql_read_blob</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); $sql = "SELECT BLOB_COLUMN FROM BLOB_TABLE;"; $rs = fbsql_query($sql, $link); $row_data = fbsql_fetch_row($rs); // $row_data[0] will now contain the blob data for teh first row fbsql_free_result($rs); $rs = fbsql_query($sql, $link); fbsql_set_lob_mode($rs, FBSQL_LOB_HANDLE); $row_data = fbsql_fetch_row($rs); // $row_data[0] will now contain a handle to the BLOB data in the first row $blob_data = fbsql_read_blob($row_data[0]); fbsql_free_result($rs); ?> ]]> </programlisting> </example> <para> See also: <function>fbsql_create_blob</function>, <function>fbsql_read_blob</function>, <function>fbsql_read_clob</function>, and <function>fbsql_set_lob_mode</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-read-clob"> <refnamediv> <refname>fbsql_read_clob</refname> <refpurpose>Read a CLOB from the database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_read_clob</function></funcdef> <paramdef>string <parameter>clob_handle</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: A string containing the CLOB specified by clob_handle. </para> <para> <function>fbsql_read_clob</function> reads CLOB data from the database. If a select statement contains BLOB and/or CLOB columns FrontBase will return the data directly when data is fetched. This default behavior can be changed with <function>fbsql_set_lob_mode</function> so the fetch functions will return handles to BLOB and CLOB data. If a handle is fetched a user must call <function>fbsql_read_clob</function> to get the actual CLOB data from the database. </para> <example> <title><function>fbsql_read_clob</function> example</title> <programlisting role="php"> <![CDATA[ <?php $link = fbsql_pconnect ("localhost", "_SYSTEM", "secret") or die ("Could not connect"); $sql = "SELECT CLOB_COLUMN FROM CLOB_TABLE;"; $rs = fbsql_query($sql, $link); $row_data = fbsql_fetch_row($rs); // $row_data[0] will now contain the clob data for teh first row fbsql_free_result($rs); $rs = fbsql_query($sql, $link); fbsql_set_lob_mode($rs, FBSQL_LOB_HANDLE); $row_data = fbsql_fetch_row($rs); // $row_data[0] will now contain a handle to the CLOB data in the first row $clob_data = fbsql_read_clob($row_data[0]); fbsql_free_result($rs); ?> ]]> </programlisting> </example> <para> See also: <function>fbsql_create_blob</function>, <function>fbsql_read_blob</function>, <function>fbsql_read_clob</function>, and <function>fbsql_set_lob_mode</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-result"> <refnamediv> <refname>fbsql_result</refname> <refpurpose>Get result data</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>fbsql_result</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>row</parameter></paramdef> <paramdef>mixed <parameter> <optional>field</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_result</function> returns the contents of one cell from a FrontBase result set. The field argument can be the field's offset, or the field's name, or the field's table dot field's name (tabledname.fieldname). If the column name has been aliased ('select foo as bar from...'), use the alias instead of the column name. </para> <para> When working on large result sets, you should consider using one of the functions that fetch an entire row (specified below). As these functions return the contents of multiple cells in one function call, they're MUCH quicker than <function>fbsql_result</function>. Also, note that specifying a numeric offset for the field argument is much quicker than specifying a fieldname or tablename.fieldname argument. </para> <para> Calls to <function>fbsql_result</function> should not be mixed with calls to other functions that deal with the result set. </para> <para> Recommended high-performance alternatives: <function>fbsql_fetch_row</function>, <function>fbsql_fetch_array</function>, and <function>fbsql_fetch_object</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-rollback"> <refnamediv> <refname>fbsql_rollback</refname> <refpurpose>Rollback a transaction to the database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_rollback</function></funcdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on failure. </para> <para> <function>fbsql_rollback</function> ends the current transaction by rolling back all statements issued since last commit. This command is only needed if autocommit is set to false. </para> <para> See also: <function>fbsql_autocommit</function> and <function>fbsql_commit</function> </para> </refsect1> </refentry> <refentry id="function.fbsql-set-lob-mode"> <refnamediv> <refname>fbsql_set_lob_mode</refname> <refpurpose> Set the LOB retreive mode for a FrontBase result set </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_set_lob_mode</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>string <parameter>database_name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on error. </para> <para> <function>fbsql_set_lob_mode</function> sets the mode for retreiving LOB data from the database. When BLOB and CLOB data is stored in FrontBase it can be stored direct or indirect. Direct stored LOB data will allways be fetched no matter the setting of the lob mode. If the LOB data is less than 512 bytes it will allways be stored directly. <itemizedlist> <listitem> <simpara> FBSQL_LOB_DIRECT - LOB data is retreived directly. When data is fetched from the database with <function>fbsql_fetch_row</function>, and other fetch functions, all CLOB and BLOB columns will be returned as ordinary columns. This is the default value on a new FrontBase result. </simpara> </listitem> <listitem> <simpara> FBSQL_LOB_HANDLE - LOB data is retreived as handles to the data. When data is fetched from the database with <function>fbsql_fetch_row </function>, and other fetch functions, LOB data will be returned as a handle to the data if the data is stored indirect or the data if it is stored direct. If a handle is returned it will be a 27 byte string formated as "@'000000000000000000000000'". </simpara> </listitem> </itemizedlist> </para> <para> See also: <function>fbsql_create_blob</function>, <function>fbsql_create_clob</function>, <function>fbsql_read_blob</function>, and <function>fbsql_read_clob</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-select-db"> <refnamediv> <refname>fbsql_select_db</refname> <refpurpose>Select a FrontBase database</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_select_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on error. </para> <para> <function>fbsql_select_db</function> sets the current active database on the server that's associated with the specified link identifier. If no link identifier is specified, the last opened link is assumed. If no link is open, the function will try to establish a link as if <function>fbsql_connect</function> was called, and use it. </para> <para> The client contacts FBExec to obtain the port number to use for the connection to the database. If the database name is a number the system will use that as a port number and it will not ask FBExec for the port number. The FrontBase server can be stared as FRontBase -FBExec=No -port=&lt;port number&gt; &lt;database name&gt;. </para> <para> Every subsequent call to <function>fbsql_query</function> will be made on the active database. </para> <para> See also: <function>fbsql_connect</function>, <function>fbsql_pconnect</function>, and <function>fbsql_query</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-start-db"> <refnamediv> <refname>fbsql_start_db</refname> <refpurpose>Start a database on local or remote server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_start_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on failure. </para> <para> <function>fbsql_start_db</function> </para> <para> See also: <function>fbsql_db_status</function> and <function>fbsql_stop_db</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-stop-db"> <refnamediv> <refname>fbsql_stop_db</refname> <refpurpose>Stop a database on local or remote server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_stop_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>resource <parameter> <optional>link_identifier</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns: &true; on success, &false; on failure. </para> <para> <function>fbsql_stop_db</function> </para> <para> See also: <function>fbsql_db_status</function> and <function>fbsql_start_db</function>. </para> </refsect1> </refentry> <refentry id="function.fbsql-tablename"> <refnamediv> <refname>fbsql_tablename</refname> <refpurpose>Get table name of field</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_tablename</function></funcdef> <paramdef>resource <parameter>result</parameter></paramdef> <paramdef>int <parameter>i</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>fbsql_tablename</function> takes a result pointer returned by the <function>fbsql_list_tables</function> function as well as an integer index and returns the name of a table. The <function>fbsql_num_rows</function> function may be used to determine the number of tables in the result pointer. <example> <title><function>fbsql_tablename</function> example</title> <programlisting role="php"> <![CDATA[ <?php fbsql_connect ("localhost", "_SYSTEM", ""); $result = fbsql_list_tables ("wisconsin"); $i = 0; while ($i < fbsql_num_rows ($result)) { $tb_names[$i] = fbsql_tablename ($result, $i); echo $tb_names[$i] . "<BR>"; $i++; } ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.fbsql-warnings"> <refnamediv> <refname>fbsql_warnings</refname> <refpurpose>Enable or disable FrontBase warnings</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>fbsql_warnings</function></funcdef> <paramdef>bool <parameter> <optional>OnOff</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Returns &true; if warnings is turned on otherwise &false;. </para> <para> <function>fbsql_warnings</function> enables or disables FrontBase warnings. </para> </refsect1> </refentry> <refentry id='function.fbsql-database'> <refnamediv> <refname>fbsql_database</refname> <refpurpose> No description given yet </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_database</function></funcdef> <paramdef>resource <parameter>link_identifier</parameter></paramdef> <paramdef>string <parameter><optional>database</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.fbsql-get-autostart-info'> <refnamediv> <refname>fbsql_get_autostart_info</refname> <refpurpose> No description given yet </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>fbsql_get_autostart_info</function></funcdef> <paramdef>resource <parameter><optional>link_identifier</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.fbsql-hostname'> <refnamediv> <refname>fbsql_hostname</refname> <refpurpose> No description given yet </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_hostname</function></funcdef> <paramdef>resource <parameter>link_identifier</parameter></paramdef> <paramdef>string <parameter><optional>host_name</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.fbsql-password'> <refnamediv> <refname>fbsql_password</refname> <refpurpose> No description given yet </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_password</function></funcdef> <paramdef>resource <parameter>link_identifier</parameter></paramdef> <paramdef>string <parameter><optional>password</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.fbsql-set-transaction'> <refnamediv> <refname>fbsql_set_transaction</refname> <refpurpose> Set the transaction locking and isolation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>fbsql_set_transaction</function></funcdef> <paramdef>resource <parameter>link_identifier</parameter></paramdef> <paramdef>int <parameter>Locking</parameter></paramdef> <paramdef>int <parameter>Isolation</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.fbsql-username'> <refnamediv> <refname>fbsql_username</refname> <refpurpose> No description given yet </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fbsql_username</function></funcdef> <paramdef>resource <parameter>link_identifier</parameter></paramdef> <paramdef>string <parameter><optional>username</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/fribidi.xml +++ phpdoc/kr/functions/fribidi.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.fribidi"> <title>FriBiDi functions</title> <titleabbrev>FriBiDi functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.fribidi-log2vis"> <refnamediv> <refname>fribidi_log2vis</refname> <refpurpose>Convert a logical string to a visual one </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>fribidi_log2vis</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>string <parameter>direction</parameter></paramdef> <paramdef>int <parameter>charset</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/iconv.xml +++ phpdoc/kr/functions/iconv.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.iconv"> <title>iconv functions</title> <titleabbrev>iconv</titleabbrev> <partintro> <para> This module contains an interface to the iconv library functions. To be able to use the functions defined in this module you must compile you PHP interpreter using the --with-iconv option. In order to do so, you must have iconv() function in standard C library or libiconv installed on your system. libiconv library is available from <ulink url="&url.libiconv;"> &url.libiconv;</ulink>. </para> <para> iconv library function converts files between various encoded character sets. The supported character sets depend on iconv() implementation on your system. Note that iconv() function in some system is not work well as you expect. In this case, you should install libiconv library. </para> </partintro> <refentry id="function.iconv"> <refnamediv> <refname>iconv</refname> <refpurpose>Convert string to requested character encoding</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>iconv</function></funcdef> <paramdef>string <parameter>in_charset</parameter></paramdef> <paramdef>string <parameter>out_charset</parameter></paramdef> <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> <para> It converts the string <parameter>string</parameter> encoded in <parameter>in_charset</parameter> to the string encoded in <parameter>out_charset</parameter>. It returns the converted string or &false;, if it fails. </para> <para> <example> <title><function>iconv</function> example:</title> <programlisting role="php"> <![CDATA[ echo iconv("ISO-8859-1","UTF-8","This is test."); ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.iconv-get-encoding"> <refnamediv> <refname>iconv_get_encoding</refname> <refpurpose> Get current setting for character encoding conversion </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>iconv_get_encoding</function></funcdef> <paramdef>string <parameter><optional>type</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> It returns the current settings of <function>ob_iconv_handler</function> as array or &false; in failure. </para> <para> See also: <function>iconv_set_encoding</function> and <function>ob_iconv_handler</function>. </para> </refsect1> </refentry> <refentry id="function.iconv-set-encoding"> <refnamediv> <refname>iconv_set_encoding</refname> <refpurpose> Set current setting for character encoding conversion </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>iconv_set_encoding</function></funcdef> <paramdef>string <parameter>type</parameter></paramdef> <paramdef>string <parameter>charset</parameter></paramdef> </funcprototype> </funcsynopsis> <para> It changes the value of <parameter>type</parameter> to <parameter>charset</parameter> and returns &true; in success or &false; in failure. </para> <para> <example> <title><function>iconv_set_encoding</function> example:</title> <programlisting role="php"> <![CDATA[ iconv_set_encoding("internal_encoding", "UTF-8"); iconv_set_encoding("output_encoding", "ISO-8859-1"); ]]> </programlisting> </example> </para> <para> See also: <function>iconv_get_encoding</function> and <function>ob_iconv_handler</function>. </para> </refsect1> </refentry> <refentry id="function.ob-iconv-handler"> <refnamediv> <refname>ob_iconv_handler</refname> <refpurpose> Convert character encoding as output buffer handler </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>ob_iconv_handler</function></funcdef> <paramdef>string <parameter>contents</parameter> </paramdef> <paramdef>int <parameter>status</parameter> </paramdef> </funcprototype> </funcsynopsis> <para> It converts the string encoded in <parameter>internal_encoding</parameter> to <parameter>output_encoding</parameter>. </para> <para> <parameter>internal_encoding</parameter> and <parameter>output_encoding</parameter> should be defined by <function>iconv_set_encoding</function> or in configuration file. </para> <para> <example> <title><function>ob_iconv_handler</function> example:</title> <programlisting role="php"> <![CDATA[ ob_start("ob_iconv_handler"); // start output buffering ]]> </programlisting> </example> </para> <para> See also: <function>iconv_get_encoding</function> and <function>iconv_set_encoding</function>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/iisfunc.xml +++ phpdoc/kr/functions/iisfunc.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.iisfunc"> <title>IIS Administration functions</title> <titleabbrev>IIS Functions</titleabbrev> <partintro> <simpara> This extension is available for Win32 only. It provides functions to administrate Microsoft Internet Information Server (IIS). The extension includes function to create web sites and vertual directories as well as configuring security and script mapping. These functions have been added in PHP 4. </simpara> </partintro> <refentry id="function.iis-get-server-by-path"> <refnamediv> <refname>iis_get_server_by_path</refname> <refpurpose>Return the instance number associated with the Path</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_get_server_by_path</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Each vertual server in IIS is associated with an instance number. <function>iis_get_server_by_path</function> Finds the instance number from the actual path to the root directory. </para> </refsect1> </refentry> <refentry id="function.iis-get-server-by-comment"> <refnamediv> <refname>iis_get_server_by_comment</refname> <refpurpose>Return the instance number associated with the Comment</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_get_server_by_comment</function></funcdef> <paramdef>string <parameter>comment</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-add-server"> <refnamediv> <refname>iis_add_server</refname> <refpurpose>Creates a new virtual web server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_add_server</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> <paramdef>string <parameter>comment</parameter></paramdef> <paramdef>string <parameter>server_ip</parameter></paramdef> <paramdef>int <parameter>port</parameter></paramdef> <paramdef>string <parameter>host_name</parameter></paramdef> <paramdef>int <parameter>rights</parameter></paramdef> <paramdef>int <parameter>start_server</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-remove-server"> <refnamediv> <refname>iis_remove_server</refname> <refpurpose>Removes the virtual web server indicated by ServerInstance</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_remove_server</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-set-dir-security"> <refnamediv> <refname>iis_set_dir_security</refname> <refpurpose>Sets Directory Security</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_set_dir_security</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> <paramdef>int <parameter>directory_flags</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-get-dir-security"> <refnamediv> <refname>iis_get_dir_security</refname> <refpurpose>Gets Directory Security</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_get_dir_security</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-set-server-rights"> <refnamediv> <refname>iis_set_server_rights</refname> <refpurpose>Sets server rights</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_set_server_rights</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> <paramdef>int <parameter>directory_flags</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-get-server-rights"> <refnamediv> <refname>iis_get_server_rights</refname> <refpurpose>Gets server rights</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_get_server_rights</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-set-script-map"> <refnamediv> <refname>iis_set_script_map</refname> <refpurpose>Sets script mapping on a virtual directory</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_set_script_map</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> <paramdef>string <parameter>script_extension</parameter></paramdef> <paramdef>string <parameter>engine_path</parameter></paramdef> <paramdef>int <parameter>allow_scripting</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-get-script-map"> <refnamediv> <refname>iis_get_script_map</refname> <refpurpose>Gets script mapping on a virtual directory for a specific extention</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_get_script_map</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> <paramdef>string <parameter>script_extension</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-set-app-settings"> <refnamediv> <refname>iis_set_app_settings</refname> <refpurpose>Creates application scope for a virtual directory</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_set_app_settings</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> <paramdef>string <parameter>virtual_path</parameter></paramdef> <paramdef>string <parameter>application_scope</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-start-server"> <refnamediv> <refname>iis_start_server</refname> <refpurpose>Starts the virtual web server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_start_server</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-stop-server"> <refnamediv> <refname>iis_stop_server</refname> <refpurpose>Stops the virtual web server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_stop_server</function></funcdef> <paramdef>int <parameter>server_instance</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-stop-service"> <refnamediv> <refname>iis_stop_service</refname> <refpurpose>Stops the service defined by ServiceId</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_stop_service</function></funcdef> <paramdef>string <parameter>service_id</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-start-service"> <refnamediv> <refname>iis_start_service</refname> <refpurpose>Starts the service defined by ServiceId</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_start_service</function></funcdef> <paramdef>string <parameter>service_id</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> <refentry id="function.iis-get-service-state"> <refnamediv> <refname>iis_get_service_state/refname> <refpurpose>Starts the service defined by ServiceId</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>iis_get_service_state</function></funcdef> <paramdef>string <parameter>service_id</parameter></paramdef> </funcprototype> </funcsynopsis> <para> </para> </refsect1> </refentry> </reference> <!-- 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:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: --> Index: phpdoc/kr/functions/ircg.xml +++ phpdoc/kr/functions/ircg.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.ircg"> <title>IRC Gateway Functions</title> <titleabbrev>IRC Gateway</titleabbrev> <partintro> <para> Internet Relay Chat Gateway ... </para> <para> Based on <ulink url="&url.ircg;">IRCG</ulink>, from Sascha Schumann. </para> </partintro> <refentry id="function.ircg-pconnect"> <refnamediv> <refname>ircg_pconnect</refname> <refpurpose> Connect to an IRC server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>ircg_pconnect</function></funcdef> <paramdef>string <parameter>username</parameter></paramdef> <paramdef>string <parameter><optional>server_ip</optional></parameter> </paramdef> <paramdef>int <parameter><optional>server_port</optional></parameter> </paramdef> <paramdef>string <parameter><optional>msg_format</optional></parameter> </paramdef> <paramdef>array <parameter><optional>ctcp_messages</optional></parameter> </paramdef> <paramdef>array <parameter><optional>user_settings</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>ircg_pconnect</function> will try to establish a connection to an IRC server and return a connection resource handle for further use. </para> <para> The only mandatory parameter is <parameter>username</parameter>, this will set your initial nickname on the server. <parameter>server_ip</parameter> and <parameter>server_port</parameter> are optional and default to <literal>127.0.0.1</literal> and <literal>6667</literal>. <note> <para> For now parameter <parameter>server_ip</parameter> will not do any hostname lookups and will only accept IP addresses in numerical form. </para> </note> </para> <para> You can customize the output of IRC messages and events by selection a format string set previously created with <function>ircg_register_format_messages</function> by specifing the sets name in <parameter>msg_format</parameter>. </para> <para> <parameter>ctcp_messages</parameter> </para> <para> <parameter>user_settings</parameter> </para> <para> See also: <function>ircg_disconnect</function>, <function>ircg_is_conn_alive</function>, <function>ircg_register_format_messages</function>. </para> </refsect1> </refentry> <refentry id="function.ircg-fetch-error-msg"> <refnamediv> <refname>ircg_fetch_error_msg</refname> <refpurpose> Returns the error from previous ircg operation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>ircg_fetch_error_msg</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>ircg_fetch_error_msg</function> returns the error from the last called ircg function. </para> <note> <para> Errorcode is stored in first array element, errortext in second. </para> </note> <para> <example> <title><function>ircg_fetch_error_msg</function> example</title> <programlisting role="php"> <![CDATA[ if (!ircg_join ($id, "#php")) { $error = ircg_fetch_error_msg($id); print ("Can't join channel #php. Errorcode: $error[0] Description: $error[1]"); } ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.ircg-set-current"> <refnamediv> <refname>ircg_set_current</refname> <refpurpose> Set current connection for output </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_set_current</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Select the current connection for output in this execution context. Every output sent from the server connected to by <parameter>connection</parameter> will be copied to standard output while using default formating or a formar string set specified by <function>ircg_register_format_messages</function> and selected by <function>ircg_lookup_format_messages</function>. </para> <para> See also: <function>ircg_register_format_messages</function> and <function>ircg_lookup_format_messages</function>. </para> </refsect1> </refentry> <refentry id="function.ircg-join"> <refnamediv> <refname>ircg_join</refname> <refpurpose> Join a channel on a connected server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_join</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>channel</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Join the channel <parameter>channel</parameter> on the server connected to by <parameter>connection</parameter>. </para> </refsect1> </refentry> <refentry id="function.ircg-part"> <refnamediv> <refname>ircg_part</refname> <refpurpose> Leave a channel on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_part</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>channel</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Leave the channel <parameter>channel</parameter> on the server connected to by <parameter>connection</parameter>. </para> </refsect1> </refentry> <refentry id="function.ircg-msg"> <refnamediv> <refname>ircg_msg</refname> <refpurpose> Send message to channel or user on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_msg</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>recipient</parameter></paramdef> <paramdef>string <parameter>message</parameter></paramdef> <paramdef>boolean <parameter><optional>suppress</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> <function>ircg_msg</function> will send the message to a channel or user on the server connected to by <parameter>connection</parameter>. A <parameter>recipient</parameter> starting with <literal>#</literal> or <literal>&amp;</literal> will send the <parameter>message</parameter> to a channel, anything else will be interpreted as a username. </para> <para> Setting the optional parameter <parameter>suppress</parameter> to a &true; value will suppress output of your message to your own <parameter>connection</parameter>. </para> </refsect1> </refentry> <refentry id="function.ircg-notice"> <refnamediv> <refname>ircg_notice</refname> <refpurpose> Send a notice to a user on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_notice</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter></parameter></paramdef> <paramdef>string <parameter>message</parameter></paramdef> </funcprototype> </funcsynopsis> <para> This function will send the <parameter>message</parameter> text to the user <parameter>nick</parameter> on the server connected to by <parameter>connection</parameter>. Query your IRC documentation of choice for the exact difference between a MSG and a NOTICE. </para> </refsect1> </refentry> <refentry id="function.ircg-nick"> <refnamediv> <refname>ircg_nick</refname> <refpurpose> Change nickname on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_nick</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Change your nickname on the given <parameter>connection</parameter> to the one given in <parameter>nick</parameter> if possible. </para> <para> Will return &true; on success and &false; on failure. </para> </refsect1> </refentry> <refentry id="function.ircg-topic"> <refnamediv> <refname>ircg_topic</refname> <refpurpose> Set topic for channel on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_topic</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>channel</parameter></paramdef> <paramdef>string <parameter>new_topic</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Change the topic for channel <parameter>channel</parameter> on the server connected to by <parameter>connection</parameter> to <parameter>new_topic</parameter>. </para> </refsect1> </refentry> <refentry id="function.ircg-channel-mode"> <refnamediv> <refname>ircg_channel_mode</refname> <refpurpose> Set channel mode flags for user </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_channel_mode</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>channel</parameter></paramdef> <paramdef>string <parameter>mode_spec</parameter></paramdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Set channel mode flags for <parameter>channel</parameter> on server connected to by <parameter>connection</parameter>. Mode flags are passed in <parameter>mode_spec</parameter> and are applied to the user specified by <parameter>nick</parameter>. </para> <para> Mode flags are set or cleared by specifind a mode character and prepending it with a plus or minus character respectively. E.g. operator mode is granted by '+o' and revoked by '-o' passed as <parameter>mode_spec</parameter>. </para> </refsect1> </refentry> <refentry id="function.ircg-html-encode"> <refnamediv> <refname>ircg_html_encode</refname> <refpurpose> Encodes HTML preserving output </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_html_encode</function></funcdef> <paramdef>string <parameter>html_string</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Encodes a HTML string <parameter>html_string</parameter> for output. This feature could be usable, e.g. if someone wants to discuss about an html problem. </para> </refsect1> </refentry> <refentry id="function.ircg-whois"> <refnamediv> <refname>ircg_whois</refname> <refpurpose> Query user information for nick on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_whois</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Sends a query to the connected server <parameter>connection</parameter> to send information for the specified user <parameter>nick</parameter>. </para> </refsect1> </refentry> <refentry id="function.ircg-kick"> <refnamediv> <refname>ircg_kick</refname> <refpurpose> Kick a user out of a channel on server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_kick</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>channel</parameter></paramdef> <paramdef>string <parameter>nick</parameter></paramdef> <paramdef>string <parameter>reason</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Kick user <parameter>nick</parameter> from <parameter>channel</parameter> on server connected to by <parameter>connection</parameter>. <parameter>reason</parameter> should give a short message describing why this action was performed. </para> </refsect1> </refentry> <refentry id="function.ircg-ignore-add"> <refnamediv> <refname>ircg_ignore_add</refname> <refpurpose> Add a user to your ignore list on a server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_ignore_add</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> This function will add user <parameter>nick</parameter> to your ignore list on the server connected to by <parameter>connection</parameter>. By doing so you will suppress all messages from this user from being send to you. </para> <para> See also: <function>ircg_ignore_del</function>. </para> </refsect1> </refentry> <refentry id="function.ircg-ignore-del"> <refnamediv> <refname>ircg_ignore_del</refname> <refpurpose> Remove a user from your ignore list on a server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_ignore_del</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> This function remove user <parameter>nick</parameter> from your ignore list on the server connected to by <parameter>connection</parameter>. </para> <para> See also: <function>ircg_ignore_add</function>. </para> </refsect1> </refentry> <refentry id="function.ircg-disconnect"> <refnamediv> <refname>ircg_disconnect</refname> <refpurpose> Close connection to server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_disconnect</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> <paramdef>string <parameter>reason</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>ircg_disconnect</function> will close a <parameter>connection</parameter> to a server previously established with <function>ircg-pconnect</function>. </para> <para> See also: <function>ircg_pconnect</function>. </para> </refsect1> </refentry> <refentry id="function.ircg-is-conn-alive"> <refnamediv> <refname>ircg_is_conn_alive</refname> <refpurpose> Check connection status </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_is_conn_alive</function></funcdef> <paramdef>resource <parameter>connection</parameter></paramdef> </funcprototype> </funcsynopsis> <para> <function>ircg_is_conn_alive</function> returns &true; if <parameter>connection</parameter> is still alive and working or &false; if the server no longer talks to us. </para> </refsect1> </refentry> <refentry id="function.ircg-lookup-format-messages"> <refnamediv> <refname>ircg_lookup_format_messages</refname> <refpurpose> Select a set of format strings for display of IRC messages </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_lookup_format_messages</function> </funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Select the set of format strings to use for display of IRC messages and events. Sets may be registered with <function>ircg_register_format_messages</function>, a default set named <literal>ircg</literal> is always available. </para> <para> See also: <function>ircg_register_format_messages</function> </para> </refsect1> </refentry> <refentry id="function.ircg-register-format-messages"> <refnamediv> <refname>ircg_register_format_messages</refname> <refpurpose> Register a set of format strings for display of IRC messages </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>ircg_register_format_messages</function> </funcdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>array <parameter>messages</parameter></paramdef> </funcprototype> </funcsynopsis> <para> With <function>ircg_register_format_messages</function> you can customize the way your IRC output looks like. You can even register different format string sets and switch between them on the fly with <function>ircg_lookup_format_messages</function>. </para> <para> <itemizedlist> <listitem><simpara>Plain channel message</simpara></listitem> <listitem><simpara>Private message received</simpara></listitem> <listitem><simpara>Private message sent</simpara></listitem> <listitem><simpara>Some user leaves channel</simpara></listitem> <listitem><simpara>Some user enters channel</simpara></listitem> <listitem> <simpara>Some user was kicked from the channel</simpara> </listitem> <listitem><simpara>Topic has been changed</simpara></listitem> <listitem><simpara>Error</simpara></listitem> <listitem><simpara>Fatal error</simpara></listitem> <listitem><simpara>Join list end(?)</simpara></listitem> <listitem><simpara>Self part(?)</simpara></listitem> <listitem><simpara>Some user changes his nick</simpara></listitem> <listitem> <simpara>Some user quits his connection</simpara> </listitem> <listitem><simpara>Mass join begin</simpara></listitem> <listitem><simpara>Mass join element</simpara></listitem> <listitem><simpara>Mass join end</simpara></listitem> <listitem><simpara>Whois user</simpara></listitem> <listitem><simpara>Whois server</simpara></listitem> <listitem><simpara>Whois idle</simpara></listitem> <listitem><simpara>Whois channel</simpara></listitem> <listitem><simpara>Whois end</simpara></listitem> <listitem> <simpara>Voice status change on user</simpara> </listitem> <listitem> <simpara>Operator status change on user</simpara> </listitem> <listitem><simpara>Banlist</simpara></listitem> <listitem><simpara>Banlist end</simpara></listitem> </itemizedlist> <itemizedlist> <listitem><simpara>%f - from</simpara></listitem> <listitem><simpara>%t - to</simpara></listitem> <listitem><simpara>%c - channel</simpara></listitem> <listitem><simpara>%r - plain message</simpara></listitem> <listitem><simpara>%m - encoded message</simpara></listitem> <listitem><simpara>%j - js encoded message</simpara></listitem> </itemizedlist> <itemizedlist> <listitem><simpara>1 - mod encode</simpara></listitem> <listitem><simpara>2 - nickname decode</simpara></listitem> </itemizedlist> </para> <para> See also: <function>ircg_lookup_format_messages</function>. </para> </refsect1> </refentry> <refentry id='function.ircg-set-on-die'> <refnamediv> <refname>ircg_set_on_die</refname> <refpurpose> Set hostaction to be execute when connection dies */ </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ircg_set_on_die</function></funcdef> <paramdef>int <parameter>connection</parameter></paramdef> <paramdef>string <parameter>host</parameter></paramdef> <paramdef>int <parameter>port</parameter></paramdef> <paramdef>string <parameter>data</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.ircg-set-file'> <refnamediv> <refname>ircg_set_file</refname> <refpurpose> Set logfile for connection </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ircg_set_file</function></funcdef> <paramdef>int <parameter>connection</parameter></paramdef> <paramdef>string <parameter>path</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.ircg-get-username'> <refnamediv> <refname>ircg_get_username</refname> <refpurpose> Get username for connection </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>ircg_get_username</function></funcdef> <paramdef>int <parameter>connection</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.ircg-nickname-escape'> <refnamediv> <refname>ircg_nickname_escape</refname> <refpurpose> Encode special characters in nickname to be IRC-compliant </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>ircg_nickname_escape</function></funcdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.ircg-nickname-unescape'> <refnamediv> <refname>ircg_nickname_escape</refname> <refpurpose> Decode encoded nickname </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>ircg_nickname_escape</function></funcdef> <paramdef>string <parameter>nick</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/java.xml +++ phpdoc/kr/functions/java.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.java"> <title>Java</title> <titleabbrev>PHP / Java Integration</titleabbrev> <partintro> <para> There are two possible ways to bridge PHP and Java: you can either integrate PHP into a Java Servlet environment, which is the more stable and efficient solution, or integrate Java support into PHP. The former is provided by a SAPI module that interfaces with the Servlet server, the latter by the Java extension. </para> <para> PHP 4 ext/java provides a simple and effective means for creating and invoking methods on Java objects from PHP. The JVM is created using JNI, and everything runs in-process. Build instructions for ext/java can be found in <filename>php4/ext/java/README</filename>. <example> <title>Java Example</title> <programlisting role="php"> <![CDATA[ <?php // get instance of Java class java.lang.System in PHP $system = new Java('java.lang.System'); // demonstrate property access print 'Java version='.$system->getProperty('java.version').' <br>'; print 'Java vendor=' .$system->getProperty('java.vendor').' <br>'; print 'OS='.$system->getProperty('os.name').' '. $system->getProperty('os.version').' on '. $system->getProperty('os.arch').' <br>'; // java.util.Date example $formatter = new Java('java.text.SimpleDateFormat', "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"); print $formatter->format(new Java('java.util.Date')); ?> ]]> </programlisting> </example> <example> <title>AWT Example</title> <programlisting role="php"> <![CDATA[ <?php // This example is only intented to be run as a CGI. $frame = new Java('java.awt.Frame', 'PHP'); $button = new Java('java.awt.Button', 'Hello Java World!'); $frame->add('North', $button); $frame->validate(); $frame->pack(); $frame->visible = True; $thread = new Java('java.lang.Thread'); $thread->sleep(10000); $frame->dispose(); ?> ]]> </programlisting> </example> Notes: <itemizedlist> <listitem> <simpara> <literal>new Java()</literal> will create an instance of a class if a suitable constructor is available. If no parameters are passed and the default constructor is useful as it provides access to classes like <literal>java.lang.System</literal> which expose most of their functionallity through static methods. </simpara> </listitem> <listitem> <simpara> Accessing a member of an instance will first look for bean properties then public fields. In other words, <literal>print $date.time</literal> will first attempt to be resolved as <literal>$date.getTime()</literal>, then as <literal>$date.time</literal>. </simpara> </listitem> <listitem> <simpara> Both static and instance members can be accessed on an object with the same syntax. Furthermore, if the java object is of type <literal>java.lang.Class</literal>, then static members of the class (fields and methods) can be accessed. </simpara> </listitem> <listitem> <para> Exceptions raised result in PHP warnings, and &null; results. The warnings may be eliminated by prefixing the method call with an "@" sign. The following APIs may be used to retrieve and reset the last error: <itemizedlist> <listitem><simpara><function>java_last_exception_get</function></simpara></listitem> <listitem><simpara><function>java_last_exception_clear</function></simpara></listitem> </itemizedlist> </para> </listitem> <listitem> <simpara> Overload resolution is in general a hard problem given the differences in types between the two languages. The PHP Java extension employs a simple, but fairly effective, metric for determining which overload is the best match. </simpara> <simpara> Additionally, method names in PHP are not case sensitive, potentially increasing the number of overloads to select from. </simpara> <simpara> Once a method is selected, the parameters are cooerced if necessary, possibly with a loss of data (example: double precision floating point numbers will be converted to boolean). <!-- FIXME Why aren't java-doubles converted to PHP-floats? Is this correct? --> </simpara> </listitem> <listitem> <simpara> In the tradition of PHP, arrays and hashtables may pretty much be used interchangably. Note that hashtables in PHP may only be indexed by integers or strings; and that arrays of primitive types in Java can not be sparse. Also note that these constructs are passed by value, so may be expensive in terms of memory and time. </simpara> </listitem> </itemizedlist> </para> <para> sapi/servlet builds upon the mechanism defined by ext/java to enable the entire PHP processor to be run as a servlet. The primary advanatage of this from a PHP perspective is that web servers which support servlets typically take great care in pooling and reusing JVMs. Build instructions for the Servlet SAPI module can be found in <filename>php4/sapi/README</filename>. Notes: <itemizedlist> <listitem> <simpara> While this code is intended to be able to run on any servlet engine, it has only been tested on Apache's Jakarta/tomcat to date. Bug reports, success stories and/or patches required to get this code to run on other engines would be appreciated. </simpara> </listitem> <listitem> <simpara> PHP has a habit of changing the working directory. sapi/servlet will eventually change it back, but while PHP is running the servlet engine may not be able to load any classes from the CLASSPATH which are specified using a relative directory syntax, or find the work directory used for administration and JSP compilation tasks. </simpara> </listitem> </itemizedlist> </para> </partintro> <refentry id="function.java-last-exception-clear"> <refnamediv> <refname>java_last_exception_clear</refname> <refpurpose>Clear last Java exception</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>java_last_exception_clear</function></funcdef> <void/> </funcprototype> </funcsynopsis> </refsect1> </refentry> <refentry id="function.java-last-exception-get"> <refnamediv> <refname>java_last_exception_get</refname> <refpurpose>Get last Java exception</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>exception <function>java_last_exception_get</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> The following example demonstrates the usage of Java's exception handler from within PHP: <example> <title>Java exception handler</title> <programlisting role="php"> <![CDATA[ <?php $stack = new Java('java.util.Stack'); $stack->push(1); // This should succeed $result = $stack->pop(); $ex = java_last_exception_get(); if (!$ex) print "$result\n"; // This should fail (error suppressed by @) $result = @$stack->pop(); $ex = java_last_exception_get(); if ($ex) print $ex->toString(); // Clear last exception java_last_exception_clear(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/mailparse.xml +++ phpdoc/kr/functions/mailparse.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.mailparse"> <title>mailparse functions</title> <titleabbrev>mailparse functions</titleabbrev> <partintro> <para> &warn.experimental; </para> </partintro> <refentry id="function.mailparse-uudecode-all"> <refnamediv> <refname>mailparse_uudecode_all</refname> <refpurpose> Scans the data from fp and extract each embedded uuencoded file. Returns an array listing filename information </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>mailparse_uudecode_all</function></funcdef> <paramdef>resource <parameter>fp</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-rfc822-parse-addresses"> <refnamediv> <refname>mailparse_rfc822_parse_addresses</refname> <refpurpose> Parse addresses and returns a hash containing that data </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>mailparse_rfc822_parse_addresses</function></funcdef> <paramdef>string <parameter>addresses</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-determine-best-xfer-encoding"> <refnamediv> <refname>mailparse_determine_best_xfer_encoding</refname> <refpurpose> Figures out the best way of encoding the content read from the file pointer fp, which must be seek-able </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mailparse_determine_best_xfer_encoding</function></funcdef> <paramdef>resource <parameter>fp</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-stream-encode"> <refnamediv> <refname>mailparse_stream_encode</refname> <refpurpose> Streams data from source file pointer, apply encoding and write to destfp </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>mailparse_stream_encode</function></funcdef> <paramdef>resource <parameter>sourcefp</parameter></paramdef> <paramdef>resource <parameter>destfp</parameter></paramdef> <paramdef>string <parameter>encoding</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-parse"> <refnamediv> <refname>mailparse_msg_parse</refname> <refpurpose>Incrementally parse data into buffer </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>mailparse_msg_parse</function></funcdef> <paramdef>resource <parameter>rfc2045buf</parameter></paramdef> <paramdef>string <parameter>data</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-parse-file"> <refnamediv> <refname>mailparse_msg_parse_file</refname> <refpurpose>Parse file and return a resource representing the structure </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>mailparse_msg_parse_file</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-free"> <refnamediv> <refname>mailparse_msg_free</refname> <refpurpose>Frees a handle allocated by mailparse_msg_crea</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>mailparse_msg_free</function></funcdef> <paramdef>resource <parameter>rfc2045buf</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-create"> <refnamediv> <refname>mailparse_msg_create</refname> <refpurpose>Returns a handle that can be used to parse a message </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mailparse_msg_create</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-get-structure"> <refnamediv> <refname>mailparse_msg_get_structure</refname> <refpurpose>Returns an array of mime section names in the supplied message </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>mailparse_msg_get_structure</function></funcdef> <paramdef>resource <parameter>rfc2045</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-extract-part"> <refnamediv> <refname>mailparse_msg_extract_part</refname> <refpurpose> Extracts/decodes a message section. If callbackfunc is not specified, the contents will be sent to "stdout" </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>mailparse_msg_extract_part</function></funcdef> <paramdef>resource <parameter>rfc2045</parameter></paramdef> <paramdef>string <parameter>msgbody</parameter></paramdef> <paramdef>string <parameter><optional>callbackfunc</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-extract-part-file"> <refnamediv> <refname>mailparse_msg_extract_part_file</refname> <refpurpose>Extracts/decodes a message section, decoding the transfer encoding </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mailparse_msg_extract_part_file</function></funcdef> <paramdef>resource <parameter>rfc2045</parameter></paramdef> <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>string <parameter><optional>callbackfunc</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-get-part-data"> <refnamediv> <refname>mailparse_msg_get_part_data</refname> <refpurpose>Returns an associative array of info about the message </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>mailparse_msg_get_part_data</function></funcdef> <paramdef>resource <parameter>rfc2045</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.mailparse-msg-get-part"> <refnamediv> <refname>mailparse_msg_get_part</refname> <refpurpose>Returns a handle on a given section in a mimemessage </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mailparse_msg_get_part</function></funcdef> <paramdef>resource <parameter>rfc2045</parameter></paramdef> <paramdef>string <parameter>mimesection</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/mbstring.xml +++ phpdoc/kr/functions/mbstring.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.mbstring"> <title>Multi-Byte String Functions</title> <titleabbrev> Multi-Byte String </titleabbrev> <partintro> &warn.experimental; <sect1 id="mb-intro"> <title>Introduction</title> <warning> <simpara> This module is EXPERIMENTAL. Function name/API is subject to change. Current conversion filter supports Japanese only. </simpara> </warning> <para> There are many languages in which all characters can be expressed by single byte. Multi-byte character codes are used to express many characters for many languages. <literal>mbstring</literal> is developed to handle Japanese characters. However, many <literal>mbstring</literal> functions are able to handle character encoding other than Japanese. </para> <para> A multi-byte character encoding represents single character with consecutive bytes. Some character encoding has shift(escape) sequences to start/end multi-byte character strings. Therefore, a multi-byte character string may be destroyed when it is divided and/or counted unless multi-byte character encoding safe method is used. This module provides multi-byte character safe string functions and other utility functions such as conversion functions. </para> <para> Since PHP is basically designed for ISO-8859-1, some multi-byte character encoding does not work well with PHP. Therefore, it is important to set <literal>mbstring.internal_encoding</literal> to a character encoding that works with PHP. </para> <para> PHP4 Character Encoding Requirements </para> <para> <itemizedlist> <listitem> <simpara> Per byte encoding </simpara> </listitem> <listitem> <simpara> Single byte characters in range of <literal>00h-7fh</literal> which is compatible with <literal>ASCII</literal> </simpara> </listitem> <listitem> <simpara> Multi-byte characters without <literal>00h-7fh</literal> </simpara> </listitem> </itemizedlist> </para> <para> These are examples of internal character encoding that works with PHP and does NOT work with PHP. <informalexample> <programlisting> <![CDATA[ Character encodings work with PHP: ISO-8859-*, EUC-JP, UTF-8 Character encodings do NOT work with PHP: JIS, SJIS ]]> </programlisting> </informalexample> </para> <para> Character encoding, that does not work with PHP, may be converted with <literal>mbstring</literal>'s HTTP input/output conversion feature/function. </para> <note> <para> SJIS should not be used for internal encoding unless the reader is familiar with parser/compiler, character encoding and character encoding issues. </para> </note> <note> <para> If you use database with PHP, it is recommended that you use the same character encoding for both database and <literal>internal encoding</literal> for ease of use and better performance. </para> <para> If you are using PostgreSQL, it supports character encoding that is different from backend character encoding. See the PostgreSQL manual for details. </para> </note> <sect2 id="mb-enable"> <title>How to Enable mbstring</title> <para> <literal>mbstring</literal> is an extended module. You must enable module with <literal>configure</literal> script. Refer to the <link linkend="installation">Install</link> section for details. </para> <simpara> The following configure options are related to <literal>mbstring</literal> module. </simpara> <para> <itemizedlist> <listitem> <para> <option role="configure">--enable-mbstring</option> : Enable <literal>mbstring</literal> functions. This option is required to use <literal>mbstring</literal> functions. </para> </listitem> <listitem> <para> <option role="configure">--enable-mbstr-enc-trans</option> : Enable HTTP input character encoding conversion using <literal>mbstring</literal> conversion engine. If this feature is enabled, HTTP input character encoding may be converted to <literal>mbstring.internal_encoding</literal> automatically. </para> </listitem> </itemizedlist> </para> </sect2> <sect2 id="mb-conv"> <title>HTTP Input and Output</title> <para> HTTP input/output character encoding conversion may convert binary data also. Users are supposed to control character encoding conversion if binary data is used for HTTP input/output. </para> <para> If <literal>enctype</literal> for HTML form is set to <literal>multipart/form-data</literal>, <literal>mbstring</literal> does not convert character encoding in POST data. If it is the case, strings are needed to be converted to internal character encoding. </para> <para> <itemizedlist> <listitem> <simpara> HTTP Input </simpara> <para> There is no way to control HTTP input character conversion from PHP script. To disable HTTP input character conversion, it has to be done in <literal>php.ini</literal>. <example> <title> Disable HTTP input conversion in php.ini </title> <programlisting role="php"> <![CDATA[ ;; Disable HTTP Input conversion mbstring.http_input = pass ]]> </programlisting> </example> </para> <para> When using PHP as an Apache module, it is possible to override PHP ini setting per Virtual Host in <literal>httpd.conf</literal> or per directory with <literal>.htaccess</literal>. Refer to the <link linkend="configuration">Configuration</link> section and Apache Manual for details. </para> </listitem> <listitem> <simpara> HTTP Output </simpara> <para> There are several ways to enable output character encoding conversion. One is using <literal>php.ini</literal>, another is using <function>ob_start</function> with <function>mb_output_handler</function> as <literal>ob_start</literal> callback function. </para> <note> <para> For PHP3-i18n users, <literal>mbstring</literal>'s output conversion differs from PHP3-i18n. Character encoding is converted using output buffer. </para> </note> </listitem> </itemizedlist> </para> <para> <example> <title><literal>php.ini</literal> setting example</title> <programlisting role="php"> <![CDATA[ ;; Enable output character encoding conversion for all PHP pages ;; Enable Output Buffering output_buffering = On ;; Set mb_output_handler to enable output conversion output_handler = mb_output_handler ]]> </programlisting> </example> </para> <para> <example> <title>Script example</title> <programlisting role="php"> <![CDATA[ <?php // Enable output character encoding conversion only for this page // Set HTTP output character encoding to SJIS mb_http_output('SJIS'); // Start buffering and specify "mb_output_handler" as // callback function ob_start('mb_output_handler'); ?> ]]> </programlisting> </example> </para> </sect2> <sect2 id="mb-code"> <title>Supported Character Encoding</title> <simpara> Currently, the following character encoding is supported by <literal>mbstring</literal> module. Caracter encoding may be specified for <literal>mbstring</literal> functions' <literal>encoding</literal> parameter. </simpara> <para> The following character encoding is supported in this PHP extension : </para> <para> <literal>UCS-4</literal>, <literal>UCS-4BE</literal>, <literal>UCS-4LE</literal>, <literal>UCS-2</literal>, <literal>UCS-2BE</literal>, <literal>UCS-2LE</literal>, <literal>UTF-32</literal>, <literal>UTF-32BE</literal>, <literal>UTF-32LE</literal>, <literal>UCS-2LE</literal>, <literal>UTF-16</literal>, <literal>UTF-16BE</literal>, <literal>UTF-16LE</literal>, <literal>UTF-8</literal>, <literal>UTF-7</literal>, <literal>ASCII</literal>, <literal>EUC-JP</literal>, <literal>SJIS</literal>, <literal>eucJP-win</literal>, <literal>SJIS-win</literal>, <literal>ISO-2022-JP</literal>, <literal>JIS</literal>, <literal>ISO-8859-1</literal>, <literal>ISO-8859-2</literal>, <literal>ISO-8859-3</literal>, <literal>ISO-8859-4</literal>, <literal>ISO-8859-5</literal>, <literal>ISO-8859-6</literal>, <literal>ISO-8859-7</literal>, <literal>ISO-8859-8</literal>, <literal>ISO-8859-9</literal>, <literal>ISO-8859-10</literal>, <literal>ISO-8859-13</literal>, <literal>ISO-8859-14</literal>, <literal>ISO-8859-15</literal>, <literal>byte2be</literal>, <literal>byte2le</literal>, <literal>byte4be</literal>, <literal>byte4le</literal>, <literal>BASE64</literal>, <literal>7bit</literal>, <literal>8bit</literal> and <literal>UTF7-IMAP</literal>. </para> <para> <literal>php.ini</literal> entry, which accepts encoding name, accepts &quot;<literal>auto</literal>&quot; and &quot;<literal>pass</literal>&quot; also. <literal>mbstring</literal> functions, which accepts encoding name, and accepts &quot;<literal>auto</literal>&quot;. </para> <para> If &quot;<literal>pass</literal>&quot; is set, no character encoding conversion is performed. </para> <para> If &quot;<literal>auto</literal>&quot; is set, it is expanded to &quot;<literal>ASCII,JIS,UTF-8,EUC-JP,SJIS</literal>&quot;. </para> <para> See also <function>mb_detect_order</function> </para> <note> <para> &quot;Supported character encoding&quot; does not mean that it works as internal character code. </para> </note> </sect2> <sect2 id="mb-ini"> <title>php.ini settings</title> <para> <itemizedlist> <listitem> <simpara> <literal>mbstring.internal_encoding</literal> defines default internal character encoding. </simpara> </listitem> <listitem> <simpara> <literal>mbstring.http_input</literal> defines default HTTP input character encoding. </simpara> </listitem> <listitem> <simpara> <literal>mbstring.http_output</literal> defines default HTTP output character encoding. </simpara> </listitem> <listitem> <simpara> <literal>mbstring.detect_order</literal> defines default character code detection order. See also <function>mb_detect_order</function>. </simpara> </listitem> <listitem> <simpara> <literal>mbstring.substitute_character</literal> defines character to substitute for invalid character encoding. </simpara> </listitem> </itemizedlist> </para> <para> Web Browsers are supposed to use the same character encoding when submitting form. However, browsers may not use the same character encoding. See <function>mb_http_input</function> to detect character encoding used by browsers. </para> <para> If <literal>enctype</literal> is set to <literal>multipart/form-data</literal> in HTML forms, <literal>mbstring</literal> does not convert character encoding in POST data. The user must convert them in the script, if conversion is needed. </para> <para> Although, browsers are smart enough to detect character encoding in HTML. <literal>charset</literal> is better to be set in HTTP header. Change <literal>default_charset</literal> according to character encoding. </para> <para> <example> <title><literal>php.ini</literal> setting example</title> <programlisting role="php"> <![CDATA[ ;; Set default internal encoding ;; Note: Make sure to use character encoding works with PHP mbstring.internal_encoding = UTF-8 ; Set internal encoding to UTF-8 ;; Set default HTTP input character encoding ;; Note: Script cannot change http_input setting. mbstring.http_input = pass ; No conversion. mbstring.http_input = auto ; Set HTTP input to auto ; "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" mbstring.http_input = SJIS ; Set HTTP2 input to SJIS mbstring.http_input = UTF-8,SJIS,EUC-JP ; Specify order ;; Set default HTTP output character encoding mbstring.http_output = pass ; No conversion mbstring.http_output = UTF-8 ; Set HTTP output encoding to UTF-8 ;; Set default character encoding detection order mbstring.detect_order = auto ; Set detect order to auto mbstring.detect_order = ASCII,JIS,UTF-8,SJIS,EUC-JP ; Specify order ;; Set default substitute character mbstring.substitute_character = 12307 ; Specify Unicode value mbstring.substitute_character = none ; Do not print character mbstring.substitute_character = long ; Long Example: U+3000,JIS+7E7E ]]> </programlisting> </example> </para> <para> <example> <title><literal>php.ini</literal> setting for <literal>EUC-JP</literal> users</title> <programlisting role="php"> <![CDATA[ ;; Disable Output Buffering output_buffering = Off ;; Set HTTP header charset default_charset = EUC-JP ;; Set HTTP input encoding conversion to auto mbstring.http_input = auto ;; Convert HTTP output to EUC-JP mbstring.http_output = EUC-JP ;; Set internal encoding to EUC-JP mbstring.internal_encoding = EUC-JP ;; Do not print invalid characters mbstring.substitute_character = none ]]> </programlisting> </example> </para> <para> <example> <title><literal>php.ini</literal> setting for <literal>SJIS</literal> users</title> <programlisting role="php"> <![CDATA[ ;; Enable Output Buffering output_buffering = On ;; Set mb_output_handler to enable output conversion output_handler = mb_output_handler ;; Set HTTP header charset default_charset = Shift_JIS ;; Set http input encoding conversion to auto mbstring.http_input = auto ;; Convert to SJIS mbstring.http_output = SJIS ;; Set internal encoding to EUC-JP mbstring.internal_encoding = EUC-JP ;; Do not print invalid characters mbstring.substitute_character = none ]]> </programlisting> </example> </para> </sect2> <sect2 id="mb-ja-basic"> <title>Basics for Japanese multi-byte character</title> <para> Most Japanese characters need more than 1 byte per character. In addition, several character encoding schemas are used under a Japanese environment. There are EUC-JP, Shift_JIS(SJIS) and ISO-2022-JP(JIS) character encoding. As Unicode becomes popular, UTF-8 is used also. To develop Web applications for a Japanese environment, it is important to use the character set for the task in hand, whether HTTP input/output, RDBMS and E-mail. </para> <para> <itemizedlist> <listitem> <simpara>Storage for a character can be up to six bytes</simpara> </listitem> <listitem> <simpara> A multi-byte character is usually twice of the width compared to single-byte characters. Wider characters are called "zen-kaku" - meaning full width, narrower characters are called "han-kaku" - meaning half width. "zen-kaku" characters are usually fixed width. </simpara> </listitem> <listitem> <simpara> Some character encoding defines shift(escape) sequence for entering/exiting multi-byte character strings. </simpara> </listitem> <listitem> <simpara> ISO-2022-JP must be used for SMTP/NNTP. </simpara> </listitem> <listitem> <para> &quot;i-mode&quot; web site is supposed to use SJIS. </para> </listitem> </itemizedlist> </para> </sect2> <sect2 id="mb-ref"> <title>References</title> <para> Multi-byte character encoding and its related issues are very complex. It is impossible to cover in sufficient detail here. Please refer to the following URLs and other resources for further readings. <itemizedlist> <listitem> <para> Unicode/UTF/UCS/etc </para> <para> <literal>http://www.unicode.org/</literal> </para> </listitem> <listitem> <para> Japanese/Korean/Chinese character information </para> <para> <literal> ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/cjk.inf </literal> </para> </listitem> </itemizedlist> </para> </sect2> </sect1> </partintro> <refentry id="function.mb-language"> <refnamediv> <refname>mb_language</refname> <refpurpose> Set/Get current language </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_language</function></funcdef> <paramdef>string <parameter><optional>language</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_language</function> sets language. If <parameter>language</parameter> is omitted, it returns current language as string. </para> <para> <parameter>language</parameter> setting is used for encoding e-mail messages. Valid languages are "Japanese", "ja","English","en" and "uni" (UTF-8). <function>mb_send_mail</function> uses this setting to encode e-mail. </para> <para> Language and its setting is ISO-2022-JP/Base64 for Japanese, UTF-8/Base64 for uni, ISO-8859-1/quoted printable for English. </para> <para> Return Value: If <parameter>language</parameter> is set and <parameter>language</parameter> is valid, it returns &true;. Otherwise, it returns &false;. When <parameter>language</parameter> is omitted, it returns language name as string. If no language is set previously, it returns &false;. </para> <para> See also <function>mb_send_mail</function>. </para> </refsect1> </refentry> <refentry id="function.mb-parse-str"> <refnamediv> <refname>mb_parse_str</refname> <refpurpose> Parse GET/POST/COOKIE data and set global variable </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>mb_parse_str</function> </funcdef> <paramdef>string <parameter>encoded_string</parameter> </paramdef> <paramdef>array <parameter><optional>result</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_parse_str</function> parses GET/POST/COOKIE data and sets global variables. Since PHP does not provide raw POST/COOKIE data, it can only used for GET data for now. It preses URL encoded data, detects encoding, converts coding to internal encoding and set values to <parameter>result</parameter> array or global variables. </para> <para> <parameter>encoded_string</parameter>: URL encoded data. </para> <para> <parameter>result</parameter>: Array contains decoded and character encoding converted values. </para> <para> Return Value: It returns &true; for success or &false; for failure. </para> <para> See also <function>mb_detect_order</function>, <function>mb_internal_encoding</function>. </para> </refsect1> </refentry> <refentry id="function.mb-internal-encoding"> <refnamediv> <refname>mb_internal_encoding</refname> <refpurpose> Set/Get internal character encoding </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_internal_encoding</function></funcdef> <paramdef>string <parameter><optional>encoding</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_internal_encoding</function> sets internal character encoding to <parameter>encoding</parameter> If parameter is omitted, it returns current internal encoding. </para> <para> <parameter>encoding</parameter> is used for HTTP input character encoding conversion, HTTP output character encoding conversion and default character encoding for string functions defined by mbstring module. </para> <para> <parameter>encoding</parameter>: Character encoding name </para> <para> Return Value: If <parameter>encoding</parameter> is set,<function>mb_internal_encoding</function> returns &true; for success, otherwise returns &false;. If <parameter>encoding</parameter> is omitted, it returns current character encoding name. </para> <para> <example> <title><function>mb_internal_encoding</function> example</title> <programlisting role="php"> <![CDATA[ /* Set internal character encoding to UTF-8 */ mb_internal_encoding("UTF-8"); /* Display current internal character encoding */ echo mb_internal_encoding(); ]]> </programlisting> </example> </para> <para> See also <function>mb_http_input</function>, <function>mb_http_output</function>, <function>mb_detect_order</function>. </para> </refsect1> </refentry> <refentry id="function.mb-http-input"> <refnamediv> <refname>mb_http_input</refname> <refpurpose>Detect HTTP input character encoding</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_http_input</function></funcdef> <paramdef>string <parameter><optional>type</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>mb_http_input</function> returns result of HTTP input character encoding detection. </simpara> <para> <parameter>type</parameter>: Input string specifies input type. &quot;G&quot; for GET, &quot;P&quot; for POST, &quot;C&quot; for COOKIE. If type is omitted, it returns last input type processed. </para> <para> Return Value: Character encoding name. If <function>mb_http_input</function> does not process specified HTTP input, it returns &false;. </para> <para> See also <function>mb_internal_encoding</function>, <function>mb_http_output</function>, <function>mb_detect_order</function>. </para> </refsect1> </refentry> <refentry id="function.mb-http-output"> <refnamediv> <refname>mb_http_output</refname> <refpurpose>Set/Get HTTP output character encoding</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_http_output</function></funcdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> If <parameter>encoding</parameter> is set, <function>mb_http_output</function> sets HTTP output character encoding to <parameter>encoding</parameter>. Output after this function is converted to <parameter>encoding</parameter>. <function>mb_http_output</function> returns &true; for success and &false; for failure. </para> <para> If <parameter>encoding</parameter> is omitted, <function>mb_http_output</function> returns current HTTP output character encoding. </para> <para> See also <function>mb_internal_encoding</function>, <function>mb_http_input</function>, <function>mb_detect_order</function>. </para> </refsect1> </refentry> <refentry id="function.mb-detect-order"> <refnamediv> <refname>mb_detect_order</refname> <refpurpose> Set/Get character encoding detection order </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>mb_detect_order</function></funcdef> <paramdef>mixed <parameter><optional>encoding-list</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_detect_order</function> sets automatic character encoding detection order to <parameter>encoding-list</parameter>. It returns &true; for success, &false; for failure. </para> <para> <parameter>encoding-list</parameter> is array or comma separated list of character encoding. ("auto" is expanded to "ASCII, JIS, UTF-8, EUC-JP, SJIS") </para> <para> If <parameter>encoding-list</parameter> is omitted, it returns current character encoding detection order as array. </para> <para> This setting affects <function>mb_detect_encoding</function> and <function>mb_send_mail</function>. </para> <note> <para> <literal>mbstring</literal> currently implements following encoding detection filters. If there is a invalid byte sequence for following encoding, encoding detection will fail. </para> <simpara> <literal>UTF-8</literal>, <literal>UTF-7</literal>, <literal>ASCII</literal>, <literal>EUC-JP</literal>,<literal>SJIS</literal>, <literal>eucJP-win</literal>, <literal>SJIS-win</literal>, <literal>JIS</literal>, <literal>ISO-2022-JP</literal> </simpara> <para> For <literal>ISO-8859-*</literal>, <literal>mbstring</literal> always detects as <literal>ISO-8859-*</literal>. </para> <para> For <literal>UTF-16</literal>, <literal>UTF-32</literal>, <literal>UCS2</literal> and <literal>UCS4</literal>, encoding detection will fail always. </para> <para> <example> <title>Useless detect order example</title> <programlisting> <![CDATA[ ; Always detect as ISO-8859-1 detect_order = ISO-8859-1, UTF-8 ; Always detect as UTF-8, since ASCII/UTF-7 values are ; valid for UTF-8 detect_order = UTF-8, ASCII, UTF-7 ]]> </programlisting> </example> </para> </note> <para> <example> <title><function>mb_detect_order</function> examples</title> <programlisting role="php"> <![CDATA[ /* Set detection order by enumerated list */ mb_detect_order("eucjp-win,sjis-win,UTF-8"); /* Set detection order by array */ $ary[] = "ASCII"; $ary[] = "JIS"; $ary[] = "EUC-JP"; mb_detect_order($ary); /* Display current detection order */ echo implode(", ", mb_detect_order()); ]]> </programlisting> </example> </para> <para> See also <function>mb_internal_encoding</function>, <function>mb_http_input</function>, <function>mb_http_output</function> <function>mb_send_mail</function>. </para> </refsect1> </refentry> <refentry id="function.mb-substitute-character"> <refnamediv> <refname>mb_substitute_character</refname> <refpurpose>Set/Get substitution character</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>mb_substitute_character</function></funcdef> <paramdef>mixed <parameter><optional>substrchar</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_substitute_character</function> specifies substitution character when input character encoding is invalid or character code is not exist in output character encoding. Invalid characters may be substituted &null;(no output), string or integer value (Unicode character code value). </para> <para> This setting affects <function>mb_detect_encoding</function> and <function>mb_send_mail</function>. </para> <para> <parameter>substchar</parameter> : Specify Unicode value as integer or specify as string as follows <itemizedlist> <listitem> <simpara> &quot;none&quot; : no output </simpara> </listitem> <listitem> <simpara> &quot;long&quot; : Output character code value (Example: U+3000,JIS+7E7E) </simpara> </listitem> </itemizedlist> </para> <para> Return Value: If <parameter>substchar</parameter> is set, it returns &true; for success, otherwise returns &false;. If <parameter>substchar</parameter> is not set, it returns Unicode value or &quot;<literal>none</literal>&quot;/&quot;<literal>long</literal>&quot;. </para> <para> <example> <title><function>mb_substitute_character</function> example</title> <programlisting role="php"> <![CDATA[ /* Set with Unicode U+3013 (GETA MARK) */ mb_substitute_character(0x3013); /* Set hex format */ mb_substitute_character("long"); /* Display current setting */ echo mb_substitute_character(); ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.mb-output-handler"> <refnamediv> <refname>mb_output_handler</refname> <refpurpose> Callback function converts character encoding in output buffer </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_output_handler</function></funcdef> <paramdef>string <parameter>contents</parameter></paramdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_output_handler</function> is <function>ob_start</function> callback function. <function>mb_output_handler</function> converts characters in output buffer from internal character encoding to HTTP output character encoding. </para> <para> 4.1.0 or later version, this hanlder adds charset HTTP header when following conditions are met: </para> <para> <itemizedlist> <listitem> <simpara>Does not set <literal>Content-Type</literal> by header()</simpara> </listitem> <listitem> <simpara>Default MIME type begins with <literal>text/</literal></simpara> </listitem> <listitem> <simpara><literal>http_output</literal> setting is other than pass</simpara> </listitem> </itemizedlist> </para> <para> <parameter>contents</parameter> : Output buffer contents </para> <para> <parameter>status</parameter> : Output buffer status </para> <para> Return Value: String converted </para> <para> <example> <title><function>mb_output_handler</function> example</title> <programlisting role="php"> <![CDATA[ mb_http_output("UTF-8"); ob_start("mb_output_handler"); ]]> </programlisting> </example> </para> <note> <para> If you want to output some binary data such as image from PHP script, you must set output encoding to &quot;pass&quot; using <function>mb_http_output</function>. </para> </note> <para> See also <function>ob_start</function>. </para> </refsect1> </refentry> <refentry id="function.mb-preferred-mime-name"> <refnamediv> <refname>mb_preferred_mime_name</refname> <refpurpose>Get MIME charset string</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_preferred_mime_name</function></funcdef> <paramdef>string <parameter>encoding</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_preferred_mime_name</function> returns MIME <literal>charset</literal> string for character encoding <parameter>encoding</parameter>. It returns <literal>charset</literal> string. </para> <para> <example> <title><function>mb_preferred_mime_string</function> example</title> <programlisting role="php"> <![CDATA[ $outputenc = "sjis-win"; mb_http_output($outputenc); ob_start("mb_output_handler"); header("Content-Type: text/html; charset=" . mb_preferred_mime_name($outputenc)); ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.mb-strlen"> <refnamediv> <refname>mb_strlen</refname> <refpurpose>Get string length</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_strlen</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_strlen</function> returns number of characters in string <parameter>str</parameter> having character encoding <parameter>encoding</parameter>. A multi-byte character is counted as 1. </para> <para> <parameter>encoding</parameter> is character encoding for <parameter>str</parameter>. If <parameter>encoding</parameter> is omitted, internal character encoding is used. </para> <para> See also <function>mb_internal_encoding</function>, <function>strlen</function>. </para> </refsect1> </refentry> <refentry id="function.mb-strpos"> <refnamediv> <refname>mb_strpos</refname> <refpurpose> Find position of first occurrence of string in a string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mb_strpos</function></funcdef> <paramdef>string <parameter>haystack</parameter></paramdef> <paramdef>string <parameter>needle</parameter></paramdef> <paramdef>int <parameter><optional>offset</optional></parameter> </paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_strpos</function> returns the numeric position of the first occurrence of <parameter>needle</parameter> in the <parameter>haystack</parameter> string. If <parameter>needle</parameter> is not found, it returns &false;. </para> <para> <function>mb_strpos</function> performs multi-byte safe <function>strpos</function> operation based on number of characters. <parameter>needle</parameter> position is counted from the beginning of the <parameter>haystack</parameter>. First character's position is 0. Second character position is 1, and so on. </para> <para> If <parameter>encoding</parameter> is omitted, internal character encoding is used. <function>mb_strrpos</function> accepts <literal>string</literal> for <parameter>needle</parameter> where <function>strrpos</function> accepts only character. </para> <para> <parameter>offset</parameter> is search offset. If it is not specified, 0 is used. </para> <para> <parameter>encoding</parameter> is character encoding name. If it is omitted, internal character encoding is used. </para> <para> See also <function>mb_strpos</function>, <function>mb_internal_encoding</function>, <function>strpos</function> </para> </refsect1> </refentry> <refentry id="function.mb-strrpos"> <refnamediv> <refname>mb_strrpos</refname> <refpurpose> Find position of last occurrence of a string in a string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mb_strrpos</function></funcdef> <paramdef>string <parameter>haystack</parameter></paramdef> <paramdef>string <parameter>needle</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_strrpos</function> returns the numeric position of the last occurrence of <parameter>needle</parameter> in the <parameter>haystack</parameter> string. If <parameter>needle</parameter> is not found, it returns &false;. </para> <para> <function>mb_strrpos</function> performs multi-byte safe <function>strrpos</function> operation based on number of characters. <parameter>needle</parameter> position is counted from the beginning of <parameter>haystack</parameter>. First character's position is 0. Second character position is 1. </para> <para> If <parameter>encoding</parameter> is omitted, internal encoding is assumed. <function>mb_strrpos</function> accepts <literal>string</literal> for <parameter>needle</parameter> where <function>strrpos</function> accepts only character. </para> <para> <parameter>encoding</parameter> is character encoding. If it is not specified, internal character encoding is used. </para> <para> See also <function>mb_strpos</function>, <function>mb_internal_encoding</function>, <function>strrpos</function>. </para> </refsect1> </refentry> <refentry id="function.mb-substr"> <refnamediv> <refname>mb_substr</refname> <refpurpose>Get part of string</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_substr</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>int <parameter>start</parameter></paramdef> <paramdef>int <parameter><optional>length</optional></parameter> </paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_substr</function> returns the portion of <parameter>str</parameter> specified by the <parameter>start</parameter> and <parameter>length</parameter> parameters. </para> <para> <function>mb_substr</function> performs multi-byte safe <function>substr</function> operation based on number of characters. Position is counted from the beginning of <parameter>str</parameter>. First character's position is 0. Second character position is 1, and so on. </para> <para> If <parameter>encoding</parameter> is omitted, internal encoding is assumed. </para> <para> <parameter>encoding</parameter> is character encoding. If it is omitted, internal character encoding is used. </para> <para> See also <function>mb_strcut</function>, <function>mb_internal_encoding</function>. </para> </refsect1> </refentry> <refentry id="function.mb-strcut"> <refnamediv> <refname>mb_strcut</refname> <refpurpose>Get part of string</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_strcut</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>int <parameter>start</parameter></paramdef> <paramdef>int <parameter><optional>length</optional></parameter> </paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_strcut</function> returns the portion of <parameter>str</parameter> specified by the <parameter>start</parameter> and <parameter>length</parameter> parameters. </para> <para> <function>mb_strcut</function> performs equivalent operation as <function>mb_substr</function> with different method. If <parameter>start</parameter> position is multi-byte character's second byte or larger, it starts from first byte of multi-byte character. </para> <para> It subtracts string from <parameter>str</parameter> that is shorter than <parameter>length</parameter> AND character that is not part of multi-byte string or not being middle of shift sequence. </para> <para> <parameter>encoding</parameter> is character encoding. If it is not set, internal character encoding is used. </para> <para> See also <function>mb_substr</function>, <function>mb_internal_encoding</function>. </para> </refsect1> </refentry> <refentry id="function.mb-strwidth"> <refnamediv> <refname>mb_strwidth</refname> <refpurpose>Return width of string</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>mb_strwidth</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_strwidth</function> returns width of string <parameter>str</parameter>. </para> <para> Multi-byte character usually twice of width compare to single byte character. </para> <para> <informalexample> <programlisting> <![CDATA[ Character width U+0000 - U+0019 0 U+0020 - U+1FFF 1 U+2000 - U+FF60 2 U+FF61 - U+FF9F 1 U+FFA0 - 2 ]]> </programlisting> </informalexample> </para> <para> <parameter>encoding</parameter> is character encoding. If it is omitted, internal encoding is used. </para> <para> See also: <function>mb_strimwidth</function>, <function>mb_internal_encoding</function>. </para> </refsect1> </refentry> <refentry id="function.mb-strimwidth"> <refnamediv> <refname>mb_strimwidth</refname> <refpurpose>Get truncated string with specified width</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_strimwidth</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>int <parameter>start</parameter></paramdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>string <parameter>trimmarker</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_strimwidth</function> truncates string <parameter>str</parameter> to specified <parameter>width</parameter>. It returns truncated string. </para> <para> If <parameter>trimmarker</parameter> is set, <parameter>trimmarker</parameter> is appended to return value. </para> <para> <parameter>start</parameter> is start position offset. Number of characters from the beginning of string. (First character is 0) </para> <para> <parameter>trimmarker</parameter> is string that is added to the end of string when string is truncated. </para> <para> <parameter>encoding</parameter> is character encoding. If it is omitted, internal encoding is used. </para> <para> <example> <title><function>mb_strimwidth</function> example</title> <programlisting role="php"> <![CDATA[ $str = mb_strimwidth($str, 0, 40, "..>"); ]]> </programlisting> </example> </para> <para> See also: <function>mb_strwidth</function>, <function>mb_internal_encoding</function>. </para> </refsect1> </refentry> <refentry id="function.mb-convert-encoding"> <refnamediv> <refname>mb_convert_encoding</refname> <refpurpose>Convert character encoding</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_convert_encoding</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>string <parameter>to-encoding</parameter></paramdef> <paramdef>mixed <parameter><optional>from-encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_convert_encoding</function> converts character encoding of string <parameter>str</parameter> from <parameter>from-encoding</parameter> to <parameter>to-encoding</parameter>. </para> <para> <parameter>str</parameter> : String to be converted. </para> <para> <parameter>from-encoding</parameter> is specified by character code name before conversion. it can be array or string - comma separated enumerated list. </para> <para> <example> <title><function>mb_convert_encoding</function> example</title> <programlisting role="php"> <![CDATA[ /* Convert internal character encoding to SJIS */ $str = mb_convert_encoding($str, "SJIS"); /* Convert EUC-JP to UTF-7 */ $str = mb_convert_encoding($str, "UTF-7", "EUC-JP"); /* Auto detect encoding from JIS, eucjp-win, sjis-win, then convert str to UCS-2LE */ $str = mb_convert_encoding($str, "UCS-2LE", "JIS, eucjp-win, sjis-win"); /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */ $str = mb_convert_encoding($str, "EUC-JP", "auto"); ]]> </programlisting> </example> </para> <para> See also: <function>mb_detect_order</function>. </para> </refsect1> </refentry> <refentry id="function.mb-detect-encoding"> <refnamediv> <refname>mb_detect_encoding</refname> <refpurpose>Detect character encoding</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_detect_encoding</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>mixed <parameter><optional>encoding-list</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_detect_encoding</function> detects character encoding in string <parameter>str</parameter>. It returns detected character encoding. </para> <para> <parameter>encoding-list</parameter> is list of character encoding. Encoding order may be specified by array or comma separated list string. </para> <para> If <parameter>encoding_list</parameter> is omitted, detect_order is used. </para> <para> <example> <title><function>mb_detect_encoding</function> example</title> <programlisting role="php"> <![CDATA[ /* Detect character encoding with current detect_order */ echo mb_detect_encoding($str); /* "auto" is expanded to "ASCII,JIS,UTF-8,EUC-JP,SJIS" */ echo mb_detect_encoding($str, "auto"); /* Specify encoding_list character encoding by comma separated list */ echo mb_detect_encoding($str, "JIS, eucjp-win, sjis-win"); /* Use array to specify encoding_list */ $ary[] = "ASCII"; $ary[] = "JIS"; $ary[] = "EUC-JP"; echo mb_detect_encoding($str, $ary); ]]> </programlisting> </example> </para> <para> See also: <function>mb_detect_order</function>. </para> </refsect1> </refentry> <refentry id="function.mb-convert-kana"> <refnamediv> <refname>mb_convert_kana</refname> <refpurpose> Convert "kana" one from another ("zen-kaku" ,"han-kaku" and more) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_convert_kana</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>string <parameter>option</parameter></paramdef> <paramdef>mixed <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_convert_kana</function> performs "han-kaku" - "zen-kaku" conversion for string <parameter>str</parameter>. It returns converted string. This function is only useful for Japanese. </para> <para> <parameter>option</parameter> is conversion option. Default value is <literal>"KV"</literal>. </para> <para> <parameter>encoding</parameter> is character encoding. If it is omitted, internal character encoding is used. </para> <para> <informalexample> <programlisting> <![CDATA[ Applicable Conversion Options option : Specify with conversion of following options. Default "KV" "r" : Convert "zen-kaku" alphabets to "han-kaku" "R" : Convert "han-kaku" alphabets to "zen-kaku" "n" : Convert "zen-kaku" numbers to "han-kaku" "N" : Convert "han-kaku" numbers to "zen-kaku" "a" : Convert "zen-kaku" alphabets and numbers to "han-kaku" "A" : Convert "zen-kaku" alphabets and numbers to "han-kaku" (Characters included in "a", "A" options are U+0021 - U+007E excluding U+0022, U+0027, U+005C, U+007E) "s" : Convert "zen-kaku" space to "han-kaku" (U+3000 -> U+0020) "S" : Convert "han-kaku" space to "zen-kaku" (U+0020 -> U+3000) "k" : Convert "zen-kaku kata-kana" to "han-kaku kata-kana" "K" : Convert "han-kaku kata-kana" to "zen-kaku kata-kana" "h" : Convert "zen-kaku hira-gana" to "han-kaku kata-kana" "H" : Convert "han-kaku kata-kana" to "zen-kaku hira-gana" "c" : Convert "zen-kaku kata-kana" to "zen-kaku hira-gana" "C" : Convert "zen-kaku hira-gana" to "zen-kaku kata-kana" "V" : Collapse voiced sound notation and convert them into a character. Use with "K","H" ]]> </programlisting> </informalexample> </para> <para> <example> <title><function>mb_convert_kana</function> example</title> <programlisting role="php"> <![CDATA[ /* Convert all "kana" to "zen-kaku" "kata-kana" */ $str = mb_convert_kana($str, "KVC"); /* Convert "han-kaku" "kata-kana" to "zen-kaku" "kata-kana" and "zen-kaku" alpha-numeric to "han-kaku" */ $str = mb_convert_kana($str, "KVa"); ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.mb-encode-mimeheader"> <refnamediv> <refname>mb_encode_mimeheader</refname> <refpurpose>Encode string for MIME header</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_encode_mimeheader</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>string <parameter><optional>charset</optional></parameter> </paramdef> <paramdef>string <parameter><optional>transfer-encoding</optional></parameter> </paramdef> <paramdef>string <parameter><optional>linefeed</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_encode_mimeheader</function> converts string <parameter>str</parameter> to encoded-word for header field. It returns converted string in ASCII encoding. </para> <para> <parameter>charset</parameter> is character encoding name. Default is <literal>ISO-2022-JP</literal>. </para> <para> <parameter>transfer-encoding</parameter> is transfer encoding. It should be one of <literal>"B"</literal> (Base64) or <literal>"Q"</literal> (Quoted-Printable). Default is <literal>"B"</literal>. </para> <para> <parameter>linefeed</parameter> is end of line marker. Default is <literal>"\r\n"</literal> (CRLF). </para> <para> <example> <title><function>mb_convert_kana</function> example</title> <programlisting role="php"> <![CDATA[ $name = ""; // kanji $mbox = "kru"; $doma = "gtinn.mon"; $addr = mb_encode_mimeheader($name, "UTF-7", "Q") . " <" . $mbox . "@" . $doma . ">"; echo $addr; ]]> </programlisting> </example> </para> <para> See also <function>mb_decode_mimeheader</function>. </para> </refsect1> </refentry> <refentry id="function.mb-decode-mimeheader"> <refnamediv> <refname>mb_decode_mimeheader</refname> <refpurpose>Decode string in MIME header field</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_decode_mimeheader</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_decode_mimeheader</function> decodes encoded-word string <parameter>str</parameter> in MIME header. </para> <para> It returns decoded string in internal character encoding. </para> <para> See also <function>mb_encode_mimeheader</function>. </para> </refsect1> </refentry> <refentry id="function.mb-convert-variables"> <refnamediv> <refname>mb_convert_variables</refname> <refpurpose>Convert character code in variable(s)</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_convert_variables</function></funcdef> <paramdef>string <parameter>to-encoding</parameter></paramdef> <paramdef>mixed <parameter>from-encoding</parameter></paramdef> <paramdef>mixed <parameter>vars</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_convert_variables</function> convert character encoding of variables <parameter>vars</parameter> in encoding <parameter>from-encoding</parameter> to encoding <parameter>to-encoding</parameter>. It returns character encoding before conversion for success, &false; for failure. </para> <para> <function>mb_convert_variables</function> join strings in Array or Object to detect encoding, since encoding detection tends to fail for short strings. Therefore, it is impossible to mix encoding in single array or object. </para> <para> It <parameter>from-encoding</parameter> is specified by array or comma separated string, it tries to detect encoding from <parameter>from-coding</parameter>. When <parameter>encoding</parameter> is omitted, <literal>detect_order</literal> is used. </para> <para> <parameter>vars (3rd and larger)</parameter> is reference to variable to be converted. String, Array and Object are accepted. <function>mb_convert_variables</function> assumes all parameters have the same encoding. </para> <para> <example> <title><function>mb_convert_variables</function> example</title> <programlisting role="php"> <![CDATA[ /* Convert variables $post1, $post2 to internal encoding */ $interenc = mb_internal_encoding(); $inputenc = mb_convert_variables($interenc, "ASCII,UTF-8,SJIS-win", $post1, $post2); ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.mb-encode-numericentity"> <refnamediv> <refname>mb_encode_numericentity</refname> <refpurpose> Encode character to HTML numeric string reference </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_encode_numericentity</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>array <parameter>convmap</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_encode_numericentity</function> converts specified character codes in string <parameter>str</parameter> from HTML numeric character reference to character code. It returns converted string. </para> <para> <parameter>array</parameter> is array specifies code area to convert. </para> <para> <parameter>encoding</parameter> is character encoding. </para> <para> <example> <title><parameter>convmap</parameter> example</title> <programlisting role="php"> <![CDATA[ $convmap = array ( int start_code1, int end_code1, int offset1, int mask1, int start_code2, int end_code2, int offset2, int mask2, ........ int start_codeN, int end_codeN, int offsetN, int maskN ); // Specify Unicode value for start_codeN and end_codeN // Add offsetN to value and take bit-wise 'AND' with maskN, then // it converts value to numeric string reference. ]]> </programlisting> </example> </para> <para> <example> <title> <function>mb_encode_numericentity</function> example </title> <programlisting role="php"> <![CDATA[ /* Convert Left side of ISO-8859-1 to HTML numeric character reference */ $convmap = array(0x80, 0xff, 0, 0xff); $str = mb_encode_numericentity($str, $convmap, "ISO-8859-1"); /* Convert user defined SJIS-win code in block 95-104 to numeric string reference */ $convmap = array( 0xe000, 0xe03e, 0x1040, 0xffff, 0xe03f, 0xe0bb, 0x1041, 0xffff, 0xe0bc, 0xe0fa, 0x1084, 0xffff, 0xe0fb, 0xe177, 0x1085, 0xffff, 0xe178, 0xe1b6, 0x10c8, 0xffff, 0xe1b7, 0xe233, 0x10c9, 0xffff, 0xe234, 0xe272, 0x110c, 0xffff, 0xe273, 0xe2ef, 0x110d, 0xffff, 0xe2f0, 0xe32e, 0x1150, 0xffff, 0xe32f, 0xe3ab, 0x1151, 0xffff ); $str = mb_encode_numericentity($str, $convmap, "sjis-win"); ]]> </programlisting> </example> </para> <para> See also: <function>mb_decode_numericentity</function>. </para> </refsect1> </refentry> <refentry id="function.mb-decode-numericentity"> <refnamediv> <refname>mb_decode_numericentity</refname> <refpurpose> Decode HTML numeric string reference to character </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>mb_decode_numericentity</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> <paramdef>array <parameter>convmap</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> Convert numeric string reference of string <parameter>str</parameter> in specified block to character. It returns converted string. </para> <para> <parameter>array</parameter> is array to specifies code area to convert. </para> <para> <parameter>encoding</parameter> is character encoding. If it is omitted, internal character encoding is used. </para> <para> <example> <title><parameter>convmap</parameter> example</title> <programlisting> <![CDATA[ $convmap = array ( int start_code1, int end_code1, int offset1, int mask1, int start_code2, int end_code2, int offset2, int mask2, ........ int start_codeN, int end_codeN, int offsetN, int maskN ); // Specify Unicode value for start_codeN and end_codeN // Add offsetN to value and take bit-wise 'AND' with maskN, // then convert value to numeric string reference. ]]> </programlisting> </example> </para> <para> See also: <function>mb_encode_numericentity</function>. </para> </refsect1> </refentry> <refentry id="function.mb-send-mail"> <refnamediv> <refname>mb_send_mail</refname> <refpurpose> Send encoded mail. </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>boolean <function>mb_send_mail</function></funcdef> <paramdef>string <parameter>to</parameter></paramdef> <paramdef>string <parameter>subject</parameter></paramdef> <paramdef>string <parameter>message</parameter></paramdef> <paramdef>string <parameter><optional>additional_headers</optional></parameter> </paramdef> <paramdef>string <parameter><optional>additional_parameter</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>mb_send_mail</function> sends email. Headers and message are converted and encoded according to <function>mb_language</function> setting. <function>mb_send_mail</function> is wrapper function of <function>mail</function>. See <function>mail</function> for details. </para> <para> <parameter>to</parameter> is mail addresses send to. Multiple recipients can be specified by putting a comma between each address in to. This parameter is not automatically encoded. </para> <para> <parameter>subject</parameter> is subject of mail. </para> <para> <parameter>message</parameter> is mail message. </para> <para> <parameter>additional_headers</parameter> is inserted at the end of the header. This is typically used to add extra headers. Multiple extra headers are separated with a newline ("\n"). </para> <para> <parameter>additional_parameter</parameter> is a MTA command line parameter. It is useful when setting the correct Return-Path header when using sendmail. </para> <para> &return.success; </para> <para> See also <function>mail</function>, <function>mb_encode_mimeheader</function>, and <function>mb_language</function>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/ming.xml +++ phpdoc/kr/functions/ming.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.ming"> <title>Ming functions for Flash</title> <titleabbrev>Ming (flash)</titleabbrev> <partintro> &warn.experimental; <sect1 id="ming.intro"> <title>Introduction</title> <simpara> Ming is an open-source (LGPL) library which allows you to create SWF ("Flash") format movies. Ming supports almost all of Flash 4's features, including: shapes, gradients, bitmaps (pngs and jpegs), morphs ("shape tweens"), text, buttons, actions, sprites ("movie clips"), streaming mp3, and color transforms--the only thing that's missing is sound events. </simpara> <simpara> Ming is not an acronym. </simpara> <simpara> Note that all values specifying length, distance, size, etc. are in "twips", twenty units per pixel. That's pretty much arbitrary, though, since the player scales the movie to whatever pixel size is specified in the embed/object tag, or the entire frame if not embedded. </simpara> <simpara> Ming offers a number of advantages over the existing PHP/libswf module. You can use Ming anywhere you can compile the code, whereas libswf is closed-source and only available for a few platforms, Windows not one of them. Ming provides some insulation from the mundane details of the SWF file format, wrapping the movie elements in PHP objects. Also, Ming is still being maintained; if there's a feature that you want to see, just let us know <ulink url="mailto:&email.ming;">&email.ming;</ulink>. </simpara> <simpara> Ming was added in PHP 4.0.5. </simpara> </sect1> <sect1 id="ming.install"> <title>Installation</title> <para> To use Ming with PHP, you first need to build and install the Ming library. Source code and installation instructions are available at the Ming home page : <ulink url="&url.ming;">&url.ming;</ulink> along with examples, a small tutorial, and the latest news. </para> <para> Download the ming archive. Unpack the archive. Go in the Ming directory. make. make install. </para> <para> This will build <filename>libming.so</filename> and install it into <filename>/usr/lib/</filename>, and copy <filename>ming.h</filename> into <filename>/usr/include/</filename>. Edit the <literal>PREFIX=</literal> line in the <filename>Makefile</filename> to change the installation directory. </para> <sect2 id="ming.install.php.unix"> <title>built into php (unix)</title> <para> <informalexample> <literallayout> <![CDATA[ mkdir <phpdir>/ext/ming cp php_ext/* <phpdir>/ext/ming cd <phpdir> ./buildconf ./configure --with-ming <other config options> ]]> </literallayout> </informalexample> Build and install php as usual, Restart web server if necessary </para> </sect2> <sect2 id="ming.install.php-module.unix"> <title>built into php (unix)</title> <para> download <filename>php_ming.so.gz</filename>. uncompress it and copy it to your php modules directory. (you can find your php module directory by running <command>php-config --extension-dir</command>). Now either just add <literal>extension=php_ming.so</literal> to your <filename>php.ini</filename> file, or put <literal>dl('php_ming.so');</literal> at the head of all of your Ming scripts. </para> </sect2> </sect1> <sect1 id="ming.use"> <title>How to use Ming</title> <simpara> Ming introduces 13 new objects in PHP, all with matching methods and attributes. To use them, you need to know about <link linkend="language.oop">objects</link>. </simpara> <itemizedlist> <listitem> <simpara> <function>swfmovie</function>. </simpara> </listitem> <listitem> <simpara> <function>swfshape</function>. </simpara> </listitem> <listitem> <simpara> <function>swfdisplayitem</function>. </simpara> </listitem> <listitem> <simpara> <function>swfgradient</function>. </simpara> </listitem> <listitem> <simpara> <function>swfbitmap</function>. </simpara> </listitem> <listitem> <simpara> <function>swffill</function>. </simpara> </listitem> <listitem> <simpara> <function>swfmorph</function>. </simpara> </listitem> <listitem> <simpara> <function>swftext</function>. </simpara> </listitem> <listitem> <simpara> <function>swffont</function>. </simpara> </listitem> <listitem> <simpara> <function>swftextfield</function>. </simpara> </listitem> <listitem> <simpara> <function>swfsprite</function>. </simpara> </listitem> <listitem> <simpara> <function>swfbutton</function>. </simpara> </listitem> <listitem> <simpara> <function>swfaction</function>. </simpara> </listitem> </itemizedlist> </sect1> </partintro> <refentry id='function.ming-setcubicthreshold'> <refnamediv> <refname>ming_setcubicthreshold</refname> <refpurpose> Set cubic threshold (?) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>ming_setcubicthreshold</function></funcdef> <paramdef>int <parameter>threshold</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.ming-setscale'> <refnamediv> <refname>ming_setscale</refname> <refpurpose> Set scale (?) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>ming_setscale</function></funcdef> <paramdef>int <parameter>scale</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.ming-useswfversion'> <refnamediv> <refname>ming_useswfversion</refname> <refpurpose> Use SWF version (?) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>ming_useswfversion</function></funcdef> <paramdef>int <parameter>version</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id='function.swfbutton-keypress'> <refnamediv> <refname>swfbutton_keypress</refname> <refpurpose> Returns the action flag for keyPress(char) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>swfbutton_keypress</function></funcdef> <paramdef>string <parameter>str</parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> <!-- SWFMovie --> <refentry id="function.swfmovie"> <refnamediv> <refname>SWFMovie</refname> <refpurpose>Creates a new movie object, representing an SWF version 4 movie.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfmovie</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie</function> creates a new movie object, representing an SWF version 4 movie. </para> <simpara> SWFMovie has the following methods : <function>swfmovie->output</function>,<function>swfmovie->save</function>, <function>swfmovie->add</function>, <function>swfmovie->remove</function>, <function>swfmovie->nextframe</function>, <function>swfmovie->setbackground</function>, <function>swfmovie->setrate</function>, <function>swfmovie->setdimension</function>, <function>swfmovie->setframes</function> and <function>swfmovie->streammp3</function>. </simpara> <simpara> See examples in : <function>swfdisplayitem->rotateto</function>, <function>swfshape->setline</function>, <function>swfshape->addfill</function>... Any example will use this object. </simpara> </refsect1> </refentry> <refentry id="function.swfmovie.output"> <refnamediv> <refname>SWFMovie->output</refname> <refpurpose>Dumps your lovingly prepared movie out.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->output</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->output</function> dumps your lovingly prepared movie out. In PHP, preceding this with the command <programlisting role="php"> <![CDATA[ <?php header('Content-type: application/x-shockwave-flash'); ?> ]]> </programlisting> convinces the browser to display this as a flash movie. </para> <simpara> See also <function>swfmovie->save</function>. </simpara> <simpara> See examples in : <function>swfmovie->streammp3</function>, <function>swfdisplayitem->rotateto</function>, <function>swfaction</function>... Any example will use this method. </simpara> </refsect1> </refentry> <refentry id="function.swfmovie.save"> <refnamediv> <refname>SWFMovie->save</refname> <refpurpose>Saves your movie in a file.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->save</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->save</function> saves your movie to the file named <parameter>filename</parameter>. </para> <simpara> See also <function>output</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfmovie.add"> <refnamediv> <refname>SWFMovie->add</refname> <refpurpose>Adds any type of data to a movie.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->add</function></funcdef> <paramdef>ressource <parameter>instance</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->add</function> adds <parameter>instance</parameter> to the current movie. <parameter>instance</parameter> is any type of data : Shapes, text, fonts, etc. must all be add'ed to the movie to make this work. </para> <para> For displayable types (shape, text, button, sprite), this returns an <function>SWFDisplayItem</function>, a handle to the object in a display list. Thus, you can add the same shape to a movie multiple times and get separate handles back for each separate instance. </para> <simpara> See also all other objects (adding this later), and <function>swfmovie->remove</function> </simpara> <simpara> See examples in : <function>swfdisplayitem->rotateto</function> and <function>swfshape->addfill</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfmovie.remove"> <refnamediv> <refname>SWFMovie->remove</refname> <refpurpose>Removes the object instance from the display list.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->remove</function></funcdef> <paramdef>resource <parameter>instance</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->remove</function> removes the object instance <parameter>instance</parameter> from the display list. </para> <simpara> See also <function>swfmovie->add</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfmovie.setbackground"> <refnamediv> <refname>SWFMovie->setbackground</refname> <refpurpose>Sets the background color.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->setbackground</function></funcdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->setbackground</function> sets the background color. Why is there no rgba version? Think about it. (Actually, that's not such a dumb question after all- you might want to let the html background show through. There's a way to do that, but it only works on IE4. Search the <ulink url="&url.macromedia;">&url.macromedia;</ulink> site for details.) </para> </refsect1> </refentry> <refentry id="function.swfmovie.setrate"> <refnamediv> <refname>SWFMovie->setrate</refname> <refpurpose>Sets the animation's frame rate.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->setrate</function></funcdef> <paramdef>int <parameter>rate</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->setrate</function> sets the frame rate to <parameter>rate</parameter>, in frame per seconds. Animation will slow down if the player can't render frames fast enough- unless there's a streaming sound, in which case display frames are sacrificed to keep sound from skipping. </para> </refsect1> </refentry> <refentry id="function.swfmovie.setdimension"> <refnamediv> <refname>SWFMovie->setdimension</refname> <refpurpose>Sets the movie's width and height.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->setdimension</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->setdimension</function> sets the movie's width to <parameter>width</parameter> and height to <parameter>height</parameter>. </para> </refsect1> </refentry> <refentry id="function.swfmovie.setframes"> <refnamediv> <refname>SWFMovie->setframes</refname> <refpurpose>Sets the total number of frames in the animation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->setframes</function></funcdef> <paramdef>string <parameter>numberofframes</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->setframes</function> sets the total number of frames in the animation to <parameter>numberofframes</parameter>. </para> </refsect1> </refentry> <refentry id="function.swfmovie.nextframe"> <refnamediv> <refname>SWFMovie->nextframe</refname> <refpurpose>Moves to the next frame of the animation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->nextframe</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->setframes</function> moves to the next frame of the animation. </para> </refsect1> </refentry> <refentry id="function.swfmovie.streammp3"> <refnamediv> <refname>SWFMovie->streammp3</refname> <refpurpose>Streams a MP3 file.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfmovie->streammp3</function></funcdef> <paramdef>string <parameter>mp3FileName</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmovie->streammp3</function> streams the mp3 file <parameter>mp3FileName</parameter>. Not very robust in dealing with oddities (can skip over an initial ID3 tag, but that's about it). Like <function>SWFShape->addJpegFill</function>, this isn't a stable function- we'll probably need to make a separate SWFSound object to contain sound types. </para> <para> Note that the movie isn't smart enough to put enough frames in to contain the entire mp3 stream- you'll have to add (length of song * frames per second) frames to get the entire stream in. </para> <para> Yes, now you can use ming to put that rock and roll devil worship music into your SWF files. Just don't tell the RIAA. <example> <title><function>swfmovie->streammp3</function> example</title> <programlisting role="php"> <![CDATA[ <?php $m = new SWFMovie(); $m->setRate(12.0); $m->streamMp3("distortobass.mp3"); // use your own MP3 // 11.85 seconds at 12.0 fps = 142 frames $m->setFrames(142); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- SWFDisplayItem --> <refentry id="function.swfdisplayitem"> <refnamediv> <refname>SWFDisplayItem</refname> <refpurpose>Creates a new displayitem object.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfdisplayitem</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem</function> creates a new swfdisplayitem object. </para> <para> Here's where all the animation takes place. After you define a shape, a text object, a sprite, or a button, you add it to the movie, then use the returned handle to move, rotate, scale, or skew the thing. </para> <simpara> SWFDisplayItem has the following methods : <function>swfdisplayitem->move</function>, <function>swfdisplayitem->moveto</function>, <function>swfdisplayitem->scaleto</function>, <function>swfdisplayitem->scale</function>, <function>swfdisplayitem->rotate</function>, <function>swfdisplayitem->rotateto</function>, <function>swfdisplayitem->skewxto</function>, <function>swfdisplayitem->skewx</function>, <function>swfdisplayitem->skewyto</function> <function>swfdisplayitem->skewyto</function>, <function>swfdisplayitem->setdepth</function> <function>swfdisplayitem->remove</function>, <function>swfdisplayitem->setname</function> <function>swfdisplayitem->setratio</function>, <function>swfdisplayitem->addcolor</function> and <function>swfdisplayitem->multcolor</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.moveto"> <refnamediv> <refname>SWFDisplayItem->moveTo</refname> <refpurpose>Moves object in global coordinates.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->moveto</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->moveto</function> moves the current object to (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->move</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.move"> <refnamediv> <refname>SWFDisplayItem->move</refname> <refpurpose>Moves object in relative coordinates.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->move</function></funcdef> <paramdef>int <parameter>dx</parameter></paramdef> <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->move</function> moves the current object by (<parameter>dx</parameter>,<parameter>dy</parameter>) from its current position. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->moveto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.scaleto"> <refnamediv> <refname>SWFDisplayItem->scaleTo</refname> <refpurpose>Scales the object in global coordinates.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->scaleto</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->scaleto</function> scales the current object to (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->scale</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.scale"> <refnamediv> <refname>SWFDisplayItem->scale</refname> <refpurpose>Scales the object in relative coordinates.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->scale</function></funcdef> <paramdef>int <parameter>dx</parameter></paramdef> <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->scale</function> scales the current object by (<parameter>dx</parameter>,<parameter>dy</parameter>) from its current size. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->scaleto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.rotateto"> <refnamediv> <refname>SWFDisplayItem->rotateTo</refname> <refpurpose>Rotates the object in global coordinates.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->rotateto</function></funcdef> <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->rotateto</function> set the current object rotation to <parameter>degrees</parameter> degrees in global coordinates. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <para> This example bring three rotating string from the background to the foreground. Pretty nice. <example> <title><function>swfdisplayitem->rotateto</function> example</title> <programlisting role="php"> <![CDATA[ <?php $thetext = "ming!"; $f = new SWFFont("Bauhaus 93.fdb"); $m = new SWFMovie(); $m->setRate(24.0); $m->setDimension(2400, 1600); $m->setBackground(0xff, 0xff, 0xff); // functions with huge numbers of arbitrary // arguments are always a good idea! Really! function text($r, $g, $b, $a, $rot, $x, $y, $scale, $string) { global $f, $m; $t = new SWFText(); $t->setFont($f); $t->setColor($r, $g, $b, $a); $t->setHeight(960); $t->moveTo(-($f->getWidth($string))/2, $f->getAscent()/2); $t->addString($string); // we can add properties just like a normal php var, // as long as the names aren't already used. // e.g., we can't set $i->scale, because that's a function $i = $m->add($t); $i->x = $x; $i->y = $y; $i->rot = $rot; $i->s = $scale; $i->rotateTo($rot); $i->scale($scale, $scale); // but the changes are local to the function, so we have to // return the changed object. kinda weird.. return $i; } function step($i) { $oldrot = $i->rot; $i->rot = 19*$i->rot/20; $i->x = (19*$i->x + 1200)/20; $i->y = (19*$i->y + 800)/20; $i->s = (19*$i->s + 1.0)/20; $i->rotateTo($i->rot); $i->scaleTo($i->s, $i->s); $i->moveTo($i->x, $i->y); return $i; } // see? it sure paid off in legibility: $i1 = text(0xff, 0x33, 0x33, 0xff, 900, 1200, 800, 0.03, $thetext); $i2 = text(0x00, 0x33, 0xff, 0x7f, -560, 1200, 800, 0.04, $thetext); $i3 = text(0xff, 0xff, 0xff, 0x9f, 180, 1200, 800, 0.001, $thetext); for($i=1; $i<=100; ++$i) { $i1 = step($i1); $i2 = step($i2); $i3 = step($i3); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> <simpara> See also <function>swfdisplayitem->rotate</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.rotate"> <refnamediv> <refname>SWFDisplayItem->Rotate</refname> <refpurpose>Rotates in relative coordinates.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->rotate</function></funcdef> <paramdef>float <parameter>ddegrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->rotate</function> rotates the current object by <parameter>ddegrees</parameter> degrees from its current rotation. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->rotateto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.skewxto"> <refnamediv> <refname>SWFDisplayItem->skewXTo</refname> <refpurpose>Sets the X-skew.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewxto</function></funcdef> <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->skewxto</function> sets the x-skew to <parameter>degrees</parameter>. For <parameter>degrees</parameter> is 1.0, it means a 45-degree forward slant. More is more forward, less is more backward. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->skewx</function>, <function>swfdisplayitem->skewy</function> and <function>swfdisplayitem->skewyto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.skewx"> <refnamediv> <refname>SWFDisplayItem->skewX</refname> <refpurpose>Sets the X-skew.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewx</function></funcdef> <paramdef>float <parameter>ddegrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->skewx</function> adds <parameter>ddegrees</parameter> to current x-skew. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->skewx</function>, <function>swfdisplayitem->skewy</function> and <function>swfdisplayitem->skewyto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.skewyto"> <refnamediv> <refname>SWFDisplayItem->skewYTo</refname> <refpurpose>Sets the Y-skew.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewyto</function></funcdef> <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->skewyto</function> sets the y-skew to <parameter>degrees</parameter>. For <parameter>degrees</parameter> is 1.0, it means a 45-degree forward slant. More is more upward, less is more downward. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->skewy</function>, <function>swfdisplayitem->skewx</function> and <function>swfdisplayitem->skewxto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.skewy"> <refnamediv> <refname>SWFDisplayItem->skewY</refname> <refpurpose>Sets the Y-skew.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->skewy</function></funcdef> <paramdef>float <parameter>ddegrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->skewy</function> adds <parameter>ddegrees</parameter> to current y-skew. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfdisplayitem->skewyto</function>, <function>swfdisplayitem->skewx</function> and <function>swfdisplayitem->skewxto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.setdepth"> <refnamediv> <refname>SWFDisplayItem->setDepth</refname> <refpurpose>Sets z-order</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->setdepth</function></funcdef> <paramdef>float <parameter>depth</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->rotate</function> sets the object's z-order to <parameter>depth</parameter>. Depth defaults to the order in which instances are created (by add'ing a shape/text to a movie)- newer ones are on top of older ones. If two objects are given the same depth, only the later-defined one can be moved. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.remove"> <refnamediv> <refname>SWFDisplayItem->remove</refname> <refpurpose>Removes the object from the movie</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->remove</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->remove</function> removes this object from the movie's display list. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <simpara> See also <function>swfmovie->add</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.setname"> <refnamediv> <refname>SWFDisplayItem->setName</refname> <refpurpose>Sets the object's name</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->setname</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->setname</function> sets the object's name to <parameter>name</parameter>, for targetting with action script. Only useful on sprites. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.setratio"> <refnamediv> <refname>SWFDisplayItem->setRatio</refname> <refpurpose>Sets the object's ratio.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->setratio</function></funcdef> <paramdef>float <parameter>ratio</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->setratio</function> sets the object's ratio to <parameter>ratio</parameter>. Obviously only useful for morphs. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <para> This simple example will morph nicely three concentric circles. <example> <title><function>swfdisplayitem->setname</function> example</title> <programlisting role="php"> <![CDATA[ <?php $p = new SWFMorph(); $g = new SWFGradient(); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(0.16, 0xff, 0xff, 0xff); $g->addEntry(0.32, 0, 0, 0); $g->addEntry(0.48, 0xff, 0xff, 0xff); $g->addEntry(0.64, 0, 0, 0); $g->addEntry(0.80, 0xff, 0xff, 0xff); $g->addEntry(1.00, 0, 0, 0); $s = $p->getShape1(); $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.05); $s->setLeftFill($f); $s->movePenTo(-160, -120); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240); $g = new SWFGradient(); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(0.16, 0xff, 0, 0); $g->addEntry(0.32, 0, 0, 0); $g->addEntry(0.48, 0, 0xff, 0); $g->addEntry(0.64, 0, 0, 0); $g->addEntry(0.80, 0, 0, 0xff); $g->addEntry(1.00, 0, 0, 0); $s = $p->getShape2(); $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.05); $f->skewXTo(1.0); $s->setLeftFill($f); $s->movePenTo(-160, -120); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240); $m = new SWFMovie(); $m->setDimension(320, 240); $i = $m->add($p); $i->moveTo(160, 120); for($n=0; $n<=1.001; $n+=0.01) { $i->setRatio($n); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfdisplayitem.addcolor"> <refnamediv> <refname>SWFDisplayItem->addColor</refname> <refpurpose>Adds the given color to this item's color transform.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->addcolor</function></funcdef> <paramdef>int <parameter><optional>red</optional></parameter></paramdef> <paramdef>int <parameter><optional>green</optional></parameter></paramdef> <paramdef>int <parameter><optional>blue</optional></parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->addcolor</function> adds the color to this item's color transform. The color is given in its RGB form. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfdisplayitem.multcolor"> <refnamediv> <refname>SWFDisplayItem->multColor</refname> <refpurpose>Multiplies the item's color transform.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfdisplayitem->multcolor</function></funcdef> <paramdef>int <parameter><optional>red</optional></parameter></paramdef> <paramdef>int <parameter><optional>green</optional></parameter></paramdef> <paramdef>int <parameter><optional>blue</optional></parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfdisplayitem->multcolor</function> multiplies the item's color transform by the given values. </para> <simpara> The object may be a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function> or a <function>swfsprite</function> object. It must have been added using the <function>swfmovie->add</function>. </simpara> <para> This simple example will modify your picture's atmospher to Halloween (use a landscape or bright picture). <example> <title><function>swfdisplayitem->multcolor</function> example</title> <programlisting role="php"> <![CDATA[ <?php $b = new SWFBitmap("backyard.jpg"); // note use your own picture :-) $s = new SWFShape(); $s->setRightFill($s->addFill($b)); $s->drawLine($b->getWidth(), 0); $s->drawLine(0, $b->getHeight()); $s->drawLine(-$b->getWidth(), 0); $s->drawLine(0, -$b->getHeight()); $m = new SWFMovie(); $m->setDimension($b->getWidth(), $b->getHeight()); $i = $m->add($s); for($n=0; $n<=20; ++$n) { $i->multColor(1.0-$n/10, 1.0, 1.0); $i->addColor(0xff*$n/20, 0, 0); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <!-- SWFShape --> <refentry id="function.swfshape"> <refnamediv> <refname>SWFShape</refname> <refpurpose>Creates a new shape object.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfshape</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfshape</function> creates a new shape object. </para> <simpara> SWFShape has the following methods : <function>swfshape->setline</function>, <function>swfshape->addfill</function>, <function>swfshape->setleftfill</function>, <function>swfshape->setrightfill</function>, <function>swfshape->movepento</function>, <function>swfshape->movepen</function>, <function>swfshape->drawlineto</function>, <function>swfshape->drawline</function>, <function>swfshape->drawcurveto</function> and <function>swfshape->drawcurve</function>. </simpara> <para> This simple example will draw a big red elliptic quadrant. <example> <title><function>swfshape</function> example</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); $s->setLine(40, 0x7f, 0, 0); $s->setRightFill($s->addFill(0xff, 0, 0)); $s->movePenTo(200, 200); $s->drawLineTo(6200, 200); $s->drawLineTo(6200, 4600); $s->drawCurveTo(200, 4600, 200, 200); $m = new SWFMovie(); $m->setDimension(6400, 4800); $m->setRate(12.0); $m->add($s); $m->nextFrame(); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfshape.setline"> <refnamediv> <refname>SWFShape->setLine</refname> <refpurpose>Sets the shape's line style.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setline</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>int <parameter><optional>red</optional></parameter></paramdef> <paramdef>int <parameter><optional>green</optional></parameter></paramdef> <paramdef>int <parameter><optional>blue</optional></parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfshape->setline</function> sets the shape's line style. <parameter>width</parameter> is the line's width. If <parameter>width</parameter> is 0, the line's style is removed (then, all other arguments are ignored). If <parameter>width</parameter> > 0, then line's color is set to <parameter>red</parameter>, <parameter>green</parameter>, <parameter>blue</parameter>. Last parameter <parameter>a</parameter> is optional. </para> <simpara> <function>swfshape->setline</function> accepts 1, 4 or 5 arguments (not 3 or 2). </simpara> <para> You must declare all line styles before you use them (see example). </para> <para> This simple example will draw a big "!#%*@", in funny colors and gracious style. <example> <title><function>swfshape->setline</function> example</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); $f1 = $s->addFill(0xff, 0, 0); $f2 = $s->addFill(0xff, 0x7f, 0); $f3 = $s->addFill(0xff, 0xff, 0); $f4 = $s->addFill(0, 0xff, 0); $f5 = $s->addFill(0, 0, 0xff); // bug: have to declare all line styles before you use them $s->setLine(40, 0x7f, 0, 0); $s->setLine(40, 0x7f, 0x3f, 0); $s->setLine(40, 0x7f, 0x7f, 0); $s->setLine(40, 0, 0x7f, 0); $s->setLine(40, 0, 0, 0x7f); $f = new SWFFont('Techno.fdb'); $s->setRightFill($f1); $s->setLine(40, 0x7f, 0, 0); $s->drawGlyph($f, '!'); $s->movePen($f->getWidth('!'), 0); $s->setRightFill($f2); $s->setLine(40, 0x7f, 0x3f, 0); $s->drawGlyph($f, '#'); $s->movePen($f->getWidth('#'), 0); $s->setRightFill($f3); $s->setLine(40, 0x7f, 0x7f, 0); $s->drawGlyph($f, '%'); $s->movePen($f->getWidth('%'), 0); $s->setRightFill($f4); $s->setLine(40, 0, 0x7f, 0); $s->drawGlyph($f, '*'); $s->movePen($f->getWidth('*'), 0); $s->setRightFill($f5); $s->setLine(40, 0, 0, 0x7f); $s->drawGlyph($f, '@'); $m = new SWFMovie(); $m->setDimension(3000,2000); $m->setRate(12.0); $i = $m->add($s); $i->moveTo(1500-$f->getWidth("!#%*@")/2, 1000+$f->getAscent()/2); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfshape.addfill"> <refnamediv> <refname>SWFShape->addFill</refname> <refpurpose>Adds a solid fill to the shape.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->addfill</function></funcdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->addfill</function></funcdef> <paramdef>SWFbitmap <parameter>bitmap</parameter></paramdef> <paramdef>int <parameter><optional>flags</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->addfill</function></funcdef> <paramdef>SWFGradient <parameter>gradient</parameter></paramdef> <paramdef>int <parameter><optional>flags</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfshape->addfill</function> adds a solid fill to the shape's list of fill styles. <function>swfshape->addfill</function> accepts three different types of arguments. </para> <para> <parameter>red</parameter>, <parameter>green</parameter>, <parameter>blue</parameter> is a color (RGB mode). Last parameter <parameter>a</parameter> is optional. </para> <para> The <parameter>bitmap</parameter> argument is an <function>swfbitmap</function> object. The <parameter>flags</parameter> argument can be one of the following values : SWFFILL_CLIPPED_BITMAP or SWFFILL_TILED_BITMAP. Default is SWFFILL_TILED_BITMAP. I think. </para> <para> The <parameter>gradient</parameter> argument is an <function>swfgradient</function> object. The flags argument can be one of the following values : SWFFILL_RADIAL_GRADIENT or SWFFILL_LINEAR_GRADIENT. Default is SWFFILL_LINEAR_GRADIENT. I'm sure about this one. Really. </para> <para> <function>swfshape->addfill</function> returns an <function>swffill</function> object for use with the <function>swfshape->setleftfill</function> and <function>swfshape->setrightfill</function> functions described below. </para> <simpara> See also <function>swfshape->setleftfill</function> and <function>swfshape->setrightfill</function>. </simpara> <para> This simple example will draw a frame on a bitmap. Ah, here's another buglet in the flash player- it doesn't seem to care about the second shape's bitmap's transformation in a morph. According to spec, the bitmap should stretch along with the shape in this example.. <example> <title><function>swfshape->addfill</function> example</title> <programlisting role="php"> <![CDATA[ <?php $p = new SWFMorph(); $b = new SWFBitmap("alphafill.jpg"); // use your own bitmap $width = $b->getWidth(); $height = $b->getHeight(); $s = $p->getShape1(); $f = $s->addFill($b, SWFFILL_TILED_BITMAP); $f->moveTo(-$width/2, -$height/4); $f->scaleTo(1.0, 0.5); $s->setLeftFill($f); $s->movePenTo(-$width/2, -$height/4); $s->drawLine($width, 0); $s->drawLine(0, $height/2); $s->drawLine(-$width, 0); $s->drawLine(0, -$height/2); $s = $p->getShape2(); $f = $s->addFill($b, SWFFILL_TILED_BITMAP); // these two have no effect! $f->moveTo(-$width/4, -$height/2); $f->scaleTo(0.5, 1.0); $s->setLeftFill($f); $s->movePenTo(-$width/4, -$height/2); $s->drawLine($width/2, 0); $s->drawLine(0, $height); $s->drawLine(-$width/2, 0); $s->drawLine(0, -$height); $m = new SWFMovie(); $m->setDimension($width, $height); $i = $m->add($p); $i->moveTo($width/2, $height/2); for($n=0; $n<1.001; $n+=0.03) { $i->setRatio($n); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfshape.setleftfill"> <refnamediv> <refname>SWFShape->setLeftFill</refname> <refpurpose>Sets left rasterizing color.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setleftfill</function></funcdef> <paramdef>swfgradient <parameter>fill</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setleftfill</function></funcdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> What this nonsense is about is, every edge segment borders at most two fills. When rasterizing the object, it's pretty handy to know what those fills are ahead of time, so the swf format requires these to be specified. </para> <para> <function>swfshape->setleftfill</function> sets the fill on the left side of the edge- that is, on the interior if you're defining the outline of the shape in a counter-clockwise fashion. The fill object is an SWFFill object returned from one of the addFill functions above. </para> <para> This seems to be reversed when you're defining a shape in a morph, though. If your browser crashes, just try setting the fill on the other side. </para> <simpara> Shortcut for <literal>swfshape->setleftfill($s->addfill($r, $g, $b [, $a]));</literal>. </simpara> <simpara> See also <function>swfshape->setrightfill</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.setrightfill"> <refnamediv> <refname>SWFShape->setRightFill</refname> <refpurpose>Sets right rasterizing color.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setrightfill</function></funcdef> <paramdef>swfgradient <parameter>fill</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->setrightfill</function></funcdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> See also <function>swfshape->setleftfill</function>. </simpara> <simpara> Shortcut for <literal>swfshape->setrightfill($s->addfill($r, $g, $b [, $a]));</literal>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.movepento"> <refnamediv> <refname>SWFShape->movePenTo</refname> <refpurpose>Moves the shape's pen.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->movepento</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> move the shape's pen to (<parameter>x</parameter>,<parameter>y</parameter>) in the shape's coordinate space. </simpara> <simpara> See also <function>swfshape->movepen</function>, <function>swfshape->drawcurveto</function>, <function>swfshape->drawlineto</function> and <function>swfshape->drawline</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.movepen"> <refnamediv> <refname>SWFShape->movePen</refname> <refpurpose>Moves the shape's pen (relative).</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->movepen</function></funcdef> <paramdef>int <parameter>dx</parameter></paramdef> <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> move the shape's pen from coordinates (current x,current y) to (current x + <parameter>dx</parameter>, current y + <parameter>dy</parameter>) in the shape's coordinate space. </simpara> <simpara> See also <function>swfshape->movepento</function>, <function>swfshape->drawcurveto</function>, <function>swfshape->drawlineto</function> and <function>swfshape->drawline</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.drawlineto"> <refnamediv> <refname>SWFShape->drawLineTo</refname> <refpurpose>Draws a line.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawlineto</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>swfshape->setrightfill</function> draws a line (using the current line style, set by <function>swfshape->setline</function>) from the current pen position to point (<parameter>x</parameter>,<parameter>y</parameter>) in the shape's coordinate space. </simpara> <simpara> See also <function>swfshape->movepento</function>, <function>swfshape->drawcurveto</function>, <function>swfshape->movepen</function> and <function>swfshape->drawline</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.drawline"> <refnamediv> <refname>SWFShape->drawLine</refname> <refpurpose>Draws a line (relative).</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawline</function></funcdef> <paramdef>int <parameter>dx</parameter></paramdef> <paramdef>int <parameter>dy</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>swfshape->drawline</function> draws a line (using the current line style set by <function>swfshape->setline</function>) from the current pen position to displacement (<parameter>dx</parameter>,<parameter>dy</parameter>). </simpara> <simpara> See also <function>swfshape->movepento</function>, <function>swfshape->drawcurveto</function>, <function>swfshape->movepen</function> and <function>swfshape->drawlineto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.drawcurveto"> <refnamediv> <refname>SWFShape->drawCurveTo</refname> <refpurpose>Draws a curve.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawcurveto</function></funcdef> <paramdef>int <parameter>controlx</parameter></paramdef> <paramdef>int <parameter>controly</parameter></paramdef> <paramdef>int <parameter>anchorx</parameter></paramdef> <paramdef>int <parameter>anchory</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>swfshape->drawcurveto</function> draws a quadratic curve (using the current line style, set by <function>swfshape->setline</function>) from the current pen position to (<parameter>anchorx</parameter>,<parameter>anchory</parameter>) using (<parameter>controlx</parameter>,<parameter>controly</parameter>) as a control point. That is, head towards the control point, then smoothly turn to the anchor point. </simpara> <simpara> See also <function>swfshape->drawlineto</function>, <function>swfshape->drawline</function>, <function>swfshape->movepento</function> and <function>swfshape->movepen</function>. </simpara> </refsect1> </refentry> <refentry id="function.swfshape.drawcurve"> <refnamediv> <refname>SWFShape->drawCurve</refname> <refpurpose>Draws a curve (relative).</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfshape->drawcurve</function></funcdef> <paramdef>int <parameter>controldx</parameter></paramdef> <paramdef>int <parameter>controldy</parameter></paramdef> <paramdef>int <parameter>anchordx</parameter></paramdef> <paramdef>int <parameter>anchordy</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <simpara> <function>swfshape->drawcurve</function> draws a quadratic curve (using the current line style,set by <function>swfshape->setline</function>) from the current pen position to the relative position (<parameter>anchorx</parameter>,<parameter>anchory</parameter>) using relative control point (<parameter>controlx</parameter>,<parameter>controly</parameter>). That is, head towards the control point, then smoothly turn to the anchor point. </simpara> <simpara> See also <function>swfshape->drawlineto</function>, <function>swfshape->drawline</function>, <function>swfshape->movepento</function> and <function>swfshape->movepen</function>. </simpara> </refsect1> </refentry> <!-- SWFGradient --> <refentry id="function.swfgradient"> <refnamediv> <refname>SWFGradient</refname> <refpurpose>Creates a gradient object</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfgradient</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfgradient</function> creates a new SWFGradient object. </para> <simpara> After you've added the entries to your gradient, you can use the gradient in a shape fill with the <function>swfshape->addfill</function> method. </simpara> <simpara> SWFGradient has the following methods : <function>swfgradient->addentry</function>. </simpara> <para> This simple example will draw a big black-to-white gradient as background, and a redish disc in its center. <example> <title><function>swfgradient</function> example</title> <programlisting role="php"> <![CDATA[ <?php $m = new SWFMovie(); $m->setDimension(320, 240); $s = new SWFShape(); // first gradient- black to white $g = new SWFGradient(); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(1.0, 0xff, 0xff, 0xff); $f = $s->addFill($g, SWFFILL_LINEAR_GRADIENT); $f->scaleTo(0.01); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240); $m->add($s); $s = new SWFShape(); // second gradient- radial gradient from red to transparent $g = new SWFGradient(); $g->addEntry(0.0, 0xff, 0, 0, 0xff); $g->addEntry(1.0, 0xff, 0, 0, 0); $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.005); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240); $m->add($s); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfgradient.addentry"> <refnamediv> <refname>SWFGradient->addEntry</refname> <refpurpose>Adds an entry to the gradient list.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfgradient->addentry</function></funcdef> <paramdef>float <parameter>ratio</parameter></paramdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfgradient->addentry</function> adds an entry to the gradient list. <parameter>ratio</parameter> is a number between 0 and 1 indicating where in the gradient this color appears. Thou shalt add entries in order of increasing ratio. </para> <para> <parameter>red</parameter>, <parameter>green</parameter>, <parameter>blue</parameter> is a color (RGB mode). Last parameter <parameter>a</parameter> is optional. </para> </refsect1> </refentry> <!-- SWFBitmap --> <refentry id="function.swfbitmap"> <refnamediv> <refname>SWFBitmap</refname> <refpurpose>Loads Bitmap object</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfbitmap</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>int <parameter><optional>alphafilename</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbitmap</function> creates a new SWFBitmap object from the Jpeg or DBL file named <parameter>filename</parameter>. <parameter>alphafilename</parameter> indicates a MSK file to be used as an alpha mask for a Jpeg image. </para> <note> <para> We can only deal with baseline (frame 0) jpegs, no baseline optimized or progressive scan jpegs! </para> </note> <simpara> SWFBitmap has the following methods : <function>swfbitmap->getwidth</function> and <function>swfbitmap->getheight</function>. </simpara> <para> You can't import png images directly, though- have to use the png2dbl utility to make a dbl ("define bits lossless") file from the png. The reason for this is that I don't want a dependency on the png library in ming- autoconf should solve this, but that's not set up yet. <example> <title>Import PNG files</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); $f = $s->addFill(new SWFBitmap("png.dbl")); $s->setRightFill($f); $s->drawLine(32, 0); $s->drawLine(0, 32); $s->drawLine(-32, 0); $s->drawLine(0, -32); $m = new SWFMovie(); $m->setDimension(32, 32); $m->add($s); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> <para> And you can put an alpha mask on a jpeg fill. <example> <title><function>swfbitmap</function> example</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); // .msk file generated with "gif2mask" utility $f = $s->addFill(new SWFBitmap("alphafill.jpg", "alphafill.msk")); $s->setRightFill($f); $s->drawLine(640, 0); $s->drawLine(0, 480); $s->drawLine(-640, 0); $s->drawLine(0, -480); $c = new SWFShape(); $c->setRightFill($c->addFill(0x99, 0x99, 0x99)); $c->drawLine(40, 0); $c->drawLine(0, 40); $c->drawLine(-40, 0); $c->drawLine(0, -40); $m = new SWFMovie(); $m->setDimension(640, 480); $m->setBackground(0xcc, 0xcc, 0xcc); // draw checkerboard background for($y=0; $y<480; $y+=40) { for($x=0; $x<640; $x+=80) { $i = $m->add($c); $i->moveTo($x, $y); } $y+=40; for($x=40; $x<640; $x+=80) { $i = $m->add($c); $i->moveTo($x, $y); } } $m->add($s); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfbitmap.getwidth"> <refnamediv> <refname>SWFBitmap->getWidth</refname> <refpurpose>Returns the bitmap's width.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>swfbitmap->getwidth</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbitmap->getwidth</function> returns the bitmap's width in pixels. </para> <para> See also <function>swfbitmap->getheight</function>. </para> </refsect1> </refentry> <refentry id="function.swfbitmap.getheight"> <refnamediv> <refname>SWFBitmap->getHeight</refname> <refpurpose>Returns the bitmap's height.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>swfbitmap->getheight</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbitmap->getheight</function> returns the bitmap's height in pixels. </para> <para> See also <function>swfbitmap->getwidth</function>. </para> </refsect1> </refentry> <!-- SWFFill --> <refentry id="function.swffill"> <refnamediv> <refname>SWFFill</refname> <refpurpose>Loads SWFFill object</refpurpose> </refnamediv> <refsect1> <title>Description</title> <para> The <function>swffill</function> object allows you to transform (scale, skew, rotate) bitmap and gradient fills. <function>swffill</function> objects are created by the <function>swfshape->addfill</function> methods. </para> <simpara> SWFFill has the following methods : <function>swffill->moveto</function> and <function>swffill->scaleto</function>, <function>swffill->rotateto</function>, <function>swffill->skewxto</function> and <function>swffill->skewyto</function>. </simpara> </refsect1> </refentry> <refentry id="function.swffill.moveto"> <refnamediv> <refname>SWFFill->moveTo</refname> <refpurpose>Moves fill origin</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->moveto</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swffill->moveto</function> moves fill's origin to (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. </para> </refsect1> </refentry> <refentry id="function.swffill.scaleto"> <refnamediv> <refname>SWFFill->scaleTo</refname> <refpurpose>Sets fill's scale</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->scaleto</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swffill->scaleto</function> sets fill's scale to <parameter>x</parameter> in the x-direction, <parameter>y</parameter> in the y-direction. </para> </refsect1> </refentry> <refentry id="function.swffill.rotateto"> <refnamediv> <refname>SWFFill->rotateTo</refname> <refpurpose>Sets fill's rotation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->rotateto</function></funcdef> <paramdef>float <parameter>degrees</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swffill->rotateto</function> sets fill's rotation to <parameter>degrees</parameter> degrees. </para> </refsect1> </refentry> <refentry id="function.swffill.skewxto"> <refnamediv> <refname>SWFFill->skewXTo</refname> <refpurpose>Sets fill x-skew</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->skewxto</function></funcdef> <paramdef>float <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swffill->skewxto</function> sets fill x-skew to <parameter>x</parameter>. For <parameter>x</parameter> is 1.0, it is a is a 45-degree forward slant. More is more forward, less is more backward. </para> </refsect1> </refentry> <refentry id="function.swffill.skewyto"> <refnamediv> <refname>SWFFill->skewYTo</refname> <refpurpose>Sets fill y-skew</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swffill->skewyto</function></funcdef> <paramdef>float <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swffill->skewyto</function> sets fill y-skew to <parameter>y</parameter>. For <parameter>y</parameter> is 1.0, it is a is a 45-degree upward slant. More is more upward, less is more downward. </para> </refsect1> </refentry> <!-- SWFMorph --> <refentry id="function.swfmorph"> <refnamediv> <refname>SWFMorph</refname> <refpurpose>Creates a new SWFMorph object.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfmorph</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmorph</function> creates a new SWFMorph object. </para> <para> Also called a "shape tween". This thing lets you make those tacky twisting things that make your computer choke. Oh, joy! </para> <para> The methods here are sort of weird. It would make more sense to just have newSWFMorph(shape1, shape2);, but as things are now, shape2 needs to know that it's the second part of a morph. (This, because it starts writing its output as soon as it gets drawing commands- if it kept its own description of its shapes and wrote on completion this and some other things would be much easier.) </para> <simpara> SWFMorph has the following methods : <function>swfmorph->getshape1</function> and <function>swfmorph->getshape1</function>. </simpara> <para> This simple example will morph a big red square into a smaller blue black-bordered square. <example> <title><function>swfmorph</function> example</title> <programlisting role="php"> <![CDATA[ <?php $p = new SWFMorph(); $s = $p->getShape1(); $s->setLine(0,0,0,0); /* Note that this is backwards from normal shapes (left instead of right). I have no idea why, but this seems to work.. */ $s->setLeftFill($s->addFill(0xff, 0, 0)); $s->movePenTo(-1000,-1000); $s->drawLine(2000,0); $s->drawLine(0,2000); $s->drawLine(-2000,0); $s->drawLine(0,-2000); $s = $p->getShape2(); $s->setLine(60,0,0,0); $s->setLeftFill($s->addFill(0, 0, 0xff)); $s->movePenTo(0,-1000); $s->drawLine(1000,1000); $s->drawLine(-1000,1000); $s->drawLine(-1000,-1000); $s->drawLine(1000,-1000); $m = new SWFMovie(); $m->setDimension(3000,2000); $m->setBackground(0xff, 0xff, 0xff); $i = $m->add($p); $i->moveTo(1500,1000); for($r=0.0; $r<=1.0; $r+=0.1) { $i->setRatio($r); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfmorph.getshape1"> <refnamediv> <refname>SWFMorph->getshape1</refname> <refpurpose>Gets a handle to the starting shape</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>swfmorph->getshape1</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmorph->getshape1</function> gets a handle to the morph's starting shape. <function>swfmorph->getshape1</function> returns an <function>swfshape</function> object. </para> </refsect1> </refentry> <refentry id="function.swfmorph.getshape2"> <refnamediv> <refname>SWFMorph->getshape2</refname> <refpurpose>Gets a handle to the ending shape</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>swfmorph->getshape2</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfmorph->getshape2</function> gets a handle to the morph's ending shape. <function>swfmorph->getshape2</function> returns an <function>swfshape</function> object. </para> </refsect1> </refentry> <!-- SWFText --> <refentry id="function.swftext"> <refnamediv> <refname>SWFText</refname> <refpurpose>Creates a new SWFText object.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swftext</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext</function> creates a new SWFText object, fresh for manipulating. </para> <simpara> SWFText has the following methods : <function>swftext->setfont</function>, <function>swftext->setheight</function>, <function>swftext->setspacing</function>, <function>swftext->setcolor</function>, <function>swftext->moveto</function>, <function>swftext->addstring</function> and <function>swftext->getwidth</function>. </simpara> <para> This simple example will draw a big yellow "PHP generates Flash with Ming" text, on white background. <example> <title><function>swftext</function> example</title> <programlisting role="php"> <![CDATA[ <?php $f = new SWFFont("Techno.fdb"); $t = new SWFText(); $t->setFont($f); $t->moveTo(200, 2400); $t->setColor(0xff, 0xff, 0); $t->setHeight(1200); $t->addString("PHP generates Flash with Ming!!"); $m = new SWFMovie(); $m->setDimension(5400, 3600); $m->add($t); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swftext.setfont"> <refnamediv> <refname>SWFText->setFont</refname> <refpurpose>Sets the current font</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setfont</function></funcdef> <paramdef>string <parameter>font</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->setfont</function> sets the current font to <parameter>font</parameter>. </para> </refsect1> </refentry> <refentry id="function.swftext.setheight"> <refnamediv> <refname>SWFText->setHeight</refname> <refpurpose>Sets the current font height</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setheight</function></funcdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->setheight</function> sets the current font height to <parameter>height</parameter>. Default is 240. </para> </refsect1> </refentry> <refentry id="function.swftext.setspacing"> <refnamediv> <refname>SWFText->setSpacing</refname> <refpurpose>Sets the current font spacing</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setspacing</function></funcdef> <paramdef>float <parameter>spacing</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->setspacing</function> sets the current font spacing to <parameter>spacing</parameter><parameter>spacing</parameter>. Default is 1.0. 0 is all of the letters written at the same point. This doesn't really work that well because it inflates the advance across the letter, doesn't add the same amount of spacing between the letters. I should try and explain that better, prolly. Or just fix the damn thing to do constant spacing. This was really just a way to figure out how letter advances work, anyway.. So nyah. </para> </refsect1> </refentry> <refentry id="function.swftext.setcolor"> <refnamediv> <refname>SWFText->setColor</refname> <refpurpose>Sets the current font color</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->setcolor</function></funcdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->setspacing</function> changes the current text color. Default is black. I think. Color is represented using the RGB system. </para> </refsect1> </refentry> <refentry id="function.swftext.moveto"> <refnamediv> <refname>SWFText->moveTo</refname> <refpurpose>Moves the pen</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->moveto</function></funcdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->moveto</function> moves the pen (or cursor, if that makes more sense) to (<parameter>x</parameter>,<parameter>y</parameter>) in text object's coordinate space. If either is zero, though, value in that dimension stays the same. Annoying, should be fixed. </para> </refsect1> </refentry> <refentry id="function.swftext.addstring"> <refnamediv> <refname>SWFText->addString</refname> <refpurpose>Draws a string</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->addstring</function></funcdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->addstring</function> draws the string <parameter>string</parameter> at the current pen (cursor) location. Pen is at the baseline of the text; i.e., ascending text is in the -y direction. </para> </refsect1> </refentry> <refentry id="function.swftext.getwidth"> <refnamediv> <refname>SWFText->getWidth</refname> <refpurpose>Computes string's width</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftext->addstring</function></funcdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftext->addstring</function> returns the rendered width of the <parameter>string</parameter> string at the text object's current font, scale, and spacing settings. </para> </refsect1> </refentry> <!-- SWFFont --> <refentry id="function.swffont"> <refnamediv> <refname>SWFFont</refname> <refpurpose>Loads a font definition</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swffont</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> If <parameter>filename</parameter> is the name of an FDB file (i.e., it ends in ".fdb"), load the font definition found in said file. Otherwise, create a browser-defined font reference. </para> <para> FDB ("font definition block") is a very simple wrapper for the SWF DefineFont2 block which contains a full description of a font. One may create FDB files from SWT Generator template files with the included makefdb utility- look in the util directory off the main ming distribution directory. </para> <para> Browser-defined fonts don't contain any information about the font other than its name. It is assumed that the font definition will be provided by the movie player. The fonts _serif, _sans, and _typewriter should always be available. For example: <programlisting role="php"> <![CDATA[ <?php $f = newSWFFont("_sans"); ?> ]]> </programlisting> will give you the standard sans-serif font, probably the same as what you'd get with <literal>&lt;font name="sans-serif"&gt;</literal> in HTML. </para> <para> <function>swffont</function> returns a reference to the font definition, for use in the <function>SWFText->setFont</function> and the <function>SWFTextField->setFont</function> methods. </para> <simpara> SWFFont has the following methods : <function>swffont->getwidth</function>. </simpara> </refsect1> </refentry> <refentry id="function.swffont.getwidth"> <refnamediv> <refname>swffont->getwidth</refname> <refpurpose>Returns the string's width</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>swffont->getwidth</function></funcdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swffont->getwidth</function> returns the string <parameter>string</parameter>'s width, using font's default scaling. You'll probably want to use the <function>SWFText</function> version of this method which uses the text object's scale. </para> </refsect1> </refentry> <!-- SWFTextField --> <refentry id="function.swftextfield"> <refnamediv> <refname>SWFTextField</refname> <refpurpose>Creates a text field object</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swftextfield</function></funcdef> <paramdef>int <parameter><optional>flags</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield</function> creates a new text field object. Text Fields are less flexible than <function>swftext</function> objects- they can't be rotated, scaled non-proportionally, or skewed, but they can be used as form entries, and they can use browser-defined fonts. </para> <para> The optional flags change the text field's behavior. It has the following possibles values : <itemizedlist> <listitem> <simpara> SWFTEXTFIELD_NOEDIT indicates that the field shouldn't be user-editable </simpara> </listitem> <listitem> <simpara> SWFTEXTFIELD_PASSWORD obscures the data entry </simpara> </listitem> <listitem> <simpara> SWFTEXTFIELD_DRAWBOX draws the outline of the textfield </simpara> </listitem> <listitem> <simpara> SWFTEXTFIELD_MULTILINE allows multiple lines </simpara> </listitem> <listitem> <simpara> SWFTEXTFIELD_WORDWRAP allows text to wrap </simpara> </listitem> <listitem> <simpara> SWFTEXTFIELD_NOSELECT makes the field non-selectable </simpara> </listitem> </itemizedlist> Flags are combined with the bitwise <link linkend="language.operators.bitwise">OR</link> operation. For example, <programlisting role="php"> <![CDATA[ <?php $t = newSWFTextField(SWFTEXTFIELD_PASSWORD | SWFTEXTFIELD_NOEDIT); ?> ]]> </programlisting> creates a totally useless non-editable password field. </para> <simpara> SWFTextField has the following methods : <function>swftextfield->setfont</function>, <function>swftextfield->setbounds</function>, <function>swftextfield->align</function>, <function>swftextfield->setheight</function>, <function>swftextfield->setleftmargin</function>, <function>swftextfield->setrightmargin</function>, <function>swftextfield->setmargins</function>, <function>swftextfield->setindentation</function>, <function>swftextfield->setlinespacing</function>, <function>swftextfield->setcolor</function>, <function>swftextfield->setname</function> and <function>swftextfield->addstring</function>. </simpara> </refsect1> </refentry> <refentry id="function.swftextfield.setfont"> <refnamediv> <refname>SWFTextField->setFont</refname> <refpurpose>Sets the text field font</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setfont</function></funcdef> <paramdef>string <parameter>font</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setfont</function> sets the text field font to the [browser-defined?] <parameter>font</parameter> font. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setbounds"> <refnamediv> <refname>SWFTextField->setbounds</refname> <refpurpose>Sets the text field width and height</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setbounds</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setbounds</function> sets the text field width to <parameter>width</parameter> and height to <parameter>height</parameter>. If you don't set the bounds yourself, Ming makes a poor guess at what the bounds are. </para> </refsect1> </refentry> <refentry id="function.swftextfield.align"> <refnamediv> <refname>SWFTextField->align</refname> <refpurpose>Sets the text field alignment</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->align</function></funcdef> <paramdef>int <parameter>alignement</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->align</function> sets the text field alignment to <parameter>alignement</parameter>. Valid values for <parameter>alignement</parameter> are : SWFTEXTFIELD_ALIGN_LEFT, SWFTEXTFIELD_ALIGN_RIGHT, SWFTEXTFIELD_ALIGN_CENTER and SWFTEXTFIELD_ALIGN_JUSTIFY. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setheight"> <refnamediv> <refname>SWFTextField->setHeight</refname> <refpurpose>Sets the font height of this text field font.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setheight</function></funcdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setheight</function> sets the font height of this text field font to the given height <parameter>height</parameter>. Default is 240. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setleftmargin"> <refnamediv> <refname>SWFTextField->setLeftMargin</refname> <refpurpose>Sets the left margin width of the text field.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setleftmargin</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setleftmargin</function> sets the left margin width of the text field to <parameter>width</parameter>. Default is 0. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setrightmargin"> <refnamediv> <refname>SWFTextField->setrightMargin</refname> <refpurpose>Sets the right margin width of the text field.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setrightmargin</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setrightmargin</function> sets the right margin width of the text field to <parameter>width</parameter>. Default is 0. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setmargins"> <refnamediv> <refname>SWFTextField->setMargins</refname> <refpurpose>Sets the margins width of the text field.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setmargins</function></funcdef> <paramdef>int <parameter>left</parameter></paramdef> <paramdef>int <parameter>right</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setmargins</function> set both margins at once, for the man on the go. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setindentation"> <refnamediv> <refname>SWFTextField->setindentation</refname> <refpurpose>Sets the indentation of the first line.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setindentation</function></funcdef> <paramdef>int <parameter>width</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setindentation</function> sets the indentation of the first line in the text field, to <parameter>width</parameter>. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setlinespacing"> <refnamediv> <refname>SWFTextField->setLineSpacing</refname> <refpurpose>Sets the line spacing of the text field.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setlinespacing</function></funcdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setlinespacing</function> sets the line spacing of the text field to the height of <parameter>height</parameter>. Default is 40. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setcolor"> <refnamediv> <refname>SWFTextField->setcolor</refname> <refpurpose>Sets the color of the text field. </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setcolor</function></funcdef> <paramdef>int <parameter>red</parameter></paramdef> <paramdef>int <parameter>green</parameter></paramdef> <paramdef>int <parameter>blue</parameter></paramdef> <paramdef>int <parameter><optional>a</optional></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setcolor</function> sets the color of the text field. Default is fully opaque black. Color is represented using RGB system. </para> </refsect1> </refentry> <refentry id="function.swftextfield.setname"> <refnamediv> <refname>SWFTextField->setname</refname> <refpurpose>Sets the variable name</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->setname</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setname</function> sets the variable name of this text field to <parameter>name</parameter>, for form posting and action scripting purposes. </para> </refsect1> </refentry> <refentry id="function.swftextfield.addstring"> <refnamediv> <refname>SWFTextField->addstring</refname> <refpurpose>Concatenates the given string to the text field</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swftextfield->addstring</function></funcdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swftextfield->setname</function> concatenates the string <parameter>string</parameter> to the text field. </para> </refsect1> </refentry> <!-- SWFSprite --> <refentry id="function.swfsprite"> <refnamediv> <refname>SWFSprite</refname> <refpurpose>Creates a movie clip (a sprite)</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfsprite</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfsprite</function> are also known as a "movie clip", this allows one to create objects which are animated in their own timelines. Hence, the sprite has most of the same methods as the movie. </para> <simpara> <function>swfsprite</function> has the following methods : <function>swfsprite->add</function>, <function>swfsprite->remove</function>, <function>swfsprite->nextframe</function> and <function>swfsprite->setframes</function>. </simpara> <para> This simple example will spin gracefully a big red square. <example> <title><function>swfsprite</function> example</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); $s->setRightFill($s->addFill(0xff, 0, 0)); $s->movePenTo(-500,-500); $s->drawLineTo(500,-500); $s->drawLineTo(500,500); $s->drawLineTo(-500,500); $s->drawLineTo(-500,-500); $p = new SWFSprite(); $i = $p->add($s); $p->nextFrame(); $i->rotate(15); $p->nextFrame(); $i->rotate(15); $p->nextFrame(); $i->rotate(15); $p->nextFrame(); $i->rotate(15); $p->nextFrame(); $i->rotate(15); $p->nextFrame(); $m = new SWFMovie(); $i = $m->add($p); $i->moveTo(1500,1000); $i->setName("blah"); $m->setBackground(0xff, 0xff, 0xff); $m->setDimension(3000,2000); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfsprite.add"> <refnamediv> <refname>SWFSprite->add</refname> <refpurpose>Adds an object to a sprite</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->add</function></funcdef> <paramdef>ressource <parameter>object</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfsprite->add</function> adds a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function>, a <function>swfaction</function> or a <function>swfsprite</function> object. </para> <para> For displayable types (<function>swfshape</function>, <function>swfbutton</function>, <function>swftext</function>, <function>swfaction</function> or <function>swfsprite</function>), this returns a handle to the object in a display list. </para> </refsect1> </refentry> <refentry id="function.swfsprite.remove"> <refnamediv> <refname>SWFSprite->remove</refname> <refpurpose>Removes an object to a sprite</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->remove</function></funcdef> <paramdef>ressource <parameter>object</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfsprite->remove</function> remove a <function>swfshape</function>, a <function>swfbutton</function>, a <function>swftext</function>, a <function>swfaction</function> or a <function>swfsprite</function> object from the sprite. </para> </refsect1> </refentry> <refentry id="function.swfsprite.setframes"> <refnamediv> <refname>SWFSprite->setframes</refname> <refpurpose>Sets the total number of frames in the animation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->setframes</function></funcdef> <paramdef>int <parameter>numberofframes</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfsprite->setframes</function> sets the total number of frames in the animation to <parameter>numberofframes</parameter>. </para> </refsect1> </refentry> <refentry id="function.swfsprite.nextframe"> <refnamediv> <refname>SWFSprite->nextframe</refname> <refpurpose>Moves to the next frame of the animation.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfsprite->nextframe</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfsprite->setframes</function> moves to the next frame of the animation. </para> </refsect1> </refentry> <!-- SWFButton --> <refentry id="function.swfbutton"> <refnamediv> <refname>SWFbutton</refname> <refpurpose>Creates a new Button.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfbutton</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton</function> creates a new Button. Roll over it, click it, see it call action code. Swank. </para> <simpara> SWFButton has the following methods : <function>swfbutton->addshape</function>, <function>swfbutton->setup</function>, <function>swfbutton->setover</function> <function>swfbutton->setdown</function>, <function>swfbutton->sethit</function> <function>swfbutton->setaction</function> and <function>swfbutton->addaction</function>. </simpara> <para> This simple example will show your usual interactions with buttons : rollover, rollon, mouseup, mousedown, noaction. <example> <title><function>swfbutton</function> example</title> <programlisting role="php"> <![CDATA[ <?php $f = new SWFFont("_serif"); $p = new SWFSprite(); function label($string) { global $f; $t = new SWFTextField(); $t->setFont($f); $t->addString($string); $t->setHeight(200); $t->setBounds(3200,200); return $t; } function addLabel($string) { global $p; $i = $p->add(label($string)); $p->nextFrame(); $p->remove($i); } $p->add(new SWFAction("stop();")); addLabel("NO ACTION"); addLabel("SWFBUTTON_MOUSEUP"); addLabel("SWFBUTTON_MOUSEDOWN"); addLabel("SWFBUTTON_MOUSEOVER"); addLabel("SWFBUTTON_MOUSEOUT"); addLabel("SWFBUTTON_MOUSEUPOUTSIDE"); addLabel("SWFBUTTON_DRAGOVER"); addLabel("SWFBUTTON_DRAGOUT"); function rect($r, $g, $b) { $s = new SWFShape(); $s->setRightFill($s->addFill($r, $g, $b)); $s->drawLine(600,0); $s->drawLine(0,600); $s->drawLine(-600,0); $s->drawLine(0,-600); return $s; } $b = new SWFButton(); $b->addShape(rect(0xff, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT); $b->addShape(rect(0, 0xff, 0), SWFBUTTON_OVER); $b->addShape(rect(0, 0, 0xff), SWFBUTTON_DOWN); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(1);"), SWFBUTTON_MOUSEUP); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(2);"), SWFBUTTON_MOUSEDOWN); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(3);"), SWFBUTTON_MOUSEOVER); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(4);"), SWFBUTTON_MOUSEOUT); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(5);"), SWFBUTTON_MOUSEUPOUTSIDE); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(6);"), SWFBUTTON_DRAGOVER); $b->addAction(new SWFAction("setTarget('/label'); gotoFrame(7);"), SWFBUTTON_DRAGOUT); $m = new SWFMovie(); $m->setDimension(4000,3000); $i = $m->add($p); $i->setName("label"); $i->moveTo(400,1900); $i = $m->add($b); $i->moveTo(400,900); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> <para> This simple example will enables you to drag draw a big red button on the windows. No drag-and-drop, just moving around. <example> <title><function>swfbutton->addaction</function> example</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); $s->setRightFill($s->addFill(0xff, 0, 0)); $s->drawLine(1000,0); $s->drawLine(0,1000); $s->drawLine(-1000,0); $s->drawLine(0,-1000); $b = new SWFButton(); $b->addShape($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER); $b->addAction(new SWFAction("startDrag('/test', 0);"), // '0' means don't lock to mouse SWFBUTTON_MOUSEDOWN); $b->addAction(new SWFAction("stopDrag();"), SWFBUTTON_MOUSEUP | SWFBUTTON_MOUSEUPOUTSIDE); $p = new SWFSprite(); $p->add($b); $p->nextFrame(); $m = new SWFMovie(); $i = $m->add($p); $i->setName('test'); $i->moveTo(1000,1000); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> <refentry id="function.swfbutton.addshape"> <refnamediv> <refname>SWFbutton->addShape</refname> <refpurpose>Adds a shape to a button</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->addshape</function></funcdef> <paramdef>ressource <parameter>shape</parameter></paramdef> <paramdef>int <parameter>flags</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->addshape</function> adds the shape <parameter>shape</parameter> to this button. The following <parameter>flags</parameter>' values are valid: SWFBUTTON_UP, SWFBUTTON_OVER, SWFBUTTON_DOWN or SWFBUTTON_HIT. SWFBUTTON_HIT isn't ever displayed, it defines the hit region for the button. That is, everywhere the hit shape would be drawn is considered a "touchable" part of the button. </para> </refsect1> </refentry> <refentry id="function.swfbutton.setup"> <refnamediv> <refname>SWFbutton->setUp</refname> <refpurpose>Alias for addShape(shape, SWFBUTTON_UP)</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->setup</function></funcdef> <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->setup</function> alias for addShape(shape, SWFBUTTON_UP). </para> <para> See also <function>swfbutton->addshape</function> and <function>SWFAction</function>. </para> </refsect1> </refentry> <refentry id="function.swfbutton.setover"> <refnamediv> <refname>SWFbutton->setOver</refname> <refpurpose>Alias for addShape(shape, SWFBUTTON_OVER)</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->setover</function></funcdef> <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->setover</function> alias for addShape(shape, SWFBUTTON_OVER). </para> <para> See also <function>swfbutton->addshape</function> and <function>SWFAction</function>. </para> </refsect1> </refentry> <refentry id="function.swfbutton.setdown"> <refnamediv> <refname>SWFbutton->setdown</refname> <refpurpose>Alias for addShape(shape, SWFBUTTON_DOWN))</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->setdown</function></funcdef> <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->setdown</function> alias for addShape(shape, SWFBUTTON_DOWN). </para> <para> See also <function>swfbutton->addshape</function> and <function>SWFAction</function>. </para> </refsect1> </refentry> <refentry id="function.swfbutton.sethit"> <refnamediv> <refname>SWFbutton->setHit</refname> <refpurpose>Alias for addShape(shape, SWFBUTTON_HIT)</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->sethit</function></funcdef> <paramdef>ressource <parameter>shape</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->sethit</function> alias for addShape(shape, SWFBUTTON_HIT). </para> <para> See also <function>swfbutton->addshape</function> and <function>SWFAction</function>. </para> </refsect1> </refentry> <refentry id="function.swfbutton.addaction"> <refnamediv> <refname>SWFbutton->addAction</refname> <refpurpose>Adds an action</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->addaction</function></funcdef> <paramdef>ressource <parameter>action</parameter></paramdef> <paramdef>int <parameter>flags</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->addaction</function> adds the action <parameter>action</parameter> to this button for the given conditions. The following <parameter>flags</parameter> are valid: SWFBUTTON_MOUSEOVER, SWFBUTTON_MOUSEOUT, SWFBUTTON_MOUSEUP, SWFBUTTON_MOUSEUPOUTSIDE, SWFBUTTON_MOUSEDOWN, SWFBUTTON_DRAGOUT and SWFBUTTON_DRAGOVER. </para> <para> See also <function>swfbutton->addshape</function> and <function>SWFAction</function>. </para> </refsect1> </refentry> <refentry id="function.swfbutton.setaction"> <refnamediv> <refname>SWFbutton->setAction</refname> <refpurpose>Sets the action</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>swfbutton->setaction</function></funcdef> <paramdef>ressource <parameter>action</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfbutton->setaction</function> sets the action to be performed when the button is clicked. Alias for addAction(shape, SWFBUTTON_MOUSEUP). <parameter>action</parameter> is a <function>swfaction</function>. </para> <para> See also <function>swfbutton->addshape</function> and <function>SWFAction</function>. </para> </refsect1> </refentry> <!-- SWFAction --> <refentry id="function.swfaction"> <refnamediv> <refname>SWFAction</refname> <refpurpose>Creates a new Action.</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>new <function>swfaction</function></funcdef> <paramdef>string <parameter>script</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>swfaction</function> creates a new Action, and compiles the given script into an SWFAction object. </para> <para> The script syntax is based on the C language, but with a lot taken out- the SWF bytecode machine is just too simpleminded to do a lot of things we might like. For instance, we can't implement function calls without a tremendous amount of hackery because the jump bytecode has a hardcoded offset value. No pushing your calling address to the stack and returning- every function would have to know exactly where to return to. </para> <para> So what's left? The compiler recognises the following tokens: <itemizedlist> <listitem> <simpara> break </simpara> </listitem> <listitem> <simpara> for </simpara> </listitem> <listitem> <simpara> continue </simpara> </listitem> <listitem> <simpara> if </simpara> </listitem> <listitem> <simpara> else </simpara> </listitem> <listitem> <simpara> do </simpara> </listitem> <listitem> <simpara> while </simpara> </listitem> </itemizedlist> </para> <para> There is no typed data; all values in the SWF action machine are stored as strings. The following functions can be used in expressions: <variablelist> <varlistentry> <term>time()</term> <listitem> <simpara> Returns the number of milliseconds (?) elapsed since the movie started. </simpara> </listitem> </varlistentry> <varlistentry> <term>random(seed)</term> <listitem> <simpara> Returns a pseudo-random number in the range 0-seed. </simpara> </listitem> </varlistentry> <varlistentry> <term>length(expr)</term> <listitem> <simpara> Returns the length of the given expression. </simpara> </listitem> </varlistentry> <varlistentry> <term>int(number)</term> <listitem> <simpara> Returns the given number rounded down to the nearest integer. </simpara> </listitem> </varlistentry> <varlistentry> <term>concat(expr, expr)</term> <listitem> <simpara> Returns the concatenation of the given expressions. </simpara> </listitem> </varlistentry> <varlistentry> <term>ord(expr)</term> <listitem> <simpara> Returns the ASCII code for the given character </simpara> </listitem> </varlistentry> <varlistentry> <term>chr(num)</term> <listitem> <simpara> Returns the character for the given ASCII code </simpara> </listitem> </varlistentry> <varlistentry> <term>substr(string, location, length)</term> <listitem> <simpara> Returns the substring of length length at location location of the given string string. </simpara> </listitem> </varlistentry> </variablelist> </para> <para> Additionally, the following commands may be used: <variablelist> <varlistentry> <term>duplicateClip(clip, name, depth)</term> <listitem> <simpara> Duplicate the named movie clip (aka sprite). The new movie clip has name name and is at depth depth. </simpara> </listitem> </varlistentry> <varlistentry> <term>removeClip(expr)</term> <listitem> <simpara> Removes the named movie clip. </simpara> </listitem> </varlistentry> <varlistentry> <term>trace(expr)</term> <listitem> <simpara> Write the given expression to the trace log. Doubtful that the browser plugin does anything with this. </simpara> </listitem> </varlistentry> <varlistentry> <term>startDrag(target, lock, [left, top, right, bottom])</term> <listitem> <simpara> Start dragging the movie clip target. The lock argument indicates whether to lock the mouse (?)- use 0 (&false;) or 1 (&true;). Optional parameters define a bounding area for the dragging. </simpara> </listitem> </varlistentry> <varlistentry> <term>stopDrag()</term> <listitem> <simpara> Stop dragging my heart around. And this movie clip, too. </simpara> </listitem> </varlistentry> <varlistentry> <term>callFrame(expr)</term> <listitem> <simpara> Call the named frame as a function. </simpara> </listitem> </varlistentry> <varlistentry> <term>getURL(url, target, [method])</term> <listitem> <simpara> Load the given url into the named target. The target argument can be a frame name (I think), or one of the magical values "_level0" (replaces current movie) or "_level1" (loads new movie on top of current movie). The optional method argument can be post or get if you want to submit variables back to the server. </simpara> </listitem> </varlistentry> <varlistentry> <term>loadMovie(url, target)</term> <listitem> <simpara> Same as above, more or less. Come to think of it, I don't quite know what the difference is. </simpara> </listitem> </varlistentry> <varlistentry> <term>nextFrame()</term> <listitem> <simpara> Go to the next frame. </simpara> </listitem> </varlistentry> <varlistentry> <term>prevFrame()</term> <listitem> <simpara> Go to the last (or, rather, previous) frame. </simpara> </listitem> </varlistentry> <varlistentry> <term>play()</term> <listitem> <simpara> Start playing the movie. </simpara> </listitem> </varlistentry> <varlistentry> <term>stop()</term> <listitem> <simpara> Stop playing the movie. </simpara> </listitem> </varlistentry> <varlistentry> <term>toggleQuality()</term> <listitem> <simpara> Toggle between high and low quality. </simpara> </listitem> </varlistentry> <varlistentry> <term>stopSounds()</term> <listitem> <simpara> Stop playing all sounds. </simpara> </listitem> </varlistentry> <varlistentry> <term>gotoFrame(num)</term> <listitem> <simpara> Go to frame number num. Frame numbers start at 0. </simpara> </listitem> </varlistentry> <varlistentry> <term>gotoFrame(name)</term> <listitem> <simpara> Go to the frame named name. Which does a lot of good, since I haven't added frame labels yet. </simpara> </listitem> </varlistentry> <varlistentry> <term>setTarget(expr)</term> <listitem> <simpara> Sets the context for action. Or so they say- I really have no idea what this does. </simpara> </listitem> </varlistentry> </variablelist> And there's one weird extra thing. The expression frameLoaded(num) can be used in if statements and while loops to check if the given frame number has been loaded yet. Well, it's supposed to, anyway, but I've never tested it and I seriously doubt it actually works. You can just use /:framesLoaded instead. </para> <para> Movie clips (all together now- aka sprites) have properties. You can read all of them (or can you?), you can set some of them, and here they are: <itemizedlist> <listitem> <simpara> x </simpara> </listitem> <listitem> <simpara> y </simpara> </listitem> <listitem> <simpara> xScale </simpara> </listitem> <listitem> <simpara> yScale </simpara> </listitem> <listitem> <simpara> currentFrame - (read-only) </simpara> </listitem> <listitem> <simpara> totalFrames - (read-only) </simpara> </listitem> <listitem> <simpara> alpha - transparency level </simpara> </listitem> <listitem> <simpara> visible - 1=on, 0=off (?) </simpara> </listitem> <listitem> <simpara> width - (read-only) </simpara> </listitem> <listitem> <simpara> height - (read-only) </simpara> </listitem> <listitem> <simpara> rotation </simpara> </listitem> <listitem> <simpara> target - (read-only) (???) </simpara> </listitem> <listitem> <simpara> framesLoaded - (read-only) </simpara> </listitem> <listitem> <simpara> name </simpara> </listitem> <listitem> <simpara> dropTarget - (read-only) (???) </simpara> </listitem> <listitem> <simpara> url - (read-only) (???) </simpara> </listitem> <listitem> <simpara> highQuality - 1=high, 0=low (?) </simpara> </listitem> <listitem> <simpara> focusRect - (???) </simpara> </listitem> <listitem> <simpara> soundBufTime - (???) </simpara> </listitem> </itemizedlist> So, setting a sprite's x position is as simple as <literal>/box.x = 100;</literal>. Why the slash in front of the box, though? That's how flash keeps track of the sprites in the movie, just like a unix filesystem- here it shows that box is at the top level. If the sprite named box had another sprite named biff inside of it, you'd set its x position with /box/biff.x = 100;. At least, I think so; correct me if I'm wrong here. </para> <para> This simple example will move the red square across the window. <example> <title><function>swfaction</function> example</title> <programlisting role="php"> <![CDATA[ <?php $s = new SWFShape(); $f = $s->addFill(0xff, 0, 0); $s->setRightFill($f); $s->movePenTo(-500,-500); $s->drawLineTo(500,-500); $s->drawLineTo(500,500); $s->drawLineTo(-500,500); $s->drawLineTo(-500,-500); $p = new SWFSprite(); $i = $p->add($s); $i->setDepth(1); $p->nextFrame(); for($n=0; $n<5; ++$n) { $i->rotate(-15); $p->nextFrame(); } $m = new SWFMovie(); $m->setBackground(0xff, 0xff, 0xff); $m->setDimension(6000,4000); $i = $m->add($p); $i->setDepth(1); $i->moveTo(-500,2000); $i->setName("box"); $m->add(new SWFAction("/box.x += 3;")); $m->nextFrame(); $m->add(new SWFAction("gotoFrame(0); play();")); $m->nextFrame(); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> <para> This simple example tracks down your mouse on the screen. <example> <title><function>swfaction</function> example</title> <programlisting role="php"> <![CDATA[ <?php $m = new SWFMovie(); $m->setRate(36.0); $m->setDimension(1200, 800); $m->setBackground(0, 0, 0); /* mouse tracking sprite - empty, but follows mouse so we can get its x and y coordinates */ $i = $m->add(new SWFSprite()); $i->setName('mouse'); $m->add(new SWFAction(" startDrag('/mouse', 1); /* '1' means lock sprite to the mouse */ ")); /* might as well turn off antialiasing, since these are just squares. */ $m->add(new SWFAction(" this.quality = 0; ")); /* morphing box */ $r = new SWFMorph(); $s = $r->getShape1(); /* Note this is backwards from normal shapes. No idea why. */ $s->setLeftFill($s->addFill(0xff, 0xff, 0xff)); $s->movePenTo(-40, -40); $s->drawLine(80, 0); $s->drawLine(0, 80); $s->drawLine(-80, 0); $s->drawLine(0, -80); $s = $r->getShape2(); $s->setLeftFill($s->addFill(0x00, 0x00, 0x00)); $s->movePenTo(-1, -1); $s->drawLine(2, 0); $s->drawLine(0, 2); $s->drawLine(-2, 0); $s->drawLine(0, -2); /* sprite container for morphing box - this is just a timeline w/ the box morphing */ $box = new SWFSprite(); $box->add(new SWFAction(" stop(); ")); $i = $box->add($r); for($n=0; $n<=20; ++$n) { $i->setRatio($n/20); $box->nextFrame(); } /* this container sprite allows us to use the same action code many times */ $cell = new SWFSprite(); $i = $cell->add($box); $i->setName('box'); $cell->add(new SWFAction(" setTarget('box'); /* ...x means the x coordinate of the parent, i.e. (..).x */ dx = (/mouse.x + random(6)-3 - ...x)/5; dy = (/mouse.y + random(6)-3 - ...y)/5; gotoFrame(int(dx*dx + dy*dy)); ")); $cell->nextFrame(); $cell->add(new SWFAction(" gotoFrame(0); play(); ")); $cell->nextFrame(); /* finally, add a bunch of the cells to the movie */ for($x=0; $x<12; ++$x) { for($y=0; $y<8; ++$y) { $i = $m->add($cell); $i->moveTo(100*$x+50, 100*$y+50); } } $m->nextFrame(); $m->add(new SWFAction(" gotoFrame(1); play(); ")); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> <para> Same as above, but with nice colored balls... <example> <title><function>swfaction</function> example</title> <programlisting role="php"> <![CDATA[ <?php $m = new SWFMovie(); $m->setDimension(11000, 8000); $m->setBackground(0x00, 0x00, 0x00); $m->add(new SWFAction(" this.quality = 0; /frames.visible = 0; startDrag('/mouse', 1); ")); // mouse tracking sprite $t = new SWFSprite(); $i = $m->add($t); $i->setName('mouse'); $g = new SWFGradient(); $g->addEntry(0, 0xff, 0xff, 0xff, 0xff); $g->addEntry(0.1, 0xff, 0xff, 0xff, 0xff); $g->addEntry(0.5, 0xff, 0xff, 0xff, 0x5f); $g->addEntry(1.0, 0xff, 0xff, 0xff, 0); // gradient shape thing $s = new SWFShape(); $f = $s->addFill($g, SWFFILL_RADIAL_GRADIENT); $f->scaleTo(0.03); $s->setRightFill($f); $s->movePenTo(-600, -600); $s->drawLine(1200, 0); $s->drawLine(0, 1200); $s->drawLine(-1200, 0); $s->drawLine(0, -1200); // need to make this a sprite so we can multColor it $p = new SWFSprite(); $p->add($s); $p->nextFrame(); // put the shape in here, each frame a different color $q = new SWFSprite(); $q->add(new SWFAction("gotoFrame(random(7)+1); stop();")); $i = $q->add($p); $i->multColor(1.0, 1.0, 1.0); $q->nextFrame(); $i->multColor(1.0, 0.5, 0.5); $q->nextFrame(); $i->multColor(1.0, 0.75, 0.5); $q->nextFrame(); $i->multColor(1.0, 1.0, 0.5); $q->nextFrame(); $i->multColor(0.5, 1.0, 0.5); $q->nextFrame(); $i->multColor(0.5, 0.5, 1.0); $q->nextFrame(); $i->multColor(1.0, 0.5, 1.0); $q->nextFrame(); // finally, this one contains the action code $p = new SWFSprite(); $i = $p->add($q); $i->setName('frames'); $p->add(new SWFAction(" dx = (/:mousex-/:lastx)/3 + random(10)-5; dy = (/:mousey-/:lasty)/3; x = /:mousex; y = /:mousey; alpha = 100; ")); $p->nextFrame(); $p->add(new SWFAction(" this.x = x; this.y = y; this.alpha = alpha; x += dx; y += dy; dy += 3; alpha -= 8; ")); $p->nextFrame(); $p->add(new SWFAction("prevFrame(); play();")); $p->nextFrame(); $i = $m->add($p); $i->setName('frames'); $m->nextFrame(); $m->add(new SWFAction(" lastx = mousex; lasty = mousey; mousex = /mouse.x; mousey = /mouse.y; ++num; if(num == 11) num = 1; removeClip('char' & num); duplicateClip(/frames, 'char' & num, num); ")); $m->nextFrame(); $m->add(new SWFAction("prevFrame(); play();")); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> <para> This simple example will handles keyboard actions. (You'll probably have to click in the window to give it focus. And you'll probably have to leave your mouse in the frame, too. If you know how to give buttons focus programatically, feel free to share, won't you?) <example> <title><function>swfaction</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* sprite has one letter per frame */ $p = new SWFSprite(); $p->add(new SWFAction("stop();")); $chars = "abcdefghijklmnopqrstuvwxyz". "ABCDEFGHIJKLMNOPQRSTUVWXYZ". "1234567890!@#$%^&/*()_+-=/[]{}|;:,.<>?`~"; $f = new SWFFont("_sans"); for($n=0; $nremove($i); $t = new SWFTextField(); $t->setFont($f); $t->setHeight(240); $t->setBounds(600,240); $t->align(SWFTEXTFIELD_ALIGN_CENTER); $t->addString($c); $i = $p->add($t); $p->labelFrame($c); $p->nextFrame(); } /* hit region for button - the entire frame */ $s = new SWFShape(); $s->setFillStyle0($s->addSolidFill(0, 0, 0, 0)); $s->drawLine(600, 0); $s->drawLine(0, 400); $s->drawLine(-600, 0); $s->drawLine(0, -400); /* button checks for pressed key, sends sprite to the right frame */ $b = new SWFButton(); $b->addShape($s, SWFBUTTON_HIT); for($n=0; $naddAction(new SWFAction(" setTarget('/char'); gotoFrame('$c'); "), SWFBUTTON_KEYPRESS($c)); } $m = new SWFMovie(); $m->setDimension(600,400); $i = $m->add($p); $i->setName('char'); $i->moveTo(0,80); $m->add($b); header('Content-type: application/x-shockwave-flash'); $m->output(); ?> ]]> </programlisting> </example> </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/msession.xml +++ phpdoc/kr/functions/msession.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.msession"> <title>Mohawk Software session handler functions</title> <titleabbrev>Msession functions</titleabbrev> <partintro> <para> undocumented </para> </partintro> <refentry id="function.msession-connect"> <refnamediv> <refname>msession_connect</refname> <refpurpose>Connect to msession sever </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>msession_connect</function></funcdef> <paramdef>string <parameter>host</parameter></paramdef> <paramdef>string <parameter>port</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-disconnect"> <refnamediv> <refname>msession_disconnect</refname> <refpurpose>Close connection to msession server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>msession_disconnect</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-count"> <refnamediv> <refname>msession_count</refname> <refpurpose>Get session count </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>msession_count</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-create"> <refnamediv> <refname>msession_create</refname> <refpurpose>Create a session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>msession_create</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-destroy"> <refnamediv> <refname>msession_destroy</refname> <refpurpose>Destroy a session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>msession_destroy</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-lock"> <refnamediv> <refname>msession_lock</refname> <refpurpose>Lock a session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>msession_lock</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-unlock"> <refnamediv> <refname>msession_unlock</refname> <refpurpose>Unlock a session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>msession_unlock</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>int <parameter>key</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-set"> <refnamediv> <refname>msession_set</refname> <refpurpose>Set value in session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>msession_set</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>string <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-get"> <refnamediv> <refname>msession_get</refname> <refpurpose>Get value from session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>msession_get</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>string <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-uniq"> <refnamediv> <refname>msession_uniq</refname> <refpurpose>Get uniq id </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>msession_uniq</function></funcdef> <paramdef>int <parameter>param</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-randstr"> <refnamediv> <refname>msession_randstr</refname> <refpurpose>Get random string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>msession_randstr</function></funcdef> <paramdef>int <parameter>param</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-find"> <refnamediv> <refname>msession_find</refname> <refpurpose>Find value </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>msession_find</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>string <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-list"> <refnamediv> <refname>msession_list</refname> <refpurpose>List ... ? </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>msession_list</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-get-array"> <refnamediv> <refname>msession_get_array</refname> <refpurpose>Get array of ... ? </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>msession_get_array</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-set-array"> <refnamediv> <refname>msession_set_array</refname> <refpurpose>Set array of ... </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>msession_set_array</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>array <parameter>tuples</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-listvar"> <refnamediv> <refname>msession_listvar</refname> <refpurpose>List variables in session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>msession_listvar</function></funcdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-timeout"> <refnamediv> <refname>msession_timeout</refname> <refpurpose>Set/get session timeout </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>msession_timeout</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>int <parameter><optional>param</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-inc"> <refnamediv> <refname>msession_inc</refname> <refpurpose>Increment value in session </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>msession_inc</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-getdata"> <refnamediv> <refname>msession_getdata</refname> <refpurpose>Get data ... ? </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>msession_getdata</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-setdata"> <refnamediv> <refname>msession_setdata</refname> <refpurpose>Set data ... ?</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>msession_setdata</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>string <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> <refentry id="function.msession-plugin"> <refnamediv> <refname>msession_plugin</refname> <refpurpose>Register a session plugin ... ? </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>msession_plugin</function></funcdef> <paramdef>string <parameter>session</parameter></paramdef> <paramdef>string <parameter>val</parameter></paramdef> <paramdef>string <parameter><optional>param</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> undocumented </para> </refsect1> </refentry> </reference> <!-- 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:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: --> Index: phpdoc/kr/functions/muscat.xml +++ phpdoc/kr/functions/muscat.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.muscat"> <title>muscat functions</title> <titleabbrev>muscat functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.muscat-setup"> <refnamediv> <refname>muscat_setup</refname> <refpurpose>Creates a new muscat session and returns the handle. Size is the ammount of memory in bytes to allocate for muscat muscat_dir is the muscat installation dir e.g. "/usr/local/empower", it defaults to the compile time muscat directory </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>muscat_setup</function></funcdef> <paramdef>int <parameter>size</parameter></paramdef> <paramdef>string <parameter><optional>muscat_dir</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.muscat-setup-net"> <refnamediv> <refname>muscat_setup_net</refname> <refpurpose>Creates a new muscat session and returns the handle. muscat_host is the hostname to connect to port is the port number to connect to - actually takes exactly the same args as fsockopen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>muscat_setup_net</function></funcdef> <paramdef>string <parameter>muscat_host</parameter></paramdef> <paramdef>int <parameter>port</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.muscat-give"> <refnamediv> <refname>muscat_give</refname> <refpurpose>Sends string to the core muscat api </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>muscat_give</function></funcdef> <paramdef>resource <parameter>muscat_handle</parameter></paramdef> <paramdef>string <parameter>string</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.muscat-get"> <refnamediv> <refname>muscat_get</refname> <refpurpose>Gets a line back from the core muscat api. Returns a literal FALSE when there is no more to get (as opposed to ""). Use === FALSE or !== FALSE to check for this </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>muscat_get</function></funcdef> <paramdef>resource <parameter>muscat_handle</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.muscat-close"> <refnamediv> <refname>muscat_close</refname> <refpurpose>Shuts down the muscat session and releases any memory back to php. [Not back to the system, note!] </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>muscat_close</function></funcdef> <paramdef>resource <parameter>muscat_handle</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/ncurses.xml +++ phpdoc/kr/functions/ncurses.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.ncurses"> <title>Ncurses terminal screen control functions</title> <titleabbrev>ncurses functions</titleabbrev> <partintro> <para> ncurses (new curses) is a free software emulation of curses in System V Rel 4.0 (and above). It uses terminfo format, supports pads, colors, multiple highlights, form characters and function key mapping. </para> <para> To get these functions to work, you have to compile the CGI version of PHP with <option role="configure">--with-ncurses</option>. That requires the ncurses library to be installed. Download the latest version from <ulink url="&url.ncurses;">&url.ncurses;</ulink>, compile and install it. </para> </partintro> <refentry id="function.ncurses-can-change-color"> <refnamediv> <refname>ncurses_can_change_color</refname> <refpurpose>Check if we can change terminals colors </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_can_change_color</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> The function <function>ncurses_can_change_color</function> returns &true; or &false;, depending on whether the terminal has color capabilities and whether the programmer can change the colors. </para> </refsect1> </refentry> <refentry id="function.ncurses-cbreak"> <refnamediv> <refname>ncurses_cbreak</refname> <refpurpose>Switch of input buffering </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_cbreak</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_cbreak</function> disables line buffering and character processing (interrupt and flow control characters are unaffected), making characters typed by the user immediately available to the program. </para> <para> <function>ncurses_cbreak</function> returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_nocbreak</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-clear"> <refnamediv> <refname>ncurses_clear</refname> <refpurpose>Clear screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_clear</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_clear</function> clears the screen completely without setting blanks. Returns &false; on success, otherwise &true;. </para> <para> Note: <function>ncurses_clear</function> clears the screen without setting blanks, which have the current background rendition. To clear screen with blanks, use <function>ncurses_erase</function>. </para> <para> See also: <function>ncurses_erase</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-clrtobot"> <refnamediv> <refname>ncurses_clrtobot</refname> <refpurpose>Clear screen from current position to bottom </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_clrtobot</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_clrtobot</function> erases all lines from cursor to end of screen and creates blanks. Blanks created by <function>ncurses_clrtobot</function> have the current background rendition. Returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_clear</function>, <function>ncurses_clrtoeol</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-clrtoeol"> <refnamediv> <refname>ncurses_clrtoeol</refname> <refpurpose>Clear screen from current position to end of line </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_clrtoeol</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_clrtoeol</function> erases the current line from cursor position to the end. Blanks created by <function>ncurses_clrtoeol</function> have the current background rendition. Returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_clear</function>, <function>ncurses_clrtobot</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-def-prog-mode"> <refnamediv> <refname>ncurses_def_prog_mode</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_def_prog_mode</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_def_prog_mode</function> saves the current terminal modes for program (in curses) for use by <function>ncurses_reset_prog_mode</function>. Returns &false; on success, otherwise &true;. </para> <para> See also: <function>ncurses_reset_prog_mode</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-def-shell-mode"> <refnamediv> <refname>ncurses_def_shell_mode</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_def_shell_mode</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_def_shell_mode</function> saves the current terminal modes for shell (not in curses) for use by <function>ncurses_reset_shell_mode</function>. Returns &false; on success, otherwise &true;. </para> <para> See also: <function>ncurses_reset_shell_mode</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-delch"> <refnamediv> <refname>ncurses_delch</refname> <refpurpose>Delete character at current position, move rest of line left </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_delch</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_delch</function> deletes the character under the cursor. All characters to the right of the cursor on the same line are moved to the left one position and the last character on the line is filled with a blank. The cursor position does not change. Returns &false; on success, otherwise &true;. </para> <para> See also: <function>ncurses_deleteln</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-deleteln"> <refnamediv> <refname>ncurses_deleteln</refname> <refpurpose>Delete line at current position, move rest of screen up </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_deleteln</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_deleteln</function> deletes the current line under cursorposition. All lines below the current line are moved up one line. The bottom line of window is cleared. Cursor position does not change. Returns &false; on success, otherwise &true;. </para> <para> See also: <function>ncurses_delch</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-doupdate"> <refnamediv> <refname>ncurses_doupdate</refname> <refpurpose>Write all prepared refreshes to terminal </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_doupdate</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_doupdate()</function> compares the virtual screen to the physical screen and updates the physical screen. This way is more effective than using multiple refresh calls. Returns &false; on success, &true; if any error occured. </para> </refsect1> </refentry> <refentry id="function.ncurses-echo"> <refnamediv> <refname>ncurses_echo</refname> <refpurpose>Activate keyboard input echo </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_echo</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_echo</function> enables echo mode. All characters typed by user are echoed by <function>ncurses_getch</function>. Returns &false; on success, &true; if any error occured. </para> <para> To disable echo mode use <function>ncurses_noecho</function>. </para> </refsect1> </refentry> <refentry id="function.ncurses-erase"> <refnamediv> <refname>ncurses_erase</refname> <refpurpose>Erase terminal screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_erase</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_erase</function> fills the terminal screen with blanks. Created blanks have the current background rendition, set by <function>ncurses_bkgd</function>. Returns &false; on success, &true; if any error occured. </para> <para> See also: <function>ncurses_bkgd</function>, <function>ncurses_clear</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-erasechar"> <refnamediv> <refname>ncurses_erasechar</refname> <refpurpose>Returns current erase character </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>ncurses_erasechar</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_erasechar</function> returns the current erase char character. </para> <para> See also: <function>ncurses_killchar</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-flash"> <refnamediv> <refname>ncurses_flash</refname> <refpurpose>Flash terminal screen (visual bell) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_flash</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_flash</function> flashes the screen, and if its not possible, sends an audible alert (bell). Returns &false; on success, otherwise &true;. </para> <para> See also: <function>ncurses_beep</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-flushinp"> <refnamediv> <refname>ncurses_flushinp</refname> <refpurpose>Flush keyboard input buffer </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_flushinp</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> The <function>ncurses_flushinp</function> throws away any typeahead that has been typed and has not yet been read by your program. Returns &false; on success, otherwise &true;. </para> </refsect1> </refentry> <refentry id="function.ncurses-has-colors"> <refnamediv> <refname>ncurses_has_colors</refname> <refpurpose>Check if terminal has colors </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_has_colors</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_has_colors</function> returns &true; or &false; depending on whether the terminal has color capacitites. </para> <para> See also: <function>ncurses_can_change_color</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-has-ic"> <refnamediv> <refname>ncurses_has_ic</refname> <refpurpose>Check for insert- and delete-capabilities </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_has_ic</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_has_ic</function> checks terminals insert- and delete capabilitites. It returns &true; when terminal has insert/delete-capabilities, otherwise &false;. </para> <para> See also: <function>ncurses_has_il</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-has-il"> <refnamediv> <refname>ncurses_has_il</refname> <refpurpose>Check for line insert- and delete-capabilities </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_has_il</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_has_il</function> checks terminals insert- and delete-line-capabilities. It returns &true; when terminal has insert/delete-line capabilities, otherwise &false; </para> <para> See also: <function>ncurses_has_ic</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-inch"> <refnamediv> <refname>ncurses_inch</refname> <refpurpose>Get character and attribute at current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>ncurses_inch</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_inch</function> returns the character from the current position. </para> </refsect1> </refentry> <refentry id="function.ncurses-insertln"> <refnamediv> <refname>ncurses_insertln</refname> <refpurpose>Insert a line, move rest of screen down </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_insertln</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_insertln</function> inserts a new line above the current line. The bottom line will be lost. </para> </refsect1> </refentry> <refentry id="function.ncurses-isendwin"> <refnamediv> <refname>ncurses_isendwin</refname> <refpurpose>Ncurses is in endwin mode, normal screen output may be performed </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_isendwin</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_isendwin</function> returns &true;, if <function>ncurses_endwin</function> has been called without any subsequent calls to <function>ncurses_wrefresh</function>, otherwise &false;. </para> <para> See also: <function>ncurses_endwin</function> <function>ncurses_wrefresh()</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-killchar"> <refnamediv> <refname>ncurses_killchar</refname> <refpurpose>Returns current line kill character </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_killchar</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_killchar</function> returns the current line kill character. </para> <para> See also: <function>ncurses_erasechar</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-nl"> <refnamediv> <refname>ncurses_nl</refname> <refpurpose>Translate newline and carriage return / line feed </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_nl</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-nocbreak"> <refnamediv> <refname>ncurses_nocbreak</refname> <refpurpose>Switch terminal to cooked mode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_nocbreak</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_nocbreak</function> routine returns terminal to normal (cooked) mode. Initially the terminal may or may not in cbreak mode as the mode is inherited. Therefore a program should call <function>ncurses_cbreak</function> and <function>ncurses_nocbreak</function> explicitly. Returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_cbreak</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-noecho"> <refnamediv> <refname>ncurses_noecho</refname> <refpurpose>Switch off keyboard input echo </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_noecho</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_noecho</function> prevents echoing of user typed characters. Returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_echo</function>, <function>ncurses_getch</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-nonl"> <refnamediv> <refname>ncurses_nonl</refname> <refpurpose>Do not translate newline and carriage return / line feed </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_nonl</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-noraw"> <refnamediv> <refname>ncurses_noraw</refname> <refpurpose>Switch terminal out of raw mode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_noraw</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_noraw</function> switches the terminal out of raw mode. Raw mode is similar to cbreak mode, in that characters typed are immediately passed through to the user program. The differences that are that in raw mode, the interrupt, quit, suspend and flow control characters are all passed through uninterpreted, instead of generating a signal. Returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_raw</function>, <function>ncurses_cbreak</function>, <function>ncurses_nocbreak</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-raw"> <refnamediv> <refname>ncurses_raw</refname> <refpurpose>Switch terminal into raw mode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_raw</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_raw</function> places the terminal in raw mode. Raw mode is similar to cbreak mode, in that characters typed are immediately passed through to the user program. The differences that are that in raw mode, the interrupt, quit, suspend and flow control characters are all passed through uninterpreted, instead of generating a signal. Returns &true; if any error occured, otherwise &false;. </para> <para> See also: <function>ncurses_noraw</function>, <function>ncurses_cbreak</function>, <function>ncurses_nocbreak</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-resetty"> <refnamediv> <refname>ncurses_resetty</refname> <refpurpose>Restore saved terminal state </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_resetty</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-savetty"> <refnamediv> <refname>ncurses_savetty</refname> <refpurpose>Save terminal state </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_savetty</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-attr"> <refnamediv> <refname>ncurses_slk_attr</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_slk_attr</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-clear"> <refnamediv> <refname>ncurses_slk_clear</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_slk_clear</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-noutrefresh"> <refnamediv> <refname>ncurses_slk_noutrefresh</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_slk_noutrefresh</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-refresh"> <refnamediv> <refname>ncurses_slk_refresh</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_slk_refresh</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-restore"> <refnamediv> <refname>ncurses_slk_restore</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_slk_restore</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-touch"> <refnamediv> <refname>ncurses_slk_touch</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_slk_touch</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-termattrs"> <refnamediv> <refname>ncurses_termattrs</refname> <refpurpose>Returns a logical OR of all attribute flags supported by terminal </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_termattrs</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-use-default-colors"> <refnamediv> <refname>ncurses_use_default_colors</refname> <refpurpose>Assign terminal default colors to color id -1 </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>ncurses_use_default_colors</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-addch"> <refnamediv> <refname>ncurses_addch</refname> <refpurpose>Add character at current position and advance cursor </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_addch</function></funcdef> <paramdef>int <parameter>ch</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-addchnstr"> <refnamediv> <refname>ncurses_addchnstr</refname> <refpurpose>Add attributed string with specified length at current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_addchnstr</function></funcdef> <paramdef>string <parameter>s</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-addchstr"> <refnamediv> <refname>ncurses_addchstr</refname> <refpurpose>Add attributed string at current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_addchstr</function></funcdef> <paramdef>string <parameter>s</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-addnstr"> <refnamediv> <refname>ncurses_addnstr</refname> <refpurpose>Add string with specified length at current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_addnstr</function></funcdef> <paramdef>string <parameter>s</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-addstr"> <refnamediv> <refname>ncurses_addstr</refname> <refpurpose>Output text at current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_addstr</function></funcdef> <paramdef>string <parameter>text</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-assume-default-colors"> <refnamediv> <refname>ncurses_assume_default_colors</refname> <refpurpose>Define default colors for color 0 </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_assume_default_colors</function></funcdef> <paramdef>int <parameter>fg</parameter></paramdef> <paramdef>int <parameter>bg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-attroff"> <refnamediv> <refname>ncurses_attroff</refname> <refpurpose>Turn off the given attributes </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_attroff</function></funcdef> <paramdef>int <parameter>attributes</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-attron"> <refnamediv> <refname>ncurses_attron</refname> <refpurpose>Turn on the given attributes </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_attron</function></funcdef> <paramdef>int <parameter>attributes</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-attrset"> <refnamediv> <refname>ncurses_attrset</refname> <refpurpose>Set given attributes </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_attrset</function></funcdef> <paramdef>int <parameter>attributes</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-baudrate"> <refnamediv> <refname>ncurses_baudrate</refname> <refpurpose>Returns baudrate of terminal </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_baudrate</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-beep"> <refnamediv> <refname>ncurses_beep</refname> <refpurpose>Let the terminal beep </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_beep</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_beep</function> sends an audlible alert (bell) and if its not possible flashes the screen. Returns &false; on success, otherwise &true;. </para> <para> See also: <function>ncurses_flash</function> </para> </refsect1> </refentry> <refentry id="function.ncurses-bkgd"> <refnamediv> <refname>ncurses_bkgd</refname> <refpurpose>Set background property for terminal screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_bkgd</function></funcdef> <paramdef>int <parameter>attrchar</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-border"> <refnamediv> <refname>ncurses_border</refname> <refpurpose>Draw a border around the screen using attributed characters </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_border</function></funcdef> <paramdef>int <parameter>left</parameter></paramdef> <paramdef>int <parameter>right</parameter></paramdef> <paramdef>int <parameter>top</parameter></paramdef> <paramdef>int <parameter>bottom</parameter></paramdef> <paramdef>int <parameter>tl_corner</parameter></paramdef> <paramdef>int <parameter>tr_corner</parameter></paramdef> <paramdef>int <parameter>bl_corner</parameter></paramdef> <paramdef>int <parameter>br_corner</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-color-set"> <refnamediv> <refname>ncurses_color_set</refname> <refpurpose>Set fore- and background color </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_color_set</function></funcdef> <paramdef>int <parameter>pair</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-curs-set"> <refnamediv> <refname>ncurses_curs_set</refname> <refpurpose>Set cursor state </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_curs_set</function></funcdef> <paramdef>int <parameter>visibility</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-define-key"> <refnamediv> <refname>ncurses_define_key</refname> <refpurpose>Define a keycode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_define_key</function></funcdef> <paramdef>string <parameter>definition</parameter></paramdef> <paramdef>int <parameter>keycode</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-delay-output"> <refnamediv> <refname>ncurses_delay_output</refname> <refpurpose>Delay output on terminal using padding characters </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_delay_output</function></funcdef> <paramdef>int <parameter>milliseconds</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-delwin"> <refnamediv> <refname>ncurses_delwin</refname> <refpurpose>Delete a ncurses window </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_delwin</function></funcdef> <paramdef>resource <parameter>window</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-echochar"> <refnamediv> <refname>ncurses_echochar</refname> <refpurpose>Single character output including refresh </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_echochar</function></funcdef> <paramdef>int <parameter>character</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-end"> <refnamediv> <refname>ncurses_end</refname> <refpurpose>Stop using ncurses, clean up the screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_end</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-filter"> <refnamediv> <refname>ncurses_filter</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_filter</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-getch"> <refnamediv> <refname>ncurses_getch</refname> <refpurpose>Read a character from keyboard </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_getch</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-halfdelay"> <refnamediv> <refname>ncurses_halfdelay</refname> <refpurpose>Put terminal into halfdelay mode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_halfdelay</function></funcdef> <paramdef>int <parameter>tenth</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-has-key"> <refnamediv> <refname>ncurses_has_key</refname> <refpurpose>Check for presence of a function key on terminal keyboard </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_has_key</function></funcdef> <paramdef>int <parameter>keycode</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-hline"> <refnamediv> <refname>ncurses_hline</refname> <refpurpose>Draw a horizontal line at current position using an attributed character and max. n characters long </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_hline</function></funcdef> <paramdef>int <parameter>charattr</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-init"> <refnamediv> <refname>ncurses_init</refname> <refpurpose>Initialize ncurses </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_init</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-init-color"> <refnamediv> <refname>ncurses_init_color</refname> <refpurpose>Set new RGB value for color </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_init_color</function></funcdef> <paramdef>int <parameter>color</parameter></paramdef> <paramdef>int <parameter>r</parameter></paramdef> <paramdef>int <parameter>g</parameter></paramdef> <paramdef>int <parameter>b</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-init-pair"> <refnamediv> <refname>ncurses_init_pair</refname> <refpurpose>Allocate a color pair </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_init_pair</function></funcdef> <paramdef>int <parameter>pair</parameter></paramdef> <paramdef>int <parameter>fg</parameter></paramdef> <paramdef>int <parameter>bg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-insch"> <refnamediv> <refname>ncurses_insch</refname> <refpurpose>Insert character moving rest of line including character at current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_insch</function></funcdef> <paramdef>int <parameter>character</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-insdelln"> <refnamediv> <refname>ncurses_insdelln</refname> <refpurpose>Insert lines before current line scrolling down (negative numbers delete and scroll up) </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_insdelln</function></funcdef> <paramdef>int <parameter>count</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-insstr"> <refnamediv> <refname>ncurses_insstr</refname> <refpurpose>Insert string at current position, moving rest of line right </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_insstr</function></funcdef> <paramdef>string <parameter>text</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-instr"> <refnamediv> <refname>ncurses_instr</refname> <refpurpose>Reads string from terminal screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_instr</function></funcdef> <paramdef>string <parameter>buffer</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> <function>ncurses_instr</function> returns the number of charaters read from the current character position until end of line. <parameter>buffer</parameter> contains the characters. Atrributes are stripped from the characters. </para> </refsect1> </refentry> <refentry id="function.ncurses-keyok"> <refnamediv> <refname>ncurses_keyok</refname> <refpurpose>Enable or disable a keycode </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_keyok</function></funcdef> <paramdef>int <parameter>keycode</parameter></paramdef> <paramdef>bool <parameter>enable</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mouseinterval"> <refnamediv> <refname>ncurses_mouseinterval</refname> <refpurpose>Set timeout for mouse button clicks </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mouseinterval</function></funcdef> <paramdef>int <parameter>milliseconds</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-move"> <refnamediv> <refname>ncurses_move</refname> <refpurpose>Move output position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_move</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvaddch"> <refnamediv> <refname>ncurses_mvaddch</refname> <refpurpose>Move current position and add character </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvaddch</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>c</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvaddchnstr"> <refnamediv> <refname>ncurses_mvaddchnstr</refname> <refpurpose>Move position and add attrributed string with specified length </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvaddchnstr</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>string <parameter>s</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvaddchstr"> <refnamediv> <refname>ncurses_mvaddchstr</refname> <refpurpose>Move position and add attributed string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvaddchstr</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>string <parameter>s</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvaddnstr"> <refnamediv> <refname>ncurses_mvaddnstr</refname> <refpurpose>Move position and add string with specified length </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvaddnstr</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>string <parameter>s</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvaddstr"> <refnamediv> <refname>ncurses_mvaddstr</refname> <refpurpose>Move position and add string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvaddstr</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>string <parameter>s</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvcur"> <refnamediv> <refname>ncurses_mvcur</refname> <refpurpose>Move cursor immediately </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvcur</function></funcdef> <paramdef>int <parameter>old_y</parameter></paramdef> <paramdef>int <parameter>old_x</parameter></paramdef> <paramdef>int <parameter>new_y</parameter></paramdef> <paramdef>int <parameter>new_x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvdelch"> <refnamediv> <refname>ncurses_mvdelch</refname> <refpurpose>Move position and delete character, shift rest of line left </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvdelch</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvgetch"> <refnamediv> <refname>ncurses_mvgetch</refname> <refpurpose>Move position and get character at new position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvgetch</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvhline"> <refnamediv> <refname>ncurses_mvhline</refname> <refpurpose>Set new position and draw a horizontal line using an attributed character and max. n characters long </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvhline</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>attrchar</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvinch"> <refnamediv> <refname>ncurses_mvinch</refname> <refpurpose>Move position and get attributed character at new position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvinch</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvvline"> <refnamediv> <refname>ncurses_mvvline</refname> <refpurpose>Set new position and draw a vertical line using an attributed character and max. n characters long </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvvline</function></funcdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>attrchar</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-mvwaddstr"> <refnamediv> <refname>ncurses_mvwaddstr</refname> <refpurpose>Add string at new position in window </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_mvwaddstr</function></funcdef> <paramdef>resource <parameter>window</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>string <parameter>text</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-napms"> <refnamediv> <refname>ncurses_napms</refname> <refpurpose>Sleep </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_napms</function></funcdef> <paramdef>int <parameter>milliseconds</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-newwin"> <refnamediv> <refname>ncurses_newwin</refname> <refpurpose>Create a new window </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_newwin</function></funcdef> <paramdef>int <parameter>rows</parameter></paramdef> <paramdef>int <parameter>cols</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-noqiflush"> <refnamediv> <refname>ncurses_noqiflush</refname> <refpurpose>Do not flush on signal characters</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_noqiflush</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-putp"> <refnamediv> <refname>ncurses_putp</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_putp</function></funcdef> <paramdef>string <parameter>text</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-qiflush"> <refnamediv> <refname>ncurses_qiflush</refname> <refpurpose>Flush on signal characters </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_qiflush</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-refresh"> <refnamediv> <refname>ncurses_refresh</refname> <refpurpose>Refresh screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_refresh</function></funcdef> <paramdef>int <parameter>ch</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-scr-dump"> <refnamediv> <refname>ncurses_scr_dump</refname> <refpurpose>Dump screen content to file </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_scr_dump</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-scr-init"> <refnamediv> <refname>ncurses_scr_init</refname> <refpurpose>Initialize screen from file dump </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_scr_init</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-scr-restore"> <refnamediv> <refname>ncurses_scr_restore</refname> <refpurpose>Restore screen from file dump </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_scr_restore</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-scr-set"> <refnamediv> <refname>ncurses_scr_set</refname> <refpurpose>Inherit screen from file dump </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_scr_set</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-scrl"> <refnamediv> <refname>ncurses_scrl</refname> <refpurpose>Scroll window content up or down without changing current position </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_scrl</function></funcdef> <paramdef>int <parameter>count</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-attroff"> <refnamediv> <refname>ncurses_slk_attroff</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_slk_attroff</function></funcdef> <paramdef>int <parameter>intarg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-attron"> <refnamediv> <refname>ncurses_slk_attron</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_slk_attron</function></funcdef> <paramdef>int <parameter>intarg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-attrset"> <refnamediv> <refname>ncurses_slk_attrset</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_slk_attrset</function></funcdef> <paramdef>int <parameter>intarg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-color"> <refnamediv> <refname>ncurses_slk_color</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_slk_color</function></funcdef> <paramdef>int <parameter>intarg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-slk-init"> <refnamediv> <refname>ncurses_slk_init</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_slk_init</function></funcdef> <paramdef>int <parameter>intarg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-standend"> <refnamediv> <refname>ncurses_standend</refname> <refpurpose>Stop using 'standout' attribute </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_standend</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-standout"> <refnamediv> <refname>ncurses_standout</refname> <refpurpose>Start using 'standout' attribute </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_standout</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-start-color"> <refnamediv> <refname>ncurses_start_color</refname> <refpurpose>Start using colors </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_start_color</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-typeahead"> <refnamediv> <refname>ncurses_typeahead</refname> <refpurpose>Specify different filedescriptor for typeahead checking </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_typeahead</function></funcdef> <paramdef>int <parameter>fd</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-ungetch"> <refnamediv> <refname>ncurses_ungetch</refname> <refpurpose>Put a character back into the input stream </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_ungetch</function></funcdef> <paramdef>int <parameter>keycode</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-use-extended-names"> <refnamediv> <refname>ncurses_use_extended_names</refname> <refpurpose>Control use of extended names in terminfo descriptions </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_use_extended_names</function></funcdef> <paramdef>bool <parameter>flag</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-vidattr"> <refnamediv> <refname>ncurses_vidattr</refname> <refpurpose></refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_vidattr</function></funcdef> <paramdef>int <parameter>intarg</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-vline"> <refnamediv> <refname>ncurses_vline</refname> <refpurpose>Draw a vertical line at current position using an attributed character and max. n characters long </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_vline</function></funcdef> <paramdef>int <parameter>charattr</parameter></paramdef> <paramdef>int <parameter>n</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-wrefresh"> <refnamediv> <refname>ncurses_wrefresh</refname> <refpurpose>Refresh window on terminal screen </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>ncurses_wrefresh</function></funcdef> <paramdef>resource <parameter>window</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-bkgdset"> <refnamediv> <refname>ncurses_bkgdset</refname> <refpurpose>Control screen background </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>ncurses_bkgdset</function></funcdef> <paramdef>int <parameter>attrchar</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-timeout"> <refnamediv> <refname>ncurses_timeout</refname> <refpurpose>Set timeout for special key sequences </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>ncurses_timeout</function></funcdef> <paramdef>int <parameter>millisec</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> <refentry id="function.ncurses-use-env"> <refnamediv> <refname>ncurses_use_env</refname> <refpurpose>Control use of environment information about terminal size </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>ncurses_use_env</function></funcdef> <paramdef>bool <parameter>flag</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> undocumented </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/notes.xml +++ phpdoc/kr/functions/notes.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.notes"> <title>Lotus Notes functions</title> <titleabbrev>Lotus Notes</titleabbrev> <partintro> <para> &warn.experimental; </para> </partintro> <refentry id="function.notes-create-db"> <refnamediv> <refname>notes_create_db</refname> <refpurpose>Create a Lotus Notes database </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>notes_create_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-drop-db"> <refnamediv> <refname>notes_drop_db</refname> <refpurpose>Drop a Lotus Notes database </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>notes_drop_db</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-version"> <refnamediv> <refname>notes_version</refname> <refpurpose>Get the version Lotus Notes </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_version</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-create-note"> <refnamediv> <refname>notes_create_note</refname> <refpurpose>Create a note using form form_name </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_create_note</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>form_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-mark-read"> <refnamediv> <refname>notes_mark_read</refname> <refpurpose>Mark a note_id as read for the User user_nam</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_mark_read</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>user_name</parameter></paramdef> <paramdef>string <parameter>note_id</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-mark-unread"> <refnamediv> <refname>notes_mark_unread</refname> <refpurpose>Mark a note_id as unread for the User user_na</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_mark_unread</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>user_name</parameter></paramdef> <paramdef>string <parameter>note_id</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-unread"> <refnamediv> <refname>notes_unread</refname> <refpurpose>Returns the unread note id's for the current User user_nam</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_unread</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>user_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-header-info"> <refnamediv> <refname>notes_header_info</refname> <refpurpose>Open the message msg_number in the specified mailbox on the specified server (leave serv</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>object <function>notes_header_info</function></funcdef> <paramdef>string <parameter>server</parameter></paramdef> <paramdef>string <parameter>mailbox</parameter></paramdef> <paramdef>int <parameter>msg_number</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-body"> <refnamediv> <refname>notes_body</refname> <refpurpose>Open the message msg_number in the specified mailbox on the specified server (leave serv</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>notes_body</function></funcdef> <paramdef>string <parameter>server</parameter></paramdef> <paramdef>string <parameter>mailbox</parameter></paramdef> <paramdef>int <parameter>msg_number</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-find-note"> <refnamediv> <refname>notes_find_note</refname> <refpurpose>Returns a note id found in database_name. Specify the name of the note. Leaving type bla</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>notes_find_note</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> <paramdef>string <parameter><optional>type</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-nav-create"> <refnamediv> <refname>notes_nav_create</refname> <refpurpose>Create a navigator name, in database_name </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>notes_nav_create</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-search"> <refnamediv> <refname>notes_search</refname> <refpurpose>Find notes that match keywords in database_na</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_search</function></funcdef> <paramdef>string <parameter>database_name</parameter></paramdef> <paramdef>string <parameter>keywords</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-copy-db"> <refnamediv> <refname>notes_copy_db</refname> <refpurpose>title]) Create a note using form form_name </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>notes_copy_db</function></funcdef> <paramdef>string <parameter>from_database_name</parameter></paramdef> <paramdef>string <parameter>to_database_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.notes-list-msgs"> <refnamediv> <refname>notes_list_msgs</refname> <refpurpose>Returns the notes from a selected database_nam</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>notes_list_msgs</function></funcdef> <paramdef>string <parameter>db</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/overload.xml +++ phpdoc/kr/functions/overload.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.overload"> <title>Object property and method call overloading</title> <titleabbrev>Object overloading</titleabbrev> <partintro id="overload.partintro"> &warn.experimental; <para> The purpose of this extension is to allow overloading of object property access and method calls. Only one function is defined in this extension, <function>overload</function> which takes the name of the class that should have this functionality enabled. The class named has to define appropriate methods if it wants to have this functionality: <literal>__get()</literal>, <literal>__set()</literal> and <literal>__call()</literal> respectively for getting/setting a property, or calling a method. This way overloading can be selective. Inside these handler functions the overloading is disabled so you can access object properties normally. </para> <para> Some simple examples on using the <function>overload</function> function: <example> <title>Overloading a PHP class</title> <programlisting role="php"> <![CDATA[ <?php class OO { var $a = 111; var $elem = array('b' => 9, 'c' => 42); // Callback method for getting a property function __get($prop_name, &$prop_value) { if (isset($this->elem[$prop_name])) { $prop_value = $this->elem[$prop_name]; return true; } else { return false; } } // Callback method for setting a property function __set($prop_name, $prop_value) { $this->elem[$prop_name] = $prop_value; return true; } } // Here we overload the OO object overload('OO'); $o = new OO; print "\$o->a: $o->a\n"; // print: $o->a: print "\$o->b: $o->b\n"; // print: $o->b: 9 print "\$o->c: $o->c\n"; // print: $o->c: 42 print "\$o->d: $o->d\n"; // print: $o->d: // add a new item to the $elem array in OO $o->x = 56; // instantiate stdclass (it is built-in in PHP 4) // $val is not overloaded! $val = new stdclass; $val->prop = 555; // Set "a" to be an array with the $val object in it // But __set() will put this in the $elem array $o->a = array($val); var_dump($o->a[0]->prop); ?> ]]> </programlisting> </example> </para> <warning> <para> As this is an experimental extension, not all things work. There is no <literal>__call()</literal> support currently, you can only overload the get and set operations for properties. You cannot invoke the original overloading handlers of the class, and <literal>__set()</literal> only works to one level of property access. </para> </warning> </partintro> <refentry id="function.overload"> <refnamediv> <refname>overload</refname> <refpurpose>Enable property and method call overloading for a class</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>overload</function> </funcdef> <paramdef>string <parameter> <optional>class_name</optional> </parameter> </paramdef> </funcprototype> </funcsynopsis> <para> The <function>overload</function> function will enable property and method call overloading for a class identified by <parameter>class_name</parameter>. <link linkend="overload.partintro">See an example in the introductory section of this part</link>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/pcntl.xml +++ phpdoc/kr/functions/pcntl.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.pcntl"> <title>Process Control Functions</title> <titleabbrev>PCNTL</titleabbrev> <partintro> <para> Process Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination. Process Control should not be enabled within a webserver environment and unexpected results may happen if any Process Control functions are used within a webserver environment. </para> <para> This documentation is intended to explain the general usage of each of the Process Control functions. For detailed information about Unix process control you are encouraged to consult your systems documentation including fork(2), waitpid(2) and signal(2) or a comprehensive reference such as <citation>Advanced Programming in the UNIX Environment by W. Richard Stevens (Addison-Wesley)</citation>. </para> <para> Process Control support in PHP is not enabled by default. You will need to use the <link linkend="install.configure.enable-pcntl">--enable-pcntl</link> configuration option when compiling PHP to enable Process Control support. </para> <note> <para> Currently, this module will not function on non-Unix platforms (Windows). </para> </note> <para> The following list of signals are supported by the Process Control functions. Please see your systems signal(7) man page for details of the default behavior of these signals. <table> <title>Supported Signals</title> <tgroup cols="2"> <tbody> <row> <entry><literal>SIGFPE</literal></entry> <entry><literal>SIGCONT</literal></entry> <entry><literal>SIGKILL</literal></entry> </row> <row> <entry><literal>SIGSTOP</literal></entry> <entry><literal>SIGUSR1</literal></entry> <entry><literal>SIGTSTP</literal></entry> </row> <row> <entry><literal>SIGHUP</literal></entry> <entry><literal>SIGUSR2</literal></entry> <entry><literal>SIGTTIN</literal></entry> </row> <row> <entry><literal>SIGINT</literal></entry> <entry><literal>SIGSEGV</literal></entry> <entry><literal>SIGTTOU</literal></entry> </row> <row> <entry><literal>SIGQUIT</literal></entry> <entry><literal>SIGPIPE</literal></entry> <entry><literal>SIGURG</literal></entry> </row> <row> <entry><literal>SIGILL</literal></entry> <entry><literal>SIGALRM</literal></entry> <entry><literal>SIGXCPU</literal></entry> </row> <row> <entry><literal>SIGTRAP</literal></entry> <entry><literal>SIGTERM</literal></entry> <entry><literal>SIGXFSZ</literal></entry> </row> <row> <entry><literal>SIGABRT</literal></entry> <entry><literal>SIGSTKFLT</literal></entry> <entry><literal>SIGVTALRM</literal></entry> </row> <row> <entry><literal>SIGIOT</literal></entry> <entry><literal>SIGCHLD</literal></entry> <entry><literal>SIGPROF</literal></entry> </row> <row> <entry><literal>SIGBUS</literal></entry> <entry><literal>SIGCLD</literal></entry> <entry><literal>SIGWINCH</literal></entry> </row> <row> <entry><literal>SIGPOLL</literal></entry> <entry><literal>SIGIO</literal></entry> <entry><literal>SIGPWR</literal></entry> </row> <row> <entry><literal>SIGSYS</literal></entry> <entry><literal></literal></entry> <entry><literal></literal></entry> </row> </tbody> </tgroup> </table> </para> <sect1 id="pcntl-example"> <title>Process Control Example</title> <para> This example forks off a daemon process with a signal handler. </para> <example> <title>Process Control Example</title> <programlisting role="php"> <![CDATA[ <?php $pid = pcntl_fork(); if ($pid == -1) { die("could not fork"); } else if ($pid) { exit(); // we are the parent } else { // we are the child } // detatch from the controlling terminal if (!posix_setsid()) { die("could not detach from terminal"); } // setup signal handlers pcntl_signal(SIGTERM, "sig_handler"); pcntl_signal(SIGHUP, "sig_handler"); // loop forever performing tasks while(1) { // do something interesting here } function sig_handler($signo) { switch($signo) { case SIGTERM: // handle shutdown tasks exit; break; case SIGHUP: // handle restart tasks break; default: // handle all other signals } } ?> ]]> </programlisting> </example> </sect1> </partintro> <refentry id="function.pcntl-fork"> <refnamediv> <refname>pcntl_fork</refname> <refpurpose>Forks the currently running process</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_fork</function></funcdef> <void/> </funcprototype> </funcsynopsis> <para> The <function>pcntl_fork</function> function creates a child process that differs from the parent process only in it's PID and PPID. Please see your system's fork(2) man page for specific details as to how fork works on your system. </para> <para> On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context, no child process will be created, and a PHP error is raised. </para> <example> <title><function>pcntl_fork</function> Example</title> <programlisting role="php"> <![CDATA[ <?php $pid = pcntl_fork(); if ($pid == -1) { die("could not fork"); } else if ($pid) { // we are the parent } else { // we are the child } ?> ]]> </programlisting> </example> <para> See also <function>pcntl_waitpid</function> and <function>pcntl_signal</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-signal"> <refnamediv> <refname>pcntl_signal</refname> <refpurpose>Installs a signal handler</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>pcntl_signal</function></funcdef> <paramdef>int <parameter>signo</parameter></paramdef> <paramdef>mixed <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The <function>pcntl_signal</function> function installs a new signal handler for the signal indicated by <parameter>signo</parameter>. The signal handler is set to <parameter>handler</parameter> which may be the name of a user created function, or either of the two global constants SIG_IGN or SIG_DFL. </para> <para> <function>pcntl_signal</function> returns &true; on success or &false; on failure. </para> <example> <title><function>pcntl_signal</function> Example</title> <programlisting role="php"> <![CDATA[ <?php // signal handler function function sig_handler($signo) { switch($signo) { case SIGTERM: // handle shutdown tasks exit; break; case SIGHUP: // handle restart tasks break; case SIGUSR1: print "Caught SIGUSR1...\n"; break; default: // handle all other signals } } print "Installing signal handler...\n"; // setup signal handlers pcntl_signal(SIGTERM, "sig_handler"); pcntl_signal(SIGHUP, "sig_handler"); pcntl_signal(SIGUSR1, "sig_handler"); print "Generating signal SIGTERM to self...\n"; // send SIGUSR1 to current process id posix_kill(posix_getpid(), SIGUSR1); print "Done\n" ?> ]]> </programlisting> </example> <para> See also <function>pcntl_fork</function> and <function>pcntl_waitpid</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-waitpid"> <refnamediv> <refname>pcntl_waitpid</refname> <refpurpose>Waits on or returns the status of a forked child</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_waitpid</function></funcdef> <paramdef>int <parameter>pid</parameter></paramdef> <paramdef>int <parameter>status</parameter></paramdef> <paramdef>int <parameter>options</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The <function>pcntl_waitpid</function> function suspends execution of the current process until a child as specified by the <parameter>pid</parameter> argument has exited, or until a signal is delivered whose action is to terminate the current process or to call a signal handling function. If a child as requested by <parameter>pid</parameter> has already exited by the time of the call (a so-called "zombie" process), the function returns immediately. Any system resources used by the child are freed. Please see your system's waitpid(2) man page for specific details as to how waitpid works on your system. </para> <para> <function>pcntl_waitpid</function> returns the process ID of the child which exited, -1 on error or zero if WNOHANG was used and no child was available </para> <para> The value of <parameter>pid</parameter> can be one of the following: <table> <title>possible values for <parameter>pid</parameter></title> <tgroup cols="2"> <tbody> <row> <entry><literal>&lt; -1</literal></entry> <entry> wait for any child process whose process group ID is equal to the absolute value of <parameter>pid</parameter>. </entry> </row> <row> <entry><literal>-1</literal></entry> <entry> wait for any child process; this is the same behaviour that the wait function exhibits. </entry> </row> <row> <entry><literal>0</literal></entry> <entry> wait for any child process whose process group ID is equal to that of the calling process. </entry> </row> <row> <entry><literal>&gt; 0</literal></entry> <entry> wait for the child whose process ID is equal to the value of <parameter>pid</parameter>. </entry> </row> </tbody> </tgroup> </table> </para> <para> <function>pcntl_waitpid</function> will store status information in the <parameter>status</parameter> parameter which can be evaluated using the following functions: <function>pcntl_wifexited</function>, <function>pcntl_wifstopped</function>, <function>pcntl_wifsignaled</function>, <function>pcntl_wexitstatus</function>, <function>pcntl_wtermsig</function> and <function>pcntl_wstopsig</function>. </para> <para> The value of <parameter>options</parameter> is the value of zero or more of the following two global constants <literal>OR</literal>'ed together: <table> <title>possible values for <parameter>options</parameter></title> <tgroup cols="2"> <tbody> <row> <entry><literal>WNOHANG</literal></entry> <entry> return immediately if no child has exited. </entry> </row> <row> <entry><literal>WUNTRACED</literal></entry> <entry> return for children which are stopped, and whose status has not been reported. </entry> </row> </tbody> </tgroup> </table> </para> <para> See also <function>pcntl_fork</function>, <function>pcntl_signal</function>, <function>pcntl_wifexited</function>, <function>pcntl_wifstopped</function>, <function>pcntl_wifsignaled</function>, <function>pcntl_wexitstatus</function>, <function>pcntl_wtermsig</function> and <function>pcntl_wstopsig</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-wexitstatus"> <refnamediv> <refname>pcntl_wexitstatus</refname> <refpurpose> Returns the return code of a terminated child </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_wexitstatus</function></funcdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the return code of a terminated child. This function is only useful if <function>pcntl_wifexited</function> returned &true;. </para> <para> The parameter <parameter>status</parameter> is the status parameter supplied to a successfull call to <function>pcntl_waitpid</function>. </para> <para> See also <function>pcntl_waitpid</function> and <function>pcntl_wifexited</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-wifexited"> <refnamediv> <refname>pcntl_wifexited</refname> <refpurpose> Returns &true; if status code represents a successful exit </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_wifexited</function></funcdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns &true; if the child status code represents a successful exit. </para> <para> The parameter <parameter>status</parameter> is the status parameter supplied to a successfull call to <function>pcntl_waitpid</function>. </para> <para> See also <function>pcntl_waitpid</function> and <function>pcntl_wexitstatus</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-wifsignaled"> <refnamediv> <refname>pcntl_wifsignaled</refname> <refpurpose> Returns &true; if status code represents a termination due to a signal </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_wifsignaled</function></funcdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns &true; if the child process exited because of a signal which was not caught. </para> <para> The parameter <parameter>status</parameter> is the status parameter supplied to a successfull call to <function>pcntl_waitpid</function>. </para> <para> See also <function>pcntl_waitpid</function> and <function>pcntl_signal</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-wifstopped"> <refnamediv> <refname>pcntl_wifstopped</refname> <refpurpose> Returns &true; if child process is currently stopped </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_wifstopped</function></funcdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns &true; if the child process which caused the return is currently stopped; this is only possible if the call to <function>pcntl_waitpid</function> was done using the option <literal>WUNTRACED</literal>. </para> <para> The parameter <parameter>status</parameter> is the status parameter supplied to a successfull call to <function>pcntl_waitpid</function>. </para> <para> See also <function>pcntl_waitpid</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-wstopsig"> <refnamediv> <refname>pcntl_wstopsig</refname> <refpurpose> Returns the signal which caused the child to stop </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_wstopsig</function></funcdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the number of the signal which caused the child to stop. This function is only useful if <function>pcntl_wifstopped</function> returned &true;. </para> <para> The parameter <parameter>status</parameter> is the status parameter supplied to a successfull call to <function>pcntl_waitpid</function>. </para> <para> See also <function>pcntl_waitpid</function> and <function>pcntl_wifstopped</function>. </para> </refsect1> </refentry> <refentry id="function.pcntl-wtermsig"> <refnamediv> <refname>pcntl_wtermsig</refname> <refpurpose> Returns the signal which caused the child to terminate </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>pcntl_wtermsig</function></funcdef> <paramdef>int <parameter>status</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the number of the signal that caused the child process to terminate. This function is only useful if <function>pcntl_wifsignaled</function> returned &true;. </para> <para> The parameter <parameter>status</parameter> is the status parameter supplied to a successfull call to <function>pcntl_waitpid</function>. </para> <para> See also <function>pcntl_waitpid</function>, <function>pcntl_signal</function> and <function>pcntl_wifsignaled</function>. </para> </refsect1> </refentry> <refentry id='function.pcntl-exec'> <refnamediv> <refname>pcntl_exec</refname> <refpurpose> Executes specified program in current process space </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>pcntl_exec</function></funcdef> <paramdef>string <parameter>path</parameter></paramdef> <paramdef>array <parameter><optional>args</optional></parameter></paramdef> <paramdef>array <parameter><optional>envs</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/printer.xml +++ phpdoc/kr/functions/printer.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.printer"> <title>Printer functions</title> <titleabbrev>Printer</titleabbrev> <partintro> <simpara> These functions are only available under Windows 9.x, ME, NT4 and 2000. They have been added in PHP 4 (4.0.4). </simpara> </partintro> <refentry id="function.printer-open"> <refnamediv> <refname>printer_open</refname> <refpurpose>Open connection to a printer</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>printer_open</function></funcdef> <paramdef>string <parameter><optional>devicename</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> This function tries to open a connection to the printer <parameter>devicename</parameter>, and returns a handle on success or &false; on failure. </para> <para> If no parameter was given it tries to open a connection to the default printer (if not specified in <filename>php.ini</filename> as <literal>printer.default_printer</literal>, php tries to detect it). </para> <para> <function>printer_open</function> also starts a device context. </para> <example> <title><function>printer_open</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open("HP Deskjet 930c"); $handle = printer_open(); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-abort"> <refnamediv> <refname>printer_abort</refname> <refpurpose>Deletes the printer's spool file</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_abort</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> This function deletes the printers spool file. </para> <para> <parameter>handle</parameter> must be a valid handle to a printer. </para> <example> <title><function>printer_abort</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_abort($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-close"> <refnamediv> <refname>printer_close</refname> <refpurpose>Close an open printer connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_close</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> This function closes the printer connection. <function>printer_close</function> also closes the active device context. </para> <para> <parameter>handle</parameter> must be a valid handle to a printer. </para> <example> <title><function>printer_close</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-write"> <refnamediv> <refname>printer_write</refname> <refpurpose>Write data to the printer</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_write</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>string <parameter>content</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Writes <parameter>content</parameter> directly to the printer, and returns &true; on success or &false; if it failed. </para> <para> <parameter>handle</parameter> must be a valid handle to a printer. </para> <example> <title><function>printer_write</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_write($handle, "Text to print"); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-list"> <refnamediv> <refname>printer_list</refname> <refpurpose>Return an array of printers attached to the server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>printer_list</function></funcdef> <paramdef>int <parameter>enumtype</parameter></paramdef> <paramdef>string <parameter><optional>name</optional></parameter></paramdef> <paramdef>int <parameter><optional>level</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function enumerates available printers and their capabilities. <parameter>level</parameter> sets the level of information request. Can be 1,2,4 or 5. <parameter>enumtype</parameter> must be one of the following predefined constants: <itemizedlist> <listitem> <simpara> <parameter>PRINTER_ENUM_LOCAL</parameter>: enumerates the locally installed printers. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_NAME</parameter>: enumerates the printer of <parameter>name</parameter>, can be a server, domain or print provider. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_SHARED</parameter>: this parameter can't be used alone, it has to be OR'ed with other parameters, i.e. PRINTER_ENUM_LOCAL to detect the locally shared printers. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_DEFAULT</parameter>: (Win9.x only) enumerates the default printer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_CONNECTIONS</parameter>: (WinNT/2000 only) enumerates the printers to which the user has made connections. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_NETWORK</parameter>: (WinNT/2000 only) enumerates network printers in the computer's domain. Only valid if <parameter>level</parameter> is 1. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ENUM_REMOTE</parameter>: (WinNT/2000 only) enumerates network printers and print servers in the computer's domain. Only valid if <parameter>level</parameter> is 1. </simpara> </listitem> </itemizedlist> </para> <example> <title><function>printer_list</function> example</title> <programlisting role="php"> <![CDATA[ /* detect locally shared printer */ var_dump( printer_list(PRINTER_ENUM_LOCAL | PRINTER_ENUM_SHARED) ); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-set-option"> <refnamediv> <refname>printer_set_option</refname> <refpurpose>Configure the printer connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_set_option</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>option</parameter></paramdef> <paramdef>mixed <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function sets the following options for the current connection: <parameter>handle</parameter> must be a valid handle to a printer. For <parameter>option</parameter> can be one of the following constants: <itemizedlist> <listitem> <simpara> <parameter>PRINTER_COPIES</parameter>: sets how many copies should be printed, <parameter>value</parameter> must be an integer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_MODE</parameter>: specifies the type of data (text, raw or emf), <parameter>value</parameter> must be a string. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TITLE</parameter>: specifies the name of the document, <parameter>value</parameter> must be a string. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_ORIENTATION</parameter>: specifies the orientation of the paper, <parameter>value</parameter> can be either PRINTER_ORIENTATION_PORTRAIT or PRINTER_ORIENTATION_LANDSCAPE </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_RESOLUTION_Y</parameter>: specifies the y-resolution in DPI, <parameter>value</parameter> must be an integer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_RESOLUTION_X</parameter>: specifies the x-resolution in DPI, <parameter>value</parameter> must be an integer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PAPER_FORMAT</parameter>: specifies the a predefined paper format, set <parameter>value</parameter> to PRINTER_FORMAT_CUSTOM if you want to specify a custom format with PRINTER_PAPER_WIDTH and PRINTER_PAPER_LENGTH. <parameter>value</parameter> can be one of the following constants. </simpara> <itemizedlist> <listitem> <simpara> <parameter> PRINTER_FORMAT_CUSTOM</parameter>: let's you specify a custom paper format. </simpara> </listitem> <listitem> <simpara> <parameter> PRINTER_FORMAT_LETTER</parameter>: specifies standard letter format (8 1/2- by 11-inches). </simpara> </listitem> <listitem> <simpara> <parameter> PRINTER_FORMAT_LETTER</parameter>: specifies standard legal format (8 1/2- by 14-inches). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FORMAT_A3</parameter>: specifies standard A3 format (297- by 420-millimeters). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FORMAT_A4</parameter>: specifies standard A4 format (210- by 297-millimeters). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FORMAT_A5</parameter>: specifies standard A5 format (148- by 210-millimeters). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FORMAT_B4</parameter>: specifies standard B4 format (250- by 354-millimeters). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FORMAT_B5</parameter>: specifies standard B5 format (182- by 257-millimeter). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FORMAT_FOLIO</parameter>: specifies standard FOLIO format (8 1/2- by 13-inch). </simpara> </listitem> </itemizedlist> </listitem> <listitem> <simpara> <parameter>PRINTER_PAPER_LENGTH</parameter>: if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM, PRINTER_PAPER_LENGTH specifies a custom paper length in mm, <parameter>value</parameter> must be an integer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PAPER_WIDTH</parameter>: if PRINTER_PAPER_FORMAT is set to PRINTER_FORMAT_CUSTOM, PRINTER_PAPER_WIDTH specifies a custom paper width in mm, <parameter>value</parameter> must be an integer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_SCALE</parameter>: specifies the factor by which the printed output is to be scaled. the page size is scaled from the physical page size by a factor of scale/100. for example if you set the scale to 50, the output would be half of it's original size. <parameter>value</parameter> must be an integer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BACKGROUND_COLOR</parameter>: specifies the background color for the actual device context, <parameter>value</parameter> must be a string containing the rgb information in hex format i.e. "005533". </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TEXT_COLOR</parameter>: specifies the text color for the actual device context, <parameter>value</parameter> must be a string containing the rgb information in hex format i.e. "005533". </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TEXT_ALIGN</parameter>: specifies the text alignment for the actual device context, <parameter>value</parameter> can be combined through OR'ing the following constants: </simpara> <itemizedlist> <listitem> <simpara> <parameter>PRINTER_TA_BASELINE</parameter>: text will be aligned at the base line. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TA_BOTTOM</parameter>: text will be aligned at the bottom. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TA_TOP</parameter>: text will be aligned at the top. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TA_CENTER</parameter>: text will be aligned at the center. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TA_LEFT</parameter>: text will be aligned at the left. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_TA_RIGHT</parameter>: text will be aligned at the right. </simpara> </listitem> </itemizedlist> </listitem> </itemizedlist> </para> <example> <title><function>printer_set_option</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_set_option($handle, PRINTER_SCALE, 75); printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-get-option"> <refnamediv> <refname>printer_get_option</refname> <refpurpose>Retrieve printer configuration data</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>printer_get_option</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>string <parameter>option</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function retrieves the configuration setting of <parameter>option</parameter>. <parameter>handle</parameter> must be a valid handle to a printer. Take a look at <function>printer_set_option</function> for the settings that can be retrieved, additionally the following settings can be retrieved: <itemizedlist> <listitem> <simpara> <parameter>PRINTER_DEVICENAME</parameter> returns the devicename of the printer. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_DRIVERVERSION</parameter> returns the printer driver version. </simpara> </listitem> </itemizedlist> </para> <example> <title><function>printer_get_option</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); print printer_get_option($handle, PRINTER_DRIVERVERSION); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-create-dc"> <refnamediv> <refname>printer_create_dc</refname> <refpurpose>Create a new device context</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_create_dc</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function creates a new device context. A device context is used to customize the graphic objects of the document. <parameter>handle</parameter> must be a valid handle to a printer. </para> <example> <title><function>printer_create_dc</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle); printer_start_page($handle); printer_create_dc($handle); /* do some stuff with the dc */ printer_set_option($handle, PRINTER_TEXT_COLOR, "333333"); printer_draw_text($handle, 1, 1, "text"); printer_delete_dc($handle); /* create another dc */ printer_create_dc($handle); printer_set_option($handle, PRINTER_TEXT_COLOR, "000000"); printer_draw_text($handle, 1, 1, "text"); /* do some stuff with the dc */ printer_delete_dc($handle); printer_endpage($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-delete-dc"> <refnamediv> <refname>printer_delete_dc</refname> <refpurpose>Delete a device context</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_delete_dc</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function deletes the device context and returns &true; on success, or &false; if an error occurred. For an example see <function>printer_create_dc</function>. <parameter>handle</parameter> must be a valid handle to a printer. </para> </refsect1> </refentry> <refentry id="function.printer-start-doc"> <refnamediv> <refname>printer_start_doc</refname> <refpurpose>Start a new document</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_start_doc</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>string <parameter><optional>document</optional></parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function creates a new document in the printer spooler. A document can contain multiple pages, it's used to schedule the print job in the spooler. <parameter>handle</parameter> must be a valid handle to a printer. The optional parameter <parameter>document</parameter> can be used to set an alternative document name. </para> <example> <title><function>printer_start_doc</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-end-doc"> <refnamediv> <refname>printer_end_doc</refname> <refpurpose>Close document</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_end_doc</function> </funcdef> <paramdef>resource <parameter>handle</parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Closes a new document in the printer spooler. The document is now ready for printing. For an example see <function>printer_start_doc</function>. <parameter>handle</parameter> must be a valid handle to a printer. </para> </refsect1> </refentry> <refentry id="function.printer-start-page"> <refnamediv> <refname>printer_start_page</refname> <refpurpose>Start a new page</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_start_page</function> </funcdef> <paramdef>resource <parameter>handle</parameter> </paramdef> </funcprototype> </funcsynopsis> <para> The function creates a new page in the active document. For an example see <function>printer_start_doc</function>. <parameter>handle</parameter> must be a valid handle to a printer. </para> </refsect1> </refentry> <refentry id="function.printer-end-page"> <refnamediv> <refname>printer_end_page</refname> <refpurpose>Close active page</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_end_page</function> </funcdef> <paramdef>resource <parameter>handle</parameter> </paramdef> </funcprototype> </funcsynopsis> <para> The function closes the active page in the active document. For an example see <function>printer_start_doc</function>. <parameter>handle</parameter> must be a valid handle to a printer. </para> </refsect1> </refentry> <refentry id="function.printer-create-pen"> <refnamediv> <refname>printer_create_pen</refname> <refpurpose>Create a new pen</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>printer_create_pen</function> </funcdef> <paramdef>int <parameter>style</parameter></paramdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>string <parameter>color</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function creates a new pen and returns a handle to it. A pen is used to draw lines and curves. For an example see <function>printer_select_pen</function>. <parameter>color</parameter> must be a color in RGB hex format, i.e. "000000" for black, <parameter>width</parameter> specifies the width of the pen whereas <parameter>style</parameter> must be one of the following constants: <itemizedlist> <listitem> <simpara> <parameter>PRINTER_PEN_SOLID</parameter>: creates a solid pen. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PEN_DASH</parameter>: creates a dashed pen. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PEN_DOT</parameter>: creates a dotted pen. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PEN_DASHDOT</parameter>: creates a pen with dashes and dots. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PEN_DASHDOTDOT</parameter>: creates a pen with dashes and double dots. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_PEN_INVISIBLE</parameter>: creates an invisible pen. </simpara> </listitem> </itemizedlist> </para> </refsect1> </refentry> <refentry id="function.printer-delete-pen"> <refnamediv> <refname>printer_delete_pen</refname> <refpurpose>Delete a pen</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_delete_pen</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function deletes the selected pen. For an example see <function>printer_select_pen</function>. It returns &true; on success, or &false; otherwise. <parameter>handle</parameter> must be a valid handle to a pen. </para> </refsect1> </refentry> <refentry id="function.printer-select-pen"> <refnamediv> <refname>printer_select_pen</refname> <refpurpose>Select a pen</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_select_pen</function> </funcdef> <paramdef>resource <parameter>printer_handle</parameter></paramdef> <paramdef>resource <parameter>pen_handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function selects a pen as the active drawing object of the actual device context. A pen is used to draw lines and curves. I.e. if you draw a single line the pen is used. If you draw an rectangle the pen is used to draw the borders, while the brush is used to fill the shape. If you haven't selected a pen before drawing shapes, the shape won't be outlined. <parameter>printer_handle</parameter> must be a valid handle to a printer. <parameter>pen_handle</parameter> must be a valid handle to a pen. </para> <example> <title> <function>printer_select_pen</function> example </title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 30, "2222FF"); printer_select_pen($handle, $pen); printer_draw_line($handle, 1, 60, 500, 60); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-create-brush"> <refnamediv> <refname>printer_create_brush</refname> <refpurpose>Create a new brush</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>printer_create_brush</function> </funcdef> <paramdef>int <parameter>style</parameter></paramdef> <paramdef>string <parameter>color</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function creates a new brush and returns a handle to it. A brush is used to fill shapes. For an example see <function>printer_select_brush</function>. <parameter>color</parameter> must be a color in RGB hex format, i.e. "000000" for black, <parameter>style</parameter> must be one of the following constants: <itemizedlist> <listitem> <simpara> <parameter>PRINTER_BRUSH_SOLID</parameter>: creates a brush with a solid color. </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_DIAGONAL</parameter>: creates a brush with a 45-degree upward left-to-right hatch ( / ). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_CROSS</parameter>: creates a brush with a cross hatch ( + ). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_DIAGCROSS</parameter>: creates a brush with a 45 cross hatch ( x ). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_FDIAGONAL</parameter>: creates a brush with a 45-degree downward left-to-right hatch ( \ ). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_HORIZONTAL</parameter>: creates a brush with a horizontal hatch ( - ). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_VERTICAL</parameter>: creates a brush with a vertical hatch ( | ). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_BRUSH_CUSTOM</parameter>: creates a custom brush from an BMP file. The second parameter is used to specify the BMP instead of the RGB color code. </simpara> </listitem> </itemizedlist> </para> </refsect1> </refentry> <refentry id="function.printer-delete-brush"> <refnamediv> <refname>printer_delete_brush</refname> <refpurpose>Delete a brush</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_delete_brush</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function deletes the selected brush. For an example see <function>printer_select_brush</function>. It returns &true; on success, or &false; otherwise. <parameter>handle</parameter> must be a valid handle to a brush. </para> </refsect1> </refentry> <refentry id="function.printer-select-brush"> <refnamediv> <refname>printer_select_brush</refname> <refpurpose>Select a brush</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_select_brush</function> </funcdef> <paramdef>resource <parameter>printer_handle</parameter></paramdef> <paramdef>resource <parameter>brush_handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function selects a brush as the active drawing object of the actual device context. A brush is used to fill shapes. If you draw an rectangle the brush is used to draw the shapes, while the pen is used to draw the border. If you haven't selected a brush before drawing shapes, the shape won't be filled. <parameter>printer_handle</parameter> must be a valid handle to a printer. <parameter>brush_handle</parameter> must be a valid handle to a brush. </para> <example> <title> <function>printer_select_brush</function> example </title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000"); printer_select_pen($handle, $pen); $brush = printer_create_brush(PRINTER_BRUSH_CUSTOM, "c:\\brush.bmp"); printer_select_brush($handle, $brush); printer_draw_rectangle($handle, 1,1,500,500); printer_delete_brush($brush); $brush = printer_create_brush(PRINTER_BRUSH_SOLID, "000000"); printer_select_brush($handle, $brush); printer_draw_rectangle($handle, 1,501,500,1001); printer_delete_brush($brush); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-create-font"> <refnamediv> <refname>printer_create_font</refname> <refpurpose>Create a new font</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>printer_create_font</function> </funcdef> <paramdef>string <parameter>face</parameter></paramdef> <paramdef>int <parameter>height</parameter></paramdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>int <parameter>font_weight</parameter></paramdef> <paramdef>bool <parameter>italic</parameter></paramdef> <paramdef>bool <parameter>underline</parameter></paramdef> <paramdef>bool <parameter>strikeout</parameter></paramdef> <paramdef>int <parameter>orientaton</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function creates a new font and returns a handle to it. A font is used to draw text. For an example see <function>printer_select_font</function>. <parameter>face</parameter> must be a string specifying the font face. <parameter>height</parameter> specifies the font height, and <parameter>width</parameter> the font width. The <parameter>font_weight</parameter> specifies the font weight (400 is normal), and can be one of the following predefined constants. <itemizedlist> <listitem> <simpara> <parameter>PRINTER_FW_THIN</parameter>: sets the font weight to thin (100). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_ULTRALIGHT</parameter>: sets the font weight to ultra light (200). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_LIGHT</parameter>: sets the font weight to light (300). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_NORMAL</parameter>: sets the font weight to normal (400). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_MEDIUM</parameter>: sets the font weight to medium (500). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_BOLD</parameter>: sets the font weight to bold (700). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_ULTRABOLD</parameter>: sets the font weight to ultra bold (800). </simpara> </listitem> <listitem> <simpara> <parameter>PRINTER_FW_HEAVY</parameter>: sets the font weight to heavy (900). </simpara> </listitem> </itemizedlist> </para> <para> <parameter>italic</parameter> can be &true; or &false;, and sets whether the font should be italic. </para> <para> <parameter>underline</parameter> can be &true; or &false;, and sets whether the font should be underlined. </para> <para> <parameter>strikeout</parameter> can be &true; or &false;, and sets whether the font should be striked out. </para> <para> <parameter>orientation</parameter> specifies a rotation. For an example see <function>printer_select_font</function>. </para> </refsect1> </refentry> <refentry id="function.printer-delete-font"> <refnamediv> <refname>printer_delete_font</refname> <refpurpose>Delete a font</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>printer_delete_font</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function deletes the selected font. For an example see <function>printer_select_font</function>. It returns &true; on success, or &false; otherwise. <parameter>handle</parameter> must be a valid handle to a font. </para> </refsect1> </refentry> <refentry id="function.printer-select-font"> <refnamediv> <refname>printer_select_font</refname> <refpurpose>Select a font</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_select_font</function> </funcdef> <paramdef>resource <parameter>printer_handle</parameter></paramdef> <paramdef>resource <parameter>font_handle</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function selects a font to draw text. <parameter>printer_handle</parameter> must be a valid handle to a printer. <parameter>font_handle</parameter> must be a valid handle to a font. </para> <example> <title> <function>printer_select_font</function> example </title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $font = printer_create_font("Arial", 148, 76, PRINTER_FW_MEDIUM, false, false, false, -50); printer_select_font($handle, $font); printer_draw_text($handle, "PHP is simply cool", 40, 40); printer_delete_font($font); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-logical-fontheight"> <refnamediv> <refname>printer_logical_fontheight</refname> <refpurpose>Get logical font height</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>printer_logical_fontheight</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function calculates the logical font height of <parameter>height</parameter>. <parameter>handle</parameter> must be a valid handle to a printer. </para> <example> <title> <function>printer_logical_fontheight</function> example </title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); print printer_logical_fontheight($handle, 72); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-roundrect"> <refnamediv> <refname>printer_draw_roundrect</refname> <refpurpose>Draw a rectangle with rounded corners</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_roundrect</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>ul_x</parameter></paramdef> <paramdef>int <parameter>ul_y</parameter></paramdef> <paramdef>int <parameter>lr_x</parameter></paramdef> <paramdef>int <parameter>lr_y</parameter></paramdef> <paramdef>int <parameter>width</parameter></paramdef> <paramdef>int <parameter>height</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws a rectangle with rounded corners. </para> <para> <parameter>handle</parameter> must be a valid handle to a printer. </para> <para> <parameter>ul_x</parameter> is the upper left x coordinate of the rectangle. </para> <para> <parameter>ul_y</parameter> is the upper left y coordinate of the rectangle. </para> <para> <parameter>lr_x</parameter> is the lower right x coordinate of the rectangle. </para> <para> <parameter>lr_y</parameter> is the lower right y coordinate of the rectangle. </para> <para> <parameter>width</parameter> is the width of the ellipse. </para> <para> <parameter>height</parameter> is the height of the ellipse. </para> <example> <title> <function>printer_draw_roundrect</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000"); printer_select_pen($handle, $pen); $brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF"); printer_select_brush($handle, $brush); printer_draw_roundrect($handle, 1, 1, 500, 500, 200, 200); printer_delete_brush($brush); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-rectangle"> <refnamediv> <refname>printer_draw_rectangle</refname> <refpurpose>Draw a rectangle</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_rectangle</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>ul_x</parameter></paramdef> <paramdef>int <parameter>ul_y</parameter></paramdef> <paramdef>int <parameter>lr_x</parameter></paramdef> <paramdef>int <parameter>lr_y</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws a rectangle. </para> <para> <parameter>handle</parameter> must be a valid handle to a printer. </para> <para> <parameter>ul_x</parameter> is the upper left x coordinate of the rectangle. </para> <para> <parameter>ul_y</parameter> is the upper left y coordinate of the rectangle. </para> <para> <parameter>lr_x</parameter> is the lower right x coordinate of the rectangle. </para> <para> <parameter>lr_y</parameter> is the lower right y coordinate of the rectangle. </para> <example> <title> <function>printer_draw_rectangle</function> example </title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000"); printer_select_pen($handle, $pen); $brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF"); printer_select_brush($handle, $brush); printer_draw_rectangle($handle, 1, 1, 500, 500); printer_delete_brush($brush); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-elipse"> <refnamediv> <refname>printer_draw_elipse</refname> <refpurpose>Draw an ellipse</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_elipse</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>ul_x</parameter></paramdef> <paramdef>int <parameter>ul_y</parameter></paramdef> <paramdef>int <parameter>lr_x</parameter></paramdef> <paramdef>int <parameter>lr_y</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws an ellipse. <parameter>handle</parameter> must be a valid handle to a printer. </para> <para> <parameter>ul_x</parameter> is the upper left x coordinate of the ellipse. </para> <para> <parameter>ul_y</parameter> is the upper left y coordinate of the ellipse. </para> <para> <parameter>lr_x</parameter> is the lower right x coordinate of the ellipse. </para> <para> <parameter>lr_y</parameter> is the lower right y coordinate of the ellipse. </para> <example> <title> <function>printer_draw_elipse</function> example </title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000"); printer_select_pen($handle, $pen); $brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF"); printer_select_brush($handle, $brush); printer_draw_elipse($handle, 1, 1, 500, 500); printer_delete_brush($brush); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-text"> <refnamediv> <refname>printer_draw_text</refname> <refpurpose>Draw text</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_text</function> </funcdef> <paramdef>resource <parameter>printer_handle</parameter></paramdef> <paramdef>string <parameter>text</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws <parameter>text</parameter> at position <parameter>x</parameter>, <parameter>y</parameter> using the selected font. <parameter>printer_handle</parameter> must be a valid handle to a printer. </para> <example> <title><function>printer_draw_text</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $font = printer_create_font("Arial",72,48,400,false,false,false,0); printer_select_font($handle, $font); printer_draw_text($handle, "test", 10, 10); printer_delete_font($font); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-line"> <refnamediv> <refname>printer_draw_line</refname> <refpurpose>Draw a line</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_line</function></funcdef> <paramdef>resource <parameter>printer_handle</parameter></paramdef> <paramdef>int <parameter>from_x</parameter></paramdef> <paramdef>int <parameter>from_y</parameter></paramdef> <paramdef>int <parameter>to_x</parameter></paramdef> <paramdef>int <parameter>to_y</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws a line from position <parameter>from_x</parameter>, <parameter>from_y</parameter> to position <parameter>to_x</parameter>, <parameter>to_y</parameter> using the selected pen. <parameter>printer_handle</parameter> must be a valid handle to a printer. </para> <example> <title><function>printer_draw_line</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 30, "000000"); printer_select_pen($handle, $pen); printer_draw_line($handle, 1, 10, 1000, 10); printer_draw_line($handle, 1, 60, 500, 60); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-chord"> <refnamediv> <refname>printer_draw_chord</refname> <refpurpose>Draw a chord</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_chord</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>rec_x</parameter></paramdef> <paramdef>int <parameter>rec_y</parameter></paramdef> <paramdef>int <parameter>rec_x1</parameter></paramdef> <paramdef>int <parameter>rec_y1</parameter></paramdef> <paramdef>int <parameter>rad_x</parameter></paramdef> <paramdef>int <parameter>rad_y</parameter></paramdef> <paramdef>int <parameter>rad_x1</parameter></paramdef> <paramdef>int <parameter>rad_y1</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws an chord. <parameter>handle</parameter> must be a valid handle to a printer. </para> <para> <parameter>rec_x</parameter> is the upper left x coordinate of the bounding rectangle. </para> <para> <parameter>rec_y</parameter> is the upper left y coordinate of the bounding rectangle. </para> <para> <parameter>rec_x1</parameter> is the lower right x coordinate of the bounding rectangle. </para> <para> <parameter>rec_y1</parameter> is the lower right y coordinate of the bounding rectangle. </para> <para> <parameter>rad_x</parameter> is x coordinate of the radial defining the beginning of the chord. </para> <para> <parameter>rad_y</parameter> is y coordinate of the radial defining the beginning of the chord. </para> <para> <parameter>rad_x1</parameter> is x coordinate of the radial defining the end of the chord. </para> <para> <parameter>rad_y1</parameter> is y coordinate of the radial defining the end of the chord. </para> <example> <title><function>printer_draw_chord</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000"); printer_select_pen($handle, $pen); $brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF"); printer_select_brush($handle, $brush); printer_draw_chord($handle, 1, 1, 500, 500, 1, 1, 500, 1); printer_delete_brush($brush); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-pie"> <refnamediv> <refname>printer_draw_pie</refname> <refpurpose>Draw a pie</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_pie</function></funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>int <parameter>rec_x</parameter></paramdef> <paramdef>int <parameter>rec_y</parameter></paramdef> <paramdef>int <parameter>rec_x1</parameter></paramdef> <paramdef>int <parameter>rec_y1</parameter></paramdef> <paramdef>int <parameter>rad1_x</parameter></paramdef> <paramdef>int <parameter>rad1_y</parameter></paramdef> <paramdef>int <parameter>rad2_x</parameter></paramdef> <paramdef>int <parameter>rad2_y</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws an pie. <parameter>handle</parameter> must be a valid handle to a printer. </para> <para> <parameter>rec_x</parameter> is the upper left x coordinate of the bounding rectangle. </para> <para> <parameter>rec_y</parameter> is the upper left y coordinate of the bounding rectangle. </para> <para> <parameter>rec_x1</parameter> is the lower right x coordinate of the bounding rectangle. </para> <para> <parameter>rec_y1</parameter> is the lower right y coordinate of the bounding rectangle. </para> <para> <parameter>rad1_x</parameter> is x coordinate of the first radial's ending. </para> <para> <parameter>rad1_y</parameter> is y coordinate of the first radial's ending. </para> <para> <parameter>rad2_x</parameter> is x coordinate of the second radial's ending. </para> <para> <parameter>rad2_y</parameter> is y coordinate of the second radial's ending. </para> <example> <title><function>printer_draw_chord</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); $pen = printer_create_pen(PRINTER_PEN_SOLID, 2, "000000"); printer_select_pen($handle, $pen); $brush = printer_create_brush(PRINTER_BRUSH_SOLID, "2222FF"); printer_select_brush($handle, $brush); printer_draw_pie($handle, 1, 1, 500, 500, 1, 1, 500, 1); printer_delete_brush($brush); printer_delete_pen($pen); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> <refentry id="function.printer-draw-bmp"> <refnamediv> <refname>printer_draw_bmp</refname> <refpurpose>Draw a bmp</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>printer_draw_bmp</function> </funcdef> <paramdef>resource <parameter>handle</parameter></paramdef> <paramdef>string <parameter>filename</parameter></paramdef> <paramdef>int <parameter>x</parameter></paramdef> <paramdef>int <parameter>y</parameter></paramdef> </funcprototype> </funcsynopsis> <para> The function simply draws an bmp the bitmap <parameter>filename</parameter> at position <parameter>x</parameter>, <parameter>y</parameter>. <parameter>handle</parameter> must be a valid handle to a printer. </para> <para> The function returns &true; on success, or otherwise &false;. </para> <example> <title><function>printer_draw_bmp</function> example</title> <programlisting role="php"> <![CDATA[ $handle = printer_open(); printer_start_doc($handle, "My Document"); printer_start_page($handle); printer_draw_bmp($handle, "c:\\image.bmp", 1, 1); printer_end_page($handle); printer_end_doc($handle); printer_close($handle); ]]> </programlisting> </example> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/qtdom.xml +++ phpdoc/kr/functions/qtdom.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.qtdom"> <title>qtdom functions</title> <titleabbrev>qtdom functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.qdom-tree"> <refnamediv> <refname>qdom_tree</refname> <refpurpose>creates a tree of an xml string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>object <function>qdom_tree</function></funcdef> <paramdef>string <parameter></parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.qdom-error"> <refnamediv> <refname>qdom_error</refname> <refpurpose>Returns the error string from the last QDOM operation or FALSE if no errors occured</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>qdom_error</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/vpopmail.xml +++ phpdoc/kr/functions/vpopmail.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.vpopmail"> <title>vpopmail functions</title> <titleabbrev>vpopmail functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.vpopmail-add-domain"> <refnamediv> <refname>vpopmail_add_domain</refname> <refpurpose>Add a new virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_add_domain</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>dir</parameter></paramdef> <paramdef>int <parameter>uid</parameter></paramdef> <paramdef>int <parameter>gid</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-del-domain"> <refnamediv> <refname>vpopmail_del_domain</refname> <refpurpose>Delete a virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_del_domain</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-add-alias-domain"> <refnamediv> <refname>vpopmail_add_alias_domain</refname> <refpurpose>Add an alias for a virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_add_alias_domain</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>aliasdomain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-add-domain-ex"> <refnamediv> <refname>vpopmail_add_domain_ex</refname> <refpurpose>Add a new virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_add_domain_ex</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>passwd</parameter></paramdef> <paramdef>string <parameter><optional>quota</optional></parameter> </paramdef> <paramdef>string <parameter><optional>bounce</optional></parameter> </paramdef> <paramdef>bool <parameter><optional>apop</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-del-domain-ex"> <refnamediv> <refname>vpopmail_del_domain_ex</refname> <refpurpose>Delete a virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_del_domain_ex</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-add-alias-domain-ex"> <refnamediv> <refname>vpopmail_add_alias_domain_ex</refname> <refpurpose>Add alias to an existing virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_add_alias_domain_ex</function></funcdef> <paramdef>string <parameter>olddomain</parameter></paramdef> <paramdef>string <parameter>newdomain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-add-user"> <refnamediv> <refname>vpopmail_add_user</refname> <refpurpose>Add a new user to the specified virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_add_user</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> <paramdef>string <parameter><optional>gecos</optional></parameter> </paramdef> <paramdef>bool <parameter><optional>apop</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-del-user"> <refnamediv> <refname>vpopmail_del_user</refname> <refpurpose>Delete a user from a virtual domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_del_user</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-passwd"> <refnamediv> <refname>vpopmail_passwd</refname> <refpurpose>Change a virtual user's password </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_passwd</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-set-user-quota"> <refnamediv> <refname>vpopmail_set_user_quota</refname> <refpurpose>Sets a virtual user's quota </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_set_user_quota</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>quota</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-auth-user"> <refnamediv> <refname>vpopmail_auth_user</refname> <refpurpose>Attempt to validate a username/domain/password. Returns true/false </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_auth_user</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>password</parameter></paramdef> <paramdef>string <parameter><optional>apop</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-alias-add"> <refnamediv> <refname>vpopmail_alias_add</refname> <refpurpose>insert a virtual alias </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_alias_add</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> <paramdef>string <parameter>alias</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-alias-del"> <refnamediv> <refname>vpopmail_alias_del</refname> <refpurpose>deletes all virtual aliases of a user </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_alias_del</function></funcdef> <paramdef>string <parameter>user</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-alias-del-domain"> <refnamediv> <refname>vpopmail_alias_del_domain</refname> <refpurpose>deletes all virtual aliases of a domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>vpopmail_alias_del_domain</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-alias-get"> <refnamediv> <refname>vpopmail_alias_get</refname> <refpurpose>get all lines of an alias for a domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>vpopmail_alias_get</function></funcdef> <paramdef>string <parameter>alias</parameter></paramdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-alias-get-all"> <refnamediv> <refname>vpopmail_alias_get_all</refname> <refpurpose>get all lines of an alias for a domain </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>vpopmail_alias_get_all</function></funcdef> <paramdef>string <parameter>domain</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.vpopmail-error"> <refnamediv> <refname>vpopmail_error</refname> <refpurpose>Get text message for last vpopmail error. Returns string </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>vpopmail_error</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/w32api.xml +++ phpdoc/kr/functions/w32api.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.w32api"> <title>W32api functions</title> <titleabbrev>W32api functions</titleabbrev> <partintro> <para> </para> </partintro> <refentry id="function.w32api-set-call-method"> <refnamediv> <refname>w32api_set_call_method</refname> <refpurpose>Sets the calling method used </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>w32api_set_call_method</function></funcdef> <paramdef>int <parameter>method</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.w32api-register-function"> <refnamediv> <refname>w32api_register_function</refname> <refpurpose>Registers function function_name from library with PHP </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>w32api_register_function</function></funcdef> <paramdef>string <parameter>libary</parameter></paramdef> <paramdef>string <parameter>function_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.w32api-invoke-function"> <refnamediv> <refname>w32api_invoke_function</refname> <refpurpose>....) Invokes function funcname with the arguments passed after the function name </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>w32api_invoke_function</function></funcdef> <paramdef>string <parameter>funcname</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.w32api-deftype"> <refnamediv> <refname>w32api_deftype</refname> <refpurpose>...) Defines a type for use with other w32api_functions. </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>w32api_deftype</function></funcdef> <paramdef>string <parameter>typename</parameter></paramdef> <paramdef>string <parameter>member1_type</parameter></paramdef> <paramdef>string <parameter>member1_name</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.w32api-init-dtype"> <refnamediv> <refname>w32api_init_dtype</refname> <refpurpose>; Creates an instance to the data type typename and fills it with the values val1, val2, the function</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>w32api_init_dtype</function></funcdef> <paramdef>string <parameter>typename</parameter></paramdef> <paramdef>mixed <parameter>val1</parameter></paramdef> <paramdef>mixed <parameter>val2</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/xmlrpc.xml +++ phpdoc/kr/functions/xmlrpc.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.xmlrpc"> <title>XMLRPC functions</title> <titleabbrev>XMLRPC function</titleabbrev> <partintro> &warn.experimental; <para> </para> </partintro> <refentry id="function.xmlrpc-encode-request"> <refnamediv> <refname>xmlrpc_encode_request</refname> <refpurpose>Generates XML for a method request </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>xmlrpc_encode_request</function></funcdef> <paramdef>string <parameter>method</parameter></paramdef> <paramdef>mixed <parameter>params</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-encode"> <refnamediv> <refname>xmlrpc_encode</refname> <refpurpose>Generates XML for a PHP value </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>xmlrpc_encode</function></funcdef> <paramdef>mixed <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-decode-request"> <refnamediv> <refname>xmlrpc_decode_request</refname> <refpurpose>Decodes XML into native PHP types </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>xmlrpc_decode_request</function></funcdef> <paramdef>string <parameter>xml</parameter></paramdef> <paramdef>string <parameter>method</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-decode"> <refnamediv> <refname>xmlrpc_decode</refname> <refpurpose>Decodes XML into native PHP types </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>xmlrpc_decode</function></funcdef> <paramdef>string <parameter>xml</parameter></paramdef> <paramdef>string <parameter><optional>encoding</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-server-create"> <refnamediv> <refname>xmlrpc_server_create</refname> <refpurpose>Creates an xmlrpc server </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>xmlrpc_server_create</function></funcdef> <void/> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-server-destroy"> <refnamediv> <refname>xmlrpc_server_destroy</refname> <refpurpose>Destroys server resources </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>xmlrpc_server_destroy</function></funcdef> <paramdef>resource <parameter>server</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-server-register-method"> <refnamediv> <refname>xmlrpc_server_register_method</refname> <refpurpose>Register a PHP function to resource method matching method_name </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>xmlrpc_server_register_method</function></funcdef> <paramdef>resource <parameter>server</parameter></paramdef> <paramdef>string <parameter>method_name</parameter></paramdef> <paramdef>string <parameter>function</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-server-register-introspection-callback"> <refnamediv> <refname>xmlrpc_server_register_introspection_callback</refname> <refpurpose>Register a PHP function to generate documentation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>xmlrpc_server_register_introspection_callback</function></funcdef> <paramdef>resource <parameter>server</parameter></paramdef> <paramdef>string <parameter>function</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-server-call-method"> <refnamediv> <refname>xmlrpc_server_call_method</refname> <refpurpose>Parses XML requests and call methods </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>mixed <function>xmlrpc_server_call_method</function></funcdef> <paramdef>resource <parameter>server</parameter></paramdef> <paramdef>string <parameter>xml</parameter></paramdef> <paramdef>mixed <parameter>user_data</parameter></paramdef> <paramdef>array <parameter><optional>output_options</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-server-add-introspection-data"> <refnamediv> <refname>xmlrpc_server_add_introspection_data</refname> <refpurpose>Adds introspection documentation </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>xmlrpc_server_add_introspection_data</function></funcdef> <paramdef>resource <parameter>server</parameter></paramdef> <paramdef>array <parameter>desc</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-parse-method-descriptions"> <refnamediv> <refname>xmlrpc_parse_method_descriptions</refname> <refpurpose>Decodes XML into a list of method descriptions </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>array <function>xmlrpc_parse_method_descriptions</function></funcdef> <paramdef>string <parameter>xml</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-set-type"> <refnamediv> <refname>xmlrpc_set_type</refname> <refpurpose>Sets xmlrpc type, base64 or datetime, for a PHP string value </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>xmlrpc_set_type</function></funcdef> <paramdef>string <parameter>value</parameter></paramdef> <paramdef>string <parameter>type</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> <refentry id="function.xmlrpc-get-type"> <refnamediv> <refname>xmlrpc_get_type</refname> <refpurpose>Gets xmlrpc type for a PHP value. Especially useful for base64 and datetime strings </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>xmlrpc_get_type</function></funcdef> <paramdef>mixed <parameter>value</parameter></paramdef> </funcprototype> </funcsynopsis> &warn.experimental.func; <para> &warn.undocumented.func; </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 --> Index: phpdoc/kr/functions/zip.xml +++ phpdoc/kr/functions/zip.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <reference id="ref.zip"> <title>Zip File Functions (Read Only Access)</title> <titleabbrev>Zip</titleabbrev> <partintro> <para> This module uses the functions of the <ulink url="&url.zziplib;">ZZIPlib</ulink> library by Guido Draheim to transparently read ZIP compressed archives and the files inside them. </para> <para> Please note that ZZIPlib only provides a subset of functions provided in a full implementation of the ZIP compression algorithm and can only read ZIP file archives. A normal ZIP utility is needed to create the ZIP file archives read by this library. </para> <para> Zip support in PHP is not enabled by default. You will need to use the <link linkend="install.configure.with-zip">--with-zip</link> configuration option when compiling PHP to enable zip support. This module requires ZZIPlib version &gt;= 0.10.6. </para> <note> <para> Zip support before PHP 4.1.0 is experimental. This section reflects the Zip extension as it exists in PHP 4.1.0 and later. </para> </note> <sect1 id="zip-example"> <title>Example Usage</title> <para> This example opens a ZIP file archive, reads each file in the archive and prints out its contents. The <filename>test2.zip</filename> archive used in this example is one of the test archives in the ZZIPlib source distribution. </para> <example> <title>Zip Usage Example</title> <programlisting role="php"> <![CDATA[ <?php $zip = zip_open("/tmp/test2.zip"); if ($zip) { while ($zip_entry = zip_read($zip)) { echo "Name: " . zip_entry_name($zip_entry) . "\n"; echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n"; echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "\n"; echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "\n"; if (zip_entry_open($zip, $zip_entry, "r")) { echo "File Contents:\n"; $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); echo "$buf\n"; zip_entry_close($zip_entry); } echo "\n"; } zip_close($zip); } ?> ]]> </programlisting> </example> </sect1> </partintro> <refentry id="function.zip-close"> <refnamediv> <refname>zip_close</refname> <refpurpose>Close a Zip File Archive</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>zip_close</function></funcdef> <paramdef>resource <parameter>zip</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Closes a zip file archive. The parameter <parameter>zip</parameter> must be a zip archive previously opened by <function>zip_open</function>. </para> <para> This function has no return value. </para> <para> See also <function>zip_open</function> and <function>zip_read</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-close"> <refnamediv> <refname>zip_entry_close</refname> <refpurpose>Close a Directory Entry</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>void <function>zip_entry_close</function></funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Closes a directory entry specified by <parameter>zip_entry</parameter>. The parameter <parameter>zip_entry</parameter> must be a valid directory entry opened by <function>zip_entry_open</function>. </para> <para> This function has no return value. </para> <para> See also <function>zip_entry_open</function> and <function>zip_entry_read</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-compressedsize"> <refnamediv> <refname>zip_entry_compressedsize</refname> <refpurpose>Retrieve the Compressed Size of a Directory Entry</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>zip_entry_compressedsize</function></funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the compressed size of the directory entry specified by <parameter>zip_entry</parameter>. The parameter <parameter>zip_entry</parameter> is a valid directory entry returned by <function>zip_read</function>. </para> <para> See also <function>zip_open</function> and <function>zip_read</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-compressionmethod"> <refnamediv> <refname>zip_entry_compressionmethod</refname> <refpurpose> Retrieve the Compression Method of a Directory Entry </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>zip_entry_compressionmethod</function> </funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the compression method of the directory entry specified by <parameter>zip_entry</parameter>. The parameter <parameter>zip_entry</parameter> is a valid directory entry returned by <function>zip_read</function>. </para> <para> See also <function>zip_open</function> and <function>zip_read</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-filesize"> <refnamediv> <refname>zip_entry_filesize</refname> <refpurpose> Retrieve the Actual File Size of a Directory Entry </refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>int <function>zip_entry_filesize</function></funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the actual size of the directory entry specified by <parameter>zip_entry</parameter>. The parameter <parameter>zip_entry</parameter> is a valid directory entry returned by <function>zip_read</function>. </para> <para> See also <function>zip_open</function> and <function>zip_read</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-name"> <refnamediv> <refname>zip_entry_name</refname> <refpurpose>Retrieve the Name of a Directory Entry</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>zip_entry_name</function></funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Returns the name of the directory entry specified by <parameter>zip_entry</parameter>. The parameter <parameter>zip_entry</parameter> is a valid directory entry returned by <function>zip_read</function>. </para> <para> See also <function>zip_open</function> and <function>zip_read</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-open"> <refnamediv> <refname>zip_entry_open</refname> <refpurpose>Open a Directory Entry for Reading</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>bool <function>zip_entry_open</function></funcdef> <paramdef>resource <parameter>zip</parameter></paramdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> <paramdef>string <parameter><optional>mode</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Opens a directory entry in a zip file for reading. The parameter <parameter>zip</parameter> is a valid resource handle returned by <function>zip_open</function>. The parameter <parameter>zip_entry</parameter> is a directory entry resource returned by <function>zip_read</function>. The optional parameter <parameter>mode</parameter> can be any of the modes specified in the documentaion for <function>fopen</function>. </para> <note> <para> Currently, <parameter>mode</parameter> is ignored and is always <literal>"rb"</literal>. This is due to the fact that zip support in PHP is read only access. Please see <function>fopen</function> for an explanation of various modes, including <literal>"rb"</literal>. </para> </note> <para> Returns &true; on succes or &false; on failure. </para> <note> <para> Unlike <function>fopen</function> and other similar functions, the return value of <function>zip_entry_open</function> only indicates the result of the operation and is not needed for reading or closing the directory entry. </para> </note> <para> See also <function>zip_entry_read</function> and <function>zip_entry_close</function>. </para> </refsect1> </refentry> <refentry id="function.zip-entry-read"> <refnamediv> <refname>zip_entry_read</refname> <refpurpose>Read From an Open Directory Entry</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>string <function>zip_entry_read</function></funcdef> <paramdef>resource <parameter>zip_entry</parameter></paramdef> <paramdef>int <parameter><optional>length</optional></parameter> </paramdef> </funcprototype> </funcsynopsis> <para> Reads up to <parameter>length</parameter> bytes from an open directory entry. If <parameter>length</parameter> is not specified, then <function>zip_entry_read</function> will attempt to read 1024 bytes. The parameter <parameter>zip_entry</parameter> is a valid directory entry returned by <function>zip_read</function>. </para> <note> <para> The <parameter>length</parameter> parameter should be the uncompressed length you wish to read. </para> </note> <para> Returns the data read, or &false; if the end of the file is reached. </para> <para> See also <function>zip_entry_open</function>, <function>zip_entry_close</function> and <function>zip_entry_filesize</function>. </para> </refsect1> </refentry> <refentry id="function.zip-open"> <refnamediv> <refname>zip_open</refname> <refpurpose>Open a Zip File Archive</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>zip_open</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Opens a new zip archive for reading. The <parameter>filename</parameter> parameter is the filename of the zip archive to open. </para> <para> Returns a resource handle for later use with <function>zip_read</function> and <function>zip_close</function> or returns &false; if <parameter>filename</parameter> does not exist. </para> <para> See also <function>zip_read</function> and <function>zip_close</function>. </para> </refsect1> </refentry> <refentry id="function.zip-read"> <refnamediv> <refname>zip_read</refname> <refpurpose>Read Next Entry in a Zip File Archive</refpurpose> </refnamediv> <refsect1> <title>Description</title> <funcsynopsis> <funcprototype> <funcdef>resource <function>zip_read</function></funcdef> <paramdef>resource <parameter>zip</parameter></paramdef> </funcprototype> </funcsynopsis> <para> Reads the next entry in a zip file archive. The parameter <parameter>zip</parameter> must be a zip archive previously opened by <function>zip_open</function>. </para> <para> Returns a directory entry resource for later use with the <function>zip_entry_...</function> functions. </para> <para> See also <function>zip_open</function>, <function>zip_close</function>, <function>zip_entry_open</function>, and <function>zip_entry_read</function>. </para> </refsect1> </refentry> </reference> <!-- 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:"../../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 -->
« previous php.doc (#969340775) next »