GithubHelp home page GithubHelp logo

bixuehujin / blink Goto Github PK

View Code? Open in Web Editor NEW
832.0 82.0 121.0 626 KB

A high performance web framework and application server in PHP.

Home Page: https://docs.rethinkphp.com/blink-framework/

License: MIT License

PHP 99.94% Makefile 0.06%
php swoole php-framework framework restful blink blink-framework webserver api-framework

blink's People

Contributors

bixuehujin avatar daxiong123 avatar devonliu02 avatar gitter-badger avatar janhuang avatar kimkit avatar lavary avatar s4urp8n avatar samnela avatar sunshare avatar whyounes avatar wozzup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blink's Issues

Swoole Features

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?

Examples

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

env function confliction

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

安装了数据库迁移包后,CLI 报错:env 函数重复

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文件。
是否有一些其他的安装方法呢?
谢谢~

can't get cookie's params

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.

用 ab 压测 下报错

#55705.0] ERROR swReactorKqueue_del(:238): kqueue->del(20, SW_EVENT_WRITE) failed. Error: No such file or directory[2]

Incorrect assumptions in readme.md

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.

[Enhancement]建议

  • Http library添加支持PSR7
    PSR7已经是相当成熟的规范了,现在已经大规模的被框架适用

  • 添加数据库访问层
    如果作者不想自己实现的话,doctrine是个不错的方案;在核心层做个桥接以方便使用

  • 命名空间格式大小写混合的写法是参照thinkphp的吧,着实辣眼睛,建议换成pascal命名法
    比较主流框架都是这个,用户迁移过来也不易反感

Console commands not loaded

The doc says that commands should be inside the src/commands folder. Does that mean they are automatically loaded?

PHP 7.2 compatibility

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

运行php blink server:server报了下面这个错

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.几忘了

Dependency Binding Bug

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.

bcontroller

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

berror

I try to fix with changing function arguments orders. And i got a new error.

bc2

And error is:

bchrome

I am trying to solve this issue if i did it i will create a pull request.

I think the FileStorage->init() should create `sessions` dir automatically

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

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.