1
BradM
A "user directory" for hacked files
  • 2004/1/7 1:34

  • BradM

  • Just popping in

  • Posts: 78

  • Since: 2003/8/14


I used to help out with an open source perl-based flat-file portal system. One idea we came up with was to create a "user_lib" directory (I can't say the idea was original, but I haven't seen it in too many places).

The portal script first checks for the existence of a particular library file in this directory; if it isn't there, it uses the one in the default installation.

For example, if I hacked away at functions.php, I would upload the modified file into my user_lib directory. XOOPS then looks there first for the file, and uses it, rather than the copy within the /include directory. If I decide to remove the hack, I just remove the file from my user_lib directory, and voila, XOOPS uses the one within the /include directory.

In the other portal system, this made it extremely easy to keep track of which files I had hacked, especially when it came time to upgrade to a new version.

I'm not too sure how difficult it would be in a php environment, but in perl all we did was add this line to the bottom of the library files:

if (-e "$scriptdir/user_lib/filename.pl") {require "$scriptdir/user_lib/filename.pl"}


Brad

Login

Who's Online

277 user(s) are online (220 user(s) are browsing Support Forums)


Members: 0


Guests: 277


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits