Comments (3)
看不太明白,请提供示例代码和说明
from laravel-tars.
class PayServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->singleton('pay', function ($app) {
$config = $app->make('config')->get('pay');
return new PayManager($config);
});
}
}
在PayManager这个类的__construct方法中写了数据库查询数据,每次请求进来都查到的是同一数据,修改数据库必须重启tars服务才生效
from laravel-tars.
Provider 的 register 应该只会执行一次,而且 Provider 在请求所有接口的时候应该都会执行,包括执行脚本。是否可以尝试用 middleware 实现。
from laravel-tars.
Related Issues (20)
- guzzlehttp/guzzle[6.3.3] 版本问题 HOT 1
- 支持 Laravel 最新版本v7.12.0吗? HOT 2
- test for new release
- laravel 5.7 compose didnot support HOT 2
- Bug 无法实例化Config HOT 5
- 新版本是否存在内存泄漏问题? HOT 3
- 你好,请问有遇到过数据库句柄一直不释放问题吗? HOT 51
- 最新版获取 deploy_cfg 又不行了 HOT 11
- 程序时常报错:failed to open stream: Too many open files HOT 1
- 路由必须指定Laravel/Route前缀才能访问通,可是文档却没有写 HOT 1
- 用lumen 版本为5.5composer后,http请求报以下错误 HOT 1
- Test for Release
- 用了lumen自带的api守卫发到tars平台上,第一次访问的时候正常,第二次就提示如下错误,本地用nginx一切正常 HOT 6
- 请教一下关于request接收的方式 HOT 3
- 做重定向跳转的时候ios系统下很慢,导致请求超时 HOT 1
- 什么时候支持laravel7,laravel8? HOT 2
- var_dump回在调试的时候打印出来 HOT 1
- composer install后导致phptars/tars-log版本从0.1.5变为0.1.6,新的版本下面没有handler文件导致服务报如下错误: HOT 2
- 用lumen框架没办法使用laravel-zipkin扩展包吗 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-tars.