Thats strange. I initially saved the wp-path-info in a file and included this one in the API files to get the right directory where wp-config.php is located:
file_put_contents(dirname(__FILE__).'/leaflet-wp-path.php', '<?php define(\'WP_PATH\',\''.ABSPATH.'\'); ?>');'
and in the API files
Due to compatibility reasons (some hosts don´t allow this kind of file operations) I skipped this solution during development and constructed the path to wp-config.php from the dirname of the file:
$wp_plugin_path_modified = explode('/',dirname(__FILE__),-3);
$wp_path = implode('/', $wp_plugin_path_modified);
I will implement a fallback for v1.2 to include the path from file and if this not exists (which might be on several host which dont permit file based operations) - the above solution is taken instead. I hope that this will increase compatibility with host configuration like yours, although I am aware, that this might also not work for host configurations, which don´t allow the function file_put_contents().
If anyone has an idea for a better solution, I would very much appreciate it :-)