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


PHP HTMLPurifier_Bootstrap::autoload方法代码示例

本文整理汇总了PHP中HTMLPurifier_Bootstrap::autoload方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLPurifier_Bootstrap::autoload方法的具体用法?PHP HTMLPurifier_Bootstrap::autoload怎么用?PHP HTMLPurifier_Bootstrap::autoload使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLPurifier_Bootstrap的用法示例。


在下文中一共展示了HTMLPurifier_Bootstrap::autoload方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __autoload

function __autoload($ClassName)
{
    // echo $ClassName;
    if (class_exists('HTMLPurifier_Bootstrap', FALSE) && HTMLPurifier_Bootstrap::autoload($ClassName)) {
        return true;
    }
    if (!class_exists('Gdn_FileSystem', FALSE)) {
        return false;
    }
    if (substr($ClassName, 0, 4) === 'Gdn_') {
        $LibraryFileName = 'class.' . strtolower(substr($ClassName, 4)) . '.php';
    } else {
        $LibraryFileName = 'class.' . strtolower($ClassName) . '.php';
    }
    if (!is_null($ApplicationManager = Gdn::Factory('ApplicationManager'))) {
        $ApplicationWhiteList = Gdn::Factory('ApplicationManager')->EnabledApplicationFolders();
    } else {
        $ApplicationWhiteList = NULL;
    }
    $LibraryPath = FALSE;
    // If this is a model, look in the models folder(s)
    if (strtolower(substr($ClassName, -5)) == 'model') {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library_mappings.php', 'Library', PATH_APPLICATIONS, $ApplicationWhiteList, 'models' . DS . $LibraryFileName);
    }
    if ($LibraryPath === FALSE) {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library_mappings.php', 'Library', PATH_LIBRARY, array('core', 'database', 'vendors' . DS . 'phpmailer', 'vendors' . DS . 'htmlpurifier'), $LibraryFileName);
    }
    // If it still hasn't been found, check for modules
    if ($LibraryPath === FALSE) {
        $LibraryPath = Gdn_FileSystem::FindByMapping('library_mappings.php', 'Library', PATH_APPLICATIONS, $ApplicationWhiteList, 'modules' . DS . $LibraryFileName);
    }
    if ($LibraryPath !== FALSE) {
        include_once $LibraryPath;
    }
}
开发者ID:Aetasiric,项目名称:Garden,代码行数:35,代码来源:functions.general.php

示例2: __autoload

function __autoload($class)
{
    if (!function_exists('spl_autoload_register')) {
        if (HTMLPurifier_Bootstrap::autoload($class)) {
            return true;
        }
        if (HTMLPurifierExtras::autoload($class)) {
            return true;
        }
    }
    require str_replace('_', '/', $class) . '.php';
    return true;
}
开发者ID:sebbie42,项目名称:casebox,代码行数:13,代码来源:common.php

示例3: __autoload

 function __autoload($class)
 {
     return HTMLPurifier_Bootstrap::autoload($class);
 }
开发者ID:b091,项目名称:mkphp-1,代码行数:4,代码来源:HTMLPurifier.autoload.php

示例4: _common_autoloader

/**
 * Automatically loads classes in PHP5 way, using SPL.
 * @param   string      $class              The class name, no namespaces are supported.
 * @return  bool                            TRUE if a class have been found and loaded, FALSE otherwise.
 * @author  Ivan Tcholakov, 2013
 * @license The MIT License
 */
