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


PHP oxSession::getInstance方法代碼示例

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


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

示例1: smarty_insert_oxid_newbasketitem

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File: insert.oxid_newbasketitem.php
 * Type: string, html
 * Name: newbasketitem
 * Purpose: Used for tracking in econda, etracker etc.
 * -------------------------------------------------------------
 *
 * @param array  $params  params
 * @param Smarty &$smarty clever simulation of a method
 *
 * @return string
 */
function smarty_insert_oxid_newbasketitem($params, &$smarty)
{
    $myConfig = oxConfig::getInstance();
    $aTypes = array('0' => 'none', '1' => 'message', '2' => 'popup', '3' => 'basket');
    $iType = $myConfig->getConfigParam('iNewBasketItemMessage');
    // If corect type of message is expected
    if ($iType && $params['type'] && $params['type'] != $aTypes[$iType]) {
        return '';
    }
    //name of template file where is stored message text
    $sTemplate = $params['tpl'] ? $params['tpl'] : 'inc_newbasketitem.snippet.tpl';
    //allways render for ajaxstyle popup
    $blRender = $params['ajax'] && $iType == 2;
    //fetching article data
    $oNewItem = oxSession::getVar('_newitem');
    $oBasket = oxSession::getInstance()->getBasket();
    if ($oNewItem) {
        // loading article object here because on some system passing article by session couses problems
        $oNewItem->oArticle = oxNew('oxarticle');
        $oNewItem->oArticle->Load($oNewItem->sId);
        // passing variable to template with unique name
        $smarty->assign('_newitem', $oNewItem);
        // deleting article object data
        oxSession::deleteVar('_newitem');
        $blRender = true;
    }
    // returning generated message content
    if ($blRender) {
        return $smarty->fetch($sTemplate);
    }
}
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:45,代碼來源:insert.oxid_newbasketitem.php

示例2: log

 /**
  * log the given message
  *
  * @param string $message
  * @param string $debuginfo
  */
 public function log($message, $debuginfo)
 {
     if (oxConfig::getInstance()->getShopConfVar('PAYMILL_ACTIVATE_LOGGING')) {
         $logging = oxNew('paymill_logging');
         $logging->assign(array('identifier' => oxSession::getInstance()->getVar('paymill_identifier'), 'debug' => $debuginfo, 'message' => $message, 'date' => date('Y-m-d H:i:s', oxUtilsDate::getInstance()->getTime())));
         $logging->save();
     }
 }
開發者ID:SiWe0401,項目名稱:paymill-oxid-4.6,代碼行數:14,代碼來源:paymill_logger.php

示例3: getRemoteAccessToken

 /**
  * Returns session Remote Access token. Later you can pass the token over rtoken URL param
  * when you want to access the shop, for example, from different client.
  *
  * @return string
  */
 public function getRemoteAccessToken()
 {
     $sRaToken = oxSession::getInstance()->getRemoteAccessToken();
     return $sRaToken;
 }
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:11,代碼來源:oxviewconfig.php

示例4: getPaymentList

 /**
  * loads the paymentlist
  *
  * @overload
  */
 public function getPaymentList()
 {
     //clear values
     oxSession::deleteVar('paymill_authorized_amount');
     $differentAmount = intval(round(oxConfig::getInstance()->getShopConfVar('PAYMILL_ACTIVATE_DIFFERENTAMOUNT'), 2) * 100);
     //save authorized Amount for secure Paymentprocessing
     $amount = intval(round(oxSession::getInstance()->getBasket()->getPrice()->getBruttoPrice() * 100) + $differentAmount);
     oxSession::setVar('paymill_authorized_amount', $amount);
     $this->addTplParam('paymillAmount', $amount);
     $paymentList = parent::getPaymentList();
     $privateKey = oxConfig::getInstance()->getShopConfVar('PAYMILL_PRIVATEKEY');
     $publicKey = oxConfig::getInstance()->getShopConfVar('PAYMILL_PUBLICKEY');
     if (empty($privateKey) || empty($publicKey)) {
         // @TODO log message so user knows that payment was deactivated because of missing private or public key
         unset($paymentList['paymill_elv']);
         unset($paymentList['paymill_cc']);
     }
     return $paymentList;
 }
