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


PHP Wekit::V方法代碼示例

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


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

示例1: afterAction

 public function afterAction($handlerAdapter)
 {
     parent::afterAction($handlerAdapter);
     $debug = Wekit::C('site', 'debug') || !Wekit::C('site', 'css.compress');
     Wekit::setGlobal(array('debug' => $debug ? '/dev' : '/build'), 'theme');
     $this->setTheme('site', null);
     /* @var $resource WindLangResource */
     $resource = Wind::getComponent('i18n');
     $_error = $this->getForward()->getVars('message');
     if ($resource !== null) {
         foreach ($_error as $key => $value) {
             if (is_array($value)) {
                 list($value, $var) = $value;
             } else {
                 $var = array();
             }
             $message = $resource->getMessage($value, $var);
             $message && ($_error[$key] = $message);
         }
     }
     $this->getForward()->setVars(array('message' => $_error, '__error' => ''));
     $type = $this->getRequest()->getAcceptTypes();
     // 如果是含有上傳的遞交,不能采用ajax的方式遞交,需要以html的方式遞交,並且返回的結果需要是json格式,將以json=1傳遞過來標誌
     $json = $this->getInput('_json');
     $requestJson = $this->getRequest()->getIsAjaxRequest() && strpos(strtolower($type), "application/json") !== false;
     if ($requestJson || $json == 1) {
         $this->getResponse()->setHeader('Content-type', 'application/json; charset=' . Wekit::V('charset'));
         echo Pw::jsonEncode($this->getForward()->getVars());
         exit;
     }
 }
開發者ID:BTSnowball,項目名稱:BTSnowball_Users_Hand,代碼行數:31,代碼來源:PwErrorController.php

