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


PHP unknown_type::getResource方法代码示例

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


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

示例1: init

 /**
  * 初始化
  */
 public function init()
 {
     $this->_bootstrap = $this->getInvokeArg('bootstrap');
     $this->_multidb = $this->_bootstrap->getResource('multidb');
     $this->_options = $this->_bootstrap->getOptions();
     $this->_helper->viewRenderer->view->setBasePath(APPLICATION_PATH . '/modules/foreign/views');
     $this->_helper->viewRenderer->setViewScriptPathSpec(':module#:controller#:action.:suffix');
     $this->_tsId = $this->_request->getParam('ts');
     $tuduId = $this->_request->getParam('tid');
     $unId = $this->_request->getParam('fid');
     if (!$this->_tsId || !$tuduId || !$unId) {
         $this->getResponse()->setHttpResponseCode(404);
         $this->getResponse()->sendResponse();
         return;
     }
     Tudu_Dao_Manager::setDbs(array(Tudu_Dao_Manager::DB_TS => $this->getTsDb($this->_tsId)));
     $this->_manager = Tudu_Tudu_Manager::getInstance();
     $this->_deliver = new Tudu_Deliver($this->getTsDb($this->_tsId));
     $this->_tudu = $this->_manager->getTuduById($tuduId, $unId);
     $this->_user = $this->_manager->getUser($tuduId, $unId);
     if (null !== $this->_user) {
         // 用户请求语言
         $language = $this->_request->getHeader('ACCEPT_LANGUAGE');
         if (strpos($language, 'zh') !== false) {
             if (strpos($language, 'hk') !== false || strpos($language, 'tw') !== false) {
                 $language = 'zh_TW';
             } else {
                 $language = 'zh_CN';
             }
         } else {
             $language = 'en_US';
         }
         $this->_user['option'] = array('language' => $language);
         if (null !== $this->_tudu) {
             $this->_session = new Zend_Session_Namespace(self::SESSION_NAMESPACE, true);
             $this->_sessionId = Zend_Session::getId();
             //
             /*if (isset($this->_session->foreign['uniqueid']) && $this->_session->foreign['uniqueid'] != $this->_user['uniqueid']) {
                   $this->_destroySession();
               }*/
             $this->_session->foreign['uniqueid'] = $this->_user['uniqueid'];
             $this->_session->foreign['address'] = $this->_user['email'] ? $this->_user['email'] : $this->_user['uniqueid'];
             $this->_session->foreign['truename'] = $this->_user['truename'];
             $this->_session->foreign['logintime'] = time();
             $this->_session->foreign['orgid'] = $this->_tudu->orgId;
             $this->_session->foreign['tsid'] = $this->_tsId;
             $this->_session->foreign['lasttime'] = time();
             if (empty($this->_session->auth)) {
                 $this->_session->auth = array('uniqueid' => $this->_user['uniqueid'], 'address' => $this->_session->foreign['address'], 'logintime' => $this->_session->foreign['logintime']);
             }
         }
         $this->_timestamp = time();
         $this->view->options = $this->_options;
         $this->view->tsid = $this->_tsId;
         $this->view->user = $this->_user;
     }
 }
开发者ID:bjtenao,项目名称:tudu-web,代码行数:60,代码来源:Foreign.php

示例2: getResource

 /**
  * This method will returns a resource identified by a key.
  * It will ask to all {@link __ResourceDictionary} instances if any of them has the resource, and will return it if it's found.
  *
  * @param string The resource's key
  * 
  * @return __ResourceBase The requested resource or null if it's not found.
  * 
  */
 public function getResource($resource_key, $language_iso_code = null)
 {
     $return_value = null;
     if ($language_iso_code == null) {
         $language_iso_code = __I18n::getInstance()->getLocale()->getLanguageIsoCode();
     }
     if ($this->_resource_table->hasLanguage($language_iso_code) == false) {
         $this->loadResources($language_iso_code);
     }
     return $this->_resource_table->getResource($resource_key, $language_iso_code);
 }
开发者ID:laiello,项目名称:lion-framework,代码行数:20,代码来源:ResourceManager.class.php

示例3: init

 /**
  * 初始化
  */
 public function init()
 {
     $this->_helper->viewRenderer->setNeverRender();
     $this->_bootstrap = $this->getInvokeArg('bootstrap');
     $this->_multidb = $this->_bootstrap->getResource('multidb');
 }
开发者ID:bjtenao,项目名称:tudu-web,代码行数:9,代码来源:Api.php


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