i am using a single php-file Drupal bootstrap to generate a standalone cronjob PHP file.
Here is my setup (the file resides in a subfolder, thats why i have to build up the base path like this)
/**
* Drupal bootstrap
*/
$path = str_replace("sites/all/modules/custom/my_module/cron",
"", DIRNAME(__FILE__));
define('DRUPAL_ROOT', $path);
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
//require_once DRUPAL_ROOT . '/includes/common.inc';
//require_once DRUPAL_ROOT . '/includes/module.inc';
//require_once DRUPAL_ROOT . '/includes/unicode.inc';
//require_once DRUPAL_ROOT . '/includes/file.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Whenever i am trying to use filebased functions like
$wrapper = file_stream_wrapper_get_instance_by_uri('public://mypath');
$wrapper->realpath();
or
drupal_realpath('public://mypath');
the result is always
bool FALSE
Do you know what i am missing here on my custom bootstrap that file operations do not work?
Thanks
In the meantime i found the solution.
All filepaths are handled relativley internally inside Drupal.
Whenever you are using some Drupal bootstrap inside a file that is not located at the ROOT-directory, make sure to use a:
right before your function calls.