Search by

tagadvance / stooge

tagadvance

A fluent builder around PHP's cURL extension for making HTTP requests.

Package info

github.com/tagadvance/Stooge

pkg:composer/tagadvance/stooge

Fund package maintenance!

tagadvance

Statistics

Installs: 21

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-09-05 21:54 UTC

This package is auto-updated.

Last update: 2026-09-15 04:02:15 UTC


README

CI Packagist PHP License: MIT

Stooge

A PHP library for simplifying the process of making HTTP requests via cURL.

Stooge performs HTTP requests by using CurlRequest as a fluent builder for PHP's Client URL Library.

  • __invoke() has been overridden to call execute()
  • there are convenience methods for get, post, and put operations
  • autoCookieJar() is useful if sessions are necessary

Download / Install

The easiest way to install Stooge is via Composer:

composer require "tagadvance/stooge:^1.0"
{
    "require": {
        "tagadvance/stooge": "^1.0"
    }
}

Example

<?php

use tagadvance\stooge\CurlRequest;

require_once 'vendor/autoload.php';

$break = str_pad ( $input = '', $pad_length = 5, PHP_EOL );

$url = 'http://intentionallyblankpage.com';
// $url = 'http://intentionallyblankpage.com/redirect.php';
// $url = 'http://intentionallyblankpage.com/test.html';

$request = new CurlRequest ();
$response = $request
		->autoDetectUserAgent ()
		->autoCookieJar()
		->setAutoreferer ()
		->setReturntransfer ()
		->setConnecttimeout ( 30 )
		->setTimeout ( 30 )
		->setFollowlocation ()
		->setMaxredirs ( 3 )
		->setFreshConnect ()
		->setForbidReuse ()
		->get ( $url );
print $response . $break;

$url = 'http://intentionallyblankpage.com/test.php';
$response = $request->post ( $url, $fields = [ ] );
print $response . $break;

$response = $request->put ( $url, $fields = [ ] );
print $response . PHP_EOL;

What's with the name?

cURL -> Curly Howard -> The Three Stooges -> Stooge

If you find this useful, you can sponsor me on GitHub.