Download the PHP package carica/phpcss without Composer

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

PhpCss - PHP CSS Parser Library

Build Status License Total Downloads Latest Stable Version Latest Unstable Version

Thanks to Benjamin Eberlei, Bastian Feder and Jakob Westhoff for ideas and concepts.

PhpCSS is a parser for CSS 3 selectors. It parses them into an AST and allows them to compile the AST to CSS selectors or Xpath expressions.

The main target of this project is the possibilty to convert CSS selectors into Xpath expressions.

Demo

A small demo application can be found at: http://xpath.thomas.weinert.info/

Installation

PhpCss is available on Packagist: Carica/PhpCss. Add it to you composer.json and update.

Basic Usage

Get CSS selector as Xpath expression

$expression = PhpCss::toXpath($selector);

Reformat/Validate CSS Selector

$selector = PhpCss::reformat($selector);

Get the AST

$ast = PhpCss::getAst($selector);

FluentDOM

FluentDOM 5 allows to inject a callback to convert selectors. If you have FluentDOM and PhpCss installed in your project, you can use CSS selectors in FluentDOM:

$fd = FluentDOM::QueryCss($xml);
$fd
  ->find('td:nth-of-type(even)')
  ->addClass('even');

Supported

Selectorto CSSto Xpath
*
E
ns|*
ns|E
Attributes
E[foo]
E[foo="bar"]
E[foo~="bar"]
E[foo^="bar"]
E[foo$="bar"]
E[foo*="bar"]
E[foo|="bar"]
Structural Pseudo Classes
E:root
E:nth-child(42)
E:nth-last-child(42)
E:nth-of-type(42)
E:nth-last-of-type(42)
E:first-child
E:last-child
E:first-of-type
E:last-of-type
E:only-child
E:only-of-type
E:empty
Link Pseudo Classes
E:link
E:visited
User Action Pseudo Classes
E:active
E:hover
E:focus
Target Pseudo Class
E:target
Language Pseudo Class
E:lang(fr)
UI Element states Pseudo Class
E:enabled✓ (not disabled)
E:disabled✓ (attribute)
E:checked✓ (attribute)
Pseudo Elements
E:first-line
E:first-letter
E:before
E:after
Class Selector
E.warning
Id Selector
E#myid
Negation Pseudo Class
E:not(s)
Combinators
E F
E > F
E + F
E ~ F
jQuery
:contains("text")
:has(s)
:gt(42)
:lt(42)
:odd
:even

All versions of phpcss with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 carica/phpcss contains the following files

Loading the files please wait ....