本文整理汇总了PHP中http::getSelfURI方法的典型用法代码示例。如果您正苦于以下问题:PHP http::getSelfURI方法的具体用法?PHP http::getSelfURI怎么用?PHP http::getSelfURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类http
的用法示例。
在下文中一共展示了http::getSelfURI方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serveDocument
protected static function serveDocument($tpl, $content_type = 'text/html', $http_cache = true, $http_etag = true)
{
$_ctx =& $GLOBALS['_ctx'];
$core =& $GLOBALS['core'];
if ($_ctx->nb_entry_per_page === null) {
$_ctx->nb_entry_per_page = $core->blog->settings->nb_post_per_page;
}
$tpl_file = $core->tpl->getFilePath($tpl);
if (!$tpl_file) {
throw new Exception('Unable to find template');
}
if ($http_cache) {
$GLOBALS['mod_files'][] = $tpl_file;
http::cache($GLOBALS['mod_files'], $GLOBALS['mod_ts']);
}
$result = new ArrayObject();
header('Content-Type: ' . $content_type . '; charset=UTF-8');
$_ctx->current_tpl = $tpl;
$result['content'] = $core->tpl->getData($tpl);
$result['content_type'] = $content_type;
$result['tpl'] = $tpl;
$result['blogupddt'] = $core->blog->upddt;
# --BEHAVIOR-- urlHandlerServeDocument
$core->callBehavior('urlHandlerServeDocument', $result);
if ($http_cache && $http_etag) {
http::etag($result['content'], http::getSelfURI());
}
echo $result['content'];
}
示例2: getLinksList
private static function getLinksList($links, $block = '<ul>%s</ul>', $item = '<li%2$s>%1$s</li>')
{
$list = '';
# Find current link item if any
$current = -1;
$current_size = 0;
$self_uri = http::getSelfURI();
foreach ($links as $k => $v) {
if (!preg_match('$^([a-z][a-z0-9.+-]+://)$', $v['link_href'])) {
$url = http::concatURL($self_uri, $v['link_href']);
if (strlen($url) > $current_size && preg_match('/^' . preg_quote($url, '/') . '/', $self_uri)) {
$current = $k;
$current_size = strlen($url);
}
}
}
foreach ($links as $k => $v) {
$title = $v['link_title'];
$href = $v['link_href'];
$desc = $v['link_desc'];
$lang = $v['link_lang'];
$xfn = $v['link_xfn'];
$link = '<a href="' . html::escapeHTML($href) . '"' . (!$lang ? '' : ' hreflang="' . html::escapeHTML($lang) . '"') . (!$desc ? '' : ' title="' . html::escapeHTML($desc) . '"') . (!$xfn ? '' : ' rel="' . html::escapeHTML($xfn) . '"') . '>' . html::escapeHTML($title) . '</a>';
$current_class = $current == $k ? ' class="active"' : '';
$list .= sprintf($item, $link, $current_class) . "\n";
}
return sprintf($block, $list) . "\n";
}
示例3: debugInfo
private static function debugInfo()
{
$global_vars = implode(', ', array_keys($GLOBALS));
$res = '<div id="debug"><div>' . '<p>memory usage: ' . memory_get_usage() . ' (' . files::size(memory_get_usage()) . ')</p>';
if (function_exists('xdebug_get_profiler_filename')) {
$res .= '<p>Elapsed time: ' . xdebug_time_index() . ' seconds</p>';
$prof_file = xdebug_get_profiler_filename();
if ($prof_file) {
$res .= '<p>Profiler file : ' . xdebug_get_profiler_filename() . '</p>';
} else {
$prof_url = http::getSelfURI();
$prof_url .= strpos($prof_url, '?') === false ? '?' : '&';
$prof_url .= 'XDEBUG_PROFILE';
$res .= '<p><a href="' . html::escapeURL($prof_url) . '">Trigger profiler</a></p>';
}
/* xdebug configuration:
zend_extension = /.../xdebug.so
xdebug.auto_trace = On
xdebug.trace_format = 0
xdebug.trace_options = 1
xdebug.show_mem_delta = On
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_dir = /tmp
xdebug.profiler_append = 0
xdebug.profiler_output_name = timestamp
*/
}
$res .= '<p>Global vars: ' . $global_vars . '</p>' . '</div></div>';
return $res;
}
示例4: serveDocument
protected static function serveDocument($tpl, $content_type = 'text/html', $http_cache = true, $http_etag = true)
{
$_ctx =& $GLOBALS['_ctx'];
$core =& $GLOBALS['core'];
if ($_ctx->nb_entry_per_page === null) {
$_ctx->nb_entry_per_page = $core->blog->settings->system->nb_post_per_page;
}
if ($_ctx->nb_entry_first_page === null) {
$_ctx->nb_entry_first_page = $_ctx->nb_entry_per_page;
}
$tpl_file = $core->tpl->getFilePath($tpl);
if (!$tpl_file) {
throw new Exception('Unable to find template ');
}
$result = new ArrayObject();
$_ctx->current_tpl = $tpl;
$_ctx->content_type = $content_type;
$_ctx->http_cache = $http_cache;
$_ctx->http_etag = $http_etag;
$core->callBehavior('urlHandlerBeforeGetData', $_ctx);
if ($_ctx->http_cache) {
$GLOBALS['mod_files'][] = $tpl_file;
http::cache($GLOBALS['mod_files'], $GLOBALS['mod_ts']);
}
header('Content-Type: ' . $_ctx->content_type . '; charset=UTF-8');
if ($core->blog->settings->system->prevents_clickjacking) {
if ($_ctx->exists('xframeoption')) {
$url = parse_url($_ctx->xframeoption);
header(sprintf('X-Frame-Options: %s', is_array($url) ? "ALLOW-FROM " . $url['scheme'] . '://' . $url['host'] : 'SAMEORIGIN'));
} else {
// Prevents Clickjacking as far as possible
header('X-Frame-Options: SAMEORIGIN');
// FF 3.6.9+ Chrome 4.1+ IE 8+ Safari 4+ Opera 10.5+
}
}
$result['content'] = $core->tpl->getData($_ctx->current_tpl);
$result['content_type'] = $_ctx->content_type;
$result['tpl'] = $_ctx->current_tpl;
$result['blogupddt'] = $core->blog->upddt;
# --BEHAVIOR-- urlHandlerServeDocument
$core->callBehavior('urlHandlerServeDocument', $result);
if ($_ctx->http_cache && $_ctx->http_etag) {
http::etag($result['content'], http::getSelfURI());
}
echo $result['content'];
}
示例5: closedir
if (is_dir($mo_dir) && is_file($mo_dir . 'bilbo.mo')) {
$lang_array[$file] = $file;
}
}
}
closedir($dir_handle);
echo '<h2>' . T_('Information on the BilboPlanet') . '</h2>' . '<p>' . T_('Thank you for taking somes minutes to answer those questions to help to the configuration of the bilboplanet.') . '</p>' . '<p><span class="red">* </span>' . T_('Fields marked with an asterisk are obligatory') . '</p>' . '<form id="install-form" action="index.php" method="post">' . '<fieldset><legend><strong>' . T_('Information of the user') . '</strong></legend>' . '<label>' . T_('Fullname') . '<span class="red"> * </span>' . form::field('u_fullname', 30, 255, html::escapeHTML($u_fullname)) . '</label>
<span class="description">' . T_('Enter your fullname or the name you want to be displayed') . '</span>' . '<label>' . T_('Email') . '<span class="red"> * </span>' . form::field('u_email', 30, 255, html::escapeHTML($u_email)) . '</label>
<span class="description">' . T_('Enter your email address') . '</span>' . '<label>' . T_('Website of the user') . ' ' . form::field('u_site', 30, 255, html::escapeHTML($u_site)) . '</label>
<span class="description">' . T_('Entre address of your website or blog (optional)') . '</span>' . '</fieldset><br/>' . '<fieldset><legend><strong>' . T_('Information on the Planet') . '</strong></legend>' . '<label>' . T_('Title of the Planet') . '<span class="red"> * </span>' . form::field('p_title', 30, 255, html_entity_decode(addslashes(html::escapeHTML($p_title)))) . '</label>
<span class="description">' . T_('Fill the title of your planet') . '</span>' . '<label>' . T_('Description') . ' ' . form::field('p_desc', 30, 255, html_entity_decode(addslashes(html::escapeHTML($p_desc)))) . '</label>
<span class="description">' . T_('Give a description of your planet') . '</span>' . '<label>' . T_('Planet Language') . ' ' . form::combo('p_lang', $lang_array, $p_lang) . '</label>
<span class="description">' . T_('Choose your langage') . '</span>' . '<label>' . T_('Join the Bilboplanet community') . ' ' . form::checkbox('p_comm', true, true) . '</label>
<span class="description">' . T_('This will notify the developpers of the Bilboplanet that you are using their work. Your planet will be added to the community and you will be informed when new important features will be released. You will also be able to ask for new features to the development team.') . '</span>' . '</fieldset><br/>' . '<fieldset><legend><strong>' . T_('Administration username and password') . '</strong></legend>' . '<label class="required" title="' . T_('Required field') . '">' . T_('Username') . '<span class="red"> * </span>' . form::field('u_login', 30, 32, html::escapeHTML($u_login)) . '</label>
<span class="description">' . T_('Enter your username') . '</span>' . '<label class="required" title="' . T_('Required field') . '">' . T_('Password') . '<span class="red"> * </span>' . form::password('u_pwd', 30, 255) . '</label>
<span class="description">' . T_('Enter your password') . '</span>' . '<label class="required" title="' . T_('Required field') . '">' . T_('Confirm your password') . '<span class="red"> * </span>' . form::password('u_pwd2', 30, 255) . '</label>
<span class="description">' . T_('Re-enter your password for verification') . '</span>' . '</fieldset><br/>' . '<input class="save" type="submit" value="' . T_('Save') . '" />' . '</form>';
} elseif ($can_install && $step == 1) {
$bpPath = explode("admin/install/index.php", http::getSelfURI());
$bpPath = $bpPath[0];
$adminPath = explode("install/index.php", http::getSelfURI());
$adminPath = $adminPath[0];
echo '<p class="message"><strong>' . T_('Install succeeded') . '</strong></p>' . '<p>' . T_('The Bilboplanet was successfully installed. Here you can find a resume of the configuration') . '</p>' . '<h3>' . T_('Your account') . '</h3>' . '<ul>' . '<li>' . T_('Username:') . ' <strong>' . html::escapeHTML($u_login) . '</strong></li>' . '</ul>' . '<h3>' . T_('Your Bilboplanet') . '</h3>' . '<ul>' . '<li>' . T_('URL of the BilboPlanet:') . ' <a href="' . html::escapeHTML($bpPath) . '">
<strong>' . html::escapeHTML($bpPath) . '</strong></a></li>' . '<li>' . T_('Administration interface:') . ' <a href="' . html::escapeHTML($adminPath) . '">
<strong>' . html::escapeHTML($adminPath) . '</strong></a></li>' . '</ul>' . '<form action="' . html::escapeHTML($adminPath) . '" method="post">' . '<p><input class="save" type="submit" value="' . T_('Go to the administration interface') . '" />' . '</p>' . '</form>';
}
?>
</div>
</body>
</html>