开发者

adding own library in drupal

开发者 https://www.devze.com 2023-03-23 21:42 出处:网络
i want to include a php file .module file like this us开发者_StackOverflow中文版ing hook_init function drupsocial_init() {

i want to include a php file .module file like this us开发者_StackOverflow中文版ing hook_init

function drupsocial_init() {
  require_once base_path().(drupal_get_path('module', 'drupsocial') . '/libraries/dsinvoke.php');

}

but showing this error

Fatal error: require_once() [function.require]: Failed opening required '/drupal6/trunk/sites
/all/modules/drupsocial/libraries/dsinvoke.php' (include_path='.;D:\xampp\php\PEAR') in D:\xampp\htdocs
\drupal6\trunk\sites\all\modules\drupsocial\drupsocial.module on line 32

how can i include such file


You normally can include any file if you know the full path of the file and the file is accessible. Check the path to the library, correct it and you should not have any problem.

Start with the full path to the file first. If that works, you can think about using a dynamic path to the file.


why drupal trying to load the file in the trunk directory ? are you working on a svn repo ? i think there's something wrong with that path.

I also suggest you to check permissions

Hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号