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


PHP JSession::set方法代码示例

本文整理汇总了PHP中JSession::set方法的典型用法代码示例。如果您正苦于以下问题:PHP JSession::set方法的具体用法?PHP JSession::set怎么用?PHP JSession::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JSession的用法示例。


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

示例1: testGetToken

 /**
  * Test...
  *
  * @covers  JSession::getToken
  *
  * @return void
  */
 public function testGetToken()
 {
     $this->object->set('session.token', 'abc');
     $this->assertEquals('abc', $this->object->getToken(), 'Token should be abc');
     $this->object->set('session.token', null);
     $token = $this->object->getToken();
     $this->assertEquals(32, strlen($token), 'Line: ' . __LINE__ . ' Token should be length 32');
     $token2 = $this->object->getToken(true);
     $this->assertNotEquals($token, $token2, 'Line: ' . __LINE__ . ' New token should be different');
 }
开发者ID:rdiaztushman,项目名称:joomla-platform,代码行数:17,代码来源:JSessionTest.php

示例2: setReturn

 /**
  * Sets the return value
  * 
  * @param type $Itemid
  * @return type
  */
 protected function setReturn($Itemid = null, $message = '')
 {
     if (empty($Itemid)) {
         return;
     }
     $newUrl = base64_encode(urlencode(JRoute::_($this->getMenuitemUrl($Itemid), false)));
     $this->input->set('return', $newUrl);
     if (!empty($message)) {
         $this->session->set('asar.message', $message);
     }
 }
开发者ID:AnythingDig,项目名称:advanced-submit-article-redirect,代码行数:17,代码来源:asar.php

示例3: testIsNew

 /**
  * Test isNew
  *
  * @return void
  */
 public function testIsNew()
 {
     $this->object->set('session.counter', 1);
     $this->assertEquals(true, $this->object->isNew(), '$isNew should be true.');
 }
开发者ID:N6REJ,项目名称:joomla-cms,代码行数:10,代码来源:JSessionTest.php

示例4: clearGroup

 /**
  * {@inheritdoc}
  */
 public function clearGroup($group = self::GROUP_DFAULT)
 {
     $this->_session->set($group, null, $this->_namespace);
 }
开发者ID:JBZoo,项目名称:CrossCMS,代码行数:7,代码来源:Session.php

示例5: randomClassName

 /**
  * Creates a valid, random name for the class selector
  *
  * @param JSession $session
  *
  * @return string
  */
 private static function randomClassName($session)
 {
     $characters = range('a', 'z');
     $class_name = $characters[mt_rand(0, count($characters) - 1)];
     $class_name_length = mt_rand(6, 12);
     $class_name .= @JUserHelper::genRandomPassword($class_name_length);
     $head_data = '<style type="text/css">div.' . $class_name . '{text-align: center; border: 1px solid #DD87A2; border-radius: 2px; padding: 5px; background-color: #F9CAD9; font-size: 120%; margin: 10px 0;}</style>';
     EasyJoomlaBackupHelper::addHeadData($head_data);
     $session->set('field_value_head', $head_data, 'krdonationcodecheck_footer');
     return $class_name;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:18,代码来源:easyjoomlabackup.php

示例6: getTotalRecords

 /**
  * Get the total number of records in the table
  *
  * @return  int		total number of records
  */
 public function getTotalRecords()
 {
     $package = $this->app->getUserState('com_fabrik.package', 'fabrik');
     // $$$ rob ensure that the limits are set - otherwise can create monster query
     $this->setLimits();
     $context = 'com_' . $package . '.list' . $this->getRenderContext() . '.total';
     if (isset($this->totalRecords)) {
         $this->session->set($context, $this->totalRecords);
         return $this->totalRecords;
     }
     // $$$ rob getData() should always be run first
     if (!isset($this->data) || is_null($this->data)) {
         $this->getData();
         return $this->totalRecords;
     }
     if ($this->mergeJoinedData()) {
         $this->totalRecords = $this->getJoinMergeTotalRecords();
         $this->session->set($context, $this->totalRecords);
         return $this->totalRecords;
     }
 }
开发者ID:pascal26,项目名称:fabrik,代码行数:26,代码来源:list.php

示例7: setQueue

 /**
  * Set the queue.
  *
  * @param   array  $queue  The queue.
  *
  * @return  void
  */
 public function setQueue(array $queue)
 {
     $this->session->set($this->sessionVariable, $queue, 'rbrowser');
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:11,代码来源:history.php

示例8: clearValue

 /**
  * Clear value in group
  * @param $key
  * @param string $group
  * @return mixed
  */
 public function clearValue($key, $group = 'default')
 {
     return $this->_session->set($key, null, $group);
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:10,代码来源:jbsession.php

示例9: afterSessionStart

 /**
  * Event listener for the `onAfterSessionStart` event.
  *
  * @param   JSession  $session  Session object
  *
  * @return  void
  *
  * @since   __DEPLOY_VERSION__
  */
 public function afterSessionStart(JSession $session)
 {
     if ($session->isNew()) {
         $session->set('registry', new Registry('session'));
     }
 }
开发者ID:joomla-projects,项目名称:media-manager-improvement,代码行数:15,代码来源:web.php

示例10: store

 /**
  * Store the data to cache by id and group
  *
  * @param   string  $key    The cache data id
  * @param   string  $group  The cache data group
  * @param   string  $data   The data to store in cache
  *
  * @return  boolean  True on success, false otherwise
  */
 public function store($key, $group = null, $data = null)
 {
     $data = json_decode(json_encode($data));
     $this->session->set('cache.' . $group . '.' . $key, $data);
     return $this;
 }
开发者ID:lyrasoft,项目名称:lyrasoft.github.io,代码行数:15,代码来源:session.php


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