本文整理汇总了PHP中Generic::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Generic::init方法的具体用法?PHP Generic::init怎么用?PHP Generic::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generic
的用法示例。
在下文中一共展示了Generic::init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Constructor
* @return void
*/
public function init()
{
parent::init();
if ($this->isFinished()) {
return;
}
$this->out("\r\n", false);
}
示例2: init
/**
* Constructor
* @return void
*/
public function init()
{
parent::init();
$this->header('Cache-Control: max-age=31536000, public, pre-check=0, post-check=0');
$this->header('Expires: ' . date('r', strtotime('+1 year')));
echo "Welcome to SockJS!\n";
$this->finish();
}
示例3: init
/**
* Constructor
* @return void
*/
public function init()
{
parent::init();
if (isset($this->attrs->version)) {
$this->version = $this->attrs->version;
}
$this->header('Cache-Control: max-age=31536000, public, pre-check=0, post-check=0');
$this->header('Expires: ' . date('r', strtotime('+1 year')));
$html = '<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
document.domain = document.domain;
_sockjs_onload = function(){SockJS.bootstrap_iframe();};
</script>
<script src="https://cdn.jsdelivr.net/sockjs/' . htmlentities($this->version, ENT_QUOTES, 'UTF-8') . '/sockjs.min.js"></script>
</head>
<body>
<h2>Don\'t panic!</h2>
<p>This is a SockJS hidden iframe. It\'s used for cross domain magic.</p>
</body>
</html>';
$etag = 'W/"' . sha1($html) . '"';
$this->header('ETag: ' . $etag);
if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
if ($_SERVER['HTTP_IF_NONE_MATCH'] === $etag) {
$this->status(304);
$this->removeHeader('Content-Type');
$this->finish();
return;
}
}
$this->header('Content-Length: ' . mb_orig_strlen($html));
echo $html;
$this->finish();
}
示例4: init
/**
* Constructor
* @return void
*/
public function init()
{
parent::init();
if ($this->isFinished()) {
return;
}
echo str_repeat(' ', 1024);
echo "\n\n";
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h2>Don't panic!</h2>
<script>
document.domain = document.domain;
var c = parent.<?php
echo $_GET['c'];
?>
;
c.start();
function p(d) {
c.message(d);
}
;
window.onload = function () {
c.stop();
};
</script>
</body>
</html>
<?php
}