Please follow this guide when attempting to diagnose problems with the
php.MVC Web application framework. Following this procedure should ensure
that you get a quicker fix for your problem, and save valuable time for
those trying to help you.
Before requesting help, check the forum and mailing list for posts of
similar problems. The problem you are having may already have been answered,
which could save you time.
Read any error messages that are displayed. The message is usually
trying to tell you something about what is wrong, and can give you
valuable clue in pin-pointing the error.
Please try to be a precise as possible when describing your problem.
Give a brief description of your setup, and the contents of any error
messages displayed.
What version or CVS snapshot of the php.mvc library are you currently
using? State this when asking for help.
Try using the latest version of the php.MVC library, available from
the CVS directory. Your problem may have been fixed in the latest release.
This will also assist with diagnosing any errors, thus providing
a quicker fix to your problem.
The Digester is a component of the php.MVC Web application framework
that is responsible for processing the phpmvc-config.xml
application XML files and serialising the configuration information. The Digester
is only called when the phpmvc-config.xml for a
particular application has been modified (touched). The application configuration
data is stored in the phpmvc-config.data file within
the WEB-INF directory.
Check if the phpmvc-config.data file is present in
the WEB-INF directory.
The phpmvc-config.data file should contain something
like:
"O:17:"applicationconfig":14:{s:7:"classID";s:53:"ApplicationConfig:
..."
The phpmvc-config.data file must also be writable by the
Web server.
This section requires making some minor changes to the php.MVC library files.
It would be a good idea to make a backup of the files listed below, so the
original files can easily be restored when testing is complete.
Tracing the Digester class:
To trace errors relating to the Digester and XML processing, setup
debugging in the Digester class constructor:
../phpmvc-base/WEB-INF/lib/digester/Digester.php
In the Digester constructor, set isDebugEnabled
to True.
Eg:
function Digester($file=NULL) {
...
$this->log->setLog('isDebugEnabled', True);
...
}
The output viewed in a text editor should look something like:
Debug: addRuleSet() with no namespace URI
Debug: Start Element handler - Pushing body text ''
Debug: New match 'phpmvc-config'
...
Be sure to make a change (touch) to the phpmvc-config.xml
file for your application, to trigger the Digester operation.
Look for any reported errors in this output, and send this debug dump if
requested.
Tracing the ActionServer class:
The ActionServer class is part of the framework controller, and initially
processes a HTTP request before passing the request on to the RequestProcessor
class. The ActionServer also calls the Digester if the applications XML
configuration file has changed and needs to be processed.
To trace errors relating to the ActionServer class, setup
debugging in the ActionServer class constructor:
../phpmvc-base/WEB-INF/classes/phpmvc/action/ActionServer.php
In the ActionServer constructor, set debug and tracing to True
.
Eg:
Be sure to make a change (touch) to the phpmvc-config.xml
file for your application, to trigger the Digester operation.
Look for any reported errors in this output, and send this debug dump if
requested.
Tracing the RequestProcessor class:
To trace errors relating to the RequestProcessor class, setup
debugging in the RequestProcessor class constructor:
../phpmvc-base/WEB-INF/classes/phpmvc/action/RequestProcessor.php
In the RequestProcessor constructor, set debug and tracing to
True
Eg:
Application Paths.
The php.MVC library and application paths are set in the application
Main.php file. These are absolute paths
to the php.MVC library directory and the application directory. They are
not relative or Web paths. Also note that no trailing slash is required
after the directory name . An example paths statement is shown below:
/* ---------- Application Paths ---------- */
// Set php.MVC library root directory
$appServerRootDir = 'D:/Dev/PHP/phpmvc-base';
// Set the application path
$moduleRootDir = 'C:/WWW/MyApplication';
/* ---------- Application Paths ---------- */
Operating System Type.
The framework attempts to automatically detect the type of server the php.MVC
application is running on. This will usually be either Unix/Linux or Windows.
The framework will then compile the necessary path environment string with
the correct separator character for the host operating system used.
If you get file path errors, try setting the $osType
variable in the applications Main.php
file to the correct server OS. Eg:
$osType = 'WINDOWS';
or
$osType = 'UNIX'
You can also display the path string if necessary by accessing the
$cPath variable in Main.php
as follows:
Have any other library files been changed? State this when asking for help.
Is the problem related to a third-party Plug-In, like Smarty or phpTAL.
If so, it may be quicker to check the Web site and resources provided
by the particular third-party vendor.