drupal:external_php_scripts_using_drupal_apis

External PHP scripts using Drupal APIs]

Q:I'm stumbling my way through importing some spreadsheets into Drupal and I can use a php script in a node to import with, but my question is how can an external PHP script access Drupal APIs?

A: To utilize the api, you might have something like:

   include_once './includes/bootstrap.inc';
   drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

Which would allow you to use the drupal api - You can take a look at the php files as an example (cron.php, index.php, xmlrpc.php) on how they start off and work from there.

drupal/external_php_scripts_using_drupal_apis.txt · Last modified: 2017/08/05 13:11 by tomgle