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


PHP Kurogo::getCharset方法代码示例

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


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

示例1: display

 public function display()
 {
     $json = $this->getJSONOutput();
     $size = strlen($json);
     header("Content-Type: application/json; charset=" . Kurogo::getCharset());
     header("Content-Length: " . $size);
     echo $json;
     return $json;
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:9,代码来源:APIResponse.php

示例2: debug

 public static function debug($val = '', $halt = false, $trace = true)
 {
     $plain = false;
     if ($halt && !headers_sent()) {
         $plain = true;
         header('Content-type: text/plain; charset=' . Kurogo::getCharset());
     }
     $line_break = PHP_SAPI == 'cli' || $plain ? PHP_EOL : PHP_EOL . "<br />" . PHP_EOL;
     $output = '';
     if ($trace) {
         $output .= implode($line_break, self::compactTrace(debug_backtrace())) . $line_break . $line_break;
     }
     if ($val || $val === 0) {
         if (PHP_SAPI != 'cli' && !is_scalar($val) && ini_get('html_errors') != 'off') {
             if (!$halt) {
                 $output .= "<pre>" . PHP_EOL;
             }
             if (is_array($val)) {
                 $output .= count($val) . ": ";
             }
             $output .= print_r($val, true);
             if (!$halt) {
                 $output .= PHP_EOL . "</pre>";
             }
         } else {
             if (is_array($val)) {
                 $output .= count($val) . ": ";
             }
             $output .= print_r($val, true);
         }
         $output .= $line_break;
     } else {
         $output .= "(empty " . gettype($val) . ")";
         $output .= $line_break;
     }
     print $output;
     if ($halt) {
         die;
     }
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:40,代码来源:KurogoDebug.php

示例3: headers

 protected function headers()
 {
     $headers = parent::headers();
     //if the first parameter is true then exclude the authorization headers
     $args = func_get_args();
     if (isset($args[0]) && $args[0]) {
         return $headers;
     }
     switch ($this->method()) {
         case 'GET':
             break;
         case 'POST':
             $headers['Content-type'] = 'application/x-www-form-urlencoded; charset=' . Kurogo::getCharset();
             break;
     }
     $headers['Authorization'] = $this->getAuthorizationHeader();
     $headers['Expect'] = '';
     return $headers;
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:19,代码来源:OAuthDataRetriever.php

示例4: exceptionHandlerForDevelopment

function exceptionHandlerForDevelopment(Exception $exception)
{
    $bt = $exception->getTrace();
    array_unshift($bt, array('line' => $exception->getLine(), 'file' => $exception->getFile()));
    Kurogo::log(LOG_ALERT, "A " . get_class($exception) . " has occured: " . $exception->getMessage(), "exception", $bt);
    $errtime = developmentErrorLog($exception);
    $error = print_r($exception, TRUE);
    if ($url = getErrorURL($exception, $errtime)) {
        Kurogo::redirectToURL($url);
    } else {
        header('Content-type: text/plain; charset=' . Kurogo::getCharset());
        die("A serious error has occurred: \n\n" . $error);
    }
}
开发者ID:nncsang,项目名称:Kurogo,代码行数:14,代码来源:exceptions.php

示例5: __doRequest

 public function __doRequest($request, $location, $action, $version, $one_way = 0)
 {
     //use curl if there is auth
     if ($this->auth) {
         $headers = array('Content-Type: text/xml; charset=' . Kurogo::getCharset());
         $ch = curl_init($location);
         if (!$this->ssl_verify) {
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
         }
         curl_setopt($ch, CURLOPT_HTTPAUTH, $this->auth);
         curl_setopt($ch, CURLOPT_USERPWD, $this->cred);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_POST, true);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         $result = curl_exec($ch);
         Kurogo::log(LOG_WARNING, "SOAP result: {$result}, {$location}", 'soap');
         return $result;
     } else {
         return parent::__doRequest($request, $location, $action, $version, $one_way);
     }
 }
开发者ID:nncsang,项目名称:Kurogo,代码行数:22,代码来源:KurogoSoapClient.php

示例6: setPageVariables

 private function setPageVariables()
 {
     $this->loadTemplateEngineIfNeeded();
     $this->loadPageConfig();
     // Set variables common to all modules
     $this->assign('moduleID', $this->id);
     $this->assign('configModule', $this->configModule);
     $this->assign('templateModule', $this->templateModule);
     $this->assign('moduleName', $this->moduleName);
     $this->assign('page', $this->page);
     $this->assign('isModuleHome', $this->page == 'index');
     $this->assign('request_uri', $_SERVER['REQUEST_URI']);
     $this->assign('hideFooterLinks', $this->hideFooterLinks);
     $this->assign('ajaxContentLoad', $this->ajaxContentLoad);
     $this->assign('charset', Kurogo::getCharset());
     $this->assign('webBridgeAjaxContentLoad', KurogoWebBridge::isAjaxContentLoad());
     // Font size for template
     $this->assign('fontsizes', $this->fontsizes);
     $this->assign('fontsize', $this->fontsize);
     $this->assign('fontsizeCSS', $this->getFontSizeCSS());
     $this->assign('fontSizeURLs', $this->getFontSizeURLs());
     // Minify URLs
     $this->assign('minify', $this->getMinifyUrls());
     // Google Analytics. This probably needs to be moved
     if ($gaID = Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_ID')) {
         $this->assign('GOOGLE_ANALYTICS_ID', $gaID);
         $this->assign('GOOGLE_ANALYTICS_DOMAIN', Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_DOMAIN'));
         $this->assign('gaImageURL', $this->googleAnalyticsGetImageUrl($gaID));
     }
     // Breadcrumbs
     $this->loadBreadcrumbs();
     // Tablet module nav list
     if ($this->pagetype == 'tablet' && $this->page != 'pane') {
         $this->addInternalJavascript('/common/javascript/lib/iscroll-4.1.9.js');
         $this->assign('moduleNavList', $this->getModuleNavlist());
     }
     if ($this->page == '__nativeWebTemplates') {
         $title = 'Error!';
         $message = '';
         try {
             if (!Kurogo::isLocalhost()) {
                 throw new KurogoException("{$this->page} command can only be run from localhost");
             }
             $platforms = array_filter(array_map('trim', explode(',', $this->getArg('platform', ''))));
             if (!$platforms) {
                 throw new KurogoException("No platforms specified");
             }
             foreach ($platforms as $platform) {
                 $this->buildNativeWebTemplatesForPlatform($platform);
             }
             $title = 'Success!';
             $message = 'Generated native web templates for ' . implode(' and ', $platforms);
         } catch (Exception $e) {
             $message = $e->getMessage();
         }
         $this->assign('contentTitle', $title);
         $this->assign('contentBody', $message);
     } else {
         if (KurogoWebBridge::useNativeTemplatePageInitializer()) {
             Kurogo::log(LOG_DEBUG, "Calling initializeForNativeTemplatePage for {$this->configModule} - {$this->page}", 'module');
             $this->initializeForNativeTemplatePage();
             //subclass behavior
             Kurogo::log(LOG_DEBUG, "Returned from initializeForNativeTemplatePage for {$this->configModule} - {$this->page}", 'module');
         } else {
             Kurogo::log(LOG_DEBUG, "Calling initializeForPage for {$this->configModule} - {$this->page}", 'module');
             $this->initializeForPage();
             //subclass behavior
             Kurogo::log(LOG_DEBUG, "Returned from initializeForPage for {$this->configModule} - {$this->page}", 'module');
         }
     }
     // Set variables for each page
     $this->assign('pageTitle', $this->pageTitle);
     // Variables which may have been modified by the module subclass
     $this->assign('inlineCSSBlocks', $this->inlineCSSBlocks);
     $this->assign('cssURLs', $this->cssURLs);
     $this->assign('inlineJavascriptBlocks', $this->inlineJavascriptBlocks);
     $this->assign('onOrientationChangeBlocks', $this->onOrientationChangeBlocks);
     $this->assign('onLoadBlocks', $this->onLoadBlocks);
     $this->assign('inlineJavascriptFooterBlocks', $this->inlineJavascriptFooterBlocks);
     $this->assign('javascriptURLs', $this->javascriptURLs);
     $this->assign('breadcrumbs', $this->breadcrumbs);
     $this->assign('breadcrumbArgs', $this->getBreadcrumbArgs());
     $this->assign('breadcrumbSamePageArgs', $this->getBreadcrumbArgs(false));
     $this->assign('moduleDebugStrings', $this->moduleDebugStrings);
     $this->assign('webBridgeOnPageLoadParams', KurogoWebBridge::getOnPageLoadParams($this->pageTitle, $this->breadcrumbTitle, $this->hasWebBridgePageRefresh));
     $this->assign('webBridgeConfig', KurogoWebBridge::getServerConfig($this->configModule, $this->page, $this->args));
     $moduleStrings = $this->getOptionalModuleSection('strings');
     $this->assign('moduleStrings', $moduleStrings);
     $this->assign('homeLink', $this->buildURLForModule($this->getHomeModuleID(), '', array()));
     $this->assign('homeModuleID', $this->getHomeModuleID());
     $this->assignLocalizedStrings();
     if ($this->page == 'help') {
         // Module Help
         $this->assign('hasHelp', false);
         $template = 'common/templates/' . $this->page;
     } else {
         if ($this->page == '__nativeWebTemplates') {
             $template = 'common/templates/staticContent';
         } else {
             if (KurogoWebBridge::useWrapperPageTemplate()) {
//.........这里部分代码省略.........
开发者ID:rolandinsh,项目名称:Kurogo-Mobile-Web,代码行数:101,代码来源:WebModule.php

示例7: setPageVariables

 private function setPageVariables()
 {
     $this->loadTemplateEngineIfNeeded();
     $this->loadPageConfig();
     // Set variables common to all modules
     $this->assign('moduleID', $this->id);
     $this->assign('configModule', $this->configModule);
     $this->assign('templateModule', $this->templateModule);
     $this->assign('moduleName', $this->moduleName);
     $this->assign('navImageID', $this->getModuleIcon());
     $this->assign('page', $this->page);
     $this->assign('isModuleHome', $this->page == 'index');
     $this->assign('request_uri', $_SERVER['REQUEST_URI']);
     $this->assign('hideFooterLinks', $this->hideFooterLinks);
     $this->assign('ajaxContentLoad', $this->ajaxContentLoad);
     $this->assign('charset', Kurogo::getCharset());
     $this->assign('http_protocol', HTTP_PROTOCOL);
     $this->assign('webBridgeAjaxContentLoad', KurogoWebBridge::isAjaxContentLoad());
     // Font size for template
     $this->assign('fontsizes', $this->fontsizes);
     $this->assign('fontsize', $this->fontsize);
     $this->assign('fontsizeCSS', $this->getFontSizeCSS());
     $this->assign('fontSizeURLs', $this->getFontSizeURLs());
     // Minify URLs
     $this->assign('minify', $this->getMinifyUrls());
     // Google Analytics. This probably needs to be moved
     if ($gaID = Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_ID')) {
         $this->assign('GOOGLE_ANALYTICS_ID', $gaID);
         $this->assign('GOOGLE_ANALYTICS_DOMAIN', Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_DOMAIN'));
         $this->assign('gaImageURL', $this->googleAnalyticsGetImageUrl($gaID));
     }
     // Breadcrumbs
     $this->loadBreadcrumbs();
     // Tablet iScroll
     if ($this->pagetype == 'tablet') {
         $this->addInternalJavascript('/common/javascript/lib/iscroll-4.2.js');
         // Module nav list
         if ($this->shouldShowNavigation()) {
             $this->assign('navigationModules', $this->getModuleNavlist());
             $allowCustomize = Kurogo::getOptionalModuleVar('ALLOW_CUSTOMIZE', true, $this->getHomeModuleID());
             $this->assignUserContexts($allowCustomize);
         }
     }
     if ($this->page == self::WEB_BRIDGE_BUILD_TEMPLATES_PAGE) {
         $title = 'Error!';
         $message = '';
         try {
             if (!Kurogo::isLocalhost()) {
                 throw new KurogoException("{$this->page} command can only be run from localhost");
             }
             $platforms = array_filter(array_map('trim', explode(',', $this->getArg('platform', ''))));
             if (!$platforms) {
                 throw new KurogoException("No platforms specified");
             }
             foreach ($platforms as $platform) {
                 $this->buildNativeWebTemplatesForPlatform($platform);
             }
             $title = 'Success!';
             $message = 'Generated native web templates for ' . implode(' and ', $platforms);
         } catch (Exception $e) {
             $message = $e->getMessage();
         }
         $this->assign('contentTitle', $title);
         $this->assign('contentBody', $message);
     } else {
         if (KurogoWebBridge::useNativeTemplatePageInitializer()) {
             Kurogo::log(LOG_DEBUG, "Calling initializeForNativeTemplatePage for {$this->configModule} - {$this->page}", 'module');
             $this->initializeForNativeTemplatePage();
             //subclass behavior
             Kurogo::log(LOG_DEBUG, "Returned from initializeForNativeTemplatePage for {$this->configModule} - {$this->page}", 'module');
         } else {
             Kurogo::log(LOG_DEBUG, "Calling initializeForPage for {$this->configModule} - {$this->page}", 'module');
             $this->initializeForPage();
             //subclass behavior
             Kurogo::log(LOG_DEBUG, "Returned from initializeForPage for {$this->configModule} - {$this->page}", 'module');
         }
     }
     // Set variables for each page
     $this->assign('pageTitle', $this->pageTitle);
     // Variables which may have been modified by the module subclass
     $this->assign('inlineCSSBlocks', $this->inlineCSSBlocks);
     $this->assign('cssURLs', $this->cssURLs);
     $this->assign('inlineJavascriptBlocks', $this->inlineJavascriptBlocks);
     $this->assign('onOrientationChangeBlocks', $this->onOrientationChangeBlocks);
     $this->assign('onLoadBlocks', $this->onLoadBlocks);
     $this->assign('inlineJavascriptFooterBlocks', $this->inlineJavascriptFooterBlocks);
     $this->assign('javascriptURLs', $this->javascriptURLs);
     $this->assign('breadcrumbs', $this->breadcrumbs);
     $this->assign('breadcrumbArgs', $this->getBreadcrumbArgs());
     $this->assign('breadcrumbSamePageArgs', $this->getBreadcrumbArgs(false));
     $this->assign('breadcrumbsShowAll', $this->getOptionalThemeVar('breadcrumbs_show', true));
     if (Kurogo::getSiteVar('MODULE_DEBUG')) {
         $this->addModuleDebugString('Config Mode', implode(', ', Kurogo::sharedInstance()->getConfigModes()));
         $this->addModuleDebugString('Version', KUROGO_VERSION);
         if (SITE_VERSION) {
             $this->addModuleDebugString('Site Version', SITE_VERSION);
         }
         if (SITE_BUILD) {
             $this->addModuleDebugString('Site Build', SITE_BUILD);
         }
//.........这里部分代码省略.........
开发者ID:sponto,项目名称:msbm-mobile,代码行数:101,代码来源:WebModule.php

示例8: setPageVariables

 private function setPageVariables()
 {
     $this->loadTemplateEngineIfNeeded();
     $this->loadPageConfig();
     // Set variables common to all modules
     $this->assign('moduleID', $this->id);
     $this->assign('configModule', $this->configModule);
     $this->assign('templateModule', $this->templateModule);
     $this->assign('moduleName', $this->moduleName);
     $this->assign('page', $this->page);
     $this->assign('isModuleHome', $this->page == 'index');
     $this->assign('request_uri', $_SERVER['REQUEST_URI']);
     $this->assign('hideFooterLinks', $this->hideFooterLinks);
     $this->assign('ajaxContentLoad', $this->ajaxContentLoad);
     $this->assign('charset', Kurogo::getCharset());
     // Font size for template
     $this->assign('fontsizes', $this->fontsizes);
     $this->assign('fontsize', $this->fontsize);
     $this->assign('fontsizeCSS', $this->getFontSizeCSS());
     $this->assign('fontSizeURLs', $this->getFontSizeURLs());
     // Minify URLs
     $this->assign('minify', $this->getMinifyUrls());
     // Google Analytics. This probably needs to be moved
     if ($gaID = Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_ID')) {
         $this->assign('GOOGLE_ANALYTICS_ID', $gaID);
         $this->assign('GOOGLE_ANALYTICS_DOMAIN', Kurogo::getOptionalSiteVar('GOOGLE_ANALYTICS_DOMAIN'));
         $this->assign('gaImageURL', $this->googleAnalyticsGetImageUrl($gaID));
     }
     // Percent Mobile Analytics
     if ($pmID = Kurogo::getOptionalSiteVar('PERCENT_MOBILE_ID')) {
         $this->assign('PERCENT_MOBILE_ID', $pmID);
         $pmBASEURL = "http://assets.percentmobile.com/percent_mobile.js";
         $this->assign('PERCENT_MOBILE_URL', $pmBASEURL);
         //$this->assign('pmImageURLJS', $this->percentMobileAnalyticsGetImageUrlJS($pmID));
         $this->assign('pmImageURL', $this->percentMobileAnalyticsGetImageUrl($pmID));
     }
     // Breadcrumbs
     $this->loadBreadcrumbs();
     // Tablet module nav list
     if ($this->pagetype == 'tablet' && $this->page != 'pane') {
         $this->addInternalJavascript('/common/javascript/lib/iscroll-4.0.js');
         $this->assign('moduleNavList', $this->getModuleNavlist());
     }
     Kurogo::log(LOG_DEBUG, "Calling initializeForPage for {$this->configModule} - {$this->page}", 'module');
     $this->initializeForPage();
     //subclass behavior
     Kurogo::log(LOG_DEBUG, "Returned from initializeForPage for {$this->configModule} - {$this->page}", 'module');
     // Set variables for each page
     $this->assign('pageTitle', $this->pageTitle);
     // Variables which may have been modified by the module subclass
     $this->assign('inlineCSSBlocks', $this->inlineCSSBlocks);
     $this->assign('cssURLs', $this->cssURLs);
     $this->assign('inlineJavascriptBlocks', $this->inlineJavascriptBlocks);
     $this->assign('onOrientationChangeBlocks', $this->onOrientationChangeBlocks);
     $this->assign('onLoadBlocks', $this->onLoadBlocks);
     $this->assign('inlineJavascriptFooterBlocks', $this->inlineJavascriptFooterBlocks);
     $this->assign('javascriptURLs', $this->javascriptURLs);
     $this->assign('breadcrumbs', $this->breadcrumbs);
     $this->assign('breadcrumbArgs', $this->getBreadcrumbArgs());
     $this->assign('breadcrumbSamePageArgs', $this->getBreadcrumbArgs(false));
     $this->assign('moduleDebugStrings', $this->moduleDebugStrings);
     $moduleStrings = $this->getOptionalModuleSection('strings');
     $this->assign('moduleStrings', $moduleStrings);
     $this->assign('homeLink', $this->buildURLForModule($this->getHomeModuleID(), '', array()));
     $this->assign('homeModuleID', $this->getHomeModuleID());
     $this->assignLocalizedStrings();
     // Module Help
     if ($this->page == 'help') {
         $this->assign('hasHelp', false);
         $template = 'common/templates/' . $this->page;
     } else {
         $this->assign('hasHelp', isset($moduleStrings['help']));
         $this->assign('helpLink', $this->buildBreadcrumbURL('help', array()));
         $this->assign('helpLinkText', $this->getLocalizedString('HELP_TEXT', $this->getModuleName()));
         $template = 'modules/' . $this->templateModule . '/templates/' . $this->templatePage;
     }
     Kurogo::log(LOG_DEBUG, "Template file is {$template}", 'module');
     // Pager support
     if (isset($this->htmlPager)) {
         $this->assign('pager', $this->getPager());
     }
     // Tab support
     if (isset($this->tabbedView)) {
         $this->assign('tabbedView', $this->tabbedView);
     }
     $this->assign('imageExt', $this->imageExt);
     $this->assign($this->getThemeVars());
     // Access Key Start
     $accessKeyStart = count($this->breadcrumbs);
     if ($this->configModule != $this->getHomeModuleID()) {
         $accessKeyStart++;
         // Home link
     }
     $this->assign('accessKeyStart', $accessKeyStart);
     if (Kurogo::getSiteVar('AUTHENTICATION_ENABLED')) {
         Kurogo::includePackage('Authentication');
         $this->setCacheMaxAge(0);
         $session = $this->getSession();
         $this->assign('session', $session);
         $this->assign('session_isLoggedIn', $this->isLoggedIn());
//.........这里部分代码省略.........
开发者ID:nncsang,项目名称:Kurogo,代码行数:101,代码来源:WebModule.php

示例9: __doRequest

 public function __doRequest($request, $location, $action, $version, $one_way = 0)
 {
     $location = $this->getRequestLocation($location);
     //use curl if there is auth
     if ($this->useCurl) {
         $headers = array('Content-Type: text/xml; charset=' . Kurogo::getCharset());
         $ch = curl_init($location);
         foreach ($this->initArgs as $key => $value) {
             if (preg_match("/CURLOPT_/", $key)) {
                 curl_setopt($ch, constant($key), $value);
             }
         }
         if ($this->authUser) {
             curl_setopt($ch, CURLOPT_HTTPAUTH, constant('CURLAUTH_' . strtoupper($this->authType)));
             curl_setopt($ch, CURLOPT_USERPWD, $this->authUser . ':' . $this->authPassword);
         }
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_POST, true);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
         //curl_setopt($ch, CURLINFO_HEADER_OUT, true);
         $result = curl_exec($ch);
         Kurogo::log(LOG_WARNING, "SOAP result: {$result}, {$location}", 'soap');
         return $result;
     } else {
         return parent::__doRequest($request, $location, $action, $version, $one_way);
     }
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:28,代码来源:KurogoSoapClient.php


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