subdomain woes

I recently wrote a custom php script to catch a grade from Flash (Actionscript2) and pass it to the gradebook. It works fine on my test installation, but when I tried to move it to a subdomain of my production site, I'm getting a failure message from line 1009 of bootstrap.inc. Seems that bootstrap.inc can not find the other include files.

I'm actually thinking that calling a bootstrapped php script from Flash might not be the best way to invoke the gradebook module functions, but I don't know what else to try, and it was working when I run it within a single site installation. Does anyone know the answer to any of the following questions?

  1. Where is the best place to locate a custom script that requires any of the 'include' files?
  2. If I put a script at the drupal installation root, but call it from within a subdomain site, what do I have to do to tell the script which db I'm targeting?
  3. Is there an easier way to call a module function from Flash? From javascript? I'm stuck with AS2, so I'm not using services. Seems that there IS an AS2 implementation of Flash Remoting, but lately I haven't been able to find any documentation for it, so I'm doing this the old fashioned way.

Becky

Login to post comments

Take a look at how arcade does it

HylkeVDS's picture
HylkeVDS - Wed, 2009-10-07 07:15

Maybe you could take a look at how the arcade module (http://drupal.org/project/arcade) handles the posting of scores from flash to drupal? You should be able to use the same code, but instead of writing a score to a highscore table you write a grade to the gradebook.

Hylke


that did it

Becky Kinney - Thu, 2009-10-08 17:31

Hylke,

Thanks for the lead. The solution turned out to be this brilliant snippet from the Arcade module that solved my bootstrapping problems:

if (!function_exists('drupal_get_path')) {
$prefix = "";
while(!file_exists($prefix ."includes/bootstrap.inc")) {
$prefix .= "../";
}
if ($prefix != "") chdir($prefix);
include_once("./includes/bootstrap.inc");
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
chdir(drupal_get_path('module','to_gradebook'));