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


PHP Zend_Session类代码示例

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


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

示例1: _getMainSection

 protected function _getMainSection()
 {
     try {
         $args = array(Sitengine_Env::PARAM_ANCESTORID => $this->_controller->getEntity()->getAncestorId());
         $query = array(Sitengine_Env::PARAM_SESSIONID => Zend_Session::getId());
         $route = $this->_controller->getFrontController()->getRouter()->getRoute(Sitengine_Newsletter_Backend_Front::ROUTE_CAMPAIGNS_ATTACHMENTS_UPLOAD);
         $submitUri = $this->_controller->getRequest()->getBasePath() . '/' . $route->assemble($args, true);
         $submitUri .= Sitengine_Controller_Request_Http::makeNameValueQuery($query);
         #print $submitUri;
         require_once $this->_controller->getEnv()->getContribDir() . '/FlexUpload/class.flexupload.inc.php';
         $flex = new FlexUpload($submitUri);
         $flex->setWidth('100%');
         #$flex->setHeight('100%');
         $flex->setMaxFiles(20);
         $flex->setMaxFileSize(100 * 1024 * 1024);
         $flex->setFileExtensions('*.zip;*.mp3;*.wav;*.gif;*.jpg;*.jpeg;*.pdf;*.doc;*.xls');
         $flex->setPathToSWF($this->_controller->getEnv()->getContribRequestDir() . '/FlexUpload/');
         $flex->setPathToSWFObject($this->_controller->getEnv()->getContribRequestDir() . '/FlexUpload/js/');
         $flex->setLocale($this->_controller->getEnv()->getContribRequestDir() . '/FlexUpload/locale/en.xml');
         return array('flex' => $flex->getHTML());
     } catch (Exception $exception) {
         require_once 'Sitengine/Newsletter/Backend/Campaigns/Attachments/Exception.php';
         throw new Sitengine_Newsletter_Backend_Campaigns_Attachments_Exception('form page error', $exception);
     }
 }
开发者ID:sitengine,项目名称:sitengine,代码行数:25,代码来源:UploadView.php

示例2: _initSession

 /**
  * init session
  */
 protected function _initSession()
 {
     Zend_Session::start();
     $session = new Zend_Session_Namespace();
     $session->lang = isset($session->lang) ? $session->lang : "pt_BR";
     Zend_Registry::set('session', new Zend_Session_Namespace());
 }
开发者ID:nandorodpires2,项目名称:homemakes,代码行数:10,代码来源:Bootstrap.php

示例3: _initSession

 protected function _initSession()
 {
     $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/sessions.ini', 'development');
     Zend_Session::setOptions($config->toArray());
     // start session
     Zend_Session::start();
 }
开发者ID:richistron,项目名称:Ofelia,代码行数:7,代码来源:Bootstrap.php

示例4: calculationSettingsChangeAction

 public function calculationSettingsChangeAction()
 {
     $this->getHelper('viewRenderer')->setNoRender();
     $request = $this->getRequest();
     if ($request->isPost()) {
         $post = $request->getPost();
         if (!isset($post['changeSet']) || empty($post['changeSet'])) {
             $this->ajaxException("Nieprawidłowa wartość parametrów");
             return;
         } else {
             $data = Zend_Json::decode($post['changeSet']);
             for ($i = 0; $i < $data['formsCount']; $i++) {
                 $form = $data[$i];
                 if (count($form['changes']) == 0) {
                     Logic_FormsTracker::invalidate(Zend_Session::getId() . '_' . $form['trackingName'], Zend_Auth::getInstance()->getIdentity()->id);
                 } else {
                     Logic_FormsTracker::store(Zend_Session::getId(), $form['trackingName'], $form['changes']);
                 }
             }
             echo Zend_Json::encode(array('result' => 'success', 'message' => 'ok'));
         }
     } else {
         $this->ajaxException("Bad request");
         return;
     }
 }
开发者ID:knatorski,项目名称:SMS,代码行数:26,代码来源:AjaxController.php

