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


PHP Wekit::S方法代碼示例

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


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

示例1: getUrl

 /** 
  * 獲取全站url信息
  *
  * @return obj
  */
 public function getUrl()
 {
     $_consts = Wekit::S('publish');
     foreach ($_consts as $const => $value) {
         if (defined($const)) {
             continue;
         }
         if ($const === 'PUBLIC_URL' && !$value) {
             $value = Wind::getComponent('request')->getBaseUrl(true);
             if (defined('BOOT_PATH') && 0 === strpos(BOOT_PATH, PUBLIC_PATH)) {
                 $path = substr(BOOT_PATH, strlen(PUBLIC_PATH));
                 !empty($path) && ($value = substr($value, 0, -strlen($path)));
             }
         }
         define($const, $value);
     }
     $url = new stdClass();
     $url->base = PUBLIC_URL;
     $url->res = WindUrlHelper::checkUrl(PUBLIC_RES, $url->base);
     $url->css = WindUrlHelper::checkUrl(PUBLIC_RES . '/css/', $url->base);
     $url->images = WindUrlHelper::checkUrl(PUBLIC_RES . '/images/', $url->base);
     $url->js = WindUrlHelper::checkUrl(PUBLIC_RES . '/js/dev/', $url->base);
     $url->attach = WindUrlHelper::checkUrl(PUBLIC_ATTACH, $url->base);
     $url->themes = WindUrlHelper::checkUrl(PUBLIC_THEMES, $url->base);
     $url->extres = WindUrlHelper::checkUrl(PUBLIC_THEMES . '/extres/', $url->base);
     return $url;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:32,代碼來源:bootstrap.php

示例2: routerShutdown

 public function routerShutdown(Yaf\Request_Abstract $request, Yaf\Response_Abstract $response)
 {
     if ($request->controller == 'Api') {
         require \Yaf\Registry::get('config')->application->phpwind->wekit_bin;
         Wekit::init('phpwind');
         $application = Wind::application('phpwind', Wekit::S());
     }
 }
開發者ID:randy-ran,項目名稱:open-api-for-vopi,代碼行數:8,代碼來源:Wekit.php

示例3: error_reporting

<?php

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']);
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:31,代碼來源:bootstrap.php


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