本文整理汇总了PHP中RequestUtil::GetRemoteHost方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestUtil::GetRemoteHost方法的具体用法?PHP RequestUtil::GetRemoteHost怎么用?PHP RequestUtil::GetRemoteHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestUtil
的用法示例。
在下文中一共展示了RequestUtil::GetRemoteHost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor initializes the controller. This method cannot be overriden. If you need
* to do something during construction, add it to Init
*
* @param Phreezer $phreezer Object persistance engine
* @param IRenderEngine $renderEngine rendering engine
* @param Context (optional) a context object for persisting the state of the current page
* @param Router (optional) a custom writer for URL formatting
*/
final function __construct(Phreezer $phreezer, $renderEngine, $context = null, IRouter $router = null)
{
$this->Phreezer =& $phreezer;
$this->RenderEngine =& $renderEngine;
// for backwards compatibility
$this->Smarty =& $renderEngine;
$ra = RequestUtil::GetRemoteHost();
$this->GUID = $this->Phreezer->DataAdapter->GetDBName() . "_" . str_replace(".", "_", $ra);
$this->_router = $router ? $router : new GenericRouter();
if ($context) {
$this->Context =& $context;
} else {
$this->Context = new Context();
$this->Context->GUID = "CTX_" . $this->GUID;
}
if ($this->RenderEngine) {
// assign some variables globally for the views
$this->Assign("CURRENT_USER", $this->GetCurrentUser());
$this->Assign("URL", $this->GetRouter());
$this->Assign("BROWSER_DEVICE", $this->GetDevice());
// if feedback was persisted, set it
$feedback = $this->Context->Get("feedback");
// print_r($feedback); die('feedback');
if (is_array($feedback)) {
foreach ($feedback as $key => $val) {
$this->Assign($key, $val);
}
} else {
$this->Assign("feedback", $feedback);
}
$this->Context->Set("feedback", null);
}
$this->Init();
}