示例5: preDispatch

 function preDispatch()
 {
     $this->_helper->layout->setLayout('layout-store');
     $this->_helper->layout->setLayoutPath(array('layoutPath' => ROOT_DIR . '/app/modules/hol-site/layouts'));
     Zend_Session::start();
     $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $sReturn = base64_encode($sReturn);
     $identity = Pandamp_Application::getResource('identity');
     $loginUrl = $identity->loginUrl;
     //$loginUrl = ROOT_URL.'/helper/synclogin/generate/?returnTo='.$sReturn;
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->_redirect($loginUrl . '?returnTo=' . $sReturn);
         //$this->_redirect($loginUrl);
     } else {
         // [TODO] else: check if user has access to admin page
         $username = $auth->getIdentity()->username;
         $this->view->username = $username;
     }
     $userId = $auth->getIdentity()->guid;
     $this->_userId = $userId;
     $tblUserFinance = new Pandamp_Modules_Identity_UserFinance_Model_UserFinance();
     $this->_userInfo = $tblUserFinance->find($userId)->current();
     $storeConfig = Pandamp_Application::getOption('store');
     $this->_configStore = $storeConfig;
 }
开发者ID:hukumonline,项目名称:quart80,代码行数:26,代码来源:StoreController.php

示例6: indexAction

 public function indexAction()
 {
     $this->view->messages = $this->_flashMessenger->getMessages();
     $this->_helper->layout->disableLayout();
     if ($this->sessCompanyInfo->parent_id != 0) {
         $this->_redirect('company/access/index/tab_ajax/group/');
     }
     $GroupList = $this->modelGroup->getGroupList($this->sessCompanyInfo->id);
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($GroupList);
     $paginator->setItemCountPerPage(PUBLISHER_PAGING_SIZE);
     //$paginator->setItemCountPerPage(2);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalCount = count($GroupList);
     $this->view->pageSize = PUBLISHER_PAGING_SIZE;
     //$this->view->pageSize=2;
     $this->view->page = $page;
     $this->view->GroupList = $paginator;
     $sessionMsg = new Zend_Session_Namespace('step1Msg');
     if (isset($sessionMsg) && !empty($sessionMsg)) {
         $this->view->formData = $sessionMsg->formData;
         $this->view->formErrors = $sessionMsg->formErrors;
         $this->view->errorMessage = $sessionMsg->errorMessage;
         Zend_Session::namespaceUnset('step1Msg');
     }
 }
开发者ID:vmangla,项目名称:evendor,代码行数:26,代码来源:GroupController.php

