本文整理汇总了PHP中plxUtils::httpEncoding方法的典型用法代码示例。如果您正苦于以下问题:PHP plxUtils::httpEncoding方法的具体用法?PHP plxUtils::httpEncoding怎么用?PHP plxUtils::httpEncoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plxUtils
的用法示例。
在下文中一共展示了plxUtils::httpEncoding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: httpEncoding
/**
* Méthode qui affiche le type de compression http
*
* @return stdout
* @scope global
* @author Stephane F
**/
public function httpEncoding()
{
$encoding = plxUtils::httpEncoding();
if ($this->plxMotor->aConf['gzip'] and $encoding) {
printf(L_HTTPENCODING, strtoupper($encoding));
}
}
示例2: ob_gzipped_page
/**
* Méthode qui applique la compression gzip avant affichage
*
* @param rel2bas conversion des urls relatives en url absolues. Si conversion contient la racine du site
* @return stout
* @return stout
**/
public static function ob_gzipped_page($rel2abs = false)
{
if ($encoding = plxUtils::httpEncoding()) {
$contents = ob_get_clean();
if ($rel2abs) {
$contents = plxUtils::rel2abs($rel2abs, $contents);
}
header('Content-Encoding: ' . $encoding);
echo "�";
$size = strlen($contents);
$contents = gzcompress($contents, 9);
$contents = substr($contents, 0, $size);
} else {
$contents = ob_get_clean();
if ($rel2abs) {
$contents = plxUtils::rel2abs($rel2abs, $contents);
}
}
echo $contents;
exit;
}
示例3: header
# Insertion du template
include PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template;
} else {
header('Content-Type: text/plain; charset=' . PLX_CHARSET);
echo L_ERR_FILE_NOTFOUND . ' (' . PLX_ROOT . $plxMotor->aConf['racine_themes'] . $plxMotor->style . '/' . $plxMotor->template . ') !';
}
# Récuperation de la bufférisation
$output = ob_get_clean();
# Hooks spécifiques au thème
ob_start();
eval($plxMotor->plxPlugins->callHook('ThemeEndHead'));
$output = str_replace('</head>', ob_get_clean() . '</head>', $output);
ob_start();
eval($plxMotor->plxPlugins->callHook('ThemeEndBody'));
$output = str_replace('</body>', ob_get_clean() . '</body>', $output);
# Hook Plugins
eval($plxMotor->plxPlugins->callHook('IndexEnd'));
# On applique la réécriture d'url si nécessaire
if ($plxMotor->aConf['urlrewriting']) {
$output = plxUtils::rel2abs($plxMotor->aConf['racine'], $output);
}
# On applique la compression gzip si nécessaire et disponible
if ($plxMotor->aConf['gzip']) {
if ($encoding = plxUtils::httpEncoding()) {
header('Content-Encoding: ' . $encoding);
$output = gzencode($output, -1, FORCE_GZIP);
}
}
# Restitution écran
echo $output;
exit;
示例4: httpEncoding
/**
* M�thode qui affiche le type de compression http
*
* @return stdout
* @scope global
* @author Stephane F
**/
public function httpEncoding()
{
if ($this->plxMotor->aConf['gzip'] and $encoding = plxUtils::httpEncoding()) {
echo 'Compression ' . strtoupper($encoding) . ' activée';
}
}