開發者ID:SiWe0401,項目名稱:paymill-oxid-4.6,代碼行數:24,代碼來源:paymill_payment.php

示例5: processUrl

 /**
  * Performs base url processing - adds required parameters to given url
  *
  * @param string $sUrl       url to process
  * @param bool   $blFinalUrl should url be finalized or should it end with ? or & (default true)
  * @param array  $aParams    additional parameters (default null)
  * @param int    $iLang      url target language (default null)
  *
  * @return string
  */
 public function processUrl($sUrl, $blFinalUrl = true, $aParams = null, $iLang = null)
 {
     $aAddParams = $this->getAddUrlParams();
     if (is_array($aParams) && count($aParams)) {
         $aAddParams = array_merge($aAddParams, $aParams);
     }
     $ret = oxSession::getInstance()->processUrl(oxLang::getInstance()->processUrl($this->appendUrl($sUrl, $aAddParams), $iLang));
     if ($blFinalUrl) {
         $ret = getStr()->preg_replace('/(\\?|&(amp;)?)$/', '', $ret);
     }
     return $ret;
 }
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:22,代碼來源:oxutilsurl.php

示例6: render

 function render()
 {
     $myConfig = oxConfig::getInstance();
     $mySession = oxSession::getInstance();
     parent::render();
 }
開發者ID:OXIDprojects,項目名稱:debugax,代碼行數:6,代碼來源:testTempOut.php

示例7: modAttach

 function modAttach($oObj = null)
 {
     parent::modAttach($oObj);
     $this->_oRealInstance = oxSession::getInstance();
     if (!$oObj) {
         $oObj = $this;
     }
     self::$unitMOD = $oObj;
     $this->_id = $this->_oRealInstance->getId();
 }
開發者ID:alexschwarz89,項目名稱:Barzahlen-OXID-4.7,代碼行數:10,代碼來源:test_utils.php

示例8: modAttach

 function modAttach()
 {
     parent::modAttach();
     $this->_oRealInstance = oxSession::getInstance();
     self::$unitMOD = $this;
     $this->_id = $this->_oRealInstance->getId();
 }
開發者ID:OXIDprojects,項目名稱:debugax,代碼行數:7,代碼來源:test_utils.php

示例9: doImport

 /**
  * Main import method, whole import of all types via a given csv file is done here
  *
  * @param string  $sPath         full path of the CSV file.
  * @param string  $sUserName     user name
  * @param string  $sUserPassword password
  * @param integer $sShopId       shop ID
  * @param integer $sShopLanguage language ID
  *
  * @return string
  *
  */
 public function doImport($sPath = null, $sUserName = null, $sUserPassword = null, $sShopId = null, $sShopLanguage = null)
 {
     $myConfig = oxConfig::getInstance();
     $mySession = oxSession::getInstance();
     $this->_sReturn = "";
     $iMaxLineLength = 8192;
     //TODO change
     $this->_sPath = $sPath;
     //init with given data
     try {
         $this->init(null, null);
     } catch (Exception $ex) {
         return $this->_sReturn = 'ERPGENIMPORT_ERROR_USER_NO_RIGHTS';
     }
     $file = @fopen($this->_sPath, "r");
     if (isset($file) && $file) {
         $iRow = 0;
         $aRow = array();
         while (($aRow = fgetcsv($file, $iMaxLineLength, $this->_getCsvFieldsTerminator(), $this->_getCsvFieldsEncolser())) !== false) {
             $this->_aData[] = $aRow;
         }
         if ($this->_blCsvContainsHeader) {
             //skipping first row - it's header
             array_shift($this->_aData);
         }
         try {
             $this->Import();
         } catch (Exception $ex) {
             echo $ex->getMessage();
             $this->_sReturn = 'ERPGENIMPORT_ERROR_DURING_IMPORT';
         }
     } else {
         $this->_sReturn = 'ERPGENIMPORT_ERROR_WRONG_FILE';
     }
     @fclose($file);
     return $this->_sReturn;
 }
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:49,代碼來源:oxerpgenimport.php

