-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to use new antidot framework package #33
Conversation
99de036
to
d8e83c6
Compare
bin/console
Outdated
$_SERVER['APP_RUNTIME'] = AntidotRuntime::class; | ||
$_SERVER['APP_RUNTIME_OPTIONS'] = [ | ||
'host' => '0.0.0.0', | ||
'port' => 3000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should let 3000
port number be used before running the development server.
Or we can have the setting to set these application runtime options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be configurable from the config 100%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bin/console
Outdated
@@ -4,13 +4,25 @@ | |||
declare(strict_types=1); | |||
|
|||
use Antidot\Cli\Application\Console; | |||
use Antidot\Framework\Runtime\AntidotRuntime; | |||
|
|||
ini_set('memory_limit', '2048M'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this memory setting configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I put 2048M because when hitting a stress test with concurrency it reaches the default memory limit, it should be configurable by framework config too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take a look at the-benchmarker/web-frameworks#4640
"wshafer/psr11-monolog", | ||
"laminas/laminas-httphandlerrunner", | ||
"laminas/laminas-diactoros" | ||
"wshafer/psr11-monolog" | ||
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we need to add the Composer script about running development server easily?
And I think it can let Quick Start be a Composer script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be something like:
composer dev-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to this composer.json script, I think we can define and use composer run dev-server
to complete this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🚀
public/index.php
Outdated
|
||
require_once $rootDir . '/vendor/autoload_runtime.php'; | ||
|
||
return static function () use ($rootDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return static function () use ($rootDir) { | |
return static function (): ContainerInterface use ($rootDir) { |
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
use Psr\Http\Server\RequestHandlerInterface; | ||
use Laminas\Diactoros\Response\JsonResponse; | ||
|
||
class HomePage implements RequestHandlerInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class HomePage implements RequestHandlerInterface | |
final class HomePage implements RequestHandlerInterface |
I think it's a good idea to only maintain the old version for possible vulnerability issues or bugs. Then, the people who want to use the new version I'll use the new tag |
@xserrat @peter279k I'm not sure about branching convention, I'm following the next logic:
Maybe is not correct and it should be
|
Oh, I see. I guess it's also good this convention. It's like all the commits/tags to reach the version <branch_name> are in that branch. For me it's ok, I don't know if it's an standard or not but it makes sense. |
Recently released the dispatcher with the async options. I should do the same with a monolog log handler to ensure that the default pipeline middleware is not blocking the event loop. I have to dig more in-depth into how to write a file using ReactPHP. I know that writing a file without blocking the event loop is a historical problem on async PHP, but I think that the ReactPHP and Amp people have solved it already;-D. |
I'm not sure to merge this PR right now, it will break the current starter with 0.x versions. Maybe the best action will be to release the Framework package 1.0.0 as is, and create the Antidot Framework 2 version with the rewrite(merge against 3.x.x instead of 2.x.x see antidot-framework/antidot-framework#41), this way, we can leave the starter 1.0.0 as is, and merge this PR against 3.x.x to create the 2.0.0 version, what do you think about?