#1220: absolute file path mentioned in exception's message when relative path is
passed to AgaviConfigCache::checkConfig()
--------------------------------+-------------------------------------------
Reporter: johnu...@… | Owner: david
Type: defect | Status: new
Priority: normal | Milestone: 1.0.3
Component: config | Version: 1.0.2
Severity: normal | Keywords:
Has_patch: 0 |
--------------------------------+-------------------------------------------
Steps to reproduce:
1. Add a custom config handler, mentioning the full (from config) path in
the pattern:
{{{
<handler pattern="%core.config_dir%/navigation_structure.xml"
class="IMNavigationStructureConfigHandler"></handler>
}}}
2. Call the {{{AgaviConfigCache::checkConfig()}}} method using a relative
path:
{{{
$struct =
include(AgaviConfigCache::checkConfig('config/navigation_structure.xml'));
}}}
The exception thrown in {{{AgaviConfigCache::executeHandler()}}} has a
message like this:
Configuration file "/home/[...]/app/config/navigation_structure.xml"
does not have a registered handler
which shows the full path of the config file, and this made me think there
were no reason not to match the pattern.
The pattern is not matched because it represents an absolute path, and the
requested file is given as a relative path. I think there may be 2
solutions:
1. absolutize the path of the requested file and maybe forget about the
original requested filename (but maybe there are reasons for keeping
separated the original requested filename and the absolute path...);
2. adjust the exception's message to display the requested filename (but
currently the originally requested filename is not available in
{{{AgaviConfigCache::executeHandler()}}}).
--
Ticket URL: <http://trac.agavi.org/ticket/1220>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5
_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets