Jump to content

Using multiple applications from single atk directory

From NusaATK
Revision as of 12:10, 14 December 2008 by Samk (talk | contribs)

ATK Howto: Using multiple applications from single atk directory

Complexity: Easy
Author: Olav B. Lygre <soppel@lygre.no>

List of other Howto's

ATK 5

The following procedure is tested on atk 5.6.0 and is used where multiple atk applications are on the same domain. For multiple domains, use symbolic links (*NIX) or junctions (Windows), which is not covered here.

To make multiple atk applications share a common atk directory, there are a couple of steps to take:

  1. Remove the line $config_atkroot="/." in the files: app.php, top.php, index.php, welcome.php, menu.php etc. These files include atk.inc, and the $config_atkroot will be set there.
  2. Edit atk.inc:
    1. Add a $config_approot="./"; before include_once(...)
    2. Change $config_atkroot="../common_code/"
      This path must be relative to config_approot, and must be readable by your webserver and the users browser.
  3. Edit Initial.inc (in atk/include dir) (also edit when updating to a new version of atk):
    1. Change $config_atkroot to $config_approot in include_once($config_atkroot."config.inc.php");
    2. Move same line (include_once($config_approot."config.inc.php")) before '// Auto-register modules' so it read your app modules from the right place
  4. Edit config.inc.php:
    Make sure a $config_module_path = $config_appdir."modules/"; is present
  5. Default you use a atktmp dir in your $config_atkroot dir.
    If your want temp files in your app path add the following to your config.inc.php:
  $config_atktempdir = $config_approot."atktmp/";
  $config_tplroot = $config_approot;
  $config_tplcompiledir = $config_atktempdir."compiled/tpl/";
  $config_tplcachedir = $config_atktempdir."tplcache/";

ATK 6

On ATK 6, the procedure is much simpler.

The following procedure is tested on atk 6.2.0 and is used where multiple atk applications are on the same domain. For multiple domains, use symbolic links (*NIX) or junctions (Windows), which is not covered here.

To make multiple atk applications share a common atk directory, there are a couple of steps to take:

  1. Remove the line $config_atkroot="/." in the files: app.php, top.php, index.php, welcome.php, menu.php etc. These files include atk.inc, and the $config_atkroot will be set there.
  2. Edit atk.inc:
    1. Add a $config_application_dir="./"; before include_once(...)
    2. Change $config_atkroot="../common_code/"
      This path must be relative to config_approot, and must be readable by your webserver and the users browser.