📄 documentation.txt
字号:
PHP Base Library Documentation, Release phplib_7_2 Boris Erdmann, boris@erdmann.com, Kristian K鰄ntopp, kk@netuse.de and Sascha Schumann, sascha@schumann.cx $Id: documentation.sgml,v 1.11 2000/02/24 23:33:02 sasha Exp $ ____________________________________________________________ Table of Contents 1. Quick Start 1.1 License 1.2 Target Group and Prerequisites 1.3 Quick Guide to Installation 1.4 Using core features of PHPLIB 1.5 Testing 2. Overview and Installation 2.1 Files, classes and functions 2.1.1 Customization 2.1.2 Core functionality 2.1.3 Extended functionality 2.1.4 HTML widgets 2.2 Downloading and unpacking the distribution 2.3 Requirements and things to check for 2.3.1 Interpreter requirements 2.3.2 Database requirements 2.3.3 Name space requirements 2.3.4 Year 2000 compliance statement 2.4 Installation procedure 2.5 Using 2.6 PHPLIB with mod_php (Apache module) 3. Core Functionality 3.1 DB_Sql 3.1.1 Instance variables 3.1.2 Instance methods 3.1.2.1 Accessible instance methods 3.1.2.2 Internal instance methods 3.1.3 Example 3.1.4 Additional information about database connections 3.1.5 Using 3.2 Page Management 3.2.1 Accessible Functions 3.2.2 Example 3.2.3 The "cart" feature is gone 3.3 CT_Sql 3.3.1 Instance variables 3.3.2 Example 3.4 CT_Split_Sql 3.4.1 Instance variables 3.4.2 Example 3.5 CT_Shm 3.5.1 Instance variables 3.5.2 Example 3.6 CT_Dbm 3.6.1 Instance variables 3.6.2 Example 3.7 CT_Ldap 3.7.1 Instance variables 3.7.2 Example 3.8 Session 3.8.1 Instance variables 3.8.2 Instance methods 3.8.2.1 Accessible instance methods 3.8.2.2 Internal instance methods 3.8.3 Example 3.8.4 Using "auto_init" 3.8.5 Unregistering variables and deleting sessions 3.8.6 Reading and understanding session data for debugging 3.8.7 How "serialize()" operates 3.9 Auth 3.9.1 Instance variables 3.9.2 Instance methods 3.9.2.1 Accessible instance methods 3.9.2.2 Internal instance methods 3.9.3 Example 3.9.4 Using default authentication 3.9.5 Using Challenge-Response Authentication 3.9.6 The complete guide to authentication and user variables 3.9.6.1 How is the 3.9.6.2 How does 3.9.6.3 How do $sess and $auth interact? 3.9.6.4 Where is the beef? 3.9.6.5 I still do not understand! What am I supposed to code? 3.9.6.6 Ok, I did that and it works. I even understood it. Now, what exactly is that uid used for? 3.9.6.7 But is the uid used internally by PHPLIB? 3.10 Perm 3.10.1 Instance variables 3.10.2 Instance methods 3.10.2.1 Accessible instance methods 3.10.2.2 Internal instance methods 3.10.3 Example 3.10.4 How permissions work 3.11 User 3.11.1 Instance variables 3.11.2 Instance methods 3.11.2.1 Accessible instance methods 3.11.2.2 Internal instance methods 3.11.3 Example 4. Extended functionality 4.1 Cart 4.1.1 Instance variables 4.1.2 Instance methods 4.1.2.1 Accessible instance methods 4.1.3 Example 4.1.4 On using Cart 4.2 Template 4.2.1 Instance variables 4.2.2 Instance methods 4.2.2.1 Accessible instance methods 4.2.2.2 Internal instance methods 4.2.3 Example 5. HTML Widgets Classes 5.1 Sql_Query 5.1.1 Instance variables 5.1.2 Instance methods 5.1.2.1 Accessible instance methods 5.1.2.2 Internal instance methods 5.1.3 Example 5.2 Table and CSV_Table 5.2.1 Instance variables 5.2.2 Instance methods 5.2.2.1 High-level instance methods 5.2.2.2 Mid-level instance methods 5.2.2.3 Low-level instance methods 5.2.3 Example 5.3 Menu 5.3.1 Instance variables 5.3.2 Instance methods 5.3.2.1 Accessible instance methods 5.3.2.2 Internal instance methods 5.3.3 Example 5.4 Form 5.4.1 Using OOH Forms 5.4.2 Customizing OOH Forms 5.5 tpl_form 5.5.1 Instance variables 5.5.2 Instance methods 5.5.2.1 Accessible instance methods 5.5.2.2 Internal instance methods 5.5.3 Example 5.6 Tree 5.6.1 Instance variables 5.6.2 Instance methods 5.6.2.1 Accessible instance methods 5.6.3 The Tree Array 5.6.4 Example 5.6.5 Known Bugs / Tips 5.7 STRINGS2 function set 6. Acknowledgments ______________________________________________________________________ 11.. QQuuiicckk SSttaarrtt The Quick Start chapter tries to give you a ten-minute introduction to PHPLIB installation, outlines a few simple testing procedures and closes with an overview of PHPLIB features. 11..11.. LLiicceennssee PHPLIB consists of the files in this directory and all its subdirectories. It is made available as free software under the LIBRARY GNU General Public license, as spelled out in the file COPYING in this directory. Also, it is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. 11..22.. TTaarrggeett GGrroouupp aanndd PPrreerreeqquuiissiitteess PHPLIB targets the PHP application developer. You need to have good knowledge of the PHP language, at least basic SQL database knowhow and at least basic knowledge on how to operate your web server to be able to use the library. The library will help you to write medium to large sized data-driven web applications. "Medium to large sized applications" are applications that consist of multiple database queries, have to generate tables from database data, need a user interface that generates SQL queries or need a comfortable and user-friendly way to protect pages or functionality on pages. "Data-driven" applications are applications that make use of a supported SQL-database to create HTML content and that use HTML forms to drive database transactions. To make use of the library you obviously need access to a web server with a working installation of a current PHP interpreter (we recommend 3.0.12 or newer for this release of the library) and access to a supported SQL database (currently, PHPLIB supports MySQL, PostgreSQL, mSQL, Oracle 7 and Oracle 8, Sybase, Microsoft SQL Server and ODBC databases). You need to be able to create and drop database tables in that database and your web server must be able to execute SELECT, INSERT, UPDATE and DELETE statements on these tables. Throughout this manual, we assume that you are using the MySQL database server. PHPLIB will run with any supported SQL server, but we are using MySQL in the development of PHPLIB. PHPLIB can be used in conjunction with the CGI version of PHP and with mod_php, integrated into Apache. Usage of the CGI version has an impact on overall speed, because you cannot take advantage of persistent database connection. We recommend the Apache module over the CGI version, although we personally use the CGI version for various reasons (easier to update and can be run with Apache suexec). PHP 4 is still in beta. We do not support deployment of this library with beta software. 11..33.. QQuuiicckk GGuuiiddee ttoo IInnssttaallllaattiioonn These instructions apply to PHPLIB running with CGI PHP. Most of them are valid for mod_php as well, though. _V_E_R_Y _I_M_P_O_R_T_A_N_T _N_O_T_E_: This is a quick installation guide to get you started if you have an installation where you control the web server, PHP interpreter and database server completely. They are not suitable for a web hosting setup where you have only limited to no control over the installation. Refer to Chapter 2 of this documentation for the complete installation instructions and troubleshooting information. Before installing PHPLIB, get your web server up and running and have it executing files with the extension .php3. Check that with a simple <?php phpinfo() ?> script. Make sure the web server accepts index.php3 as well as index.html as a default file for URLs ending in "/" (Apache: DirectoryIndex index.html index.php3). Get your MySQL database server up an running. Create an empty database for your application and make sure the owner of your web server processes can access this database with SELECT, INSERT, UPDATE and DELETE access. Don't forget the mysqladmin reload after changing the user and db tables. SStteepp 11 Create an include directory named php parallel to your web servers document root directory. Do not put the include directory below your web servers document root. SStteepp 22 Unpack your PHPLIB distribution. Move the contents of the php distribution directory into the php directory you just created. SStteepp 33 Get to the php3.ini file for your web servers PHP interpreter and update the include_path statement so that it points to that php directory. Update the auto_prepend_file statement so that it points to the prepend.php3 file in that include directory. If you do not have control over your php3.ini file, you did not read the _V_E_R_Y _I_M_P_O_R_T_A_N_T _N_O_T_E above. SStteepp 44 Also check that track_vars are enabled and that you have enabled magic_quotes_gpc. While you are at it, you might want to check sendmail_path, if you plan to send mail from your application. It has to be set to /usr/lib/sendmail -t on most UNIX systems to work. If you do not have control over your php3.ini file, you did not read the _V_E_R_Y _I_M_P_O_R_T_A_N_T _N_O_T_E above. SStteepp 55 cd into the php include directory. Edit local.inc. In class DB_Example supply the appropriate parameters for your database connection. SStteepp 66 For this database, run create_database.mysql from the distribution to create active_sessions and auth_user. auth_user will be populated with a sample user named kris with a password test. SStteepp 77 Move the contents of the pages directory and all its subdirectories into your document root directory.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -