<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Paradox File Access</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PHP 手册" HREF="index.html"><LINK REL="UP" TITLE="函数参考" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="ovrimos_rollback" HREF="function.ovrimos-rollback.html"><LINK REL="NEXT" TITLE="px_close" HREF="function.px-close.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" 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.ovrimos-rollback.html" ACCESSKEY="P" >上一页</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.px-close.html" ACCESSKEY="N" >下一页</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.paradox" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >CXVII. Paradox File Access</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN166955" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.intro" >简介</A ></H1 ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >警告</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >本扩展模块是<SPAN CLASS="emphasis" ><I CLASS="emphasis" >实验性</I ></SPAN >的。本模块的行为,包括其函数的名称以及其它任何关于此模块的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本扩展模块风险自担。</P ></TD ></TR ></TABLE ></DIV ><P > This module allows to read and write Paradox databases, primary index files and blob files. Write support has been proven to be quite reliable, though due to lack of documentation the produced files may not in any case be readable by other applications. Encrypted databases can be read without specifying a password if pxlib >= 0.5.0 is used. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >注意: </B > This module is also in development and may change, though I don't expect major changes to the API. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.requirements" >需求</A ></H1 ><P > You need at least PHP 5.0.0 and pxlib >= 0.4.4 for the basic set of functions. Some newer functions are only available with pxlib >= 0.6.0. Reading and writing of encrypted databases requires at least pxlib >= 0.5.0. The paradox library (pxlib) is available at <A HREF="http://pxlib.sourceforge.net" TARGET="_top" >http://pxlib.sourceforge.net</A >. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.installation" >安装</A ></H1 ><P > 安装此 PECL 扩展库的信息可在手册中标题为 <A HREF="install.pecl.html" >PECL 扩展库安装</A >的一章中找到。 更多信息如新版本,下载,源文件,维护者信息以及更新日志等可以在这里找到: <A HREF="http://pecl.php.netparadox" TARGET="_top" >http://pecl.php.netparadox</A > </P ><P > Make sure you have pxlib installed before. If you install pxlib from an rpm or debian package, do not forget to install the development package as well. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.configuration" >运行时配置</A ></H1 ><P >本扩展模块在 <TT CLASS="filename" >php.ini</TT > 中未定义任何配置选项。</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.oo-api" >Object oriented API</A ></H1 ><P > The paradox extension provides also an object oriented API. It consists of only one class called paradox_db. Its methods only differ from the functions in its name and of course the missing first parameter. The following table will list all methods and its equivalent functions. <DIV CLASS="table" ><A NAME="paradox.table-class-methods" ></A ><P ><B >表 1. Methods of class paradox_db</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >Name of method</TH ><TH >Equivalent function</TH ></TR ></THEAD ><TBODY ><TR ><TD >Constructor</TD ><TD ><A HREF="function.px-new.html" ><B CLASS="function" >px_new()</B ></A ></TD ></TR ><TR ><TD >Destructor</TD ><TD ><A HREF="function.px-delete.html" ><B CLASS="function" >px_delete()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >open_fp()</B ></TD ><TD ><A HREF="function.px-open-fp.html" ><B CLASS="function" >px_open_fp()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >create_fp()</B ></TD ><TD ><A HREF="function.px-create-fp.html" ><B CLASS="function" >px_create_fp()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >close()</B ></TD ><TD ><A HREF="function.px-close.html" ><B CLASS="function" >px_close()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >numrecords()</B ></TD ><TD ><A HREF="function.px-numrecords.html" ><B CLASS="function" >px_numrecords()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >numfields()</B ></TD ><TD ><A HREF="function.px-numfields.html" ><B CLASS="function" >px_numfields()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_record()</B ></TD ><TD ><A HREF="function.px-get-record.html" ><B CLASS="function" >px_get_record()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >put_record()</B ></TD ><TD ><A HREF="function.px-put-record.html" ><B CLASS="function" >px_put_record()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >retrieve_record()</B ></TD ><TD ><A HREF="function.px-retrieve-record.html" ><B CLASS="function" >px_retrieve_record()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >delete_record()</B ></TD ><TD ><A HREF="function.px-delete-record.html" ><B CLASS="function" >px_delete_record()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >insert_record()</B ></TD ><TD ><A HREF="function.px-insert-record.html" ><B CLASS="function" >px_insert_record()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >update_record()</B ></TD ><TD ><A HREF="function.px-update-record.html" ><B CLASS="function" >px_update_record()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_field()</B ></TD ><TD ><A HREF="function.px-get-field.html" ><B CLASS="function" >px_get_field()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_schema()</B ></TD ><TD ><A HREF="function.px-get-schema.html" ><B CLASS="function" >px_get_schema()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_info()</B ></TD ><TD ><A HREF="function.px-get-info.html" ><B CLASS="function" >px_get_info()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >set_parameter()</B ></TD ><TD ><A HREF="function.px-set-parameter.html" ><B CLASS="function" >px_set_parameter()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_parameter()</B ></TD ><TD ><A HREF="function.px-get-parameter.html" ><B CLASS="function" >px_get_parameter()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >set_value()</B ></TD ><TD ><A HREF="function.px-set-value.html" ><B CLASS="function" >px_set_value()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_value()</B ></TD ><TD ><A HREF="function.px-get-value.html" ><B CLASS="function" >px_get_value()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >get_info()</B ></TD ><TD ><A HREF="function.px-get-info.html" ><B CLASS="function" >px_get_info()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >set_targetencoding()</B ></TD ><TD ><A HREF="function.px-set-targetencoding.html" ><B CLASS="function" >px_set_targetencoding()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >set_tablename()</B ></TD ><TD ><A HREF="function.px-set-tablename.html" ><B CLASS="function" >px_set_tablename()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >set_blob_file()</B ></TD ><TD ><A HREF="function.px-set-blob-file.html" ><B CLASS="function" >px_set_blob_file()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >date2string()</B ></TD ><TD ><A HREF="function.px-date2string.html" ><B CLASS="function" >px_date2string()</B ></A ></TD ></TR ><TR ><TD ><B CLASS="function" >timestamp2string()</B ></TD ><TD ><A HREF="function.px-timestamp2string.html" ><B CLASS="function" >px_timestamp2string()</B ></A ></TD ></TR ></TBODY ></TABLE ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.resources" >资源类型</A ></H1 ><P > <A HREF="function.px-new.html" ><B CLASS="function" >px_new()</B ></A > creates a new Paradox object required by all Paradox functions. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="paradox.constants" >预定义常量</A ></H1 ><P >以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。</P ><P > The following two tables lists all constants defined by the paradox extension. <DIV CLASS="table" ><A NAME="paradox.table-fieldtypes" ></A ><P ><B >表 2. Contants for field types</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >Name</TH ><TH >Meaning</TH ></TR ></THEAD ><TBODY ><TR ><TD >PX_FIELD_ALPHA</TD ><TD >Character data with fixed length</TD ></TR ><TR ><TD >PX_FIELD_DATE</TD ><TD >Date, number of days since 1.1.0000</TD ></TR ><TR ><TD >PX_FIELD_SHORT</TD ><TD >Short integer (2 Bytes)</TD ></TR ><TR ><TD >PX_FIELD_LONG</TD ><TD >Long integer (4 Bytes)</TD ></TR ><TR ><TD >PX_FIELD_CURRENCY</TD ><TD >same as PX_FIELD_NUMBER</TD ></TR ><TR ><TD >PX_FIELD_NUMBER</TD ><TD >Double</TD ></TR ><TR ><TD >PX_FIELD_LOGICAL</TD ><TD >Boolean</TD ></TR ><TR ><TD >PX_FIELD_MEMOBLOB</TD ><TD >Binary large object</TD ></TR ><TR ><TD >PX_FIELD_BLOB</TD ><TD >Binary large object (not supported)</TD ></TR ><TR ><TD >PX_FIELD_FMTMEMOBLOB</TD ><TD >Binary large object</TD ></TR ><TR ><TD >PX_FIELD_OLE</TD ><TD >OLE object (basically a blob, not supported)</TD ></TR ><TR ><TD >PX_FIELD_GRAPHIC</TD ><TD >Graphic (basically a blob, not supported)</TD ></TR ><TR ><TD >PX_FIELD_TIME</TD ><TD >time, number of milli seconds since midnight</TD ></TR ><TR ><TD >PX_FIELD_TIMESTAMP</TD ><TD >timestamp, number of milli seconds since 1.1.0000 </TD ></TR ><TR ><TD >PX_FIELD_AUTOINC</TD ><TD >Auto incrementing interger (like PX_FIELD_LONG)</TD ></TR ><TR ><TD >PX_FIELD_BCD</TD ><TD >Decimal number stored in bcd format (not supported)</TD ></TR ><TR ><TD >PX_FIELD_BYTES</TD ><TD >Array of Bytes with not more than 255 bytes (not supported)</TD ></TR ><TR ><TD >PX_KEYTOLOWER</TD ><TD >Turn all field names into lower case</TD ></TR ><TR ><TD >PX_KEYTOUPPER</TD ><TD >Turn all field names into upper case</TD ></TR ></TBODY ></TABLE ></DIV > <DIV CLASS="table" ><A NAME="paradox.table-filetypes" ></A ><P ><B >表 3. Contants for file types</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >Name</TH ><TH >Meaning</TH ></TR ></THEAD ><TBODY ><TR ><TD >PX_FILE_INDEX_DB</TD ><TD >Indexed database</TD ></TR ><TR ><TD >PX_FILE_PRIM_INDEX</TD ><TD >Primary index</TD ></TR ><TR ><TD >PX_FILE_NON_INDEX_DB</TD ><TD >None indexed database</TD ></TR ><TR ><TD >PX_FILE_NON_INC_SEC_INDEX</TD ><TD >None incremental secondary index</TD ></TR ><TR ><TD >PX_FILE_SEC_INDEX</TD ><TD >Secondary index</TD ></TR ><TR ><TD >PX_FILE_INC_SEC_INDEX</TD ><TD >Incremental secondary index</TD ></TR ><TR ><TD >PX_FILE_NON_INC_SEC_INDEX_G</TD ><TD >Non incremental secondary index</TD ></TR ><TR ><TD >PX_FILE_SEC_INDEX_G</TD ><TD >Secondary index</TD ></TR ><TR ><TD >PX_FILE_INC_SEC_INDEX_G</TD ><TD >Non incremental secondary index</TD ></TR ></TBODY ></TABLE ></DIV > </P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >目录</B ></DT ><DT ><A HREF="function.px-close.html" >px_close</A > -- Closes a paradox database</DT ><DT ><A HREF="function.px-create-fp.html" >px_create_fp</A > -- Create a new paradox database</DT ><DT ><A HREF="function.px-date2string.html" >px_date2string</A > -- Converts a date into a string. </DT ><DT ><A HREF="function.px-delete-record.html" >px_delete_record</A > -- Deletes record from paradox database</DT ><DT ><A HREF="function.px-delete.html" >px_delete</A > -- Deletes resource of paradox database</DT ><DT ><A HREF="function.px-get-field.html" >px_get_field</A > -- Returns the specification of a single field</DT ><DT ><A HREF="function.px-get-info.html" >px_get_info</A > -- Return lots of information about a paradox file</DT ><DT ><A HREF="function.px-get-parameter.html" >px_get_parameter</A > -- Gets a parameter</DT ><DT ><A HREF="function.px-get-record.html" >px_get_record</A > -- Returns record of paradox database</DT ><DT ><A HREF="function.px-get-schema.html" >px_get_schema</A > -- Returns the database schema</DT ><DT ><A HREF="function.px-get-value.html" >px_get_value</A > -- Gets a value</DT ><DT ><A HREF="function.px-insert-record.html" >px_insert_record</A > -- Inserts record into paradox database</DT ><DT ><A HREF="function.px-new.html" >px_new</A > -- Create a new paradox object</DT ><DT ><A HREF="function.px-numfields.html" >px_numfields</A > -- Returns number of fields in a database</DT ><DT ><A HREF="function.px-numrecords.html" >px_numrecords</A > -- Returns number of records in a database</DT ><DT ><A HREF="function.px-open-fp.html" >px_open_fp</A > -- Open paradox database</DT ><DT ><A HREF="function.px-put-record.html" >px_put_record</A > -- Stores record into paradox database</DT ><DT ><A HREF="function.px-retrieve-record.html" >px_retrieve_record</A > -- Returns record of paradox database</DT ><DT ><A HREF="function.px-set-blob-file.html" >px_set_blob_file</A > -- Sets the file where blobs are read from</DT ><DT ><A HREF="function.px-set-parameter.html" >px_set_parameter</A > -- Sets a parameter</DT ><DT ><A HREF="function.px-set-tablename.html" >px_set_tablename</A > -- Sets the name of a table (deprecated)</DT ><DT ><A HREF="function.px-set-targetencoding.html" >px_set_targetencoding</A > -- Sets the encoding for character fields (deprecated)</DT ><DT ><A HREF="function.px-set-value.html" >px_set_value</A > -- Sets a value</DT ><DT ><A HREF="function.px-timestamp2string.html" >px_timestamp2string</A > -- Converts the timestamp into a string. </DT ><DT ><A HREF="function.px-update-record.html" >px_update_record</A > -- Updates record in paradox database</DT ></DL ></DIV ></DIV ></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.ovrimos-rollback.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.px-close.html" ACCESSKEY="N" >下一页</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >ovrimos_rollback</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >上一级</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >px_close</TD ></TR ></TABLE ></DIV ></BODY ></HTML >