Download the PHP package manychois/cici without Composer

On this page you can find all versions of the php package manychois/cici. 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 cici

Cici

PHP Version Require Latest Stable Version License codecov

Cici is a PHP library which lets you use CSS selector to locate elements in an HTML document.

Features

Installation

Usage

The class Manychois\Cici\DomQuery provides three methods to match element(s) by the given CSS selectors:

They all accept an optional argument $nsLookup which is an associative array of namespace prefixes and URIs. This is useful when you need to match elements with specific namespace URI. If you need to define a default namespace, use the empty string '' as the key.

Examples

Locate an element

Locate an element with a namespace URI

Locate multiple elements

Supported CSS selectors

Selector Example Notes
Attribute selector [attr="value" i] Namespace prefix is supported.
Case-sensitivity modifier is supported.
Class selector .primary
ID selector #main
Type selector div Namespace prefix is supported.
Universal selector * Namespace prefix is supported.
Pseudo-class selector :nth-child(2n+1 of .selected) Check the section below for supported pseudo-classes.
Compound selector div.active
Child combinator ul > li
Descendant combinator nav a
Next-sibling combinator p + img
Subsequent-sibling combinator div ~ img
Selector list ul, ol

Supported pseudo-classes

List in alphabetical order:

Unsupported CSS selectors

Performance concern

This library parses the CSS selector string, builds a selector tree, and then traverses the DOM tree in depth-first search order to locate the element(s). Since everything is written in PHP, this allows a wider support of CSS selector syntax. However, this also means that the performance is not comparable to the native PHP functions, e.g. Document->getElementById(), DOMXPath->query().

In a basic performance test, this library can be 2x to 10x slower than equilvalent DOMXPath->query(). As long as you are fine with the performance of a native PHP foreach loop, this library should be good enough for you. You can run composer run benchmark to see the performance comparison.


All versions of cici with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
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 manychois/cici contains the following files

Loading the files please wait ...