• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extending with customer specific files

#1
[eluser]Jocke[/eluser]
Hello,

I've tried to search but didn't really find a solution that I can use so I try to explain it here and hope someone will have a solution or can point me in the right direction.

I have a application that is used by some customers. Some customers have there own folder with this application with some adaptations. This is fine but to easier update the customers whith adaptations version of the application I would like to extend the loader I believe to look at one more folder for specific files (keeping the customized files in one folder outside of the application so I can update the core of my application without harming the customized files or having to diff-merge it).

Example of structure:
/system
/myapplication
... /application
......./controllers
........../main.php
...../views
.....and so on
/customer1
... /application <--- exact copy of /myapplication/application
... /adaptation <--- here I would like to store customer specific files
......./extended_main.php <--- extended version of main.php

So how can I achieve this? If there is a customer specific version of a file (controller, helper, view, model) it gets loaded? Exactly like when I'm extending the core with MY_ files I would hope there is a way to do the same thing with once more with customer files.

Thanks in advanced! :-)

#2
[eluser]pickupman[/eluser]
I would lean in the direction of extending the Loader class. This what is done in the popular HVMC Modular Extensions by wiredesignz. The Loader class looks through a series of folders to try and find what Controller, Library, etc to load.

You would want to extend the code to look into BASEPATH . '/customerX/adaptation' for folders /controllers/, /libraries/, /helpers/, and '/views/' then look into the default location if not found


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.