本文整理汇总了PHP中Configuration::configurationIsLoaded方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::configurationIsLoaded方法的具体用法?PHP Configuration::configurationIsLoaded怎么用?PHP Configuration::configurationIsLoaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::configurationIsLoaded方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: purifyHTML
public static function purifyHTML($html)
{
static $use_html_purifier = null;
static $purifier = null;
if (defined('PS_INSTALLATION_IN_PROGRESS') || !Configuration::configurationIsLoaded()) {
return $html;
}
if ($use_html_purifier === null) {
$use_html_purifier = (bool) Configuration::get('PS_USE_HTMLPURIFIER');
}
if ($use_html_purifier) {
$config = HTMLPurifier_Config::createDefault();
$config->set('Attr.EnableID', true);
$config->set('Cache.SerializerPath', _PS_CACHE_DIR_ . 'purifier');
if (Configuration::get('PS_ALLOW_HTML_IFRAME')) {
$config->set('HTML.SafeIframe', true);
$config->set('HTML.SafeObject', true);
$config->set('URI.SafeIframeRegexp', '/.*/');
}
$purifier = new HTMLPurifier($config);
$html = $purifier->purify($html);
}
return $html;
}
示例2: purifyHTML
public static function purifyHTML($html)
{
static $use_html_purifier = null;
static $purifier = null;
if (defined('PS_INSTALLATION_IN_PROGRESS') || !Configuration::configurationIsLoaded()) {
return $html;
}
if ($use_html_purifier === null) {
$use_html_purifier = (bool) Configuration::get('PS_USE_HTMLPURIFIER');
}
if ($use_html_purifier) {
if ($purifier === null) {
$config = HTMLPurifier_Config::createDefault();
$config->set('Attr.EnableID', true);
$config->set('HTML.Trusted', true);
$config->set('Cache.SerializerPath', _PS_CACHE_DIR_ . 'purifier');
$config->set('Attr.AllowedFrameTargets', array('_blank', '_self', '_parent', '_top'));
if (Configuration::get('PS_ALLOW_HTML_IFRAME')) {
$config->set('HTML.SafeIframe', true);
$config->set('HTML.SafeObject', true);
$config->set('URI.SafeIframeRegexp', '/.*/');
}
$purifier = new HTMLPurifier($config);
}
if (_PS_MAGIC_QUOTES_GPC_) {
$html = stripslashes($html);
}
$html = $purifier->purify($html);
if (_PS_MAGIC_QUOTES_GPC_) {
$html = addslashes($html);
}
}
return $html;
}
示例3: purifyHTML
public static function purifyHTML($html)
{
static $use_html_purifier = null;
static $purifier = null;
if (defined('PS_INSTALLATION_IN_PROGRESS') || !Configuration::configurationIsLoaded()) {
return $html;
}
if ($use_html_purifier === null) {
$use_html_purifier = (bool) Configuration::get('PS_USE_HTMLPURIFIER');
}
if ($use_html_purifier) {
if ($purifier === null) {
$config = HTMLPurifier_Config::createDefault();
// Set some HTML5 properties
$config->set('HTML.DefinitionID', 'html5-definitions');
// unqiue id
$config->set('HTML.DefinitionRev', 1);
$config->set('Attr.EnableID', true);
$config->set('HTML.Trusted', true);
$config->set('Cache.SerializerPath', _PS_CACHE_DIR_ . 'purifier');
$config->set('Attr.AllowedFrameTargets', array('_blank', '_self', '_parent', '_top'));
if (Configuration::get('PS_ALLOW_HTML_IFRAME')) {
$config->set('HTML.SafeIframe', true);
$config->set('HTML.SafeObject', true);
$config->set('URI.SafeIframeRegexp', '/.*/');
}
// http://developers.whatwg.org/the-video-element.html#the-video-element
if ($def = $config->maybeGetRawHTMLDefinition()) {
$def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array('src' => 'URI', 'type' => 'Text', 'width' => 'Length', 'height' => 'Length', 'poster' => 'URI', 'preload' => 'Enum#auto,metadata,none', 'controls' => 'Bool'));
$def->addElement('source', 'Block', 'Flow', 'Common', array('src' => 'URI', 'type' => 'Text'));
}
$purifier = new HTMLPurifier($config);
}
if (_PS_MAGIC_QUOTES_GPC_) {
$html = stripslashes($html);
}
$html = $purifier->purify($html);
if (_PS_MAGIC_QUOTES_GPC_) {
$html = addslashes($html);
}
}
return $html;
}
示例4: purifyHTML
public static function purifyHTML($html, $uri_unescape = null, $allow_style = false)
{
require_once _PS_TOOL_DIR_ . 'htmlpurifier/HTMLPurifier.standalone.php';
static $use_html_purifier = null;
static $purifier = null;
if (defined('PS_INSTALLATION_IN_PROGRESS') || !Configuration::configurationIsLoaded()) {
return $html;
}
if ($use_html_purifier === null) {
$use_html_purifier = (bool) Configuration::get('PS_USE_HTMLPURIFIER');
}
if ($use_html_purifier) {
if ($purifier === null) {
$config = HTMLPurifier_Config::createDefault();
$config->set('Attr.EnableID', true);
$config->set('HTML.Trusted', true);
$config->set('Cache.SerializerPath', _PS_CACHE_DIR_ . 'purifier');
$config->set('Attr.AllowedFrameTargets', array('_blank', '_self', '_parent', '_top'));
if (is_array($uri_unescape)) {
$config->set('URI.UnescapeCharacters', implode('', $uri_unescape));
}
if (Configuration::get('PS_ALLOW_HTML_IFRAME')) {
$config->set('HTML.SafeIframe', true);
$config->set('HTML.SafeObject', true);
$config->set('URI.SafeIframeRegexp', '/.*/');
}
/** @var HTMLPurifier_HTMLDefinition|HTMLPurifier_HTMLModule $def */
// http://developers.whatwg.org/the-video-element.html#the-video-element
if ($def = $config->getHTMLDefinition(true)) {
$def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array('src' => 'URI', 'type' => 'Text', 'width' => 'Length', 'height' => 'Length', 'poster' => 'URI', 'preload' => 'Enum#auto,metadata,none', 'controls' => 'Bool'));
$def->addElement('source', 'Block', 'Flow', 'Common', array('src' => 'URI', 'type' => 'Text'));
if ($allow_style) {
$def->addElement('style', 'Block', 'Flow', 'Common', array('type' => 'Text'));
}
}
$purifier = new HTMLPurifier($config);
}
if (_PS_MAGIC_QUOTES_GPC_) {
$html = stripslashes($html);
}
$html = $purifier->purify($html);
if (_PS_MAGIC_QUOTES_GPC_) {
$html = addslashes($html);
}
}
return $html;
}