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


PHP Wind::getApp方法代碼示例

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


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

示例1: beforeAction

 public function beforeAction($handlerAdapter)
 {
     parent::beforeAction($handlerAdapter);
     $charset = 'utf-8';
     $_windidkey = $this->getInput('windidkey', 'get');
     $_time = (int) $this->getInput('time', 'get');
     $_clientid = (int) $this->getInput('clientid', 'get');
     if (!$_time || !$_clientid) {
         $this->output(WindidError::FAIL);
     }
     $clent = $this->_getAppDs()->getApp($_clientid);
     if (!$clent) {
         $this->output(WindidError::FAIL);
     }
     if (WindidUtility::appKey($clent['id'], $_time, $clent['secretkey']) != $_windidkey) {
         $this->output(WindidError::FAIL);
     }
     $time = Windid::getTime();
     if ($time - $_time > 120) {
         $this->output(WindidError::TIMEOUT);
     }
     $charset = $clent['charset'] == 1 ? 'utf8' : 'gbk';
     $baseUrl = Wind::getApp()->getRequest()->getBaseUrl(true) . '/';
     $config = array('windid' => 'client', 'serverUrl' => $baseUrl, 'clientId' => $clent['id'], 'clientKey' => $clent['secretkey'], 'clientDb' => 'mysql', 'clientCharser' => $charset);
     WindidClientBo::getInstance($config);
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:26,代碼來源:IndexController.php

示例2: beforeAction

 public function beforeAction($handlerAdapter)
 {
     $this->setOutput(NEXT_VERSION, 'wind_version');
     $_consts = (include Wind::getRealPath('CONF:publish.php', true));
     foreach ($_consts as $const => $value) {
         if (defined($const)) {
             continue;
         }
         if ($const === 'PUBLIC_URL' && !$value) {
             $value = Wind::getApp()->getRequest()->getBaseUrl(true);
         }
         define($const, $value);
     }
     $url = array();
     $url['base'] = PUBLIC_URL;
     $url['res'] = WindUrlHelper::checkUrl(PUBLIC_RES, PUBLIC_URL);
     $url['css'] = WindUrlHelper::checkUrl(PUBLIC_RES . '/css/', PUBLIC_URL);
     $url['images'] = WindUrlHelper::checkUrl(PUBLIC_RES . '/images/', PUBLIC_URL);
     $url['js'] = WindUrlHelper::checkUrl(PUBLIC_RES . '/js/dev/', PUBLIC_URL);
     $url['attach'] = WindUrlHelper::checkUrl(PUBLIC_ATTACH, PUBLIC_URL);
     Wekit::setGlobal($url, 'url');
     $this->setOutput('phpwind 8.7 to 9.0', 'wind_version');
     //ajax遞交編碼轉換
     $token = $this->getInput('token', 'get');
     $lockFile = Wind::getRealPath('DATA:setup.setup.lock', true);
     if (file_exists($lockFile) && !$token) {
         $this->showError('升級程序已被鎖定, 如需重新運行,請先刪除setup.lock');
     }
     $encryptToken = trim(file_get_contents($lockFile));
     if (md5($token) != $encryptToken) {
         $this->showError('升級程序訪問異常! 重新安裝請先刪除setup.lock');
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:33,代碼來源:UpgradeController.php

示例3: checkAction

 public function checkAction()
 {
     require_once Wind::getRealPath('ACLOUD:aCloud');
     ACloudSysCoreCommon::setGlobal('g_siteurl', PUBLIC_URL);
     ACloudSysCoreCommon::setGlobal('g_sitename', 'phpwind');
     ACloudSysCoreCommon::setGlobal('g_charset', Wind::getApp()->getResponse()->getCharset());
     list($this->BenchService, $operate) = array(ACloudSysCoreCommon::loadSystemClass('administor', 'bench.service'), strtolower($this->getInput("operate")));
     return $operate == 'reset' ? $this->reset() : $this->checkEnvironment();
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:9,代碼來源:ServerController.php

示例4: init

 protected function init()
 {
     $router = Wind::getComponent('router');
     $this->default_m || ($this->default_m = Wind::getApp()->getConfig('default-module', '', $router->getDefaultModule()));
     if ($this->getConfig('default')) {
         $router->setDefaultModule($this->default_m);
     }
     $this->init = true;
 }
開發者ID:ccq18,項目名稱:EduSoho,代碼行數:9,代碼來源:PwAdminRoute.php

示例5: run

 public function run()
 {
     $this->setOutput("Error message", "errorHeader");
     $this->setOutput($this->error, "errors");
     $errDir = Wind::getApp()->getConfig('errorpage');
     !$errDir && ($errDir = $this->errorDir);
     $this->setTemplatePath($errDir);
     $this->setTemplate('erroraction');
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:9,代碼來源:WindErrorHandler.php

示例6: testGetInstance

 /**
  * Tests WindFactory->getInstance()
  */
 public function testGetInstance()
 {
     $this->assertTrue(Wind::getApp()->getComponent("forward") instanceof WindForward);
     try {
         Wind::getApp()->getComponent("notExistCom");
     } catch (WindException $e) {
         return;
     }
     $this->fail("GetInstance Test Error");
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:13,代碼來源:WindFactoryTest.php

示例7: checkUrl

 /**
  * url檢查
  * 
  * 當$absolute === true且url不包含協議部分時,默認加上當前應用的協議部分.
  * @param string $url 需要檢查合法性的url
  * @param boolean $absolute 是否為絕對路徑
  * @return string
  */
 public static function checkUrl($url, $absolute = true)
 {
     if ($absolute) {
         $_baseUrl = $absolute === true ? Wind::getApp()->getRequest()->getBaseUrl(true) : $absolute;
         if (strpos($url, '://') === false) {
             $url = trim($_baseUrl, '/') . '/' . trim($url, '/');
         }
     }
     return $url;
 }
開發者ID:ccq18,項目名稱:EduSoho,代碼行數:18,代碼來源:WindUrlHelper.php

示例8: synLogin

 public function synLogin($uid)
 {
     Wind::import('SRC:service.user.bo.PwUserBo');
     Wind::import('SRC:service.user.srv.PwLoginService');
     $userBo = new PwUserBo($uid);
     $srv = new PwLoginService();
     $ip = Wind::getApp()->getRequest()->getClientIp();
     $srv->welcome($userBo, $ip);
     return true;
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:10,代碼來源:PwWindidInform.php

示例9: showErrorMessage

 protected function showErrorMessage($message, $file, $line, $trace, $errorcode)
 {
     $log = $message . "\r\n" . $file . ":" . $line . "\r\n";
     list($fileLines, $trace) = WindUtility::crash($file, $line, $trace);
     foreach ($trace as $key => $value) {
         $log .= $value . "\r\n";
     }
     if (WIND_DEBUG & 2) {
         Wind::getApp()->getComponent('windLogger')->error($log, 'error', true);
     }
     exit($log);
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:12,代碼來源:WindCommandFrontController.php

示例10: compile

 public function compile($key, $content)
 {
     if (!$this->message) {
         return $content;
     }
     $resource = Wind::getApp()->getComponent('i18n');
     $resource !== null && ($this->message = $resource->getMessage($this->message));
     if (!$this->params) {
         return $this->message;
     }
     return '<?php echo WindUtility::strtr("' . $this->message . '", ' . $this->params . ');?>';
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:12,代碼來源:WindTemplateCompilerLang.php

示例11: getAction

    /**
     * 獲取驗證碼
     */
    public function getAction()
    {
        $rand = $this->getInput('rand', 'get');
        $config = Wekit::C('verify');
        $config['type'] = $config['type'] ? $config['type'] : 'image';
        Wind::import('SRV:verify.srv.PwVerifyService');
        $srv = new PwVerifyService('PwVerifyService_getVerifyType');
        if ($rand) {
            $srv->getVerify($config['type']);
            exit;
        }
        $url = WindUrlHelper::createUrl('verify/index/get', array('rand' => Pw::getTime()), '', 'pw');
        $display = $srv->getOutType($config['type']);
        if ($display == 'flash') {
            $html = '<embed align="middle" 
				width="' . $config['width'] . '" 
				height="' . $config['height'] . '" 
				type="application/x-shockwave-flash" 
				allowscriptaccess="sameDomain" 
				menu="false" 
				bgcolor="#ffffff" 
				wmode="transparent" 
				quality="high" 
				src="' . $url . '">';
            if ($config['voice']) {
                $url = WindUrlHelper::createUrl('verify/index/getAudio', array('songVolume' => 100, 'autoStart' => 'false', 'repeatPlay' => 'false', 'showDownload' => 'false', 'rand' => Pw::getTime()), '', 'pw');
                $html .= '<embed height="20" width="25" 
				type="application/x-shockwave-flash" 
				pluginspage="http://www.macromedia.com/go/getflashplayer" 
				quality="high" 
				src="' . Wind::getApp()->getResponse()->getData('G', 'url', 'images') . '/audio.swf?file=' . urlencode($url) . '">';
            }
            $html .= '<a id="J_verify_update_a" href="#" role="button">換一個</a>';
        } elseif ($display == 'image') {
            $html = '<img id="J_verify_update_img" src="' . $url . '" 
				width="' . $config['width'] . '" 
				height="' . $config['height'] . '" >';
            if ($config['voice']) {
                $url = WindUrlHelper::createUrl('verify/index/getAudio', array('songVolume' => 100, 'autoStart' => 'false', 'repeatPlay' => 'false', 'showDownload' => 'false', 'rand' => Pw::getTime()), '', 'pw');
                $html .= '<span title="點擊後鍵入您聽到的內容"><embed wmode="transparent" height="20" width="25" 
				type="application/x-shockwave-flash" 
				pluginspage="http://www.macromedia.com/go/getflashplayer" 
				quality="high" 
				src="' . Wind::getApp()->getResponse()->getData('G', 'url', 'images') . '/audio.swf?file=' . urlencode($url) . '"></span>';
            }
            $html .= '<a id="J_verify_update_a" href="#" role="button">換一個</a>';
        } else {
            $html = $srv->getVerify($config['type']);
        }
        $this->setOutput($html, 'html');
        $this->showMessage("operate.success");
    }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:55,代碼來源:IndexController.php

示例12: testFormFilter

 public function testFormFilter()
 {
     $_SERVER['SCRIPT_FILENAME'] = "index.php";
     $_SERVER['SCRIPT_NAME'] = 'index.php';
     $_SERVER['HTTP_HOST'] = 'localhost';
     $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?c=long&a=test';
     $_POST['shi'] = 'shi';
     $_POST['long'] = 'long';
     Wind::application('EnableValidata', $this->getConfigData())->run();
     $testForm = Wind::getApp()->getRequest()->getAttribute("testForm");
     $this->assertEquals("shi", $testForm->getShi());
     $this->assertEquals("long", $testForm->getLong());
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:13,代碼來源:WindEnableValidateModuleTest.php

示例13: synLogin

 public function synLogin($uid)
 {
     Wind::import('SRC:service.user.bo.PwUserBo');
     Wind::import('SRC:service.user.srv.PwLoginService');
     $userBo = new PwUserBo($uid);
     if ($userBo->isExists() && !Pw::getstatus($userBo->info['status'], PwUser::STATUS_UNACTIVE)) {
         $srv = new PwLoginService();
         $ip = Wind::getApp()->getRequest()->getClientIp();
         $srv->setLoginCookie($userBo, $ip, 1);
     }
     exit;
     //return true;
 }
開發者ID:YoursBoss,項目名稱:nextwind,代碼行數:13,代碼來源:PwWindidInform.php

示例14: testDispatch

 /**
  * Tests WindDispatcher->dispatch()
  */
 public function testDispatch()
 {
     $_SERVER['SCRIPT_FILENAME'] = "index.php";
     $_SERVER['SCRIPT_NAME'] = 'index.php';
     $_SERVER['HTTP_HOST'] = 'localhost';
     $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_FILENAME'] . '?c=long&a=noPrint';
     $front = Wind::application('long', array('web-apps' => array('long' => array('modules' => array('default' => array('controller-path' => 'data', 'controller-suffix' => 'Controller', 'error-handler' => 'TEST:data.ErrorControllerTest'))))))->run();
     $forward = new WindForward();
     $forward->setIsReAction(true);
     $forward->setAction('/long/test');
     ob_start();
     Wind::getApp()->doDispatch($forward);
     $this->assertEquals(ob_get_clean(), 'LongController-test');
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:17,代碼來源:WindDispatcherTest.php

示例15: getDao

 /**
  * 返回Dao類實例
  * 
  * $className接受兩種形式呃參數如下
  * <ul>
  * <li>'namespace:path'</li>
  * <li>'className'</li>
  * </ul>
  * 
  * @param string $className Dao名字
  * @return WindDao
  * @throws WindDaoException 如果獲取實例錯誤拋出異常
  */
 public function getDao($className)
 {
     try {
         if (strpos($className, ":") === false) {
             $className = $this->getDaoResource() . '.' . $className;
         }
         Wind::getApp()->getWindFactory()->addClassDefinitions($className, array('path' => $className, 'scope' => 'application'));
         $daoInstance = Wind::getApp()->getWindFactory()->getInstance($className);
         $daoInstance->setDelayAttributes(array('connection' => array('ref' => 'db')));
         return $daoInstance;
     } catch (Exception $exception) {
         throw new WindDaoException('[dao.WindDaoFactory] create dao ' . $className . ' fail.' . $exception->getMessage());
     }
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:27,代碼來源:WindDaoFactory.php


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