Skip to content

Commit

Permalink
更新配置文件格式与添加外观
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Apr 25, 2015
1 parent 4d3cbc2 commit 3a7a9f1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
40 changes: 40 additions & 0 deletions src/Facade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace Overtrue\LaravelWechat;

use Illuminate\Support\Facades\Facade as LaravelFacade;
use Log;

/**
* @see Overtrue\Wechat\Wechat
*/
class Facade extends LaravelFacade
{
/**
* 默认提供服务端
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'wechat.server';
}

/**
* 魔术方法
*
* @param string $method
* @param array $args
*
* @return mixed
*/
public function __call($method, $args)
{
if (isset(static::$app["wechat.{$method}"])) {
Log::warning("建议不要再统一使用 `Wechat::on()` 等形式使用,overtrue/wechat 2.x 已经改为独立服务类型来使用各模块的功能,更多请参阅文档:https://github.com/overtrue/wechat/wiki");
return static::$app["wechat.{$method}"];
}

parent::__call($method, $args);
}
}
9 changes: 5 additions & 4 deletions src/config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
return [
'appId' => 'Your app id', // 必填
'secret' => 'Your secret', // 必填
'token' => 'Your token', // 必填
'encodingAESKey' => 'Your encoding AES Key' // 加密模式需要,其它模式不需要
'use_alias' => false,
'app_id' => 'YourAppId', // 必填
'secret' => 'YourSecret', // 必填
'token' => 'YourToken', // 必填
'encoding_key' => 'YourEncodingAESKey' // 加密模式需要,其它模式不需要
];

0 comments on commit 3a7a9f1

Please sign in to comment.