<commit_before># PHP library for UserApp

[![Build Status](https://travis-ci.org/userapp-io/userapp-php.png)](https://travis-ci.org/userapp-io/userapp-php)
[![Code Quality](https://scrutinizer-ci.com/g/userapp-io/userapp-php/badges/quality-score.png?s=4731b8e33e4f5866f28a1b9cafb23b83d39d9792)](https://scrutinizer-ci.com/g/userapp-io/userapp-php/)

## Getting started

### Finding your App Id and Token

If you don't have a UserApp account, you need to [create one](https://app.userapp.io/#/sign-up/).

* **App Id**: The App Id identifies your app. After you have logged in, you should see your `App Id` instantly. If you're having trouble finding it, [follow this guide](https://help.userapp.io/customer/portal/articles/1322336-how-do-i-find-my-app-id-).

*  **Token**: A token authenticates a user on your app. If you want to create a token for your logged in user, [follow this guide](https://help.userapp.io/customer/portal/articles/1364103-how-do-i-create-an-api-token-). If you want to authenticate using a username/password, you can acquire your token by calling `$api->user->login(...);`

### Loading the library

UserApp relies on the autoloading features of PHP to load its files when needed. The autoloading complies with the PSR-0 standard which makes it compatible with most of the major frameworks and libraries. Autoloading in your application is handled automatically when managing the dependencies with [Composer](https://packagist.org/packages/userapp/userapp), but you can also leverage its own autoloader class if you are going to use it in a project or script without any PSR-0 compliant autoloading facility:

    require 'UserApp/Autoloader.php';
    UserApp\Autoloader::register();

### Creating your first client

	$api = new \UserApp\API("YOUR APP ID");

#### Additional ways of creating a client

If you want to create a client with additional options  the easiest way is to pass an array with the options as shown below.<commit_msg>Improved Composer load docs. Thanks to @vsbmeza :)<commit_after># PHP library for UserApp

[![Build Status](https://travis-ci.org/userapp-io/userapp-php.png)](https://travis-ci.org/userapp-io/userapp-php)
[![Code Quality](https://scrutinizer-ci.com/g/userapp-io/userapp-php/badges/quality-score.png?s=4731b8e33e4f5866f28a1b9cafb23b83d39d9792)](https://scrutinizer-ci.com/g/userapp-io/userapp-php/)

## Getting started

### Finding your App Id and Token

If you don't have a UserApp account, you need to [create one](https://app.userapp.io/#/sign-up/).

* **App Id**: The App Id identifies your app. After you have logged in, you should see your `App Id` instantly. If you're having trouble finding it, [follow this guide](https://help.userapp.io/customer/portal/articles/1322336-how-do-i-find-my-app-id-).

*  **Token**: A token authenticates a user on your app. If you want to create a token for your logged in user, [follow this guide](https://help.userapp.io/customer/portal/articles/1364103-how-do-i-create-an-api-token-). If you want to authenticate using a username/password, you can acquire your token by calling `$api->user->login(...);`

### Loading the library

UserApp relies on the autoloading features of PHP to load its files when needed. The autoloading complies with the PSR-0 standard which makes it compatible with most of the major frameworks and libraries. Autoloading in your application is handled automatically when managing the dependencies with [Composer](https://packagist.org/packages/userapp/userapp).
    
#### Using Composer? Add this to your `composer.json`

	{
		"repositories": [
			{
				"type": "package",
				"package": {
					"name": "userapp/userapp",
					"version": "1.0",
					"source": {
						"url": "https://github.com/userapp-io/userapp-php.git",
						"type": "git",
						"reference": "master"
					}
				}
			}
		],
		"require": {
			"userapp/userapp": "*",
		}
	}

#### Not using Composer? Use the library Autoloader to load the library yourself

    require 'UserApp/Autoloader.php';
    UserApp\Autoloader::register();

### Creating your first client

	$api = new \UserApp\API("YOUR APP ID");

#### Additional ways of creating a client

If you want to create a client with additional options  the easiest way is to pass an array with the options as shown below.
{'fraction_non_alphanumeric': 0.12403463608705827, 'fraction_numerical': 0.019892347296981045, 'mean_word_length': 4.1432009626955475, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 17, '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': '37332', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1332, 'n_words': 447}