Download the PHP package phpwatch/phptoken-polyfill without Composer

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

PhpToken Polyfill

A polyfill to bring the PHP 8.0 PhpToken class to PHP 7.1 and later.

Latest Stable Version License CI

Synopsis

This library provides a compatible layer to bring PhpToken class that comes with PHP 8. It provides the full functionality of the class, but from user-land PHP code. Note that PHP 8's built-in PhpToken class is fast and memory-friendly because it is in C language. However, if you have a library that requires the PhpToken class, you can use this library to transparently bring that functionality to any PHP version 7.1 or later.

Prerequisites

Installing

The simplest way would be to install using composer.

If the PhpToken class is not available in your system, composer autoloader will seamlessly autoload the class provided by this library to provide the same functionality.

If you cannot use Composer, try convincing whoever made that decision it is not 2012 anymore. If that doesn't work, you can manually load the classes in the src/ directory.

Usage

Usage is exactly the same as PHP 8 native PhpToken class.

Make sure that the file is included. If you use Composer, include its autoload file. If the PhpToken class is natively available, this library will not be loaded at all. If you do not use Composer autoloader, you will need to manually require the files in the src directory.

Here is an example of using PhpToken class. The example below should work in any PHP version from 7.1 to 8.0 and later, even the PhpToken is not natively available.

Development, tests, and contributing

Contributions are welcome. Please open an issue or send a pull-request. Please make sure to run the tests in both Linux-based platforms and Windows. Windows uses CRLF line endings, which can make tests fail if you hardcode the assertions to expect a specific position within an LF/CR-preferred platform.

Please note that tests and other deveopment dependencies are not included when you download the zip files from Github. This is to keep the library size small. You need to clone the repository or fork it to get the full source.

Credits

@Ayesh: Ayesh Karunaratne.


All versions of phptoken-polyfill with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
ext-tokenizer Version *
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 phpwatch/phptoken-polyfill contains the following files

Loading the files please wait ....