本文整理汇总了PHP中thebuggenie\core\framework\Settings::isUploadsImageCachingEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::isUploadsImageCachingEnabled方法的具体用法?PHP Settings::isUploadsImageCachingEnabled怎么用?PHP Settings::isUploadsImageCachingEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Settings
的用法示例。
在下文中一共展示了Settings::isUploadsImageCachingEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runGetFile
public function runGetFile(framework\Request $request)
{
$file = new entities\File((int) $request['id']);
if ($file instanceof entities\File) {
if ($file->hasAccess()) {
$disableCache = true;
$isFile = false;
$this->getResponse()->cleanBuffer();
$this->getResponse()->clearHeaders();
$this->getResponse()->setDecoration(\thebuggenie\core\framework\Response::DECORATE_NONE);
if ($file->isImage() && \thebuggenie\core\framework\Settings::isUploadsImageCachingEnabled()) {
$this->getResponse()->addHeader('Pragma: public');
$this->getResponse()->addHeader('Cache-Control: public, max-age: 15768000');
$this->getResponse()->addHeader("Expires: " . gmdate('D, d M Y H:i:s', time() + 15768000) . " GMT");
$disableCache = false;
}
$this->getResponse()->addHeader('Content-disposition: ' . ($request['mode'] == 'download' ? 'attachment' : 'inline') . '; filename="' . $file->getOriginalFilename() . '"');
$this->getResponse()->setContentType($file->getContentType());
if (framework\Settings::getUploadStorage() == 'files') {
$fh = fopen(framework\Settings::getUploadsLocalpath() . $file->getRealFilename(), 'r');
$isFile = true;
} else {
$fh = $file->getContent();
}
if (is_resource($fh)) {
if ($isFile && \thebuggenie\core\framework\Settings::isUploadsDeliveryUseXsend()) {
$this->getResponse()->addHeader('X-Sendfile: ' . framework\Settings::getUploadsLocalpath() . $file->getRealFilename());
$this->getResponse()->addHeader('X-Accel-Redirect: /files/' . $file->getRealFilename());
$this->getResponse()->renderHeaders($disableCache);
} else {
$this->getResponse()->renderHeaders($disableCache);
fpassthru($fh);
}
} else {
$this->getResponse()->renderHeaders($disableCache);
echo $fh;
}
exit;
}
}
$this->return404(framework\Context::getI18n()->__('This file does not exist'));
}
示例2: __
<td style="width: auto;">
<?php
if ($access_level == \thebuggenie\core\framework\Settings::ACCESS_FULL) {
?>
<input type="radio" name="upload_allow_image_caching" value="1" id="upload_allow_image_caching_yes"<?php
if (\thebuggenie\core\framework\Settings::isUploadsImageCachingEnabled()) {
?>
checked<?php
}
?>
onclick="toggleSettings();"><label for="upload_allow_image_caching_yes"><?php
echo __('Yes');
?>
</label>
<input type="radio" name="upload_allow_image_caching" value="0" id="upload_allow_image_caching_no"<?php
if (!\thebuggenie\core\framework\Settings::isUploadsImageCachingEnabled()) {
?>
checked<?php
}
?>
onclick="toggleSettings();"><label for="upload_allow_image_caching_no"><?php
echo __('No');
?>
</label>
<?php
}
?>
</td>
</tr>
<tr>
<td class="config_explanation" colspan="2"><?php