本文整理汇总了PHP中drupal_bootstrap函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_bootstrap函数的具体用法?PHP drupal_bootstrap怎么用?PHP drupal_bootstrap使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drupal_bootstrap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
function connect()
{
chdir(DRUPAL_ROOT);
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
set_error_handler('drupal_error_handler');
}
示例2: xcvs_bootstrap
/**
* Bootstrap all of Drupal (DRUPAL_BOOTSTRAP_FULL phase) and set the
* current working directory to the Drupal root path.
*/
function xcvs_bootstrap($xcvs)
{
chdir($xcvs['drupal_path']);
// Bootstrap Drupal so we can use Drupal functions to access the databases, etc.
if (!file_exists('./includes/bootstrap.inc')) {
fwrite(STDERR, "Error: failed to load Drupal's bootstrap.inc file.\n");
exit(1);
}
// Set up a few variables, Drupal might not bootstrap without those.
// Copied from scripts/drupal.sh.
$_SERVER['HTTP_HOST'] = 'default';
$_SERVER['PHP_SELF'] = '/index.php';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_SOFTWARE'] = 'PHP CLI';
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['QUERY_STRING'] = '';
$_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] = '/';
// Set up the multisite directory if necessary.
if ($xcvs['multisite_directory']) {
$_SERVER['HTTP_HOST'] = $xcvs['multisite_directory'];
// Set a dummy script name, so the multisite configuration
// file search will always trigger.
$_SERVER['SCRIPT_NAME'] = '/foo';
}
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
示例3: setUp
protected function setUp()
{
parent::setUp();
// Enfore the settings load in order to overrides the path.inc file
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
$GLOBALS['conf']['path_inc'] = __DIR__ . '/../sf_dic.path.inc';
}
示例4: insert_door_to_drupal
function insert_door_to_drupal($door_id)
{
// set HTTP_HOST or drupal will refuse to bootstrap
$_SERVER['HTTP_HOST'] = 'zl-apps';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$door = new Door();
$door_detail = $door->read(null, $door_id);
$door_nid = null;
$query = new EntityFieldQuery();
$entities = $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'doors')->propertyCondition('status', 1)->fieldCondition('field_door_id', 'value', $door_detail['Door']['id'], '=')->execute();
foreach ($entities['node'] as $nid => $value) {
$door_nid = $nid;
break;
// no need to loop more even if there is multiple (it is supposed to be unique
}
$node = null;
if (is_null($door_nid)) {
$node = new stdClass();
$node->language = LANGUAGE_NONE;
} else {
$node = node_load($door_nid);
}
$node->type = 'doors';
node_object_prepare($node);
$node->title = $door_detail['Door']['door_style'];
$node->field_door_id[$node->language][0]['value'] = $door_detail['Door']['id'];
$node->sell_price = 0;
$node->model = $door_detail['Door']['door_style'];
$node->shippable = 1;
$path = 'door/' . $node->title;
$node->path = array('alias' => $path);
node_save($node);
}
示例5: boot
/**
* Bootstrap Drupal to the specified phase.
*
* @param string $current_phase
*
* @return mixed
*/
public function boot($current_phase)
{
if (!static::$isEnvironmentInitialized) {
self::prepareEnvironment($this->root, $this->serverVars);
}
return drupal_bootstrap(constant($current_phase));
}
示例6: CollectionClass
/**
* Creates a collection object. Optionally can associate it with a single collection with parameter $pid.
*
* @param string $pid The pid of the collection to represent.
* @return CollectionClass
*/
function CollectionClass($pid = null)
{
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (!empty($pid)) {
module_load_include('$php', 'Fedora_Repository', 'ObjectHelper');
$this->collection_object = new ObjectHelper($pid);
}
}
示例7: ObjectEpistemetecHelper
function ObjectEpistemetecHelper()
{
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
module_load_include('php', 'Fedora_Repository', 'ConnectionHelper');
$connectionHelper = new ConnectionHelper();
//$this->fedoraUser = $connectionHelper->getUser();
//$this->fedoraPass = $connectionHelper->getPassword();
}
示例8: initialize
public function initialize(\Boris\Boris $boris, $dir)
{
parent::initialize($boris, $dir);
chdir($dir);
define('DRUPAL_ROOT', $dir);
require_once "{$dir}/includes/bootstrap.inc";
drupal_override_server_variables();
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
示例9: EpistemetecNode
function EpistemetecNode()
{
define('ITEM_DL', 'fedora_obj');
define('COLLECTION_DL', 'fedora_collectiondl');
define('IMAGE_DL', 'img_');
define('AUDIO_DL', 'aud_');
define('VIDEO_DL', 'vid_');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
示例10: Object_Pool
function Object_Pool($object_pool_id = null)
{
module_load_include('nc', 'Object_Pool', '');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (!empty($object_pool_id)) {
$this->object_pool_id = $object_pool_id;
$this->loadDBObjectPool();
$this->loadFedoraObjectPool();
}
}
示例11: bootstrap_drupal_full
function bootstrap_drupal_full()
{
if (!drush_get_context('DRUSH_QUIET', FALSE)) {
ob_start();
}
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (!drush_get_context('DRUSH_QUIET', FALSE)) {
ob_end_clean();
}
parent::bootstrap_drupal_full();
}
示例12: getCacheMode
private function getCacheMode()
{
// Check for a cache mode force from settings.php.
if (variable_get('page_cache_without_database')) {
$cache_enabled = TRUE;
} else {
drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES, FALSE);
$cache_enabled = variable_get('cache');
}
return $cache_enabled;
}
示例13: bootstrapDrupal
/**
* { @inheritdoc }
*/
public function bootstrapDrupal()
{
$this->config['root'] = $this->getDrupalRoot();
$this->validateDrupalRoot($this->config['root']);
// Do a Drush-style bootstrap.
define('DRUPAL_ROOT', $this->config['root']);
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_override_server_variables();
// Bootstrap Drupal.
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
}
示例14: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
// Prevent PHP notice.
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
define('DRUPAL_ROOT', __DIR__ . '/../../../../../..');
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$this->getApplication()->setCatchExceptions(false);
$boris = new Boris();
$boris->setPrompt('oxygen> ');
$boris->start();
}
示例15: drupalize
function drupalize()
{
while (!@stat('./includes/bootstrap.inc')) {
chdir('..');
}
#module_load_include('/includes/bootstrap.inc', 'image', 'includes/bootstrap');
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
// See http://drupal.org/node/211378#comment-924059
#drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
#drupal_cron_run();
}