<commit_before>CURLFile Compatibility Library
==============================

[![Build Status](https://travis-ci.org/imnotjames/curlfile-compat.svg?branch=master)](https://travis-ci.org/imnotjames/curlfile-compat)
[![Coverage Status](https://img.shields.io/coveralls/imnotjames/curlfile-compat.svg)](https://coveralls.io/r/imnotjames/curlfile-compat)

Compatibility library to add a [CURLFile](http://php.net/class.curlfile) class to older versions of PHP<commit_msg>make readme a bit clearer, adding some basic installation + usage info<commit_after># CURLFile Compatibility Library

[![Build Status](https://travis-ci.org/imnotjames/curlfile-compat.svg?branch=master)](https://travis-ci.org/imnotjames/curlfile-compat)
[![Coverage Status](https://img.shields.io/coveralls/imnotjames/curlfile-compat.svg)](https://coveralls.io/r/imnotjames/curlfile-compat)

Compatibility library to add a [CURLFile](http://php.net/class.curlfile) class to older versions of PHP

## Installation

New school or old school, your choice.

For a new school installation with [Composer](http://getcomposer.org) simply [add it to your list of dependencies.](https://packagist.org/packages/imnotjames/curlfile-compat)

If you're kicking it old school you've got to `require` `src/CURLFile.php` and `src/imnotjames/CURLFILE.php`.

Either way, the non-namespaced CURLFile will only be created if the class doesn't already exist.  Same goes for the `create_curl_file` function.


## Usage

Exactly the same as [PHP's CURLFile'](http://php.net/curlfile)

```php
$handle = curl_init('http://example.com');

$cfile = new CURLFile('puppy.jpg','image/jpeg','puppy_boquet');

// Assign POST data
$data = array('test_file' => $cfile);

curl_setopt($handle, CURLOPT_POST,1);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);

curl_exec($handle);
```
{'fraction_non_alphanumeric': 0.15922865013774104, 'fraction_numerical': 0.0005509641873278236, 'mean_word_length': 5.931297709923665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1931433', 'n_tokens_mistral': 639, 'n_tokens_neox': 593, 'n_words': 130}