14 Mar
2007
14 Mar
'07
2:53 p.m.
Some users keep contributed modules outside the Drupal directory and create symlinks to them in sites/all/modules. This causes problems for Chat Room, which uses a PHP file in its own directory for AJAX updates (to avoid loading all of Drupal on each update) but must include some files from Drupal. I was using the following code to find the Drupal files: $chatroom_base = urldecode($_POST['chatroom_base']); $depth = substr_count($chatroom_base, '/'); chdir(str_repeat('../', $depth+1)); If people are keeping Chat Room outside of Drupal, chdir() will need the absolute path to the Drupal directory. What is the best way to get this?