PHPackages                             clox/hicurl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. clox/hicurl

ActiveLibrary[HTTP &amp; Networking](/categories/http)

clox/hicurl
===========

hicurl is an object-oriented wrapper of the PHP cURL extension.Its main feature however is the ability to save requested pages and it also includes a javascript "class" for viewing the saved data.

v3.15.0(4mo ago)070PHP

Since Apr 7Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Clox/hicurl)[ Packagist](https://packagist.org/packages/clox/hicurl)[ Docs](https://github.com/Clox/hicurl)[ RSS](/packages/clox-hicurl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (44)Used By (0)

Hicurl
======

[](#hicurl)

A library that aims in making cURL-requests a piece of cake while also allowing for saving the fetched pages along with headers and postdata to files for later viewing. It essentially is a PHP wrapper class for cURL, and a javascript "class" that displays the saved data nicely.

Getting Started
---------------

[](#getting-started)

\###Simple Usage To use Hicurl on the PHP side you simply need to include hicurl.php inside the src folder:

```
require_once 'hicurl/src/hicurl.php';
```

Then you can do something like the following to begin loading some pages:

```
$hicurl=new Hicurl();
$google=$hicurl->loadSingle('www.google.com');
The $google-variable will now hold an associative array looking like:
[
    'content'=>page-content
    ,'headers'=>all the received headers
    ,'error'=>false for success, otherwise a description of the error
]
```

It is also easy sending post-data. If an object is passed to the second parameter the request will be sent as POST with that data:

```
require_once 'hicurl/src/hicurl.php';
$hicurl=new Hicurl();
$hicurl->loadSingle('http://www.htmlcodetutorial.com/cgi-bin/mycgi.pl',['foo'=>'bar']);
```

\###Settings

There's a bunch of settings that can be used. These can be passed or like this:

```
$hicurl=new Hicurl(['cookie'=>'cookies/cookie.txt']);
```

Any calls made with that instance will now save cookies in and send cookies from that file. Settings can be changed after instance-creation:

```
$hicurl->settings(['cookie'=>'cookies/muffin.txt']);
```

Lastly, they may also be passed to the load call in which case they will be merged with the settings of the instance during that call only:

```
$hicurl->loadSingle('www.google.com',null,['cookie'=>'cookies/macarone.txt']);
```

\###Static usage Most methods also have static counterparts which can be convenient if only a single call is to be made:

```
$result=Hicurl->loadSingleStatic($url,$postData,['cookie'=>'cake.txt']);
```

It's equivalent without hicurl would be something along the lines of:

```
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLINFO_HEADER_OUT,true);
curl_setopt($ch,CURLOPT_COOKIEFILE],'cake.txt');
curl_setopt($ch,CURLOPT_COOKIEJAR]'cake.txt');
$postDataString="";
foreach ($postData as $key=>$value) {
    $postDataString.=urlencode($key)."=".urlencode($value)."&";
}
curl_setopt($ch,CURLOPT_POSTFIELDS, trim($string, ","));
$result=['content'=>curl_exec($ch),'headers'=>curl_getinfo($ch)];
curl_close($ch);
```

"Whew!" ###Saving history Saving data is easy too. For starters we need one additional setting:

```
//set a history output filepath. This setting will be used for subsequent load-calls and will make them save data to that file.
$hicurl->settings(['history'=>'history/myHistoryFile']);
//load a couple pages. they will be saved to myHistoryFile
$hicurl->loadSingle("www.google.com");
$hicurl->loadSingle("www.facebook.com");
//When we are done writing to the file we need to "compile it".
//This puts it in a closed state, and also compresses it.
//This is the state it is sent to the client in.
$hicurl->compileHistory();
```

\###Sending history There's some easy job to be done for sending the data to the client. Here's one way of doing it:

*getHistory.php*

```
require_once 'hicurl/src/hicurl.php';
Hicurl::serveHistory('history/myHistoryFile');
```

That's what we need for sending the data. Though simply loading this page in the browser wont help much, so we will need to do the following... ###Viewing history To be able to view the data in a meaningful way we will use the javascript hicurl-class. We need to load some files to use it and then write a tiny bit more code.

```

    //it expects a DOM-element in its first parameter, where everything will be rendered unto.
    //As second parameter we will need to pass a url-string where it will fetch the history-data from.
    hicurl=new Hicurl(document.body,"getMyHistory.php");
    //We will need to create that page, e.g. "getHistory.php" in this case,  and make it send the data.

```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance74

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~103 days

Recently: every ~414 days

Total

39

Last Release

144d ago

Major Versions

v1.6.0 → v2.0.0-a2015-04-29

2.x-dev → v3.0.02020-04-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/445fd233593995371bc75c5bc7c30762f04294939494f140f0133ed3ebe8e99e?d=identicon)[Clox](/maintainers/Clox)

---

Top Contributors

[![Clox](https://avatars.githubusercontent.com/u/105810?v=4)](https://github.com/Clox "Clox (53 commits)")

---

Tags

logloggingcurlhistorysave

### Embed Badge

![Health badge](/badges/clox-hicurl/health.svg)

```
[![Health](https://phpackages.com/badges/clox-hicurl/health.svg)](https://phpackages.com/packages/clox-hicurl)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[bilfeldt/laravel-http-client-logger

A logger for the Laravel HTTP Client

1531.6M3](/packages/bilfeldt-laravel-http-client-logger)[gmponos/guzzle_logger

A Guzzle middleware to log request and responses automatically

772.2M6](/packages/gmponos-guzzle-logger)[altek/accountant

The auditing &amp; accountability package for Laravel's Eloquent ORM.

92954.3k4](/packages/altek-accountant)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

1935.1k](/packages/onlime-laravel-http-client-global-logger)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
