当前位置: 首页>>代码示例>>PHP>>正文


PHP drupal_bootstrap函数代码示例

本文整理汇总了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');
 }
开发者ID:ab-k,项目名称:phresco,代码行数:7,代码来源:DrupalBaseclass.php

示例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);
}
开发者ID:haxney,项目名称:versioncontrol_cvs,代码行数:31,代码来源:xcvs-config.php

示例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';
 }
开发者ID:makinacorpus,项目名称:drupal-sf-dic,代码行数:7,代码来源:PathIncReplacementTest.php

示例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);
 }
开发者ID:khaled-saiful-islam,项目名称:zen_v1.0,代码行数:35,代码来源:Door.php

示例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));
 }
开发者ID:bangpound,项目名称:drupal-bridge,代码行数:14,代码来源:Bootstrap.php

示例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);
     }
 }
开发者ID:ratzeni,项目名称:islandora,代码行数:14,代码来源:CollectionClass.php

示例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();
 }
开发者ID:ratzeni,项目名称:epistemetec,代码行数:8,代码来源:ObjectHelper.php

示例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);
 }
开发者ID:philrennie,项目名称:boris-loader,代码行数:9,代码来源:Drupal7.php

示例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);
 }
开发者ID:ratzeni,项目名称:epistemetec,代码行数:9,代码来源:Node.php

示例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();
     }
 }
开发者ID:0x27,项目名称:apiary-project,代码行数:10,代码来源:class.Object_Pool.php

示例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();
 }
开发者ID:bjargud,项目名称:drush,代码行数:11,代码来源:DrupalBoot7.php

示例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;
 }
开发者ID:bangpound,项目名称:drupal-bridge,代码行数:11,代码来源:PageCacheListener.php

示例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);
 }
开发者ID:chapabu,项目名称:codeception-module-drupal,代码行数:14,代码来源:Drupal7.php

示例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();
 }
开发者ID:Briareos,项目名称:Oxygen,代码行数:12,代码来源:ShellCommand.php

示例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();
}
开发者ID:ndp,项目名称:aida-americas.org-src,代码行数:12,代码来源:image.php


注:本文中的drupal_bootstrap函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。