示例7: testInitSetsSaveHandler

 public function testInitSetsSaveHandler()
 {
     $saveHandler = $this->getMock('Zend_Session_SaveHandler_Interface');
     $this->resource->setSaveHandler($saveHandler);
     $this->resource->init();
     $this->assertSame($saveHandler, Zend_Session::getSaveHandler());
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:7,代码来源:SessionTest.php

示例8: init

 public function init()
 {
     $this->bootstrap = $this->getInvokeArg('bootstrap');
     $this->options = $this->bootstrap->getOptions();
     $this->_host = $this->_request->getServer('HTTP_HOST');
     if (Zend_Session::sessionExists()) {
         if (!$this->session) {
             $singleton = !empty($this->options['unittest']) ? false : true;
             $this->session = new Zend_Session_Namespace(self::SESSION_NAMESPACE, $singleton);
         }
         $this->_sessionId = Zend_Session::getId();
         do {
             // 登陆信息验证
             $names = $this->options['cookies'];
             if (!isset($this->session->auth) || !$this->_request->getCookie($names['username'])) {
                 break;
             }
             //var_dump($this->_request->getCookie($names['email']));exit();
             if ($this->session->auth['username'] != $this->_request->getCookie($names['username'])) {
                 break;
             }
             $this->session->auth['lasttime'] = time();
             $this->_user = Tudu_User::getInstance();
             $this->_user->init($this->session->auth);
         } while (false);
     } else {
         $authId = $this->_request->getCookie($this->options['cookies']['auth']);
         if (!empty($authId)) {
             $referer = PROTOCOL . '//' . $this->_request->getServer('HTTP_HOST') . '/frame';
             return $this->_redirect($this->options['sites']['www'] . '/login/auto?referer=' . urlencode($referer));
         }
     }
 }
开发者ID:bjtenao,项目名称:tudu-web,代码行数:33,代码来源:IndexController.php

示例9: _initZFDebug

 protected function _initZFDebug()
 {
     if (getenv('APPLICATION_ENV') != 'production' && $this->_config->appSettings->debugMode == 1) {
         $autoloader = Zend_Loader_Autoloader::getInstance();
         $autoloader->registerNamespace('ZFDebug');
         Zend_Session::start();
         $options = array('plugins' => array('Variables', 'File' => array('base_path' => '/path/to/project'), 'Memory', 'Time', 'Registry', 'Exception'));
         # Instantiate the database adapter and setup the plugin.
         # Alternatively just add the plugin like above and rely on the autodiscovery feature.
         if ($this->hasPluginResource('db')) {
             $this->bootstrap('db');
             $db = $this->getPluginResource('db')->getDbAdapter();
             $options['plugins']['Database']['adapter'] = $db;
         }
         # Setup the cache plugin
         if ($this->hasPluginResource('cache')) {
             $this->bootstrap('cache');
             $cache = $this - getPluginResource('cache')->getDbAdapter();
             $options['plugins']['Cache']['backend'] = $cache->getBackend();
         }
         $debug = new ZFDebug_Controller_Plugin_Debug($options);
         $this->bootstrap('frontController');
         $frontController = $this->getResource('frontController');
         $frontController->registerPlugin($debug);
     }
 }
开发者ID:roopkanta-kumari,项目名称:her-group,代码行数:26,代码来源:Bootstrap.php

示例10: perioddialogAction

 public function perioddialogAction()
 {
     $yearList = new Model_Year_List();
     $this->view->assign("yearList", $yearList->getListView());
     $this->view->assign("yearCurrent", Zend_Session::getOptions("yearId"));
     $this->view->assign("filter", new Model_Abstract_Filter());
 }
开发者ID:nikita-prikazchikov,项目名称:academic_load,代码行数:7,代码来源:IndexController.php

示例11: listAction

 /**
  * 一覧
  */
 public function listAction()
 {
     // フォーム設定読み込み
     $form = $this->view->form;
     // 検索・クリア
     if ($this->getRequest()->isPost()) {
         if ($this->getRequest()->getParam('clear')) {
             // クリア
             Zend_Session::namespaceUnset(self::NAMESPACE_LIST);
         } elseif ($this->getRequest()->getParam('search')) {
             // 検索開始
             $form->setDefaults($_POST);
             $session = new Zend_Session_Namespace(self::NAMESPACE_LIST);
             $session->post = $_POST;
             $this->_redirect(self::NAMESPACE_LIST);
         } else {
             // 検索条件復元
             $this->restoreSearchForm($form);
         }
     } else {
         // 検索条件復元
         $this->restoreSearchForm($form);
     }
     // 一覧取得
     $this->createNavigator($this->createWherePhrase());
     // 表示用カスタマイズ
     $models = array();
     foreach ($this->view->paginator as $model) {
         $model = $model->toArray();
         array_push($models, $model);
     }
     $this->view->models = $models;
 }
开发者ID:herisher,项目名称:citrajayamandiri,代码行数:36,代码来源:AdminController.php

示例12: indexAction

 public function indexAction()
 {
     $creditHistoryObj = new User_Model_DbTable_Chistory();
     $this->view->messages = $this->_flashMessenger->getMessages();
     $this->_helper->layout->disableLayout();
     if ($this->sessCompanyInfo->parent_id != 0) {
         $this->_redirect('company/access/index/tab_ajax/transaction/');
     }
     //echo "kkk".$this->sessCompanyInfo->id;
     $sql = "select * from pclive_credit_history where userid='" . $this->sessCompanyInfo->id . "' group by order_id order by credit_id desc";
     $MemberList = $creditHistoryObj->getAdapter()->fetchAll($sql);
     //$MemberList = $transactionHistoryObj->getOrderHistory($this->sessCompanyInfo->id);
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($MemberList);
     $paginator->setItemCountPerPage(PUBLISHER_PAGING_SIZE);
     //$paginator->setItemCountPerPage(2);
     $paginator->setCurrentPageNumber($page);
     $this->view->totalCount = count($MemberList);
     $this->view->pageSize = PUBLISHER_PAGING_SIZE;
     //$this->view->pageSize=2;
     $this->view->page = $page;
     $this->view->MemberList = $paginator;
     $this->view->modelGroup = $this->modelGroup;
     $sessionMsg = new Zend_Session_Namespace('step1Msg');
     if (isset($sessionMsg) && !empty($sessionMsg)) {
         $this->view->formData = $sessionMsg->formData;
         $this->view->formErrors = $sessionMsg->formErrors;
         $this->view->errorMessage = $sessionMsg->errorMessage;
         Zend_Session::namespaceUnset('step1Msg');
     }
 }
开发者ID:vmangla,项目名称:evendor,代码行数:31,代码来源:TransactionhistoryController.php

示例13: preDispatch

 function preDispatch()
 {
     //don't check auth from here because the verificationAction SHOULD NOT USE ANY AUTHENTICATION METHOD
     /*
     - Load Configuration dari tabel kutupaymentSetting
     - set TestMode = True or False 
     */
     $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $this->_testMode = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where(" settingKey= 'testMode'"));
     $crc = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where("settingKey= 'currency'"));
     $this->_defaultCurrency = $crc[0]->settingValue;
     $usdIdrEx = $tblPaymentSetting->fetchAll($tblPaymentSetting->select()->where(" settingKey= 'USDIDR'"));
     $this->_currencyValue = $usdIdrEx[0]->settingValue;
     $this->_helper->layout()->setLayout('layout-final-inside');
     $saveHandlerManager = new Kutu_Session_SaveHandler_Manager();
     $saveHandlerManager->setSaveHandler();
     Zend_Session::start();
     $sReturn = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $sReturn = urlencode($sReturn);
     $this->view->returnTo = $sReturn;
     $tblPaymentSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $rowSet = $tblPaymentSetting->fetchAll();
     //var_dump($rowSet);
     for ($iRow = 0; $iRow < count($rowSet); $iRow++) {
         $key = $rowSet[$iRow]->settingKey;
         $this->_paymentVars[$key] = $rowSet[$iRow]->settingValue;
     }
     $tblSetting = new Kutu_Core_Orm_Table_PaymentSetting();
     $this->_lgsMail = $tblSetting->fetchAll($tblSetting->select()->where("settingKey = 'paypalBusiness'"));
 }
