8000 Release the WebServer as a standalone application · Issue #23771 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Release the WebServer as a standalone application #23771

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

Closed
voronkovich opened this issue Aug 2, 2017 · 7 comments
Closed

Release the WebServer as a standalone application #23771

voronkovich opened this issue Aug 2, 2017 · 7 comments

Comments

@voronkovich
Copy link
Contributor
voronkovich commented Aug 2, 2017
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 4.0 (or 3.4 )

Trying to solve the problem with environment variables (see #23723 ) I figured out that the main problem is:

The dev web server is tight coupled with an application.

So, what about to release it as a standalone console app? The big benefit of doing that is that not only Symfony developers could use the web server.

I've forked the WebServerBundle and created the POC for this idea. All changes needed, you can see in this diff: symfony/web-server-bundle@master...voronkovich:master

If you want to see how it works, you can clone the repo (https://github.com/voronkovich/symfony-webserver) and build a phar archive using the box.

To avoid the BC breaks we could add the application as a dependency to the original WebServerBundle and just change the commands FQNs:

<service id="web_server.command.server_run" class="Symfony\WebServer\Command\ServerRunCommand">
        <argument>%kernel.project_dir%/public</argument>
        <argument>%kernel.environment%</argument>
	<tag name="console.command" command="server:run" />
</service>
@stof
Copy link
Member
stof commented Aug 3, 2017

@voronkovich the removal of supports for $env when searching the front controller makes it incompatible with SE-style projects. This is not a good idea.

and if we go this way, the webserver script should also support being installed as a dependency of the project (the only required change is related to the location of the autoload file in this case, as it will be in ../../autoload.php instead).
And the application version should be the component version.

@voronkovich
Copy link
Contributor Author
voronkovich commented Aug 3, 2017

@stof, Thanks for the code review! I've fixed the problems you pointed out:

  • support of $env is returned back (with minor improvements!);
  • version is changed to 4.0-DEV;
  • now this app can be installed as a dependency.

@ghost
Copy link
ghost commented Aug 3, 2017

@voronkovich Since the purpose of detaching this bundle to something standalone I rather see the namespacing of this package to follow as Symfony\Component\WebServer instead of Symfony\WebServer (c97efc90ae/Command/ServerLogCommand.php). This is because other components are following the same namespace prefix (Symfony\Component).

@voronkovich
Copy link
Contributor Author

@ricknox, IMO a standalone application isn't a "component". Also, for example, the Symfony Installer use a Symfony\Installer prefix, see https://github.com/symfony/symfony-installer/blob/master/src/Symfony/Installer/AboutCommand.php#L12

@ghost
Copy link
ghost commented Aug 3, 2017

@voronkovich Fair point, I didn't know about those prefix. Carry on.

@nicolas-grekas
Copy link
Member

Too much work, too little benefit, and too little activity.

@fabpot
Copy link
Member
fabpot commented Feb 25, 2019

One can use the new Symfony CLI as well: https://symfony.com/download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0