<commit_before><?php

/**
 *	@author <NAME> <<EMAIL>>
 *	@license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
 */

namespace Essence\Di\Container;

use Essence\Essence;
use Essence\Di\Container;
use Essence\Cache\Engine\Volatile as VolatileCacheEngine;
use Essence\Dom\Parser\Native as NativeDomParser;
use Essence\Http\Client\Curl as CurlHttpClient;
use Essence\Http\Client\Native as NativeHttpClient;
use Essence\Log\Logger\Null as NullLogger;
use Essence\Provider\Collection;
use Essence\Provider\OEmbed;
use Essence\Provider\OEmbed\Vimeo;
use Essence\Provider\OEmbed\Youtube;
use Essence\Provider\OpenGraph;
use Essence\Media\Preparator;
use Essence\Media\Preparator\Bandcamp as BandcampPreparator;
use Essence\Media\Preparator\Vine as VinePreparator;
use Essence\Media\Preparator\Youtube as YoutubePreparator;


/**
 *	Contains the default injection properties.
 *
 *	@package Essence.Di.Container
 */

class Standard extends Container {

	/**
	 *	Sets the default properties.
	 */

	public function __construct( array $properties = [ ]) {

		$this->_properties = $properties + [

			// Providers are loaded from the default config file
			'providers' => ESSENCE_DEFAULT_PROVIDERS,

			// A volatile cache engine is shared across the application
			'Cache' => Container::unique( function( ) {
				return new VolatileCacheEngine( );
			}),

			// A cURL HTTP client is shared across the application
			// If cURL isn't available, a native client is used
			'Http' => Container::unique( function( ) {
				return function_exists( 'curl_init' )
					? new CurlHttpClient( )
					: new NativeHttpClient( );
			}),

			// A native DOM parser is shared across the application
			'Dom' => Container::unique( function( ) {
				return new NativeDomParser( );
			}),
<commit_msg>Added a default user agent<commit_after><?php

/**
 *	@author <NAME> <<EMAIL>>
 *	@license FreeBSD License (http://opensource.org/licenses/BSD-2-Clause)
 */

namespace Essence\Di\Container;

use Essence\Essence;
use Essence\Di\Container;
use Essence\Cache\Engine\Volatile as VolatileCacheEngine;
use Essence\Dom\Parser\Native as NativeDomParser;
use Essence\Http\Client\Curl as CurlHttpClient;
use Essence\Http\Client\Native as NativeHttpClient;
use Essence\Log\Logger\Null as NullLogger;
use Essence\Provider\Collection;
use Essence\Provider\OEmbed;
use Essence\Provider\OEmbed\Vimeo;
use Essence\Provider\OEmbed\Youtube;
use Essence\Provider\OpenGraph;
use Essence\Media\Preparator;
use Essence\Media\Preparator\Bandcamp as BandcampPreparator;
use Essence\Media\Preparator\Vine as VinePreparator;
use Essence\Media\Preparator\Youtube as YoutubePreparator;


/**
 *	Contains the default injection properties.
 *
 *	@package Essence.Di.Container
 */

class Standard extends Container {

	/**
	 *	Sets the default properties.
	 */

	public function __construct( array $properties = [ ]) {

		$this->_properties = $properties + [

			// Providers are loaded from the default config file
			'providers' => ESSENCE_DEFAULT_PROVIDERS,

			// A volatile cache engine is shared across the application
			'Cache' => Container::unique( function( ) {
				return new VolatileCacheEngine( );
			}),

			// User agent
			'HttpUserAgent' => 'Essence',

			// A cURL HTTP client is shared across the application
			// If cURL isn't available, a native client is used
			'Http' => Container::unique( function( $C ) {
				$Http = function_exists( 'curl_init' )
					? new CurlHttpClient( )
					: new NativeHttpClient( );

				$Http->setUserAgent( $C->get( 'HttpUserAgent' ));
				return $Http;
			}),

			// A native DOM parser is shared across the application
			'Dom' => Container::unique( function( ) {
				return new NativeDomParser( );
			}),

{'fraction_non_alphanumeric': 0.11308084877786731, 'fraction_numerical': 0.0005372011818426001, 'mean_word_length': 4.039242219215156, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 22, 'https://': 0, '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': '3936985', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1132, 'n_words': 310}