Requirements and things to check for
The PHPlib base library requires a working web server with CGI
capability and the CGI version of PHP 3.0.12 or higher
installed. Alternatively mod_php can be used. Lower
versions of PHP do not work at all: The session class uses the
base64_encode() and base64_decode()
functions which are known to be buggy in lower versions (up to
3.0.7) of the library. Also, the OOH Forms classes are using
constructor syntax, which has been introduced into the PHP
language in 3.0.5 and later versions. An issue with the
$PHP_SELF variable and CGI PHP has been resolved with
version 3.0.5 and later. Perl regular expression functions are
being used in the Template class and these are not really
avilable up to 3.0.12.
Note: If you are using CGI PHP, it must have been
compiled with the --enable-force-cgi-redirect switch for
$PHP_SELF to have the correct value.
Basically, if PHP_SELF is the exact local part of your $URL, all is well.
If it instead contains the modified URL with /your cgi-bin/php prefixed,
you have a buggy version of CGI PHP. Either upgrade your version of PHP or replace all occurrences
of $PHP_SELF with $PATH_INFO in PHPlib
Note: PHPlib requires that you have track_vars
compiled in and enabled.
The PHP base library requires a database connection in the
default setup for storage of session variables, but this can be
circumvented by selection another storage container type at
installation time. Currently, storage containers are available
for SQL databases (the default), SQL databases with limited
string length (ct_split_sql.inc), System V shared
memory (requires a PHP interpreter with SYSVSHM and SYSVSEM
support), LDAP servers (requires a PHP interpreter with LDAP
support), flat files, and DBM files.
Using SQL, currently MySQL is fully supported and PostgreSQL,
mSQL, Sybase, Microsoft SQL Server, ODBC and Oracle have limited
support (the limitation is only relevant if you intend to access
metadata information, i.e. table definitions and the like).
Database interfaces are not difficult to write and you can
easily write your own interface.
You need a database server connection with select,
insert, update and delete privileges from your
CGI environment. You need create and drop privileges
from an administrative account outside your CGI environment as
well.
PHPlib core functionality requires two tables as part of your
application table name space: active_sessions (select,
insert, update and delete privilege required for the application
user) and auth_user (select privilege required for the
application user. insert, update and delete privilege required
for the application user if user management is to be done from
within the application).
Extended functionality may require additional tables.
PHPlib tries to be as name space neutral as possible with its core features.
There is issues no HTML by default and it occupies only few names in the global name space.
These are the class names for the classes defined: DB_Sql, DB_SAM, CT_Sql, Session, Auth, Perm, User
.
Additionally, the classnames DB_Example, Example_CT_Sql, Example_Session,
Example_Auth, Example_Challenge_Auth, Example_Perm and Example_User
are defined by the sample setup in local.inc, but these names can and should
be customized by the application developer.
PHPlib defines the function names
page_open(), page_close, sess_load() and sess_save() for the page management functions.
The global variable $_PHPLIB (a hash) is taken. Only if page_open() is being used,
globals are defined by the library by default, but one global for each "feature" requested in
the page_open() statement is taken. These are at most $sess, $user, $auth and $perm.