What is ZenX?
"ZenX" library is an object-oriented implementation of useful routines for data storage and manupulation. Though basics are quite simple and this library can be used by a man with no background in programming, it is still aimed for professional programmers, since main advantages come from overriding and/or extending methods provided herein.
Complete original tutorial is available at http://files.dk-lab.org/zenx/doc/index.html.
See also detailed documentation, example code and live examples at the project home page!
"ZenX" automates several data processing steps: input, verification, storage and retrieval; and also provides handy methods for its visualization and manipulation (like sorters, filters, table cell colorings etc).
ZenX System Requirements
It is implied that ZenX will be run under PHP 5.0 or higher. Correct library work is tested only under Apache 2. In order to run ZenX you MUST have the following packages installed:
php-mysql
php-mbstring
php-gd
Pictures and files are stored externally (not in mysql), by default in "../img" and "../dat" folders respectively. File paths are indicated relatively to user-defined ZenX classes. You must provide read/ write access to these folders for PHP. Default image/files folders paths can be changed by user settings.
Basic ZenX Concepts
This section describes some of the basic ZenX concepts.
Since ZenX engine was designed in a manner to simplify and automate routine data manipulation operations, it is split in several parts. Let's call these parts "Phases" since they represent separate steps in data processing. Typically, data is sent from one page to another, where it undergoes different manupulations. For ZenX, however, this is not the case. Since we want to keep it simple, we want to use only one page for all our activities. So the data is sent back to the same page it comes from. That means we need to distinguish cases when we show data from cases when we accept it. For this purpose different blocks of code are activated on different phases. You can think of them as of "page inside the page".
Though this reference relies heavily of MySQL terminology like records, tables etc. they are not completely equal, since different storage engine may implement different ways to store and organize data. However, since currently ZenX implements only MySQL storage engine, the concepts are very close.
Output Phase
Output or "Listing" Phase activates a block of code that does data retrieval and rendering to the web-page.
On the Output Phase we access out data storage and retrieve set of records matching some predefined criteria. This is phase is actually a result of operator job, whether it is a price list or internet shop goods listing. Settings for this phase supplied to the setParameters() method are mainly starting from the "list" word, showing that they will affect only behaviour and appearance of this phase.
Input Phase
Input Phase activates blocks of code that do data verification,rendering and saving.
The Input Phase is actually a group of smaller phases related to new data entry and editing. Since data editing implies rendering of the old data to screen this phase also deals with data retrieval. However, this time we get only one specific record. Then, once editing or new data input is completed, data is send to the script and again gets into the input phase, but goes different way this time. First it is verified for correctness, and saved to data storage, if no errors are found. Then it is rendered back to screen (this time it shows the new data) again. This smaller cycle: ...->show->get input->verify->save->... is all Input Phase, and is launched inside MainEngineAbstract::runInputCycle() method.