当前位置: 首页>>代码示例>>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;未经允许,请勿转载。