Web:Extend documentation (deprecated by the guide)

Loïc Hoguin

Anthony Ramine

Youssef Leulmi

HEAD

This work is licensed under a Creative Commons Attribution 3.0 Unported License.

Abstract

Web:Extend is a simple yet powerful PHP5 API that makes web development easy.


Table of Contents

1. Introduction
Philosophy
Simplicity
Small and efficient framework
Developers, developers, developers
Goals
2. Getting started
Requirements
Installation
Directory layout
Small application layout
Modular layout
Third party libraries
Database versioning
Hello, world
3. Core component
Predefined classes, constants and functions
Classes
Constants
Functions
Interfaces
Autoload
Exceptions
Default exception handling
Safely throwing exceptions
Catching PHP errors
Recommended practices
Server log
Log format
Native language support
Options
Translation files
4. Access control lists module
5. Application controller module
MVC architecture
Separation of concerns
Data flow
Dependencies
Configuration
File format
Configuration namespaces
Application configuration
Application drivers
Events
Setup and access control
Writing events
Template files
Forwarding events
Routing
Route translation
Fail-safe routing
Custom routes
Taconite for AJAX integration
Usage
Alongside forms
Limitations
6. Authentication module
Database table driver
LDAP driver
Hash-based authentication
7. Caching module
8. Database access layer module
Connection
With the application module
Without the application module
Query
The query method
The queryValue method
Retrieving the last primary key ID created
Retrieving the number of affected rows
SQL results
Counting rows
Fetching rows
Custom row class
Prepared statements
Initialization
Execution
Retrieving the number of affected rows
9. Database metadata access layer module
Common interface for all meta objects
Retrieving an object's name
Schemas
Fetching the schema list
Checking whether a schema exists
Fetching a specific schema
Retrieving the name of an object's schema
Schemas and qualified names
Tables
Fetching the table list
Checking whether a table exists
Fetching a specific table
Retrieving the name of an object's table
Columns
Fetching a table's columns list
Checking whether a column exists in a table
Fetching a given column from a table
Checking whether a column has a default value
Retrieving the expression of the default value
Checking whether a column is nullable
Retrieving the position of a column in the table
Generating a validator for a column
Primary keys
Checking whether a table has a primary key
Fetching the primary key of a table
Fetching the names of the columns of a primary key
Foreign keys
Fetching a table's foreign keys list
Checking whether a foreign key exists in a table
Fetching a given foreign key from a table
Fetching the names of the columns of a foreign key
Retrieving the name of the referenced table
Retrieving the name of the referenced schema
Retrieving the names of the referenced columns
Commentable objects
Checking whether a database object is commentable
Retrieving the comment of a database object
10. Forms module
Form file format
Header
Widgets
Embedded XHTML
Usage
Form helpers
Form key protection
Target action
Filling values
XPATH queries
Data validation
Filtering data
Validating data
Error handling
Widgets reference
Fieldset container
Writable widgets
Selectable
Buttons
Output customization
Loading user stylesheets
Overriding default rules
11. HTTP module
Cookies
With the application module
Without the application module
Setting cookies
Deleting cookies
File upload
Files and arrays of files
Accessing a specific file
Iterating through the uploaded files
Error handling
Retrieving file information
Moving the uploaded file
Full upload handling example
Sessions
With the application module
Without the application module
Obtaining the user's IP address
Storing the session data in a database
Compability with $_SESSION
12. LDAP module
LDAP directories
Distinguished name
Base DN
Example entry
Example of a directory information tree
Connection without the application module
Rebinding
Cloning
Closing the connection
Manipulation
Escaping a DN
Comparing attribute values
Inserting
Modifying
Deleting
Copying
Moving
Renaming
Query
Escaping a filter
Fetching
Listing
Searching
Results
Counting
Sorting
Fetching
Entries
Retrieving the entry's DN
Reading and writing attributes
Iterating over the entry's attributes
Converting to an array
13. Localization module
Locale map
Locale selection based on the HTTP headers
Locale selection based on the URL
Manual locale selection
14. Mail module
Sending emails
Usage
Using templates
Debugging
Fetching emails
Connection
Fetching messages
Reading messages
Downloading attachments
15. Model module
Fat models are sexier
Sets and models
Set
Model
Database model
Set
Model
Defining the database used
Database scaffolding
Counting
Fetching
Custom results order
Joins
Subsets
Deleting
Inserting
Updating
Performance
16. Output module
Switching output
Output control
Templates
Usage
Safe link generation
Rendering
PDF output
Why LaTeX?
Usage
LaTeX resources
17. Unit testing module
Writing test cases
Functions reference
Extended data functions
18. Validators module
Usage
Form validators
Custom validators
19. Tools
Makefile
make all
make lint
make api
make test
make clean
make fclean
make todo
Addons manager
API generator
CLI test suite runner
Usage
Code coverage analysis
QUnit test suite runner
Writing QUnit tests
QUnit reference

List of Tables

3.1. Logical exceptions
3.2. Runtime exceptions
5.1. List of configuration targets
5.2. Parameters for application configuration
5.3. Server-side taconite supported commands
10.1. Main nodes in a form file
10.2. Header nodes in a form file
10.3. Widget nodes in a form file
10.4. Selectable widget-specific nodes in a form file
10.5. Widget nodes reference
10.6. Nodes for the fieldset widget
10.7. Nodes for the textarea widget
10.8. textarea widget-specific nodes
10.9. Nodes for the textbox widget
10.10. textbox widget-specific nodes
10.11. Nodes for the password widget
10.12. Nodes for the hidden widget
10.13. Nodes for the fileinput widget
10.14. fileinput widget-specific nodes
10.15. Nodes for the checkbox widget
10.16. Nodes for the checklist widget
10.17. Nodes for the choice widget
10.18. choice widget-specific nodes
10.19. Nodes for the radiobox widget
10.20. Nodes for the buttons
14.1. Options for weeFetchMail
17.1. Test functions reference
18.1. Standard validators