當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Axis::session方法代碼示例

本文整理匯總了PHP中Axis::session方法的典型用法代碼示例。如果您正苦於以下問題:PHP Axis::session方法的具體用法?PHP Axis::session怎麽用?PHP Axis::session使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Axis的用法示例。


在下文中一共展示了Axis::session方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 private function __construct()
 {
     $this->_session = Axis::session('install');
     if (!isset($this->_session->step)) {
         $this->_session->step = self::STEP_REQUIREMENTS;
     }
 }
開發者ID:rguedes,項目名稱:axiscommerce,代碼行數:7,代碼來源:Wizard.php

示例2: getCacheKey

 public function getCacheKey()
 {
     if (null === $this->_cacheKey) {
         $this->_cacheKey = md5('admin_navigation' . Axis::session()->roleId . Axis_Locale::getLocale()->toString());
     }
     return $this->_cacheKey;
 }
開發者ID:rguedes,項目名稱:axiscommerce,代碼行數:7,代碼來源:Navigation.php

示例3: changeAction

 public function changeAction()
 {
     $code = $this->_getParam('currency-code', 'USD');
     if (Axis::single('locale/currency')->isExists($code)) {
         Axis::session()->currency = $code;
     }
     $this->_redirect($this->_getBackUrl());
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:8,代碼來源:CurrencyController.php

示例4: changeAction

 public function changeAction()
 {
     $code = $this->_getParam('currency-code', 'USD');
     if (Axis::single('locale/currency')->isExists($code)) {
         Axis::session()->currency = $code;
     }
     $this->_redirect($this->getRequest()->getServer('HTTP_REFERER'));
 }
開發者ID:rguedes,項目名稱:axiscommerce,代碼行數:8,代碼來源:CurrencyController.php

示例5: updateAction

 public function updateAction()
 {
     $this->_helper->layout->disableLayout();
     $data = $this->_getParam('quantity');
     foreach ($data as $itemId => $quantity) {
         Axis::single('checkout/cart')->updateItem($itemId, $quantity);
     }
     Axis::session()->lastUrl = $this->_getParam('last_url');
     $this->_redirect($this->getRequest()->getServer('HTTP_REFERER'));
 }
開發者ID:rguedes,項目名稱:axiscommerce,代碼行數:10,代碼來源:CartController.php

示例6: getVisitor

 /**
  * Return visitor row
  *
  * @return Zend_Db_Table_Row_Abstract
  */
 public function getVisitor()
 {
     if (!isset(Axis::session()->visitorId) || !($row = $this->find(Axis::session()->visitorId)->current())) {
         $row = $this->createRow(array('session_id' => Zend_Session::getId(), 'customer_id' => Axis::getCustomerId() ? Axis::getCustomerId() : new Zend_Db_Expr('NULL')));
         $row->save();
         Axis::session()->visitorId = $row->id;
         //unset only on logout
     }
     return $row;
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:15,代碼來源:Visitor.php

示例7: dispatchLoopStartup

 /**
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
 public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
 {
     if (Axis_Area::isFrontend() && null !== $request->getParam('locale')) {
         $locale = $request->getParam('locale');
     } elseif (isset(Axis::session()->locale)) {
         $locale = Axis::session()->locale;
     } else {
         $locale = Axis_Locale::getDefaultLocale();
     }
     Axis_Locale::setLocale($locale);
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:16,代碼來源:Locale.php

示例8: init

 public function init()
 {
     $this->initView();
     $layout = Zend_Layout::getMvcInstance();
     $this->_session = Axis::session('install');
     $this->view->baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
     $this->view->addHelperPath('app/views/helpers', 'Axis_View_Helper');
     $this->view->doctype('XHTML1_STRICT');
     $layout->setView($this->view)->setOptions(array('layoutPath' => 'app/views/layouts', 'layout' => 'layout'));
     $this->_install = Axis_Install_Model_Wizard::getInstance();
 }
開發者ID:rommmka,項目名稱:axiscommerce,代碼行數:11,代碼來源:IndexController.php

示例9: updateIndexAction

 public function updateIndexAction()
 {
     $indexer = Axis::model('search/indexer');
     $session = Axis::session('search_index');
     if ($this->_getParam('reset_session', false)) {
         $indexer->removeAllIndexesFromFilesystem();
         $session->page = 1;
         $session->processed = 0;
         $session->completeProduct = false;
     }
     $rowCount = $this->_getParam('limit', 50);
     if (!$session->completeProduct) {
         $select = Axis::model('catalog/product')->select(array('id', 'sku'))->join('catalog_product_description', 'cpd.product_id = cp.id', array('name', 'description'))->joinRight('locale_language', 'll.id = cpd.language_id', 'locale')->joinLeft('catalog_product_image', 'cpi.id = cp.image_thumbnail', array('image_thumbnail' => 'path'))->joinLeft('catalog_product_image_title', 'cpit.image_id = cpi.id', array('image_title' => 'title'))->join('catalog_product_category', 'cp.id = cpc.product_id')->join('catalog_category', 'cc.id = cpc.category_id', 'site_id')->joinLeft('catalog_hurl', "ch.key_id = cp.id AND ch.key_type='p'", 'key_word')->order('cc.site_id')->order('cpd.language_id')->group(array('cc.site_id', 'cpd.language_id', 'cp.id'))->calcFoundRows()->limitPage($session->page, $rowCount);
     } else {
         $select = Axis::model('cms/page_content')->select('*')->join('cms_page_category', 'cpc2.cms_page_id = cpc.cms_page_id')->join('cms_category', 'cc.id = cpc2.cms_category_id', 'site_id')->joinRight('locale_language', 'll.id = cpc.language_id', 'locale')->order('cc.site_id')->order('cpc.language_id')->calcFoundRows();
     }
     $rowset = $select->fetchRowset();
     $count = $select->foundRows();
     $index = $path = null;
     foreach ($rowset as $_row) {
         $_path = $indexer->getIndexPath($_row->site_id . '/' . $_row->locale);
         //next index
         if ($path !== $_path) {
             //save prev index
             if ($index) {
                 $index->optimize();
                 $index->commit();
             }
             $path = $_path;
             $index = $indexer->getIndex($path);
         }
         $index->addDocument($indexer->getDocument($_row));
     }
     if ($index) {
         $index->optimize();
         $index->commit();
     }
     $session->processed += $rowset->count();
     $session->page++;
     Axis::message()->addSuccess(Axis::translate('search')->__("%d of %d items(s) was processed", $session->processed, $count));
     $completed = false;
     if ($count == $session->processed) {
         if ($session->completeProduct) {
             $completed = true;
             $session->unsetAll();
         } else {
             $session->page = 1;
             $session->processed = 0;
             $session->completeProduct = true;
         }
     }
     $this->_helper->json->sendSuccess(array('completed' => $completed));
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:53,代碼來源:IndexController.php

示例10: _initLocale

 protected function _initLocale()
 {
     $session = Axis::session('install');
     $timezone = Axis_Locale::DEFAULT_TIMEZONE;
     $locale = Axis_Locale::DEFAULT_LOCALE;
     if (is_array($session->locale)) {
         $timezone = current($session->locale['timezone']);
     }
     if ($session->current_locale) {
         $locale = $session->current_locale;
     }
     Axis_Locale::setLocale($locale);
     Axis_Locale::setTimezone($timezone);
 }
開發者ID:rommmka,項目名稱:axiscommerce,代碼行數:14,代碼來源:Install.php

示例11: _hasSnapshot

 /**
  * @return bool
  */
 protected function _hasSnapshot()
 {
     return isset(Axis::session()->snapshot) && !empty(Axis::session()->snapshot);
 }
開發者ID:rommmka,項目名稱:axiscommerce,代碼行數:7,代碼來源:Action.php

示例12: _setCartId

 /**
  *
  * @param int $id
  * @return void
  */
 protected function _setCartId($id)
 {
     Axis::session()->cartId = $id;
     $this->_cartId = $id;
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:10,代碼來源:Cart.php

示例13: _getCacheKeyParams

 protected function _getCacheKeyParams()
 {
     return array(Axis::session()->roleId);
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:4,代碼來源:Navigation.php

示例14: logoutAction

 public function logoutAction()
 {
     Zend_Auth::getInstance()->clearIdentity();
     unset(Axis::session()->roleId);
     $this->_redirect('auth');
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:6,代碼來源:AuthController.php

示例15: _initSession

 protected function _initSession()
 {
     $cacheDir = AXIS_ROOT . '/var/sessions';
     if (!is_readable($cacheDir)) {
         mkdir($cacheDir, 0777);
     } elseif (!is_writable($cacheDir)) {
         chmod($cacheDir, 0777);
     }
     Zend_Session::setOptions(array('cookie_lifetime' => 864000, 'name' => 'axisid', 'strict' => 'off', 'save_path' => $cacheDir, 'cookie_httponly' => true));
     try {
         Zend_Session::start();
     } catch (Zend_Session_Exception $e) {
         Zend_Session::destroy();
         // ZF doesn't allow to start session after destroying
         if (!headers_sent()) {
             $host = $_SERVER['HTTP_HOST'];
             $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
             header("Location: http://{$host}{$uri}/");
         }
         exit;
     }
     return Axis::session();
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:23,代碼來源:Bootstrap.php


注:本文中的Axis::session方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。