wevrem / wcommon
Useful PHP functions and classes
v2.0.11
2019-12-23 04:32 UTC
Requires
- pear/auth_sasl: ^1.1
- pear/html_template_sigma: dev-wevrem-constructor
- pear/mail: ^1.4
- pear/net_smtp: ^1.7
- wevrem/dstruct: ^1.1
README
Common code for templates, forms, and page elements.
wStandard
Functions for handling errors, managing URL's, string and date manipulations, and custom HTML elements.
HTMLComposer
An object for constructing HTML, keeping track of and closing elements as they are added to the pile.
Template
Subclass of HTML_Template_Sigma that adds useful features.
FormBuilder
Class for handling the building and processing of HTML forms.
Using wCommon—A very quick guide
The following are very high level steps (read: bare minimum steps) to setting up a simple blog-like website that uses wCommon and dStruct.
- Set up a server with Apache, PHP and MySQL. Using PEAR, install HTML_Template_Sigma.
- Install wCommon and dStruct on your server, typically in
/usr/share/php
. Adjust PHP'sinclude_path
to point to this location. - Copy the files from the
sample
folder to some location reachable by Apache and set the DocumentRoot to thewww
folder. - Create a database and run the statements in
struct.sql
to create the proper dStruct tables. - Create a user with permissions for that database, and capture those credentials inside
inc-standard.php
. - After editing some internal parameters, run the script
create-user.php
to create an admin user. - At this point you should have a working website that displays posts. You can log in as the admin and create, edit, and delete posts and also upload images and other documents.