Download the PHP package abdulbaquee/twitter-oauth-v2 without Composer

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

Twitter OAuth 2.0 PHP Library

A modern, robust PHP library for integrating Twitter API v2 using OAuth 2.0 with PKCE support. This library is framework-agnostic and works seamlessly with core PHP.

Features

Note: Media uploads (images, GIFs, videos) are not yet supported in Twitter API v2. This feature will be added once Twitter releases the media upload endpoints for v2.

Requirements

Installation

Configuration

  1. Copy the example configuration file:

  2. Edit config.php and fill in your Twitter API credentials:

Session Handling

The library provides a flexible session handling system that works with any PHP framework. Choose the appropriate session handler for your framework:

Vanilla PHP

Laravel

Symfony

Custom Implementation

You can create your own session handler by implementing the SessionHandlerInterface:

PHP Configuration Requirements (Optimal)

For optimal performance and security, we recommend the following PHP settings:

Note: These are recommended settings. Adjust them according to your specific environment and security requirements.

Usage

Basic Setup

User Operations

Tweet Operations

List Operations

User Interactions

Example Pages

The library includes several example pages to demonstrate its functionality:

  1. auth.php - OAuth 2.0 authorization flow
  2. callback.php - OAuth callback handling
  3. users.php - User profile and relationship operations
  4. tweet.php - Tweet creation and management
  5. lists.php - List creation and management
  6. interactions.php - Tweet interactions (like, retweet, reply)
  7. basic_usage.php - Basic usage examples

Error Handling

The library throws exceptions for various error conditions:

Base Example Class

The library provides a BaseExample class that serves as a foundation for implementing Twitter API operations. This class handles common functionality like authentication and request handling.

Features

Usage Example

Extending the Base Class

You can extend the BaseExample class to add custom functionality:

Error Handling

The base class includes comprehensive error handling:

Media Upload

The media upload functionality supports:

Note: Media upload functionality is subject to Twitter API v2 limitations and requirements.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This library is licensed under the MIT License.


All versions of twitter-oauth-v2 with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
guzzlehttp/guzzle Version ^7.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0 || ^2.0
psr/log Version ^1.1
psr/cache Version ^1.0 || ^2.0 || ^3.0
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 abdulbaquee/twitter-oauth-v2 contains the following files

Loading the files please wait ....