Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

If this is you own script, you could simply convert it into a module. That is easy, just create a module (tons of guides to be found in the internet) and put your functions in the .module file, then they will be available to all other code running on the site.

If this is a script/library provides by someone else, you could either place it in a custom module folder and include it with module_load_include() or (better!) declare it as a library with the help of the Libraries module. You will however need to create a custom module with some code to connect the functions of your script with drupal (Usually implementing the correct hooks and calling your functions from that) for both methods.

See also How do I go about putting standalone PHP files?How do I go about putting standalone PHP files? and How do I load a library defined with hook_library() on node/edit pages?How do I load a library defined with hook_library() on node/edit pages?.

If this is you own script, you could simply convert it into a module. That is easy, just create a module (tons of guides to be found in the internet) and put your functions in the .module file, then they will be available to all other code running on the site.

If this is a script/library provides by someone else, you could either place it in a custom module folder and include it with module_load_include() or (better!) declare it as a library with the help of the Libraries module. You will however need to create a custom module with some code to connect the functions of your script with drupal (Usually implementing the correct hooks and calling your functions from that) for both methods.

See also How do I go about putting standalone PHP files? and How do I load a library defined with hook_library() on node/edit pages?.

If this is you own script, you could simply convert it into a module. That is easy, just create a module (tons of guides to be found in the internet) and put your functions in the .module file, then they will be available to all other code running on the site.

If this is a script/library provides by someone else, you could either place it in a custom module folder and include it with module_load_include() or (better!) declare it as a library with the help of the Libraries module. You will however need to create a custom module with some code to connect the functions of your script with drupal (Usually implementing the correct hooks and calling your functions from that) for both methods.

See also How do I go about putting standalone PHP files? and How do I load a library defined with hook_library() on node/edit pages?.

Source Link
Berdir
  • 83.5k
  • 6
  • 161
  • 207

If this is you own script, you could simply convert it into a module. That is easy, just create a module (tons of guides to be found in the internet) and put your functions in the .module file, then they will be available to all other code running on the site.

If this is a script/library provides by someone else, you could either place it in a custom module folder and include it with module_load_include() or (better!) declare it as a library with the help of the Libraries module. You will however need to create a custom module with some code to connect the functions of your script with drupal (Usually implementing the correct hooks and calling your functions from that) for both methods.

See also How do I go about putting standalone PHP files? and How do I load a library defined with hook_library() on node/edit pages?.