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


PHP Session::start方法代码示例

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


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

示例1: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->View = new View();
     $this->Session = new SessionHelper($this->View);
     Session::start();
     if (!Session::started()) {
         Session::start();
     }
     $_SESSION = array('test' => 'info', 'Message' => array('flash' => array('element' => 'default', 'params' => array(), 'message' => 'This is a calling'), 'notification' => array('element' => 'session_helper', 'params' => array('title' => 'Notice!', 'name' => 'Alert!'), 'message' => 'This is a test of the emergency broadcasting system'), 'classy' => array('element' => 'default', 'params' => array('class' => 'positive'), 'message' => 'Recorded'), 'bare' => array('element' => null, 'message' => 'Bare message', 'params' => array())), 'Deeply' => array('nested' => array('key' => 'value')));
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:16,代码来源:SessionHelperTest.php

示例2: id

 /**
  * Get/Set the session id.
  *
  * When fetching the session id, the session will be started
  * if it has not already been started. When setting the session id,
  * the session will not be started.
  *
  * @param string $id Id to use (optional)
  * @return string The current session id.
  */
 public function id($id = null)
 {
     if (empty($id)) {
         Session::start();
     }
     return Session::id($id);
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:17,代码来源:SessionComponent.php

示例3: testSetLanguageWithSession

 /**
  * testSetLanguageWithSession method
  *
  * @return void
  */
 public function testSetLanguageWithSession()
 {
     Session::start();
     Session::write('Config.language', 'po');
     $singular = $this->_singular();
     $this->assertEquals('Po (translated)', $singular);
     $plurals = $this->_plural();
     $this->assertTrue(in_array('0 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('1 is 1 (po translated)', $plurals));
     $this->assertTrue(in_array('2 is 2-4 (po translated)', $plurals));
     $this->assertTrue(in_array('3 is 2-4 (po translated)', $plurals));
     $this->assertTrue(in_array('4 is 2-4 (po translated)', $plurals));
     $this->assertTrue(in_array('5 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('6 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('7 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('8 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('9 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('10 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('11 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('12 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('13 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('14 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('15 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('16 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('17 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('18 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('19 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('20 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('21 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('22 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('23 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('24 everything else (po translated)', $plurals));
     $this->assertTrue(in_array('25 everything else (po translated)', $plurals));
     Session::delete('Config.language');
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:40,代码来源:I18nTest.php

示例4: testDestroy

 /**
  * testDestroy method
  *
  * @return void
  */
 public function testDestroy()
 {
     $session = new Session();
     $session->start();
     $session->write('bulletProof', 'invincible');
     $session->id('foo');
     $session->destroy();
     $this->assertFalse($session->check('bulletProof'));
 }
开发者ID:Slayug,项目名称:castor,代码行数:14,代码来源:SessionTest.php

示例5: testSessionId

 /**
  * testSessionId method
  *
  * @return void
  */
 public function testSessionId()
 {
     unset($_SESSION);
     $Session = new SessionComponent($this->ComponentRegistry);
     Session::start();
     $this->assertEquals(session_id(), $Session->id());
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:SessionComponentTest.php


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