I run my development setup is on a windows machine running apache as my test server and using eclipse as my workbench. Im in the process of build a system for a group I belong to. I have been attempting to use module_load_include to ensure an include file is loaded before I call a function in it. After a bit of trial and error I managed to get the parameters correct for what I wanted but the module in question still wouldnt load. On running it through eclipse debug I found what appears to be a problem, module_load_include constructs a file name using the following

$file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type";

When you look at the result the part from DRUPAL_ROOT comes back with back slashes as you would expect with a windows setup but the bit returned by drupal_get_path comes back with a forward slash as you would expect from a unix/linux environment. The following is_file fails and the require_once is not executed.

Have I missed something does is_file accept mixed slashes in file paths and I just haven't got my call incorrect or is there a genuine problem here.

Comments

Jaypan’s picture

No clue (I don't use windows), but you should probably append 'on Windows' to the thread title, both to make it clear for people seeing it now, and for people searching in the future with the same issue.

septesian’s picture

Have resolved issue 2 characters in file name swapped. Looks like is_file in a php running under windows copes with mixture of slash separators.