Ejecutar scripts de Drupal desde subdirectorios
Hay ocasiones en las que queremos crear un script en subdirectorio, por ejemplo en:
/var/mydomain/httpdocs/mydir/hola.php
y que ejecute funciones de Drupal, no vale simplemente con incluir el bootstrap es necesario realizar un chdir previo.
$base_dir = $_SERVER['DOCUMENT_ROOT'];
chdir($base_dir);
require_once "./includes/bootstrap.inc";
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

Permissions beyond the scope of this license may be available at http://phpia.net/contact

Enviar un comentario nuevo