Wednesday, February 18, 2009

Setting up a common library container for multiple p.mapper application

p.mapper currently requires to have all PHP and Javascript files inside the main application window. For multiple applications using the same PHP and JS code base this requires a multiple maintenance of these files. Most p.mapper applications differ just in the configuration (config.ini, map file, etc) and the CSS templates, so having them sharing the same libaries makes the maintenance of these applications easier, mainly for applying updates and bug fixes.

One way to work with this is the use of symbolic links. One could e.g. set up in the WWW root a common directory pmapper containing the javascript and incphp directories and symlinking them into the applications' tree. Like the following example

+ pmapper
+ incphp
+ javascript

+ application_1
+ incphp->../pmapper/incphp
+ javascript->../pmapper/javascript
+ application_2
+ incphp->../pmapper/incphp
+ javascript->../pmapper/javascript

While working with symlinks is something typical under UNIX, Windows does not seem to provide this functionality. But in fact, it does, just not well documented. See eg. this article how to work with 'junctions', the equivalent of symlinks under Windows.

No comments:

Post a Comment

Followers