Studs MVC Framework+ 0.9.7 review

Download
by rbytes.net on

Studs MVC Framework+ contains a port of Apache's Jakarta Struts to PHP, though the libraries included in the rest of the project are

License: GPL (GNU General Public License)
File size: 0K
Developer: Dan Allen
0 stars award from rbytes.net

Studs MVC Framework+ contains a port of Apache's Jakarta Struts to PHP, though the libraries included in the rest of the project are much more vast.

In order to implement the Struts port, it was necessary to build a core, object-oriented API in the style of the JDK and the Jakarta Commons, a servlet container to handle HTTP requests and to invoke servlet classes, and finally, a parsing engine for JSP-style template pages.

In the end, the result is an environment which is very similar to that provided by a J2EE Web Container, only everything is implemented in PHP.

While it was possible to carry over many of the concepts, designs and mechanisms from J2EE, some limitations do exist due to the nature of the PHP programming language, such as the lack of checked exceptions (runtime only).

Horizon: An Object-Oriented Environment and API

Horizon bootstraps PHP, cloaking it with a core object layer and adding missing functionality, such as imports based on qualified classname, classloading, runtime exception handling, logging, reflection, iterator language constructs and common libraries, such as an XML Digester. Once horizon takes over, the whole nature of programming in PHP changes dramatically.

Stratus: An HTTP Servlet Container

Stratus brings the servlet model to PHP. The two core features are the web.xml parsing and the doService() method call. PHP hands off what it knows about the request to the Stratus HTTP processor and it dispatches the request to a servlet mapped to the URL pattern, paralleling the workflow of Java Servlets. One crucial aspect of Stratus is that it retains state from one page request to the next by use of PHP's serialization, despite claims that PHP is incapable of this task.

Phase: PHP Server Pages Engine

The most exciting part about this project is the JSP compatible parser and compilation engine. There are a horde of templating engines for PHP, but nothing has topped JSP custom tag libraries when it comes to flexibility, ease of use and integration with the business layer. Phase is a servlet which parses regular JSP syntax, with the exception of scriptlets, which are handled by the PHP parser. Phase also ships with a handful of JSTL-like core tab libraries for data manipulation and output, supporting a full implementation of EL.

Studs proves that PHP is a very capable object-oriented language and that it is possible to use best design practices despite limitations in the language. The runtime exception handling layer should be proof that anything is possible.

The reason I really like PHP is because the core functions are so rich that under the covers, PHP can do operations very efficiently, relying on interfaces to hide the implementation details.

What's New in This Release:
Automatic reload of Studs configuration file if changed [Studs]
improved handling of DTD validation for web.xml and struts-config.xml
get_qualified_class() migrated to Clazz::getQualifiedName() and optimized [Horizon]
umask() behaves consistently, globally setting the file create permissions [General]
confirmed that the ternary operator works in EL and documented it [Phase]
throw exception if web.xml cannot be read in the include path [Stratus]
it is possible to eliminate index.php from URL and use mod_rewrite instead [Stratus]
modified EL processing so that arrays can be referenced as foo.bar or foo[bar] so that cases where native arrays are used in place of HashMap will still comply with JSTL EL syntax [Phase]
changed from Hashtable to HashMap across application [General]
changes are detected in the Studs config files (struts-config.xml) and the ActionServlet is automatically reloaded if their timestamps have been modified [Studs]
fixed bug in Assert that caused assertFalse() to fail [Horizon]
reimplemented the phase string taglib [Phase]
fixed token handling in form taglib so that now they are usable [Studs]
redirect taglib can take url as body [Phase]
enabled more flexibility in specifying configuration directories [General]
halt with better message when servlet work directory is not writable [Stratus]
enabled handling of multivalued paramaters in Studs [Studs]
added HtmlCheckboxTag and HtmlPasswordTag [Studs]
ActionForm generator [Studs]

Studs MVC Framework+ 0.9.7 search tags