示例10: getSession

 /**
  * Returns the OXID session object.
  *
  * @return oxSession
  */
 public function getSession()
 {
     return oxSession::getInstance();
 }
開發者ID:amrshawqy,項目名稱:cushymoco,代碼行數:9,代碼來源:VersionLayer460.php

示例11: getSession

 /**
  * oxSession instance getter
  *
  * @return oxsession
  */
 public function getSession()
 {
     if (defined('OXID_PHP_UNIT')) {
         if (isset($this->unitCustModSess)) {
             return $this->unitCustModSess;
         }
         return oxSession::getInstance();
     }
     if (self::$_oSession == null) {
         self::$_oSession = oxSession::getInstance();
     }
     return self::$_oSession;
 }
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:18,代碼來源:oxsupercfg.php

示例12: getShopBasePath

 include_once $sBasePath . 'modules/functions.php';
 include_once $sBasePath . 'core/oxfunctions.php';
 include_once $sBasePath . 'core/adodblite/adodb.inc.php';
 include_once $sBasePath . 'core/oxconfig.php';
 include_once $sBasePath . 'core/oxsupercfg.php';
 include_once $sBasePath . "core/oxutils.php";
 $myConfig = oxConfig::getInstance();
 // Includes Utility module.
 $sUtilModule = $myConfig->getConfigParam('sUtilModule');
 if ($sUtilModule && file_exists(getShopBasePath() . "modules/" . $sUtilModule)) {
     include_once getShopBasePath() . "modules/" . $sUtilModule;
 }
 $myConfig->setConfigParam('blAdmin', true);
 $myConfig->setConfigParam('blTemplateCaching', false);
 // authorization
 if (!(oxSession::getInstance()->checkSessionChallenge() && count(oxUtilsServer::getInstance()->getOxCookie()) && oxUtils::getInstance()->checkAccessRights())) {
     header("location:index.php");
     oxUtils::getInstance()->showMessageAndExit("");
 }
 if ($sContainer = oxConfig::getParameter('container')) {
     $sContainer = trim(strtolower(basename($sContainer)));
     $aColumns = array();
     include_once 'inc/' . $sContainer . '.inc.php';
     //$oAjaxComponent = new ajaxcomponent( $aColumns );
     $oAjaxComponent = oxNew("ajaxcomponent");
     $oAjaxComponent->init($aColumns);
     $oAjaxComponent->setName($sContainer);
     $oAjaxComponent->processRequest(oxConfig::getParameter('fnc'));
 } else {
 }
 $myConfig->pageClose();
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:31,代碼來源:oxajax.php

示例13: loadSessionData

 /**
  * oxERPBase::loadSessionData()
  * load session - should be called on init
  *
  * @param string $sSessionID session id
  *
  * @return null
  */
 public function loadSessionData($sSessionID)
 {
     if (!$sSessionID) {
         throw new Exception("ERROR: Session ID not valid!");
     }
     $_COOKIE = array('admin_sid' => $sSessionID);
     // start session
     $myConfig = oxConfig::getInstance();
     $myConfig->setConfigParam('blAdmin', 1);
     $myConfig->setAdminMode(true);
     $mySession = oxSession::getInstance();
     // change session if needed
     if ($sSessionID != session_id()) {
         if (session_id()) {
             session_write_close();
         }
         session_id($sSessionID);
         session_start();
     }
     $sAuth = $mySession->getVar('auth');
     if (!isset($sAuth) || !$sAuth) {
         throw new Exception("ERROR: Session ID not valid!");
     }
     $this->_iLanguage = $mySession->getVar('lang');
     $this->_sUserID = $sAuth;
     $this->_blInit = true;
 }
開發者ID:JulianaSchuster,項目名稱:oxid-frontend,代碼行數:35,代碼來源:oxerpbase.php


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