snytkine / LampCMS

Open source Question and Answer program similar to StackOverflow and Quora in PHP + MongoDB. Follow @snytkine on Twitter
http://support.lampcms.com
323 stars 104 forks source link

Add multi-site support #82

Closed snytkine closed 12 years ago

snytkine commented 12 years ago

Need a way to optionally define full path to directory where all Lampcms classes are located This has to be defined BEFORE using any of the require statements and before instantiating Registry and Ini object because these classes reside in lib dir.

Right now the solution that comes to mind is to add define('LAMPCMS_DIR', '/usr/local/lib/Lampcms'); // point to Lampcms not to 'lib' subdir. Also No leading slash! at the top of !inc.php file

Once defined the autoloader will be passed the correct base path to lib and everything will just work from a single copy of Lampcms - every class including controller classes can be reused between multiple sites.

The concrete site will heed only their own version of !config.ini, index.php, and style dir with own templates inside the !config.ini will have to define path to templates dir (possibly)

snytkine commented 12 years ago

Done. This is now possible by setting custom value of LAMPCMS_LIB_DIR in bootstrap.php