示例2: checkUpgrade

 /**
  * 根據當前版本+release獲取升級信息(patch包地址) ,hash值
  * 獲取升級文件列表
  */
 public function checkUpgrade()
 {
     $url = PwApplicationHelper::acloudUrl(array('a' => 'forward', 'do' => 'getUpdateInfo', 'pwversion' => $this->local));
     $r = PwApplicationHelper::requestAcloudData($url);
     $r = WindConvert::convert($r, Wekit::V('charset'), 'utf8');
     return is_array($r) ? $r['code'] === '0' ? $r['info'] : $r['msg'] : '無法連接雲平台!';
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:11,代碼來源:PwSystemInstallation.php

示例3: run

 public function run()
 {
     header("Content-type: text/html; charset=" . Wekit::V('charset'));
     //$pwServer['HTTP_USER_AGENT'] = 'Shockwave Flash';
     $swfhash = 1;
     Pw::echoJson(array('uid' => $this->loginUser->uid, 'a' => 'dorun', 'verify' => $swfhash));
     $this->setTemplate('');
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:8,代碼來源:UploadController.php

示例4: getCache

 public function getCache()
 {
     $cache = new PwCache();
     $cache->mergeKeys(Wekit::V('cacheKeys'));
     if (Wekit::V('dbcache') && $cache->isDbCache()) {
         PwLoader::importCache(Wekit::S('cacheService'));
     }
     return $cache;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:9,代碼來源:bootstrap.php

示例5: afterAction

 /**
  * 重寫下afterAction,不去i18n解析
  * 
  */
 public function afterAction($handlerAdapter)
 {
     $_error = $this->getForward()->getVars('message');
     $this->getForward()->setVars(array('message' => $_error, '__error' => ''));
     $type = $this->getRequest()->getAcceptTypes();
     if ($this->getRequest()->getIsAjaxRequest() && strpos(strtolower($type), "application/json") !== false) {
         $this->getResponse()->setHeader('Content-type', 'application/json; charset=' . Wekit::V('charset'));
         exit(Pw::jsonEncode($this->getForward()->getVars()));
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:14,代碼來源:MessageController.php

示例6: output

 protected function output($message = '')
 {
     if (is_numeric($message)) {
         echo $message;
         exit;
     } else {
         header('Content-type: application/json; charset=' . Wekit::V('charset'));
         echo Pw::jsonEncode($message);
         exit;
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:11,代碼來源:OpenBaseController.php

示例7: __construct

 /**
  * manifest path
  *
  * @param string $manifest        	
  */
 public function __construct($manifest, $extends = array())
 {
     is_string($manifest) && ($manifest = Wind::getComponent('configParser')->parse($manifest));
     if ($extends) {
         $manifest = WindUtility::mergeArray($manifest, $extends);
         $charset = isset($manifest['application']['charset']) ? $manifest['application']['charset'] : 'utf-8';
     } else {
         $charset = Wekit::V('charset');
     }
     strncasecmp($charset, 'utf', 3) && ($manifest = WindConvert::convert($manifest, $charset, 'utf-8'));
     $this->manifest = $manifest;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:17,代碼來源:PwManifest.php

示例8: __construct

 public function __construct()
 {
     $config = Wekit::C('email');
     $this->_config = array('mailOpen' => $config['mailOpen'], 'mailMethod' => $config['mailMethod'], 'host' => $config['mail.host'], 'port' => $config['mail.port'], 'from' => $config['mail.from'], 'auth' => $config['mail.auth'], 'user' => $config['mail.user'], 'password' => $config['mail.password'], 'timeout' => 20);
     //嘗試鏈接超時時間
     $this->_mail = new WindMail();
     $this->_mail->setCharset(Wekit::V('charset'));
     $this->_mail->setDate(date('r', Pw::getTime()));
     $this->_mail->setContentEncode(WindMail::ENCODE_BASE64);
     $this->_mail->setContentType(WindMail::MIME_HTML);
     $this->_mail->setFrom($this->_config['from'], Wekit::C('site', 'info.name'));
 }
開發者ID:ccq18,項目名稱:EduSoho,代碼行數:12,代碼來源:PwMail.php

示例9: _setPreHook

 protected function _setPreHook($m, $mc, $mca)
 {
     $prehook = Wekit::V('prehook');
     PwHook::preset($prehook['ALL']);
     PwHook::preset($prehook[$this->loginUser->isExists() ? 'LOGIN' : 'UNLOGIN']);
     if (isset($prehook[$m])) {
         PwHook::preset($prehook[$m]);
     }
     if (isset($prehook[$mc])) {
         PwHook::preset($prehook[$mc]);
     }
     if (isset($prehook[$mca])) {
         PwHook::preset($prehook[$mca]);
     }
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:15,代碼來源:PwBaseController.php

示例10: afterAction

 public function afterAction($handlerAdapter)
 {
     parent::afterAction($handlerAdapter);
     $debug = Wekit::C('site', 'debug') || !Wekit::C('site', 'css.compress');
     Wekit::setGlobal(array('debug' => $debug ? '/dev' : '/build'), 'theme');
     $this->setTheme('site', null);
     /* @var $resource WindLangResource */
     $resource = Wind::getComponent('i18n');
     $_error = $this->getForward()->getVars('message');
     if ($resource !== null) {
         foreach ($_error as $key => $value) {
             if (is_array($value)) {
                 list($value, $var) = $value;
             } else {
                 $var = array();
             }
             $message = $resource->getMessage($value, $var);
             $message && ($_error[$key] = $message);
         }
     }
     $this->getForward()->setVars(array('message' => $_error, '__error' => ''));
     $type = $this->getRequest()->getAcceptTypes();
     // 如果是含有上傳的遞交,不能采用ajax的方式遞交,需要以html的方式遞交,並且返回的結果需要是json格式,將以json=1傳遞過來標誌
     $json = $this->getInput('_json');
     $requestJson = $this->getRequest()->getIsAjaxRequest() && strpos(strtolower($type), "application/json") !== false;
     if ($requestJson || $json == 1) {
         $this->getResponse()->setHeader('Content-type', 'application/json; charset=' . Wekit::V('charset'));
         $vars = $this->getForward()->getVars();
         isset($vars['referer']) && ($vars['referer'] = rawurlencode($vars['referer']));
         foreach ($vars as $key => $value) {
             if ($key == 'html') {
                 continue;
             }
             //$vars[$key] = WindSecurity::escapeArrayHTML($value);
         }
         //jsonp
         $callback = $this->getInput('callback', 'get');
         if ($callback && preg_match('/[\\w_]/i', $callback)) {
             echo $callback . "(" . Pw::jsonEncode($vars) . ")";
             exit;
         }
         //            print_r($vars);
         echo Pw::jsonEncode($vars);
         exit;
     }
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:46,代碼來源:PwErrorController.php

示例11: dorunAction

 public function dorunAction()
 {
     $this->getRequest()->isPost() || $this->showError('operate.fail');
     list($windid, $serverUrl, $clientId, $clientKey, $connect) = $this->getInput(array('windid', 'serverUrl', 'clientId', 'clientKey', 'connect'), 'post');
     if ($windid == 'local') {
         $serverUrl = Wekit::C('site', 'info.url') . '/windid';
         $clientId = 1;
         !$clientKey && ($clientKey = md5(WindUtility::generateRandStr(10)));
         $connect = 'db';
     }
     $config = new PwConfigSet('windid');
     $config->set('windid', $windid)->set('serverUrl', $serverUrl)->set('clientId', $clientId)->set('clientKey', $clientKey)->set('connect', $connect);
     if ($windid == 'client') {
         list($dbhost, $dbport, $dbuser, $dbpwd, $dbname, $dbprefix, $dbcharset) = $this->getInput(array('dbhost', 'dbport', 'dbuser', 'dbpwd', 'dbname', 'dbprefix', 'dbcharset'), 'post');
         $config->set('db.host', $dbhost)->set('db.port', $dbport)->set('db.user', $dbuser)->set('db.pwd', $dbpwd)->set('db.name', $dbname)->set('db.prefix', $dbprefix)->set('db.charset', $dbcharset);
     }
     $config->flush();
     if ($clientId) {
         Wekit::C()->reload('windid');
         $service = WindidApi::api('app');
         WindidApi::getDm('app');
         if (!$service->getApp($clientId)) {
             $charset = Wekit::V('charset');
             $charset = str_replace('-', '', strtolower($charset));
             if (!in_array($charset, array('gbk', 'utf8', 'big5'))) {
                 $charset = 'utf8';
             }
             $dm = new WindidAppDm();
             $dm->setId($clientId)->setApiFile('windid.php')->setIsNotify(1)->setIsSyn(1)->setAppName(Wekit::C('site', 'info.name'))->setSecretkey($clientKey)->setAppUrl(Wekit::C('site', 'info.url'))->setAppIp(Wind::getComponent('request')->getClientIp())->setCharset($charset);
             $service->addApp($dm);
         } elseif ($clientKey) {
             $dm = new WindidAppDm($clientId);
             $dm->setSecretkey($clientKey)->setAppUrl(Wekit::C('site', 'info.url'))->setCharset($charset);
             $service->editApp($dm);
         }
     }
     $_avatarUrl = WindidApi::api('avatar')->getAvatarUrl();
     if ($_avatarUrl != WindidError::SERVER_ERROR) {
         Wekit::C()->setConfig('site', 'avatarUrl', $_avatarUrl);
     }
     $this->showMessage('ADMIN:success');
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:42,代碼來源:WindidController.php

示例12: getOnlinePatchList

 /**
  * 獲取線上補丁列表
  *
  * @return Ambigous <multitype:, boolean, string>
  */
 public function getOnlinePatchList()
 {
     $url = PwApplicationHelper::acloudUrl(array('a' => 'forward', 'do' => 'getSecurityPatch', 'pwversion' => NEXT_VERSION));
     $r = PwApplicationHelper::requestAcloudData($url);
     if (!is_array($r)) {
         return '無法連接雲平台!';
     }
     if ($r['code'] !== '0') {
         return $r['msg'];
     }
     /* $r['info'] = array(
     			array('id' => '9000001', 'name' => '更新', 'desc' => 'blabla', 'time' => '1323333', 'rule' => array(
     				array('filename' => 'src/wekit.php', 'search' => base64_encode('Jianmin Chen'), 'replace' => base64_encode('Shi Long'), 'count' => '1', 'nums' => array('1'))))
     		); */
     $temp = array();
     foreach ($r['info'] as $v) {
         $v['id'] = $v['name'];
         $temp[$v['id']] = WindConvert::convert($v, Wekit::V('charset'), 'utf8');
     }
     return $temp;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:26,代碼來源:PwPatchUpdate.php

示例13: run

 public function run()
 {
     header("Content-type:text/html;charset=" . Wekit::V('charset'));
     echo '這裏是windid係統服務中心';
     exit;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:6,代碼來源:IndexController.php

示例14: error_reporting

if (!defined('WEKIT_VERSION')) {
    error_reporting(E_ERROR | E_PARSE);
    require_once WINDID_BOOT . '../wekit.php';
    Wekit::init('windidclient');
    Wind::application('windidclient', Wekit::S());
    $database = (include WINDID_BOOT . 'conf/database.php');
    $windidConfig = (include Wind::getRealPath('WINDID:conf.config.php', true));
    Wind::register(WINDID_PATH . 'service', 'SRV');
} else {
    $windidConfig = Wekit::C('windid');
    if ($windidConfig['windid'] == 'local') {
        $database = Wind::getComponent('db')->getConfig();
        $database['tableprefix'] .= 'windid_';
        $windidConfig['connect'] = 'db';
    } else {
        $database = array('dsn' => 'mysql:host=' . $windidConfig['db.host'] . ';dbname=' . $windidConfig['db.name'] . ';port=' . $windidConfig['db.port'], 'user' => $windidConfig['db.user'], 'pwd' => $windidConfig['db.pwd'], 'charset' => $windidConfig['db.charset'], 'tableprefix' => $windidConfig['db.prefix']);
    }
    $windidConfig['charset'] = Wekit::V('charset');
}
Wind::register(WINDID_PATH . 'service', 'WSRV');
Wind::import('WSRV:base.WindidBaseDao');
Wind::import('WSRV:base.WindidUtility');
Wind::import('WSRV:base.WindidError');
Wind::registeComponent(array('path' => 'WIND:db.WindConnection', 'config' => $database), 'windiddb', 'singleton');
define('WINDID_CONNECT', $windidConfig['connect']);
define('WINDID_SERVER_URL', $windidConfig['serverUrl']);
define('WINDID_CLIENT_ID', $windidConfig['clientId']);
define('WINDID_CLIENT_KEY', $windidConfig['clientKey']);
define('WINDID_CLIENT_CHARSET', $windidConfig['charset']);
Wekit::createapp('windidclient', 'windid');
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:30,代碼來源:bootstrap.php

示例15: _saveVerifyCode

 private function _saveVerifyCode()
 {
     Wind::import('LIB:utility.verifycode.PwBaseCode');
     $code = WindConvert::convert(PwBaseCode::getCode(), Wekit::V('charset'), 'UTF-8');
     $code = Pw::encrypt(strtolower($code));
     //Wind::import('WIND:http.session.WindSession');
     Pw::setCookie('Pw_verify_code', $code, 3600);
     /*$session = new WindSession();
     		$session->set('verifycode', $code);*/
 }
開發者ID:latticet,項目名稱:EduSoho_jb51,代碼行數:10,代碼來源:PwVerifyCode.php


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