<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >yaz_connect</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="YAZ Functions" HREF="ref.yaz.html"><LINK REL="PREVIOUS" TITLE="yaz_close" HREF="function.yaz-close.html"><LINK REL="NEXT" TITLE="yaz_database" HREF="function.yaz-database.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP 手册</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.yaz-close.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.yaz-database.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.yaz-connect" ></A >yaz_connect</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN247595" ></A ><P > (PHP 4 >= 4.0.1, PECL)</P >yaz_connect -- Prepares for a connection to a Z39.50 server </DIV ><DIV CLASS="refsect1" ><A NAME="AEN247598" ></A ><H2 >说明</H2 >mixed <B CLASS="methodname" >yaz_connect</B > ( string zurl [, mixed options] )<BR ></BR ><P > This function returns a connection resource on success, zero on failure. </P ><P > <B CLASS="function" >yaz_connect()</B > prepares for a connection to a Z39.50 server. This function is non-blocking and does not attempt to establish a connection - it merely prepares a connect to be performed later when <A HREF="function.yaz-wait.html" ><B CLASS="function" >yaz_wait()</B ></A > is called. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > The <A HREF="http://www.indexdata.dk/yazproxy/" TARGET="_top" >YAZ proxy</A > is a freely available Z39.50 proxy. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN247616" ></A ><H2 >参数</H2 ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><CODE CLASS="parameter" >zurl</CODE ></DT ><DD ><P > A string that takes the form <TT CLASS="literal" >host[:port][/database]</TT >. If port is omitted, port 210 is used. If database is omitted <TT CLASS="literal" >Default</TT > is used. </P ></DD ><DT ><CODE CLASS="parameter" >options</CODE ></DT ><DD ><P > If given as a string, it is treated as the Z39.50 V2 authentication string (OpenAuth). </P ><P > If given as an array, the contents of the array serves as options. <P ></P ><DIV CLASS="variablelist" ><DL ><DT >user</DT ><DD ><P > Username for authentication. </P ></DD ><DT >group</DT ><DD ><P > Group for authentication. </P ></DD ><DT >password</DT ><DD ><P > Password for authentication. </P ></DD ><DT >cookie</DT ><DD ><P > Cookie for session (YAZ proxy). </P ></DD ><DT >proxy</DT ><DD ><P > Proxy for connection (YAZ proxy). </P ></DD ><DT >persistent</DT ><DD ><P > A boolean. If <TT CLASS="constant" ><B >TRUE</B ></TT > the connection is persistent; If <TT CLASS="constant" ><B >FALSE</B ></TT > the connection is not persistent. By default connections are persistent. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > If you open a persistent connection, you won't be able to close it later with <A HREF="function.yaz-close.html" ><B CLASS="function" >yaz_close()</B ></A >. </P ></BLOCKQUOTE ></DIV ></DD ><DT >piggyback</DT ><DD ><P > A boolean. If <TT CLASS="constant" ><B >TRUE</B ></TT > piggyback is enabled for searches; If <TT CLASS="constant" ><B >FALSE</B ></TT > piggyback is disabled. By default piggyback is enabled. </P ><P > Enabling piggyback is more efficient and usually saves a network-round-trip for first time fetches of records. However, a few Z39.50 servers do not support piggyback or they ignore element set names. For those, piggyback should be disabled. </P ></DD ><DT >charset</DT ><DD ><P > A string that specifies character set to be used in Z39.50 language and character set negotiation. Use strings such as: <TT CLASS="literal" >ISO-8859-1</TT >, <TT CLASS="literal" >UTF-8</TT >, <TT CLASS="literal" >UTF-16</TT >. </P ><P > Most Z39.50 servers do not support this feature (and thus, this is ignored). Many servers use the ISO-8859-1 encoding for queries and messages. MARC21/USMARC records are not affected by this setting. </P ></DD ><DT >preferredMessageSize</DT ><DD ><P > An integer that specifies the maximum byte size of all records to be returned by a target during retrieval. See the <A HREF="http://www.loc.gov/z3950/agency/markup/04.html#3.2.1.1.4" TARGET="_top" >Z39.50 standard</A > for more information. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > This option is supported in PECL YAZ 1.0.5 or later. </P ></BLOCKQUOTE ></DIV ></DD ><DT >maximumRecordSize</DT ><DD ><P > An integer that specifies the maximum byte size of a single record to be returned by a target during retrieval. This entity is referred to as Exceptional-record-size in the <A HREF="http://www.loc.gov/z3950/agency/markup/04.html#3.2.1.1.4" TARGET="_top" >Z39.50 standard</A >. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > This option is supported in PECL YAZ 1.0.5 or later. </P ></BLOCKQUOTE ></DIV ></DD ></DL ></DIV > </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN247692" ></A ><H2 >返回值</H2 ><P > A connection resource on success, <TT CLASS="constant" ><B >FALSE</B ></TT > on error. </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN247696" ></A ><H2 >更新日志</H2 ><P > <DIV CLASS="informaltable" ><P ></P ><A NAME="AEN247699" ></A ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >版本</TH ><TH >说明</TH ></TR ></THEAD ><TBODY ><TR ><TD >4.1.0</TD ><TD > The parameter <CODE CLASS="parameter" >options</CODE > was added. </TD ></TR ></TBODY ></TABLE ><P ></P ></DIV > </P ></DIV ><DIV CLASS="refsect1" ><A NAME="AEN247710" ></A ><H2 >参见</H2 ><P > <P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="function.yaz-close.html" ><B CLASS="function" >yaz_close()</B ></A ></TD ></TR ></TBODY ></TABLE ><P ></P > </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.yaz-close.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >起始页</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.yaz-database.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >yaz_close</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.yaz.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >yaz_database</TD ></TR ></TABLE ></DIV ></BODY ></HTML >