<commit_before><?php
/*!
 * yii2 extension - wechat
 * xiewulong <<EMAIL>>
 * https://github.com/xiewulong/yii2-wechat
 * https://raw.githubusercontent.com/xiewulong/yii2-wechat/master/LICENSE
 * create: 2014/12/30
 * update: 2016/3/4
 * version: 0.0.1
 */

namespace yii\wechat;

use Yii;
use yii\base\ErrorException;
use yii\data\Pagination;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;
use yii\wechat\models\Wechat;
use yii\wechat\models\WechatUser;
use yii\wechat\models\WechatUserGroup;
use yii\wechat\models\WechatMenu;
use yii\wechat\models\WechatMaterial;
use yii\wechat\models\WechatMedia;
use yii\wechat\models\WechatNews;
use yii\wechat\models\WechatNewsMedia;
use yii\wechat\models\WechatNewsImage;

class Manager {

	//微信接口网关
	private $api = 'https://api.weixin.qq.com';

	//公众号
	public $wechat;

	//提示信息
	private $messages = false;

	//错误码
	public $errcode = 0;

	//错误信息
	public $errmsg = null;

	//fileupload扩展组件名
	public $fileupload = 'fileupload';

	//临时素材有效时长, 3天
	private $effectiveTimeOfTemporaryMaterial = 259200;

	/**
	 * 设置全局公众号
	 * @method setApp
	 * @since 0.0.1
	 * @param {string} $appid AppID
	 * @return {object}
	 * @example \Yii::$app->wechat->setApp($appid);
	 */
	public function setApp($appid) {
		if(!$this->wechat = Wechat::findOne($appid)) {
			throw new ErrorException('Without the wechat app');
		}

		return $this;
	}
<commit_msg>wechat<commit_after><?php
/*!
 * yii2 extension - wechat
 * xiewulong <<EMAIL>>
 * https://github.com/xiewulong/yii2-wechat
 * https://raw.githubusercontent.com/xiewulong/yii2-wechat/master/LICENSE
 * create: 2014/12/30
 * update: 2016/3/15
 * version: 0.0.1
 */

namespace yii\wechat;

use Yii;
use yii\base\ErrorException;
use yii\data\Pagination;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;
use yii\wechat\models\Wechat;
use yii\wechat\models\WechatUser;
use yii\wechat\models\WechatUserGroup;
use yii\wechat\models\WechatMenu;
use yii\wechat\models\WechatMaterial;
use yii\wechat\models\WechatMedia;
use yii\wechat\models\WechatNews;
use yii\wechat\models\WechatNewsMedia;
use yii\wechat\models\WechatNewsImage;

class Manager {

	//微信接口网关
	private $api = 'https://api.weixin.qq.com';

	//默认appid
	public $defaultAppid;

	//公众号
	public $wechat;

	//提示信息
	private $messages = false;

	//错误码
	public $errcode = 0;

	//错误信息
	public $errmsg = null;

	//fileupload扩展组件名
	public $fileupload = 'fileupload';

	//临时素材有效时长, 3天
	private $effectiveTimeOfTemporaryMaterial = 259200;

	/**
	 * 构造器
	 * @method __construct
	 * @since 0.0.1
	 * @return {none}
	 */
	public function __construct() {
		if($this->defaultAppid) {
			$this->setApp($this->defaultAppid);
		}
	}

	/**
	 * 设置全局公众号
	 * @method setApp
	 * @since 0.0.1
	 * @param {string} $appid AppID
	 * @return {object}
	 * @example \Yii::$app->wechat->setApp($appid);
	 */
	public function setApp($appid) {
		if(!$this->wechat = Wechat::findOne($appid)) {
			throw new ErrorException('Without the wechat app');
		}

		return $this;
	}

{'fraction_non_alphanumeric': 0.15223981138430448, 'fraction_numerical': 0.02222970697204446, 'mean_word_length': 3.8450244698205545, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 6, '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': '2697049', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1238, 'n_words': 215}