本文整理汇总了PHP中Kurogo::isLocalhost方法的典型用法代码示例。如果您正苦于以下问题:PHP Kurogo::isLocalhost方法的具体用法?PHP Kurogo::isLocalhost怎么用?PHP Kurogo::isLocalhost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kurogo
的用法示例。
在下文中一共展示了Kurogo::isLocalhost方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
//.........这里部分代码省略.........
示例2: 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()) {
//.........这里部分代码省略.........
示例3: shouldIgnoreAuth
public static function shouldIgnoreAuth()
{
return Kurogo::isLocalhost() && self::isNativeCall() && (!self::isAjaxContentLoad() || self::isAssetCheck());
}