我正在使用单个 php 文件 Drupal 引导程序来生成一个独立的 cronjob PHP 文件。
这是我的设置(文件位于子文件夹中,这就是为什么我必须像这样构建基本路径)
/**
* 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);
每当我尝试使用基于文件的功能时
$wrapper = file_stream_wrapper_get_instance_by_uri('public://mypath');
$wrapper->realpath();
或者
drupal_realpath('public://mypath');
结果总是
bool FALSE
你知道我在我的自定义引导程序中缺少什么文件操作不起作用吗?
谢谢