Ister PHP Framework

Whitepaper On Goals And Architecture.

Why again? Sure, there are a lot of frameworks already written and in use, so, why this one? First answer: We needed it for a real life project. Second answer: We found existing frameworks not to fit all our needs. Third answer: Why not?

The goals of Ister PHP Framework are in short: object orientation with some pattern implementation, high flexibility, abstraction as far as meaningful, usage of at least PHP extensions as possible (should run with a PHP interpreter compiled with default configuration plus database), fair performance and ressource usage, usable for any use case as long as it requires a web application.

Features The core features of the Ister PHP Framework are already implemented: utilities to support programming in general, custom logging, encapsulation of HTTP, application class, classes to dynamically configure an application, access control, database anbstraction with drivers for MySQL and PostgreSQL, templating system, automated form processing, session handling. Additional features as of version 0.4.0 will include: components, views, framework class, basic XML support, persistent data object.

Planned features for future versions are: more database drivers, caching, extended XML support, XHTML and later on even XForms widgets and more.

Custom Logging The base class of all Ister PHP Framework classes IsterObject provides a customizable logging facility. User triggered logging messages as well as PHP notices and warnings can be logged via this facility. Classes for logging to STDOUT, file or database are provided. It is easy to extend the base IsterLogger to write own loggers. It is also possible to use different loggers at the same time or to configure certain objects to log via this and others via that logger. The logging facility is powerful but still lightweight.

Components An application using the Ister PHP Framework as of version 0.4.0 is a modular system with any freedom to implement and arrange components. Some components are predifined such as forms but the developer will usually extend abstract components to implement its own. In the future, specialized components for common tasks may be provided as long as a minimum level of abstraction is maintaned.

Components are arranged in views and views are arranged to a single application or "framework". Each view is called by the framework regarding to the incoming HTTP request. A component maintains its own data and may have its own template to render HTML or what data type ever. Components may contain other components up to any level. It is also possible to connect different components to different databases, even to databases of a different vendor. It's all about freedom!

Future versions of the framework will also support remote components like web services.

Templates To separate the model and controller from the view it is common for web applications to use a templating system. With Ister PHP Framework in general it is possible to use any template language as desired. For ease of use the framework comes with its own template language T24.

T24 is a light weight language providing only those features really needed in a template. Beside of the already implemented functions it is not intended to add more since this would only increase complexity and contradict the idea of a template language. Such a language must be easy to use by the designer who has in most cases not the experience of a software developer.

With T24 it is possible not only to write HTML templates but also XML, WAP, plain text or even PDF templates, while the latter task may need advanced experience with PDF format. Nevertheless, it is possible and once again the developer remains free.

Medium Database Abstraction The Ister PHP framework provides a database abstraction layer that does not restrict the developer in any way. First of all, no data model is included. With exception of the SQL logger classes not a single line of SQL has been written. This gives the developer the freedom to use any data model ever. Even in a restricted environment with low database privileges the framework can be used since all SQL queries can be adjusted to this environment.

On the other hand this means the developer in fact has to write all SQL himself. Other frameworks may support the programmer with their own models but for the price of lesser flexibility. Nevertheless the Ister PHP Framework provides some classes that reduce the work signficant, such as the IsterSqlDataObject which can (as of version 0.4.0) easily be mapped to a web form. Other objects help to read and write configuration data using a database transparently.

This kind of medium abstraction also benefits from a good performance. Each line of code must be parsed and interpreted each time the application runs and lesser code results in a shorter parse time. A complete abstraction layer would need much more PHP code to load.

XML For a modern framework XML support is mandatory. The Ister PHP Framework will support XML with standard APIs like XPath, DOM and SAX. Also a lot of classes (as of 0.4.0) use XML configuration files. For example, form to data object mappings, views and even whole applications can be defined by only writing some XML configuration files and a small number of customized classes extending standard classes.

As of version 0.4.0 the Ister PHP Framework provides XML support even for light weight PHP4 environments. The IsterXmlSimpleXMLImpl class for example is a backport implementation of the new PHP5 API SimpleXML.

Porting PHP4 to PHP5 One goal of the Ister PHP Framework is the support of porting applications from PHP4 to PHP5. Usually, this is a trivial task only for very simplistic applications. More complex use cases require some work to make scripts portable. An application written in PHP4 and using the framework should in most cases easily be ported to PHP5 by only installing the PHP5 version of the framework. Please contact Ister.ORG if you need support.

Find the project home page and extended documentation at the framework pages.