Download the PHP package nojimage/twitter-text-php without Composer

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

Twitter Text (PHP Edition)

A library of PHP classes that provide auto-linking and extraction of usernames, lists, hashtags and URLs from tweets. Originally created from twitter-text-rb and twitter-text-java projects by Matt Sanford and ported to PHP by Mike Cochrane, this library has been improved and made more complete by Nick Pope.

Build Status Codecov Latest Stable Version

Requirements

If the necessary extensions are not installed on the server, please install it additionally or use symfony/polyfill.

Install

You can install this library into your application using Composer.

Note for Older Server

This library use intl/libICU. Some older server and PHP 7.2+ combinations may have deprecated warnings due to older ICU versions. refs #32

If you are using RHEL/CentOS 6, installing PHP using the remi repository is the best choice. If you use remi, you can use the new ICU.

Features

Autolink

Extractor

Hit Highlighter

Validation

Parser

Length validation

twitter-text 3.0 updates the config file with emojiParsingEnabled config option. When true, twitter-text-php will parse and discount emoji supported by the Unicode Emoji 11.0 (NOTE: Original twitter-text supported twemoji library). The length of these emoji will be the default weight (200 or two characters) even if they contain multiple code points combined by zero-width joiners. This means that emoji with skin tone and gender modifiers no longer count as more characters than those without such modifiers.

twitter-text 2.0 introduced configuration files that define how Tweets are parsed for length. This allows for backwards compatibility and flexibility going forward. Old-style traditional 140-character parsing is defined by the v1.json configuration file, whereas v2.json is updated for "weighted" Tweets where ranges of Unicode code points can have independent weights aside from the default weight. The sum of all code points, each weighted appropriately, should not exceed the max weighted length.

Some old methods from twitter-text-php 1.0 have been marked deprecated, such as the Twitter\Text\Validator::isValidTweetText(), Twitter\Text\Validator::getTweetLength() method. The new API is based on the following method, Twitter\Text\Parser::parseTweet()

This method takes a string as input and returns a results object that contains information about the string. Twitter\Text\ParseResults object includes:

Examples

For examples, please see tests/example.php which you can view in a browser or run from the command line.

Conformance

You'll need the test data which is in YAML format from the following repository:

https://github.com/twitter/twitter-text

twitter/twitter-text already included in composer.json, so you should just need to run:

curl -s https://getcomposer.org/installer | php
php composer.phar install

There are a couple of options for testing conformance:

Thanks & Contributions

The bulk of this library is from the heroic efforts of:


All versions of twitter-text-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-mbstring Version *
ext-intl 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 nojimage/twitter-text-php contains the following files

Loading the files please wait ....