搜索
首页PHP 库Other libraries轻量级的PHP标记解析库
轻量级的PHP标记解析库
 public function addClientParser($parser)
    {
        if (is_string($parser) && class_exists('DeviceDetector\Parser\Client\' . $parser)) {
            $className = 'DeviceDetector\Parser\Client\' . $parser;
            $parser = new $className();
        }
        if ($parser instanceof ClientParserAbstract) {
            $this->clientParsers[] = $parser;
            self::$clientTypes[] = $parser->getName();
            return;
        }
        throw new \Exception('client parser not found');
    }

你想要一个小巧的框架;
你需要出色的性能;
你需要广泛兼容标准主机上的各种 PHP 版本和配置;
你想要一个几乎零配置的框架;
你想要一个不需使用命令行的框架;
你想要一个不想被编码规则的条条框框限制住的框架;
你对 PEAR 这种庞然大物不感兴趣;
你不想被迫学习一种新的模板语言(当然如果你喜欢,你可以选择一个模板解析器);
你不喜欢复杂,追求简单;
那么这一款轻量级的PHP标记解析库就是你想要的!

<?php
/**
 * @copyright   2006-2014, Miles Johnson - http://milesj.me
 * @license     https://github.com/milesj/decoda/blob/master/license.md
 * @link        http://milesj.me/code/php/decoda
 */
error_reporting(E_ALL | E_STRICT);
// Set constants
define('TEST_DIR', __DIR__);
define('VENDOR_DIR', dirname(TEST_DIR) . '/vendor');
define('DECODA', str_replace('\', '/', dirname(TEST_DIR) . '/src/Decoda/'));
// Ensure that composer has installed all dependencies
if (!file_exists(VENDOR_DIR . '/autoload.php')) {
    exit('Please install Composer in Decoda\'s root folder before running tests!');
}
// Include the composer autoloader
$loader = require VENDOR_DIR . '/autoload.php';
$loader->add('Decoda', TEST_DIR);


免责声明

本站所有资源均由网友贡献或各大下载网站转载。请自行检查软件的完整性!本站所有资源仅供学习参考。请不要将它们用于商业目的。否则,一切后果由您负责!如有侵权,请联系我们删除。联系方式:admin@php.cn

相关文章

为什么我的 JNI 项目找不到依赖库?为什么我的 JNI 项目找不到依赖库?

21Nov2024

解决 UnsatisfiedLinkError: Can't Find Dependent Libraries in JNI Projects当开发 Java Native Interface (JNI) 项目时,您可能...

phpmyadmin不显示登录页面phpmyadmin不显示登录页面

30Oct2019

​phpmyadmin不显示登录页面解决方法:找到并打开phpMyAdmin\libraries\plugins\auth\AuthenticationCookie.class.php文件,将其中关于登录页面代码中的两处hide删除即可。

如何修复 phpMyAdmin 中的'count():参数必须是实现可数的数组或对象”错误?如何修复 phpMyAdmin 中的'count():参数必须是实现可数的数组或对象”错误?

20Oct2024

phpMyAdmin 错误:“count():参数必须是实现可数的数组或对象”您是否遇到过 phpMyAdmin 错误,指出“./libraries/sql.lib.php#601\ncount() 中的警告:参数必须是数组或对象

dacom.dll - 什么是 dacom.dll?dacom.dll - 什么是 dacom.dll?

19Oct2024

dacom.dll 在我的计算机上做什么? dacom.dll 是 Microsoft Corporation 创建的 Digital Anvil Component Libraries 使用的 DLL 文件。此过程仍在审核中。 dacom.dll 等非系统进程源自您安装的软件

用node.js显示在点矩阵LED显示器上显示图像用node.js显示在点矩阵LED显示器上显示图像

19Feb2025

关键要点 培训DMD库用于将线,形状和文本绘制到点矩阵LED显示屏上。该库可以从freetronics github存储库中下载并复制到/arduino/libraries/folder中。 Arduino SK

ctvcal.dll - 什么是 ctvcal.dll?ctvcal.dll - 什么是 ctvcal.dll?

16Oct2024

ctvcal.dll 在我的计算机上做什么? ctvcal.dll 是属于 Oracle Corporation 的 Oracle Calendar Libraries 的一个模块。 ctvcal.dll 等非系统进程源自您系统上安装的软件。由于大多数应用程序

See all articles