开发者ID:psykomo,项目名称:kutump,代码行数:30,代码来源:PaymentController.php

示例14: logoutAction

 public function logoutAction()
 {
     Zend_Session::destroy();
     $out['errno'] = '0';
     $out['msg'] = Yy_ErrMsg_User::getMsg('logout', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
开发者ID:baiooy,项目名称:hqimt_backend,代码行数:7,代码来源:UserController.php

示例15: main

 static function main()
 {
     Zend_Registry::set('config', new Strass_Config_Php('strass', array()));
     Zend_Registry::set('acl', new Strass_Installer_FakeAcl());
     Strass_Cache::setup();
     try {
         $fc = Zend_Controller_Front::getInstance();
         $fc->setRequest(new Strass_Controller_Request_Http());
         $fc->setParam('useDefaultControllerAlways', true);
         $fc->setParam('noViewRenderer', true);
         $fc->setModuleControllerDirectoryName('Installer');
         $fc->addControllerDirectory(Strass::getPrefix() . 'include/Strass/Installer/Controller', 'Strass');
         $fc->setDefaultModule('Strass');
         $fc->registerPlugin(new Strass_Controller_Plugin_Error());
         $fc->dispatch();
         Zend_Session::writeClose();
     } catch (Exception $e) {
         // affichage complet des exceptions non intercepté par le controlleur. À améliorer.
         $msg = ":(\n\n";
         $msg .= $e->getMessage() . "\n\n";
         $msg .= " à " . $e->getFile() . ":" . $e->getLine() . "\n\n";
         $msg .= str_replace('#', '<br/>#', $e->getTraceAsString()) . "\n";
         Orror::kill(strip_tags($msg));
     }
 }
开发者ID:bersace,项目名称:strass,代码行数:25,代码来源:Installer.php


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