當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。