<commit_before><?php
namespace Aobo\Easemob;

class EasemobClass {

	protected $client_id;
	protected $client_secret;
	protected $org_name;
	protected $app_name;
	protected $url;

	/**
	* 初始化参数
	*
	* @param array $options
	* @param $options['client_id']
	* @param $options['client_secret']
	* @param $options['org_name']
	* @param $options['app_name']
	*/
	public function __construct( $options = [] )
	{
		$this->client_id = isset ( $options ['client_id'] ) ? $options ['client_id'] : '';
		$this->client_secret = isset ( $options ['client_secret'] ) ? $options ['client_secret'] : '';
		$this->org_name = isset ( $options ['org_name'] ) ? $options ['org_name'] : '';
		$this->app_name = isset ( $options ['app_name'] ) ? $options ['app_name'] : '';
		if (! empty ( $this->org_name ) && ! empty ( $this->app_name )) {
			$this->url = 'https://a1.easemob.com/' . $this->org_name . '/' . $this->app_name . '/';
		}else(
			abort('403','Uses Easemob Without Configs! ~');
		)
	}
	/**
	* 开放注册模式
	*
	* @param $options['username'] 用户名
	* @param $options['password'] 密码
	*/
	public function openRegister($options) {
		$url = $this->url . "users";
		$result = $this->postCurl ( $url, $options, $head = [] );
		return $result;
	}

	/**
	* 授权注册模式 || 批量注册
	*
	* @param $options['username'] 用户名
	* @param $options['password'] 密码
	*        	批量注册传二维数组
	*/
	public function accreditRegister($options) {
		$url = $this->url . "users";
		$access_token = $this->getToken ();
		$header[] = 'Authorization: Bearer ' . $access_token;
		$result = $this->postCurl ( $url, $options, $header );
		return $result;
	}

	/**<commit_msg>big typo…………<commit_after><?php
namespace Aobo\Easemob;

class EasemobClass {

	protected $client_id;
	protected $client_secret;
	protected $org_name;
	protected $app_name;
	protected $url;

	/**
	* 初始化参数
	*
	* @param array $options
	* @param $options['client_id']
	* @param $options['client_secret']
	* @param $options['org_name']
	* @param $options['app_name']
	*/
	public function __construct( $options = [] )
	{
		$this->client_id = isset ( $options ['client_id'] ) ? $options ['client_id'] : '';
		$this->client_secret = isset ( $options ['client_secret'] ) ? $options ['client_secret'] : '';
		$this->org_name = isset ( $options ['org_name'] ) ? $options ['org_name'] : '';
		$this->app_name = isset ( $options ['app_name'] ) ? $options ['app_name'] : '';
		if (! empty ( $this->org_name ) && ! empty ( $this->app_name )) {
			$this->url = 'https://a1.easemob.com/' . $this->org_name . '/' . $this->app_name . '/';
		}else{
			abort('403','Uses Easemob Without Configs! ~');
		}
	}
	/**
	* 开放注册模式
	*
	* @param $options['username'] 用户名
	* @param $options['password'] 密码
	*/
	public function openRegister($options) {
		$url = $this->url . "users";
		$result = $this->postCurl ( $url, $options, $head = [] );
		return $result;
	}

	/**
	* 授权注册模式 || 批量注册
	*
	* @param $options['username'] 用户名
	* @param $options['password'] 密码
	*        	批量注册传二维数组
	*/
	public function accreditRegister($options) {
		$url = $this->url . "users";
		$access_token = $this->getToken ();
		$header[] = 'Authorization: Bearer ' . $access_token;
		$result = $this->postCurl ( $url, $options, $header );
		return $result;
	}

	/**
{'fraction_non_alphanumeric': 0.20889027043829655, 'fraction_numerical': 0.0024867889337892445, 'mean_word_length': 3.8905775075987843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 2, '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': '4513175', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1279, 'n_words': 235}