Download the PHP package freema/perspective-api-bundle without Composer

On this page you can find all versions of the php package freema/perspective-api-bundle. 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 perspective-api-bundle

Perspective API Bundle for Symfony

[!WARNING] Archived, no longer maintained. Google Jigsaw shuts down the Perspective API on December 31, 2026 (perspectiveapi.com), and this bundle stops working with it. No new versions will be released. Plan a move to another moderation service before then.

Latest Stable Version PHP Version Require Symfony Version

A powerful Symfony bundle that integrates Google's Perspective API for content moderation and toxicity detection in your applications. Built with flexibility in mind, it supports multiple threshold management strategies, caching, and can be used as a standalone service or Symfony validator.

๐ŸŽฏ Key Features

๐Ÿš€ Why This Bundle?

This bundle was created as a modern, maintained alternative to abandoned Perspective API wrappers. It provides a clean, Symfony-native integration that follows best practices and offers the flexibility needed for real-world applications.

Unlike simple API wrappers, this bundle understands that different parts of your application might need different moderation thresholds - a children's section needs stricter controls than a general discussion forum. It allows you to implement context-aware content moderation without sacrificing simplicity.

โš ๏ธ Important Note About Google's Gemini LLM Integration

Google has integrated their Gemini LLM into the Perspective API, which represents a shift from traditional deterministic models to AI-powered analysis. While the API remains fully functional and is actively supported by Google, please be aware that:

This change reflects Google's commitment to improving the API with cutting-edge AI technology, but it's important to understand these characteristics when implementing content moderation.

๐Ÿ“‹ Requirements

๐Ÿ”ง Advanced Configuration

HTTP Client Options

The bundle supports custom HTTP client configuration for environments that require proxy servers or specific timeouts:

This is particularly useful for:

๐Ÿ› ๏ธ Use Cases

This bundle is perfect for:

๐Ÿ“ฆ Installation

Install the bundle using Composer:

โš™๏ธ Configuration

Basic Configuration

Environment Variables

๐Ÿ“– Usage

Basic Service Usage

Using as a Validator

Using in Symfony Forms

The bundle provides a PerspectiveTextType for easy integration into Symfony forms:

Form Type Options

Custom Threshold Provider

Implement dynamic thresholds based on context:

Using Threshold Resolver

Batch Analysis

Analyzing with Specific Attributes

๐Ÿงช Development

For development setup, testing, and contribution guidelines, see:

๐Ÿ”„ Migration from bredmor/comment-analyzer

If you're migrating from the deprecated bredmor/comment-analyzer library:

๐Ÿ“Š Available Attributes

๐Ÿค Contributing

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

๐Ÿ“„ License

This bundle is released under the MIT License. See the bundled LICENSE file for details.

๐Ÿ™ Credits

๐Ÿ“š Resources


All versions of perspective-api-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/log Version ^1.1|^2.0|^3.0
symfony/http-kernel Version ^5.4|^6.4|^7.1
symfony/framework-bundle Version ^5.4|^6.4|^7.1
symfony/dependency-injection Version ^5.4|^6.4|^7.1
symfony/config Version ^5.4|^6.4|^7.1
symfony/http-client Version ^5.4|^6.4|^7.1
symfony/yaml Version ^5.4|^6.4|^7.1
symfony/cache Version ^5.4|^6.4|^7.1
symfony/validator Version ^5.4|^6.4|^7.1
symfony/http-client-contracts Version ^2.5|^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 freema/perspective-api-bundle contains the following files

Loading the files please wait ...