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'); }
You want a compact framework;
You need excellent performance;
You need broad compatibility with various PHP versions and configurations on standard hosts;
You want an almost zero-configuration Framework;
You want a framework that does not require the use of the command line;
You want a framework that does not want to be restricted by coding rules;
You are not interested in behemoths like PEAR;
You don’t want to be forced to learn a new template language (of course, if you like, you can choose a template parser);
You don’t like complexity and pursue simplicity;
Then this lightweight PHP tag The parsing library is what you want!
<?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);
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
08 Aug 2016
:This article mainly introduces the PHP parsing HTML class library simple_html_dom. Students who are interested in PHP tutorials can refer to it.
30 Sep 2020
The php column analyzes the SPL data structure of the PHP standard library for everyone.
15 Jul 2016
Several tag parsing for PHP scripts. What we want to introduce to you today is about 1. There are four types of tags in PHP scripts: short tags and asp tags are convenient but have poor portability and distribution, and are generally not recommended. Also note that if you add PHP
16 Dec 2024
Lithe Events is a lightweight yet powerful library for event management in PHP applications. It allows you to easily create, register, emit, and remove events, creating a decoupled and flexible architecture. This detailed guide will walk you through
13 Jul 2016
PHP-ExcelReader: PHP class library for parsing excel files. PHP-ExcelReader: PHP class library for parsing excel files. PHP-ExcelReader is an open source project based on PHP. Its function is to parse excel files. The official website of PHP-ExcelReader is as follows:
13 Jul 2016
PHP parsing html class library simple_html_dom transcoding bug. I have been using simple_html_dom to capture some articles these days. The encoding of different websites in China is basically gbk gb2312 utf-8. Most of them are gb2312 and utf-8. My version of simple_html_dom has a method
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images