Giter Site home page Giter Site logo

easywechat-composer's Issues

Server Delegation

Usage

use EasyWeChatComposer\EasyWeChat;

// Enable:
EasyWeChat::withDelegation()->toHost('https://yourdomain.com')->enable();

// Disable:
EasyWeChat::withDelegation()->toHost('https://yourdomain.com')->disable();

// Use as usual:
Factory::openPlatform([])...;

Supports

  • Laravel

在服务提供者中加载路由,在未使用到路由的项目中,会导致 `boot` 严重慢

在服务提供者中加载路由,在未使用到路由的项目中,会导致 boot 严重慢

/**
* Bootstrap any application services.
*/
public function boot()
{
$this->registerRoutes();
$this->publishes([
__DIR__.'/config.php' => config_path('easywechat-composer.php'),
]);
}

在核心代码中不必指定 declare(strict_types=1);

<?php
declare(strict_types=1);

使用 composer.lock 的哈希作为 key,一方面是安全性可能被枚举到。另外就是性能上,会多一次文件io。再如果项目的 composer.lock 被删除了,会报错?

/**
* Register any application services.
*/
public function register()
{
$this->configure();
EasyWeChat::setEncryptionKey(
$defaultKey = md5_file(base_path('composer.lock'))
);
EasyWeChat::withDelegation()
->toHost($this->config('delegation.host'))
->ability($this->config('delegation.enabled'));
$this->app->when(DefaultEncrypter::class)->needs('$key')->give($defaultKey);
}

Laravel 5.8 缓存存活时间问题

Laravel 5.8 的缓存存活时间单位从分钟变成了秒,造成 EasyWeChatComposer\Laravel\ServiceProvider::getMd5Key() 的行为在 Laravel 5.8 之前和之后不一致。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.