bixuehujin / blink Goto Github PK
View Code? Open in Web Editor NEWA high performance web framework and application server in PHP.
Home Page: https://docs.rethinkphp.com/blink-framework/
License: MIT License
A high performance web framework and application server in PHP.
Home Page: https://docs.rethinkphp.com/blink-framework/
License: MIT License
I understand that this an HTTP framework built on top of Swoole. But Swoole has many other features, such as allowing one to program websocket servers, tcp servers and making use of asynchronous IO for accessing databases. I just went through the docs, and it doesn't mention any of this. To what extent is Blink meant to support these other swoole features?
我是做安卓开发的,apicloud太黑了,人气爆满后欠费1万,我要自己写一个服务器才行,不然的话,app要重写。
Hi guys, could be possible some examples about how to access "server" configuration
For example, at directory structure we have /src/config/server.php. How using HttpController access this configuration? for example I want to set some HTTP configurations at server.php and read it at application
PHP Fatal error: Cannot redeclare env() (previously declared in /vendor/illuminate/support/helpers.php:606) in /vendor/blink/blink/src/support/helpers.php on line 121
composer.json:
"require": {
"blink/blink": "0.4.*",
"robmorgan/phinx": "~0.10"
},
"require-dev": {
"phpunit/phpunit": "~7.0"
},
报错:
test>vendor\bin\phinx.bat
PHP Fatal error: Cannot redeclare env() (previously declared in D:\Uio\cygwin64\home\newiep\test-app\vendor\cakephp\core\functions.php:200)
in D:\Uio\cygwin64\home\newiep\test-app\vendor\blink\blink\src\support\helpers.php on line 126
Fatal error: Cannot redeclare env() (previously declared in D:\Uio\cygwin64\home\newiep\test-app\vendor\cakephp\core\functions.php:200)
in D:\Uio\cygwin64\home\newiep\test-app\vendor\blink\blink\src\support\helpers.php on line 126
明明执行的是 phinx.bat 脚本,竟然会加载 blink 包……我该咋办?
hello~
你好,今天想使用一下您的开源项目blink,但在安装使用时,发现了几个小问题:
我使用您readme中提供的唯一安装方法composer create-project --prefer-dist blink/seed your-app
,可能是因为国内的原因吧,没法安装。
于是我尝试git clone,但clone的结果和文档说的目录结构不太一样,没有找到router.php文件。
是否有一些其他的安装方法呢?
谢谢~
hello~
I have a problem about get cookie in controller.
When I use the object Request "getCookies" method ,cannot get a cookie in the Request.
thank u.
用phinx 类库时候发现 那边先申明了env函数 加载报错
cgi 模式下需要使用 [HTTPS] => on
来判断是否使用 https
#55705.0] ERROR swReactorKqueue_del(:238): kqueue->del(20, SW_EVENT_WRITE) failed. Error: No such file or directory[2]
I noticed that your readme states the following:
In php-fpm or mod_php, all resources like objects and database connections only live within a single request
This isn't true for php-fpm
, it's actually the exact opposite. Database connections specifically persist. Objects don't, but the lexing and all the heavy work is done and stored to OPCache. I was referred to this repository by a potential client, and it seems that you've got a mistake there that leads people to wrong conclusions.
The other thing I've noticed is the claim that you're 100% faster. I couldn't find the actual proof of the statement for comparison, but from a lot of testing I've conducted with similar projects - the best you can hope for is to be near performance of php-fpm
, there is no possibility to achieve more since essentially a cli
executed script is nearly the same as php-fpm
executed one from the execution POV.
I don't want to be "that guy" who dumps on someone's project, I think you have an interesting tool here but I believe you would agree with me that incorrect assumptions are quickly to propagate as "facts" when in reality - it's not true.
I wish you all the best, hopefully you won't take my comment/issue the wrong way, the intent is not to belittle your work.
报错内容
blink\core\NotSupportedException: The content type: '' does not supported in vendor/blink/blink/src/http/Request.php:341
原因猜测可能是RequestActor的doRequest方法里,用
$this->request->{$key} = $value;
的方式,无法通过request->body赋值给reuqest->payload
in vendor/blink/blink/src/server/Server.php on line 5
PHP 7.2.0 (cli) (built: Dec 3 2017 21:47:51) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.6.0alpha1, Copyright (c) 2002-2017, by Derick Rethans
Http library添加支持PSR7
PSR7已经是相当成熟的规范了,现在已经大规模的被框架适用
添加数据库访问层
如果作者不想自己实现的话,doctrine是个不错的方案;在核心层做个桥接以方便使用
命名空间格式大小写混合的写法是参照thinkphp的吧,着实辣眼睛,建议换成pascal命名法
比较主流框架都是这个,用户迁移过来也不易反感
The doc says that commands should be inside the src/commands
folder. Does that mean they are automatically loaded?
On PHP 7.2, trying to start php blink server:serve
fails with the following error:
PHP Fatal error: Cannot use blink\core\Object as Object because 'Object' is a special class name in /var/www/blink/vendor/blink/blink/src/server/Server.php on line 5
我看到大致意思是先在主进程创建app实例,然后复制成多个子进程,这个时候只是简单的app实例在进程中,那么进程之间的产生的服务是怎么共享的??
PHP Fatal error: Cannot use blink\core\Object as Object because 'Object' is a special class name in /data/wwwroot/www.hcode.wang/vendor/blink/blink/src/server/Server.php on line 5
环境:PHP 7.2.1、swoole2.几忘了
这个框架怎么创建WEBSOCKET
The framework should follow PSR-1 for naming namespaces.
If i add a dependency to my controller function blink gives error because of algorithm used in getMethodDepencies in ServiceLocator file. In getMethodDependencies it uses array_slice to get parameters with offset which is number of route parameters. And it trys to get route parameter value then throws error.
This is the error:
[2020-12-20 14:48:34] blink.ERROR: blink\core\InvalidParamException: Missing required argument: name in /home/serip/workspace/junk/php/your-app/vendor/blink/blink/src/core/ServiceLocator.php:84
I try to fix with changing function arguments orders. And i got a new error.
And error is:
I am trying to solve this issue if i did it i will create a pull request.
If you has not a sessions
dir in runtime
, when you start the server, many errors occured:
[2015-10-23 06:59:05 *5939.0] WARN zm_deactivate_swoole: Fatal error: Uncaught exception 'blink\core\InvalidConfigException' with message 'The param: '/var/www/blink-seed/src/config/../../runtime/sessions' is invalid or not writable' in /var/www/blink-seed/vendor/blink/blink/src/session/FileStorage.php:24
Stack trace:
#0 /var/www/blink-seed/vendor/blink/blink/src/core/ObjectTrait.php(19): blink\session\FileStorage->init()
#1 [internal function]: blink\core\Object->__construct(Array)
#2 /var/www/blink-seed/vendor/blink/blink/src/di/Container
PHP Fatal error: Uncaught exception 'blink\core\InvalidConfigException' with message 'The param: '/var/www/blink-seed/src/config/../../runtime/sessions' is invalid or not writable' in /var/www/blink-seed/vendor/blink/blink/src/session/FileStorage.php:24
Stack trace:
#0 /var/www/blink-seed/vendor/blink/blink/src/core/ObjectTrait.php(19): blink\session\FileStorage->init()
#1 [internal function]: blink\core\Object->__construct(Array)
#2 /var/www/blink-seed/vendor/blink/blink/src/di/Container.php(433): ReflectionClass->newInstanceArgs(Array)
#3 /var/www/blink-seed/vendor/blink/blink/src/di/Container.php(185): blink\di\Container->build('blink\session\F...', Array, Array)
#4 /var/www/blink-seed/vendor/blink/blink/src/support/helpers.php(26): blink\di\Container->get('blink\session\F...', Array, Array)
#5 /var/www/blink-seed/vendor/blink/blink/src/session/Manager.php(32): make(Array)
#6 /var/www/blink-seed/vendor/blink/blink/src/core/ObjectTrait.php(19): blink\session\Manager->init()
#7 [internal function]: blink\core\Object->__const in /var/www/blink-seed/vendor/blink/blink/src/session/FileStorage.php on line 24
PHP Stack trace:
PHP 1. {main}() /var/www/blink-seed/blink:0
PHP 2. blink\core\Application->handleConsole() /var/www/blink-seed/blink:11
PHP 3. Symfony\Component\Console\Application->run() /var/www/blink-seed/vendor/blink/blink/src/core/Application.php:248
PHP 4. Symfony\Component\Console\Application->doRun() /var/www/blink-seed/vendor/symfony/console/Application.php:126
PHP 5. Symfony\Component\Console\Application->doRunCommand() /var/www/blink-seed/vendor/symfony/console/Application.php:195
PHP 6. blink\core\console\Command->run() /var/www/blink-seed/vendor/symfony/console/Application.php:878
PHP 7. Symfony\Component\Console\Command\Command->run() /var/www/blink-seed/vendor/blink/blink/src/core/console/Command.php:47
PHP 8. blink\console\ServerCommand->execute() /var/www/blink-seed/vendor/symfony/console/Command/Command.php:259
PHP 9. call_user_func() /var/www/blink-seed/vendor/blink/blink/src/console/ServerCommand.php:36
PHP 10. blink\console\ServerCommand->handleServe() /var/www/blink-seed/vendor/blink/blink/src/console/ServerCommand.php:36
PHP 11. blink\server\SwServer->run() /var/www/blink-seed/vendor/blink/blink/src/console/ServerCommand.php:45
PHP 12. swoole_http_server->start() /var/www/blink-seed/vendor/blink/blink/src/server/SwServer.php:177
[2015-10-23 06:59:05] blink.CRITICAL: exception 'blink\core\ErrorException' with message 'Uncaught exception 'blink\core\InvalidConfigException' with message 'The param: '/var/www/blink-seed/src/config/../../runtime/sessions' is invalid or not writable' in /var/www/blink-seed/vendor/blink/blink/src/session/FileStorage.php:24 Stack trace: #0 /var/www/blink-seed/vendor/blink/blink/src/core/ObjectTrait.php(19): blink\session\FileStorage->init() #1 [internal function]: blink\core\Object->__construct(Array) #2 /var/www/blink-seed/vendor/blink/blink/src/di/Container.php(433): ReflectionClass->newInstanceArgs(Array) #3 /var/www/blink-seed/vendor/blink/blink/src/di/Container.php(185): blink\di\Container->build('blink\session\F...', Array, Array) #4 /var/www/blink-seed/vendor/blink/blink/src/support/helpers.php(26): blink\di\Container->get('blink\session\F...', Array, Array) #5 /var/www/blink-seed/vendor/blink/blink/src/session/Manager.php(32): make(Array) #6 /var/www/blink-seed/vendor/blink/blink/src/core/ObjectTrait.php(19): blink\session\Manager->init() #7 [internal function]: blink\core\Object->__const' in /var/www/blink-seed/vendor/blink/blink/src/session/FileStorage.php:24 Stack trace: #0 /var/www/blink-seed/vendor/blink/blink/src/console/ServerCommand.php(45): blink\server\SwServer->run() #1 /var/www/blink-seed/vendor/blink/blink/src/console/ServerCommand.php(36): blink\console\ServerCommand->handleServe() #2 /var/www/blink-seed/vendor/blink/blink/src/console/ServerCommand.php(36): ::call_user_func() #3 /var/www/blink-seed/vendor/symfony/console/Command/Command.php(259): blink\console\ServerCommand->execute() #4 /var/www/blink-seed/vendor/blink/blink/src/core/console/Command.php(47): Symfony\Component\Console\Command\Command->run() #5 /var/www/blink-seed/vendor/symfony/console/Application.php(878): blink\core\console\Command->run() #6 /var/www/blink-seed/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRunCommand() #7 /var/www/blink-seed/vendor/symfony/console/Application.php(126): Symfony\Component\Console\Application->doRun() #8 /var/www/blink-seed/vendor/blink/blink/src/core/Application.php(248): Symfony\Component\Console\Application->run() #9 /var/www/blink-seed/blink(11): blink\core\Application->handleConsole() #10 {main} [] []
[2015-10-23 06:59:05 *5940.0] WARN zm_deactivate_swoole: Fatal error: Uncaught exception 'blink\core\InvalidConfigException' with message 'The param: '/var/www/blink-seed/src/config/../../runtime/sessions' is invalid or not writable' in /var/www/blink-seed/vendor/blink/blink/src/session/FileStorage.php:24
Stack trace:
#0 /var/www/blink-seed/vendor/blink/blink/src/core/ObjectTrait.php(19): blink\session\FileStorage->init()
#1 [internal function]: blink\core\Object->__construct(Array)
#2 /var/www/blink-seed/vendor/blink/blink/src/di/Container
^C
I think the FileStorage->init() method should create sessions
dir automatically
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.