A Phrame application comes with its own copy of the Phrame class library. Follow the next steps to install Phrame for any particular Phrame application. Remember Phrame is modeled after Struts, so the directory structure of your Phrame application will be largely similar to that of a Struts (i.e. Java) application.
- Create a root for your Phrame application. For example:
MyDocRoot/MyApp.
IMPORTANT
Ensure that this directory and all its subdirectories are accessible by PHP and your web server.
- Create a
WEB-INF subdirectory directly underneath the application root to hold your application's classes, message resources and module configurations.
- Create a subdirectory
WEB-INF/lib to hold the third party class libraries used by your application. For example: MyDocRoot/MyApp/WEB-INF/lib.
Third party libraries are for example Phrame, PEAR, Adodb and Smarty. Place each library in its own subdirectory to improve maintainability of your application.
- Unpack the Phrame 3 files to the
WEB-INF/lib directory you have just created. This will install Phrame in a subdirectory called phrame.
- Pre 3.1 versions only: Phrame 3 relies on the Log4php package for logging services. Copy this package to the
WEB-INF/lib directory as explained in the Log4php documentation, which is accessible here.
- Create a subdirectory
WEB-INF/classes to hold your custom made classes. For example: MyDocRoot/MyApp/WEB-INF/classes.
Careful planning of the WEB-INF/classes subdirectory structure can significantly improve maintainability of your application. If your class hierarchy is large enough, split up the classes into packages and create a separate subdirectory for each package (this is similar to Java).
- Although not mandatory, it is a good practise to create a separate subdirectory of
WEB-INF for your module configurations (as opposed to storing these in your WEB-INF/classes directory). For example: MyDocRoot/MyApp/WEB-INF/config.
- Pre 3.1 versions: create a bootstrap script to configure and trigger the action server. Version 3.1 onwards: create action server scripts to instantiate and configure the Phrame container and trigger a particular (default or named) action server.