Studs MVC Framework+

Studs began simply as a port of Apache's Jakarta Struts MVC Framework to PHP, though it has turned out to be decidedly more. I started this project to study the internals of J2EE web applications and then to bring these design concepts into the PHP environment. Now it is time the see if the code lives up to this challenge.

Studs Workflow DiagramThe primary goal of this project, apart from being a road tested implementation of the MVC pattern for PHP, is to provide a learning platform for developers looking to give J2EE a try, while at the same time providing a comfortable PHP environment for those people familiar with Java Servlet technology. One way Studs manages this neutral ground is by relying on many of the standard deployment descriptors used in Java Servlets and Struts, including such files as web.xml, struts-config.xml and taglib.tld. By achieving this level of compatibility, existing tools can be leveraged to help develop applications in this environment.

To begin developing with Studs, read over the QuickStart Guide, which describes step-by-step how to acquire Studs and use it to create a basic application.

Out of this little experiment to port Jakarta Struts to PHP grew several supporting projects which help to make PHP "feel" more like a well-rounded object-oriented environment. Additionally, these libraries support the framework and provide a standard API that reflects the essence of the JDK. These projects are introduced below.

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.


OSEtailer (Open Source online rEtailer solutions) is a framework built on top of Studs MVC. It provides a new and exciting MVC that is designed for flexibility in giving the important online business modules to make operating the business fun, enjoyable, and profitable. This framework includes the OSELIB library which is an extension of Studs.


Read what people are saying about Studs!

Listed as one of the top ten PHP frameworks (#6).


I was looking for a framework and found a lot of them. There are a lot of nice projects like cake or php.mvc but I think I fell in love with studs because it is really close to the original J2EE architecture.

Ronny Moreas:

I'm very happy with your Studs project. I've already extended it with a servlet for serving Smarty templates with some classes for intefacing with the studs environment from within the smarty template. The latter is inspired from the Java Velocity/Struts Toolbox library.

Anthony Musselwhite:

Your studs mvc framework is fantastic. I've used struts in java extensively, and was quite pleased to find your version.

I think that your implementation needs to get more visibility! It is so rich from a java developer's perspective.

Studs in Production