Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WebServerBundle] added a way to dump current status host/port/address when getting the status#22316

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromfabpot:server-status-options
Apr 6, 2017

Conversation

@fabpot
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

Now that the web server can run on an automatically chosen port, it's more complex to integrate it into tests (I want to run some functional tests locally).

Theserver:status command gives this information, but not in a machine-readable way.

I propose to add a--filter flag to fix that:

./bin/console server:status --filter=address

@fabpot
Copy link
MemberAuthor

Here is how I'm using this in my Makefile:

bf-dev:blackfire-player --endpoint=http://`bin/console server:status --filter=address` run tests/bkf/all.bkf.PHONY: bf-dev
chalasr reacted with heart emoji

@fabpotfabpotforce-pushed theserver-status-options branch fromcf724dd tob417b62CompareApril 6, 2017 16:47
Copy link
Contributor

@ro0NLro0NL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Clever!

->setName('server:status')
->setDefinition(array(
newInputOption('pidfile',null, InputOption::VALUE_REQUIRED,'PID file'),
newInputOption('filter',null, InputOption::VALUE_REQUIRED,'The value to display (one of port, host, or address)'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What about something like--value | --get | --get-value?

if ($server->isRunning($input->getOption('pidfile'))) {
list($host,$port) =explode(':',$address =$server->getAddress($input->getOption('pidfile')));
if ('address' ===$filter) {
$output->write($address);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we useOUTPUT_RAW to avoid formatting possible malicious input?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

input comes from the pidfile. If you mess up with it, then you are on your own anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Note it can also be messed up by some formatter implementation. But fair enough.. what are the odds anyway :)

@fabpotfabpot merged commitb417b62 intosymfony:masterApr 6, 2017
fabpot added a commit that referenced this pull requestApr 6, 2017
…ost/port/address when getting the status (fabpot)This PR was merged into the 3.3-dev branch.Discussion----------[WebServerBundle] added a way to dump current status host/port/address when getting the status| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aNow that the web server can run on an automatically chosen port, it's more complex to integrate it into tests (I want to run some functional tests locally).The `server:status` command gives this information, but not in a machine-readable way.I propose to add a `--filter` flag to fix that:`./bin/console server:status --filter=address`Commits-------b417b62 [WebServerBundle] added a way to dump current status host/port/address when getting the status
@fabpotfabpot deleted the server-status-options branchApril 7, 2017 17:17
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@fabpot@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp