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


PHP CakeSession::destroy方法代码示例

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


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

示例1: exitSystem

 public function exitSystem()
 {
     session_start();
     session_destroy();
     CakeSession::destroy();
     $this->redirect('/logins/index', null, true);
 }
开发者ID:skydel,项目名称:universal-online-exam,代码行数:7,代码来源:LoginsController.php

示例2: tearDown

 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     CakeSession::clear();
     CakeSession::destroy();
     ClassRegistry::flush();
 }
开发者ID:dlpc,项目名称:CakeWX,代码行数:12,代码来源:CroogoControllerTestCase.php

示例3: tearDown

 /**
  * tearDown
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     if (CakeSession::started()) {
         CakeSession::clear();
         CakeSession::destroy();
     }
     ClassRegistry::flush();
 }
开发者ID:saydulk,项目名称:croogo,代码行数:14,代码来源:CroogoControllerTestCase.php

示例4: setUp

 /**
  * SetUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->_admin = Configure::read('Routing.prefixes.0');
     Configure::write('Routing.prefixes.0', 'admin');
     CakeSession::destroy();
     $this->Controller = new TestMenuGathererController(new CakeRequest(), new CakeResponse());
     $this->Controller->constructClasses();
     $this->Controller->startupProcess();
     $this->MenuGatherer = new TestMenuGathererComponent(new ComponentCollection());
 }
开发者ID:jgprolluxer,项目名称:prosales,代码行数:16,代码来源:MenuGathererComponentTest.php

示例5: index

 public function index()
 {
     CakeSession::destroy();
 }
开发者ID:tatakauashi,项目名称:meiteampower,代码行数:4,代码来源:ManagementController.php

示例6: destroy

 /**
  * Used to destroy sessions
  *
  * In your controller: $this->Session->destroy();
  *
  * @return void
  * @link http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::destroy
  */
 public function destroy()
 {
     return CakeSession::destroy();
 }
开发者ID:jgera,项目名称:orangescrum,代码行数:12,代码来源:SessionComponent.php

示例7: endTest

 /**
  * @brief after a test stops
  *
  * unset the model object and clear out the registry
  *
  * @access public
  *
  * @return void
  */
 public function endTest($method)
 {
     if (!is_subclass_of($this, 'AppControllerTestCase')) {
         return;
     }
     list($plugin, $controller) = pluginSplit($this->setup[$this->setup['type']]);
     unset($this->{$controller});
     ClassRegistry::flush();
     if (class_exists('CakeSession')) {
         CakeSession::destroy();
     }
     $this->AppTest->endTest($method);
     echo sprintf('<div style="padding: 8px; background-color: green; color: white;">%s <span style="color:#ffdd00;">[%ss]</span></div>', $this->AppTest->prettyTestMethod($method), $this->data[$method]['total']);
     echo '</div>';
     if ($this->stop === true) {
         debug('Skipping further tests', false, false);
         $this->AppTest->endTest();
         exit;
     }
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:29,代码来源:AppControllerTestCase.php

示例8: logout

 function logout()
 {
     $this->set('title_for_layout', "User::logout");
     CakeLog::write('info', 'cakelog write: logout, uid:' . CakeSession::read('uid'));
     $this->log('logout, uid=' . CakeSession::read('uid'), 'info');
     $this->Session->delete('uid');
     CakeSession::destroy();
     $this->redirect('/');
 }
开发者ID:udo-tech-team,项目名称:yitianjian,代码行数:9,代码来源:UsersController.php

示例9: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->View, $this->Flash);
     CakeSession::destroy();
 }
开发者ID:kingsj,项目名称:cakephp-shopping-cart,代码行数:11,代码来源:FlashHelperTest.php

示例10: save_workout_complete

 public function save_workout_complete()
 {
     $workoutData = CakeSession::read('custom_workout');
     $templateData = $this->request->data;
     $redirect = true;
     $userID = $_COOKIE['UID'];
     $this->loadModel('Member');
     $findUser = $this->Member->find('all', array('conditions' => array('id' => $userID)));
     $this->loadModel('Workout');
     $this->loadModel('WorkoutAttribute');
     $this->loadModel('WorkoutTemplate');
     $this->loadModel('WorkoutAttributeDetail');
     $this->loadModel('WorkoutTemplateDetail');
     if (CakeSession::read('saved_workout')) {
         $workD['Workout']['id'] = CakeSession::read('saved_workout');
     }
     $workD['Workout']['member_id'] = $findUser[0]['Member']['id'];
     $workD['Workout']['type'] = $workoutData['exercise_type'];
     if ($this->Workout->save($workD)) {
         $workoutID = $this->Workout->id;
         CakeSession::write('saved_workout', $workoutID);
         if (CakeSession::read('saved_workout_template_id')) {
             $workoutTemplateData['WorkoutTemplate']['id'] = CakeSession::read('saved_workout_template_id');
         }
         $workoutTemplateData['WorkoutTemplate']['workout_id'] = $workoutID;
         $workoutTemplateData['WorkoutTemplate']['template_name'] = $workoutData['template_name'];
         if ($this->WorkoutTemplate->save($workoutTemplateData)) {
             $workoutTemplateID = $this->WorkoutTemplate->id;
             CakeSession::write('saved_workout_template_id', $workoutTemplateID);
             foreach ($templateData['template_details'] as $tempData) {
                 $this->WorkoutTemplateDetail->create();
                 $workoutTemplateDetailsData['WorkoutTemplateDetail']['workout_template_id'] = $workoutTemplateID;
                 $workoutTemplateDetailsData['WorkoutTemplateDetail']['name'] = $tempData['name'];
                 $workoutTemplateDetailsData['WorkoutTemplateDetail']['value'] = $tempData['value'];
                 $this->WorkoutTemplateDetail->save($workoutTemplateDetailsData);
             }
         } else {
             $redirect = false;
         }
         foreach ($workoutData['attributes'] as $attributes) {
             $attributeData['WorkoutAttribute']['workout_id'] = $workoutID;
             $attributeData['WorkoutAttribute']['name'] = $attributes['name'];
             $this->WorkoutAttribute->create();
             if ($this->WorkoutAttribute->save($attributeData)) {
                 $workoutAttributeID = $this->WorkoutAttribute->id;
                 foreach ($attributes['attribute'] as $a) {
                     $this->WorkoutAttributeDetail->create();
                     $aData['WorkoutAttributeDetail']['workout_attribute_id'] = $workoutAttributeID;
                     $aData['WorkoutAttributeDetail']['name'] = $a['name'];
                     $aData['WorkoutAttributeDetail']['value'] = $a['value'];
                     $this->WorkoutAttributeDetail->save($aData);
                 }
             } else {
                 $redirect = false;
             }
         }
     } else {
         $redirect = false;
     }
     CakeSession::destroy('custom_workout');
     CakeSession::destroy('saved_workout_template_id');
     CakeSession::destroy('saved_workout');
     echo json_encode($redirect);
     die;
 }
开发者ID:rooswill,项目名称:CommanderHQ,代码行数:65,代码来源:ExercisesController.php

示例11: order

 /**
  *
  */
 public function order()
 {
     $countries = array("Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Barbuda", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Trty.", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Caicos Islands", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Futuna Islands", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard", "Herzegovina", "Holy See", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Jan Mayen Islands", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea", "Korea (Democratic)", "Kuwait", "Kyrgyzstan", "Lao", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "McDonald Islands", "Mexico", "Micronesia", "Miquelon", "Moldova", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "Nevis", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Palestinian Territory, Occupied", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Principe", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Barthelemy", "Saint Helena", "Saint Kitts", "Saint Lucia", "Saint Martin (French part)", "Saint Pierre", "Saint Vincent", "Samoa", "San Marino", "Sao Tome", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia", "South Sandwich Islands", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Grenadines", "Timor-Leste", "Tobago", "Togo", "Tokelau", "Tonga", "Trinidad", "Tunisia", "Turkey", "Turkmenistan", "Turks Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "US Minor Outlying Islands", "Uzbekistan", "Vanuatu", "Vatican City State", "Venezuela", "Vietnam", "Virgin Islands (British)", "Virgin Islands (US)", "Wallis", "Western Sahara", "Yemen", "Zambia", "Zimbabwe");
     $captcha = $this->Session->read('captcha_code');
     if ($this->request->is('post')) {
         if (!empty($this->request->data['Order'])) {
             if ($captcha == $this->request->data['Order']['captcha']) {
                 $order_details = $this->request->data['Order'];
                 $order_details['order_item_count'] = $this->Cart->getCount();
                 $order_details['total'] = CakeSession::read('total');
                 $order_details['user_id'] = $this->Auth->user('id');
                 $order_details['country'] = $countries[$order_details['country']];
                 if (!$this->Order->save($order_details)) {
                     $this->Session->setFlash('Something went wrong, please try again!');
                 }
                 $foreign_key = $this->Order->getLastInsertID();
                 $this->OrderItem->updateAll(array('OrderItem.order_id' => $foreign_key), array('OrderItem.session_id' => CakeSession::id()));
                 $order = $this->OrderItem->find('all', array('conditions' => array('OrderItem.session_id' => CakeSession::id())));
                 $this->Session->write('order', $order);
                 $filename = date('Y-m-d H.i.s');
                 $this->createPdf($filename);
                 $email = $order_details['email'];
                 $this->sendBill($order, $email, $filename);
                 //ez töröl mindent, de nekem csak a kosarat kell, a user cuccokat nem (ne jelentkeztessen ki)
                 CakeSession::destroy();
                 $this->view = 'success';
             } else {
                 $this->Session->setFlash(__('Captcha code does not match'));
                 $this->redirect(array('action' => 'checkOut'));
             }
         }
     }
 }
开发者ID:BlueMescaline,项目名称:MadDollTees,代码行数:36,代码来源:ShopController.php

示例12: endTest

 /**
  * @brief after a test stops
  *
  * unset the model object and clear out the registry
  *
  * @access public
  *
  * @return void
  */
 public function endTest($method)
 {
     list($plugin, $behavior) = pluginSplit($this->setup[$this->setup['type']]);
     $behaviorClass = $behavior . 'Behavior';
     unset($this->{$behaviorClass});
     foreach ($this->setup['models'] as $modelToLoad) {
         list($plugin, $model) = pluginSplit($modelToLoad);
         unset($this->{$model});
     }
     ClassRegistry::flush();
     if (class_exists('CakeSession')) {
         $CakeSession = new CakeSession();
         $CakeSession->destroy();
     }
     $this->AppTest->endTest($method);
     return true;
     echo sprintf('<div style="padding: 8px; background-color: green; color: white;">%s <span style="color:#ffdd00;">[%ss]</span></div>', $this->AppTest->prettyTestMethod($method), $this->data[$method]['total']);
     echo '</div>';
     if ($this->stop === true) {
         debug('Skipping further tests', false, false);
         $this->AppTest->endTest();
         exit;
     }
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:33,代码来源:AppBehaviorTestCase.php

示例13: __construct

 public function __construct(ControllerTestCase $controllerTestCase)
 {
     $this->controllerTestCase = $controllerTestCase;
     $this->controllerName = substr(get_class($this->controllerTestCase), 0, -strlen('ControllerTest'));
     CakeSession::destroy();
 }
开发者ID:Asdafers,项目名称:MyAL,代码行数:6,代码来源:ControllerTestCaseUtils.php

示例14: endTest

 /**
  * @brief after a test stops
  *
  * unset the model object and clear out the registry
  *
  * @access public
  *
  * @return void
  */
 public function endTest($method)
 {
     list($plugin, $helper) = pluginSplit($this->setup[$this->setup['type']]);
     $helperClass = $helper . 'Helper';
     unset($this->{$helper});
     foreach ($this->setup['models'] as $modelToLoad) {
         list($plugin, $model) = pluginSplit($modelToLoad);
         unset($this->{$model});
     }
     ClassRegistry::flush();
     if (class_exists('CakeSession')) {
         CakeSession::destroy();
     }
     $this->AppTest->endTest($method);
     echo sprintf('<div style="padding: 8px; background-color: green; color: white;">%s <span style="color:#ffdd00;">[%ss]</span></div>', $this->AppTest->prettyTestMethod($method), $this->data[$method]['total']);
     echo '</div>';
     if ($this->stop === true) {
         echo '<pre class="cake-debug">Skipping further tests</pre>';
         $this->AppTest->endTest();
         exit;
     }
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:31,代码来源:AppHelperTestCase.php

示例15: testAfterFind

 /**
  * testAfterFind method
  *
  * @return void
  */
 public function testAfterFind()
 {
     $article = array('Article' => array('title' => 'Lorem ipsum', 'body' => 'Lorem ipsum', 'published' => 1), 'User' => array(array('id' => 838239), array('id' => 38989128)));
     $this->Model->save($article);
     $articleId = $this->Model->id;
     CakeSession::write('Auth.User.id', 7);
     // set user id
     $result = $this->Model->find('all', array('conditions' => array('Article.id' => $articleId)));
     $this->assertTrue(empty($result));
     // test that result is empty because our user id is not 838239, or 38989128
     CakeSession::write('Auth.User.id', 838239);
     // set user id
     $result = $this->Model->find('all', array('conditions' => array('Article.id' => $articleId)));
     $this->assertTrue(!empty($result));
     // should now be filled because the user id is now set
     $this->assertTrue(!empty($result[0]['Article']['__used']));
     // test that the __used field exists and is filled
     CakeSession::write('Auth.User.id', 38989128);
     // set user id
     $result = $this->Model->find('first', array('conditions' => array('Article.id' => $articleId)));
     $this->assertGreaterThan(1, $result['Article']['__used']);
     // test that it works with single records as well
     CakeSession::destroy();
 }
开发者ID:ayaou,项目名称:Zuha,代码行数:29,代码来源:UsableBehaviorTest.php


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