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


PHP drupal_session_start函数代码示例

本文整理汇总了PHP中drupal_session_start函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_session_start函数的具体用法?PHP drupal_session_start怎么用?PHP drupal_session_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drupal_session_start函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeScenario

 public function beforeScenario($event)
 {
     parent::beforeScenario($event);
     // @todo provide our own mail system to ameliorate ensuing ugliness.
     if ($event instanceof ScenarioEvent) {
         if ($event->getScenario()->hasTag('mail')) {
             if (module_exists('devel')) {
                 variable_set('mail_system', array('default-system' => 'DevelMailLog'));
             } else {
                 throw new \Exception('You must ensure that the devel module is enabled');
             }
             $fs = new \Filesystem();
             if ($mail_path = $event->getScenario()->getTitle()) {
                 $fs->remove('/tmp/' . $mail_path);
                 $fs->mkdir($mail_path);
             }
             variable_set('devel_debug_mail_directory', $mail_path);
             // NB: DevelMailLog is going to replace our separator with __.
             variable_set('devel_debug_mail_file_format', '%to::%subject');
             $this->mail = new \DevelMailLog();
         }
     }
     if (!$this->drupalSession) {
         $_SERVER['SERVER_SOFTWARE'] = 'foo';
         $this->drupalSession = (object) array('name' => session_name(), 'id' => session_id());
         $_SESSION['foo'] = 'bar';
         drupal_session_commit();
     }
     session_name($this->drupalSession->name);
     session_id($this->drupalSession->id);
     $_COOKIE[session_name()] = session_id();
     drupal_session_start();
     $base_url = getenv('DRUPAL_BASE_URL');
     if (!empty($base_url)) {
         $this->setMinkParameter('base_url', $base_url);
     }
     $userName = getenv('DRUPAL_BASIC_AUTH_USERNAME');
     $pass = getenv('DRUPAL_BASIC_AUTH_PASS');
     foreach (array('selenium2', 'goutte') as $session) {
         $session = $this->getMink()->getSession($session);
         $session->visit($this->locatePath('/index.php?foo=bar'));
         if (!empty($userName) && !empty($pass)) {
             $this->getMink()->getSession()->setBasicAuth($userName, $pass);
         }
     }
 }
开发者ID:promet,项目名称:drupal-behat-extension,代码行数:46,代码来源:PrometDrupalContext.php

示例2: update_selection_page

                $output = update_selection_page();
                break;
            }
        case 'Apply pending updates':
            if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
                update_batch($_POST['start'], $base_url . '/update.php?op=results', $base_url . '/update.php');
                break;
            }
        case 'info':
            $output = update_info_page();
            break;
        case 'results':
            $output = update_results_page();
            break;
            // Regular batch ops : defer to batch processing API.
        // Regular batch ops : defer to batch processing API.
        default:
            update_task_list('run');
            $output = _batch_page();
            break;
    }
} else {
    $output = update_access_denied_page();
}
if (isset($output) && $output) {
    // Explictly start a session so that the update.php token will be accepted.
    drupal_session_start();
    // We defer the display of messages until all updates are done.
    $progress_page = ($batch = batch_get()) && isset($batch['running']);
    print theme('update_page', array('content' => $output, 'show_messages' => !$progress_page));
}
开发者ID:boombatower,项目名称:drupal,代码行数:31,代码来源:update.php

示例3: initialize

 /**
  * Creates an array in the session. All variables now will be stored
  * under this array
  *
  * @param bool $isRead
  *   Is this a read operation, in this case, the session will not be touched.
  *
  *
  * @return void
  */
 public function initialize($isRead = FALSE)
 {
     // lets initialize the _session variable just before we need it
     // hopefully any bootstrapping code will actually load the session from the CMS
     if (!isset($this->_session)) {
         // CRM-9483
         if (!isset($_SESSION) && PHP_SAPI !== 'cli') {
             if ($isRead) {
                 return;
             }
             $config =& CRM_Core_Config::singleton();
             // FIXME: This belongs in CRM_Utils_System_*
             if ($config->userSystem->is_drupal && function_exists('drupal_session_start')) {
                 // https://issues.civicrm.org/jira/browse/CRM-14356
                 if (!(isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
                     drupal_session_start();
                 }
                 $_SESSION = array();
             } else {
                 session_start();
             }
         }
         $this->_session =& $_SESSION;
     }
     if ($isRead) {
         return;
     }
     if (!isset($this->_session[$this->_key]) || !is_array($this->_session[$this->_key])) {
         $this->_session[$this->_key] = array();
     }
     return NULL;
 }
开发者ID:kidaa30,项目名称:yes,代码行数:42,代码来源:Session.php

示例4: initialize

 /**
  * Creates an array in the session. All variables now will be stored
  * under this array
  *
  * @param boolean isRead is this a read operation, in this case, the session will not be touched
  *
  * @access private
  *
  * @return void
  */
 function initialize($isRead = FALSE)
 {
     // lets initialize the _session variable just before we need it
     // hopefully any bootstrapping code will actually load the session from the CMS
     if (!isset($this->_session)) {
         // CRM-9483
         if (!isset($_SESSION) && PHP_SAPI !== 'cli') {
             if ($isRead) {
                 return;
             }
             $config =& CRM_Core_Config::singleton();
             if ($config->userSystem->is_drupal && function_exists('drupal_session_start')) {
                 drupal_session_start();
             } else {
                 session_start();
             }
         }
         $this->_session =& $_SESSION;
     }
     if ($isRead) {
         return;
     }
     if (!isset($this->_session[$this->_key]) || !is_array($this->_session[$this->_key])) {
         $this->_session[$this->_key] = array();
     }
     return;
 }
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:37,代码来源:Session.php

示例5: storeToSession

 /**
  * Stores the current transaction session to the Drupal session.
  */
 public function storeToSession()
 {
     if (!drupal_session_started()) {
         drupal_session_start();
     }
     $_SESSION['publisher_transaction_session'] = $this;
 }
开发者ID:sammarks,项目名称:publisher,代码行数:10,代码来源:TransactionSession.php


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