Download the PHP package gymadarasz/xparser without Composer

On this page you can find all versions of the php package gymadarasz/xparser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xparser

XParser

XParser is a very fast XHTML DOM Parser and easy to use.

If you like the jQuery style DOM selection at the PHP backend side or you like simple_html_dom or Ganon you will love this smart library!

Why you sould use it?

- benchmark:

and:

Install via Composer

$ composer require gymadarasz/xparser

Or download latest version

xparser-0.3.1-dev.zip

Usage

Validation

The validation is not too quick process and you don't have to use it every single html loading and parsing but if you aren't sure that your html is valid, you can check it before use:

Note: Be carefull!

Technically when you make a query which try to find something recursion in html struct the regex search time exponentially improve but If you try to find an exact element it seem to be very fast. So this lib fast incase if you know which is the element (or a few of elements) what you looking for and these elements aren't too deep in DOM tree in a recursion.

We never can know in the recurions before try to proccess it, so I had to make a recursion detect in the element search function. It will working until get the deeply process as a class variable in XNode. So if you need deeper searching as default at private static $maxRecursionInStartegy = 8; you can modify it but be carefull!

Get count of elements

When you can not know how many element will in your query incase I created a getCount function which relatively fast and give you how much element are in your selection:

Get parent element:

Other facilities

Symfony CSS-Selector implemented:

If you want to use more css selection in your queries more option e.g. '>' child selection and 'nth-child' or selection by attribute etc. it's possible via Symfony CSS-Selector DOMDocument and XPath.

Note: My goal is not to make a better CSS selection than e.g symphony. I want to make a realy fast html reader and/or manipulator lib for php, the css selection is just an 'extra' in this lib. If you have any idea how it will better please leave an issue on github.


All versions of xparser with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gymadarasz/xparser contains the following files

Loading the files please wait ....