当前位置: 首页>>代码示例>>PHP>>正文


PHP Configuration::configurationIsLoaded方法代码示例

本文整理汇总了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;
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:24,代码来源:Tools.php

示例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;
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:34,代码来源:Tools.php

示例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;
 }
开发者ID:evgrishin,项目名称:mh16014,代码行数:43,代码来源:Tools.php

示例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;
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:47,代码来源:Tools.php


注:本文中的Configuration::configurationIsLoaded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。