phpPhrasebook is an implementation, by Andrew Barilla
of the Phrasebook Pattern as outlined in
by Yonat Sharon and Rani Pinchuk. It is based on the Perl module,
It uses the same file format for the XML files and has much of the same functionality.
What is the Phrasebook Pattern?
To fully understand the functionality of phpPhrasebook you should read
The Phrasebook Pattern.
But briefly, a phrasebook is an XML document detailing text such as error messages or SQL statements.
This provides two major advantages of embedding text within the code. First, much as a templating system separates
ths display from the logic, this separates the text from the logic. In the instance of using a phrasebook
for SQL statements, one could have a DBA handle the XML document without them needing to dig through code
for SQL statements. Second, it allows for multiple "dictionaries." There can be multiple dictionaries in each
phrasebook allowing for the easy switching between languages be it English and Spanish or MySQL and PostgreSQL.