Download the PHP package gembla/traffic-rotator without Composer
On this page you can find all versions of the php package gembla/traffic-rotator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gembla/traffic-rotator
More information about gembla/traffic-rotator
Files in gembla/traffic-rotator
Package traffic-rotator
Short Description A micro smartlink and traffic rotator for gambling affiliate marketing
License MIT
Homepage https://github.com/Gembla/traffic-rotator
Informations about the package traffic-rotator
English | Русский
🎰 Gambling Traffic Rotator & Micro-Smartlink
A simple, fast, and efficient PHP traffic rotator (a lightweight Smartlink / TDS) tailored for affiliates and media buyers in the Gambling vertical.
It allows you to distribute the flow of users (players) across various offers, casinos, or landing pages based on pre-configured weights (probability ratios).
⚡ Features
- Flexible Weight Distribution: No need to strictly match a 100% total. Add any weights (e.g., 20, 50, 70), and the traffic will be proportionally distributed.
- Advanced Real IP Detection: Automatically extracts genuine user IP addresses behind Cloudflare (
CF-Connecting-IP), reverse proxies like Nginx (X-Forwarded-For), or standard environments. - Fail-Safe Redirects: If HTTP headers have already been sent by your framework or server, the library automatically falls back to an HTML/JavaScript redirect instead of crashing.
- Optional Logging: Logging is disabled by default. The script will not create unnecessary files or consume disk resources unless you explicitly pass a file path to the class constructor.
- Availability Check: Easily check if any offers are loaded before executing logic with the
$rotator->hasOffers()method.
✅ Requirements
To run this library, you will need:
- PHP: Version
8.0or higher - Composer: For dependency management
🚀 Quick Start & Testing (No Setup Required)
You can test the rotator locally on your machine right away without downloading any external third-party libraries:
- Clone this repository.
-
Generate the autoloader by running the following command in your project terminal:
-
Start the built-in PHP development web server:
- Open
http://localhost:8000in your browser. Theindex.phpscript will execute instantly and redirect you to one of the test offers.
📦 Installation
When you are ready to integrate the rotator into your funnel, install the package via Composer:
💻 Code Usage
Dynamic Offers Checking (Optional)
If you load your offers dynamically (e.g., from a database or an external API), you can check if the rotator has any active URLs before triggering the redirect:
📝 Log Format Example
Every click is stored in your specified log file in the following format:
📂 Project Structure
src/Rotator.php— Core traffic distribution logic.index.php— Ready-to-use example for quick testing.composer.json— Composer configuration with PSR-4 autoloading under theGembla\TrafficRotatornamespace
📄 License
This project is open-source software licensed under the MIT License. You are free to use it in your marketing setups and commercial projects.