To create a sdk easiler!
- pimple (Container)
- Http
- Log
php 7 以上(需要PHP5的可移步到其他人维护的仓库 https://github.com/CodeNauhc/foundation-sdk/tree/php5)
To create a sdk easiler!
License: MIT License
To create a sdk easiler!
php 7 以上(需要PHP5的可移步到其他人维护的仓库 https://github.com/CodeNauhc/foundation-sdk/tree/php5)
移除 app 依赖之后
请问 旧版本的开发的组件如何兼容?
我在包中的Foundation 类的构造方法中手动 __set config参数进去才能起作用
public function __construct($config)
{
parent::__construct();
$this->setConfig($config);
$this->__set('config',$config);
if ($this->config['debug'] ?? false) {
error_reporting(E_ALL);
}
$this->registerProviders();
$this->registerBase();
$this->initializeLogger();
}
请问我哪里有可能设置做了,或者做错了吗?
可以把cache 更换成Symfony\Component\Cache包吗?
如果第三方要求签名加在 headers 里传递, 能支持么?
Http 那里,我感觉有点问题
以下这个方法,如果存在 $default['handler'] 的话,感觉不应该当成一个 middleware push 进来,而是直接使用 setHandler 吧
protected function getHandler()
{
$stack = HandlerStack::create();
foreach ($this->middlewares as $middleware) {
$stack->push($middleware);
}
if (isset(static::$defaults['handler']) && is_callable(static::$defaults['handler'])) {
$stack->push(static::$defaults['handler'], self::USER_DEFINED_HANDLER);
}
if (isset($this->app['guzzle_handler'])) {
$guzzleHandler = $this->app['guzzle_handler'];
$stack->setHandler(is_string($guzzleHandler) ? new $guzzleHandler() : $this->app['guzzle_handler']);
}
return $stack;
}
希望发个1.1 版本。让旧版本也支持
https://github.com/CodeNauhc/foundation-sdk/tree/php5
现在还是2.0呢,导致monolog的版本错误
很多框架最低要求已经是 guzzlehttp/guzzle
7.x 了,在使用这些框架的时候,用这个包会有冲突。
版本:从3.0.5升级到3.1
具体错误位置:
hanson/foundation-sdk/src/AbstractAPI.php(32): Hanson\Foundation\Http->__construct(NULL)
Http中的构造函数添加了app参数,这个问题需要升级到那个版本就可以解决了?
类 Hanson\Foundation\Http 的 request 方法,在里面调用了 $response->getBody() 记录日志,然后再返回 $response,使用 $response->getBody()->getContents() 获取返回的内容,是个空字符串。
是否需要加个 $response->getBody()->rewind() 将指针重置到起始位置。
3424000
这个commit把 Illuminate\Support\Collection 改成了 Tightenco\Collect\Support\Collection ,但是在我使用的时候就会出现如下报错
2018/06/16 18:45:02 [error] 20620#2420: *50 FastCGI sent in stderr: "PHP Fatal error: Class 'Tightenco\Collect\Support\Collection' not found in C:\nginx-1.14.0\html\tjupt_pay\vendor\hanson\foundation-sdk\src\Config.php on line 8" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /tjupt_pay/test.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"
所以我把那个类改回去,就可以正常使用了,请看一下这里是不是有什么问题
public function __construct(Foundation $app)
{
$this->app = $app;
}
=======================================
我以前正常的程序,现在需要把这个屏蔽掉才能正常工作。
这个app 有什么约定吗?
$http->upload('/upload', $file, [
"fields" => [
"user1" => [
"name" => 1
]
]
])
当文件上传时还需要传送多维数组时,目前的处理服务端无法接收到多维数组的参数。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.