function _common_autoloader($class)
{
    static $locations = null;
    if (!isset($locations)) {
        $locations = array();
        $autoload = null;
        _autoload_classes_read_config($autoload, APPPATH . 'config/autoload_classes.php');
        _autoload_classes_read_config($autoload, APPPATH . 'config/' . ENVIRONMENT . '/autoload_classes.php');
        if (isset($autoload) && is_array($autoload) && isset($autoload['classes']) && is_array($autoload['classes'])) {
            $locations = $autoload['classes'];
        }
    }
    $class = (string) $class;
    // No class name? Abort.
    if ($class == '') {
        return false;
    }
    // Scanning for classes in specific directories (see the array above).
    if (isset($locations[$class])) {
        require $locations[$class];
        return true;
    }
    // Autoload CodeIgniter classes.
    if (strpos($class, 'CI_') === 0) {
        if (is_file($location = BASEPATH . 'core/' . substr($class, 3) . '.php')) {
            require $location;
            return true;
        }
        if (is_file($location = BASEPATH . 'libraries/' . substr($class, 3) . '.php')) {
            require $location;
            return true;
        }
        if (is_file($location = BASEPATH . 'libraries/' . substr($class, 3) . '/' . substr($class, 3) . '.php')) {
            require $location;
            return true;
        }
    }
    // Autoload core classes.
    if (is_file($location = APPPATH . "core/{$class}.php")) {
        require $location;
        return true;
    }
    // Autoload Modular Extensions MX core classes.
    if (strpos($class, 'MX_') === 0 && is_file($location = APPPATH . 'third_party/MX/' . substr($class, 3) . '.php')) {
        require $location;
        return true;
    }
    // Autoload library classes.
    if (is_file($location = APPPATH . "libraries/{$class}.php")) {
        require $location;
        return true;
    }
    // Autoload models (that are extended by other models).
    if (is_file($location = APPPATH . "models/{$class}.php")) {
        require $location;
        return true;
    }
    // Autoload custom classes, non-standard way.
    if (is_file($location = APPPATH . "classes/{$class}.php")) {
        require $location;
        return true;
    }
    // PSR-0 autoloading.
    if (is_file($location = APPPATH . 'classes/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php')) {
        require $location;
        return true;
    }
    // Autoload HTMLPurifier classes.
    if (HTMLPurifier_Bootstrap::autoload($class)) {
        return true;
    }
    // Autoload PEAR packages that are integrated in this platform.
    if (is_file($location = APPPATH . 'third_party/pear/' . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php')) {
        require $location;
        return true;
    }
    return false;
}
开发者ID:jaffarsolo,项目名称:starter-public-edition-3,代码行数:85,代码来源:autoload.php

示例5: autoload

 /**
  * Autoload-Method
  *
  * @param string $class name of the class
  */
 public function autoload($class)
 {
     HTMLPurifier_Bootstrap::autoload($class);
 }
开发者ID:robo47,项目名称:robo47-components,代码行数:9,代码来源:HtmlPurifier.php

示例6: CargarDatos

function CargarDatos($id_publicacion, $id_usuario)
{
    // HTML purifier
    require_once "PHP/HTMLPurifier.standalone.php";
    $config = HTMLPurifier_Config::createDefault();
    $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
    $config->set('Filter.YouTube', true);
    $purifier = new HTMLPurifier($config);
    HTMLPurifier_Bootstrap::autoload('HTMLPurifier_Filter_YouTube');
    $id_publicacion = db_codex($id_publicacion);
    $id_usuario = db_codex($id_usuario);
    if (_F_usuario_cache('nivel') != _N_administrador) {
        $datos["tipo"] = _A_temporal;
        $datos["fecha_ini"] = mysql_datetime();
        $datos["fecha_fin"] = mysql_datetime();
    }
    $datos["id_categoria"] = _F_form_cache("id_categoria");
    // $datos["id_usuario"] = $id_usuario; // No usar.
    $datos["precio"] = _F_form_cache("precio");
    $datos["titulo"] = _F_form_cache("titulo");
    $datos["descripcion_corta"] = strip_html_tags(_F_form_cache("descripcion_corta"));
    $datos["descripcion"] = $purifier->purify(_F_form_cache("descripcion"));
    $ret = db_actualizar_datos("ventas_publicaciones", $datos, "id_publicacion='{$id_publicacion}'");
    unset($datos);
    // Tags
    // Procesamos los nuevos tags (eliminamos los espacios, las comas finales y hacemos array)
    // Nota: no evaluamos las comas finales con posibles espacios porque se eliminan con la primera pasada
    $tags = explode(",", preg_replace(array('/ */', '/^,/', '/,$/'), '$1', @$_POST['tags']), 5);
    // Eliminamos posible exploit en los tags
    $tags = db_codex($tags);
    // Insertamos los nuevos tags
    $val_tags = implode("'),('", $tags);
    db_consultar("INSERT IGNORE INTO ventas_tag (tag) VALUES('{$val_tags}')");
    // Ponemos los tags en referencia a la publicación actual
    // +Eliminados los tags de esta publicación primero+++++++++++++++++++++++++
    $val_tags = implode("','", $tags);
    $c = "DELETE FROM ventas_tag_uso WHERE id_publicacion='{$id_publicacion}'";
    $r = db_consultar($c);
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    db_consultar("INSERT INTO ventas_tag_uso (id_tag,id_publicacion) SELECT id, {$id_publicacion} FROM ventas_tag WHERE tag IN ('{$val_tags}')");
    // Hay que eliminar los flags antes que nada.
    $c = "DELETE FROM ventas_flags_pub WHERE id_publicacion='{$id_publicacion}'";
    $r = db_consultar($c);
    $datos['id'] = NULL;
    $datos['id_publicacion'] = $id_publicacion;
    foreach (array("venta", "pago", "entrega") as $campo) {
        if (isset($_POST[$campo]) && is_array($_POST[$campo])) {
            foreach ($_POST[$campo] as $llave => $valor) {
                $datos['id_flag'] = $valor;
                $datos['tipo'] = $campo;
                db_agregar_datos("ventas_flags_pub", $datos);
            }
        }
    }
}
开发者ID:vlad88sv,项目名称:YoMachete,代码行数:55,代码来源:stubs.php

示例7: autoload

 /**
  * Load a class
  * @param string $class Class name
  * @return boolean Success?
  */
 public static function autoload($class)
 {
     // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
     $class = ltrim($class, '\\');
     $uclass = ucfirst($class);
     if (!empty(self::$noAutoLoad[$class])) {
         return false;
     }
     // try known classes
     if (isset(self::$classMap[$uclass])) {
         if (self::$classMap[$uclass]) {
             // No need for a file_exists, if it is in the map we have found it before
             require_once self::$classMap[$uclass];
             return true;
         }
         return false;
     }
     // try namespaces
     if (false !== strpos($class, '\\')) {
         if ($file = self::getFilenameForFQCN($class)) {
             if (self::load($file)) {
                 self::$classMap[$class] = $file;
                 self::$classMapDirty = true;
                 return true;
             }
         }
         self::$classMap[$class] = false;
         self::$classMapDirty = true;
         return false;
     }
     if (empty(self::$moduleMap)) {
         if (isset($GLOBALS['beanFiles'])) {
             self::$moduleMap = $GLOBALS['beanFiles'];
         } else {
             include 'include/modules.php';
             self::$moduleMap = $beanFiles;
         }
     }
     // Try known modules
     if (!empty(self::$moduleMap[$class])) {
         require_once self::$moduleMap[$class];
         return true;
     }
     if (strncmp('HTMLPurifier', $class, 12) == 0) {
         return HTMLPurifier_Bootstrap::autoload($class);
     }
     // Split on _, capitalize elements and make a path
     // foo_bar -> Foo/Bar.
     $class_file = join('/', array_map('ucfirst', explode('_', $class)));
     // Try known prefixes
     foreach (self::$prefixMap as $prefix => $dir) {
         if (strncasecmp($prefix, $class, strlen($prefix)) === 0) {
             if ($file = self::requireWithCustom("{$dir}{$class_file}.php")) {
                 self::$classMap[$uclass] = $file;
                 self::$classMapDirty = true;
                 return true;
             } else {
                 break;
             }
         }
     }
     // Special cases
     // Special case because lookup goes to $_REQUEST['module']
     if ($file = self::getFilenameForViewClass($class)) {
         self::$classMap[$uclass] = $file;
         self::$classMapDirty = true;
         return true;
     }
     // Special case because widget name can be lowercased
     if ($file = self::getFilenameForSugarWidget($class)) {
         self::$classMap[$uclass] = $file;
         self::$classMapDirty = true;
         return true;
     }
     // Special case because it checks by ending in Layout
     if ($file = self::getFilenameForLayoutClass($class)) {
         self::$classMap[$uclass] = $file;
         self::$classMapDirty = true;
         return true;
     }
     if ($file = self::getFilenameForExpressionClass($class)) {
         self::$classMap[$uclass] = $file;
         self::$classMapDirty = true;
         return true;
     }
     // Try known dirs
     foreach (self::$dirMap as $dir) {
         // include/Class.php
         if ($file = self::requireWithCustom("{$dir}{$class_file}.php")) {
             self::$classMap[$uclass] = $file;
             self::$classMapDirty = true;
             return true;
         }
         // include/Class/Class.php
         // Note here we don't use $class_file since using path twice would not make sense:
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:autoloader.php


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