Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 951a1a2

Browse files
committed
[WebServerBundle] changed wording
1 parent ac1ba77 commit 951a1a2

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

src/Symfony/Bundle/WebServerBundle/Command/ServerCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1515

1616
/**
17-
* Base methods for commands related to PHP's built-in web server.
17+
* Base methods for commands related to a local web server.
1818
*
1919
* @author Christian Flothmann <[email protected]>
2020
*/
@@ -47,7 +47,6 @@ protected function getLockFile($address)
4747
protected function isOtherServerProcessRunning($address)
4848
{
4949
$lockFile = $this->getLockFile($address);
50-
5150
if (file_exists($lockFile)) {
5251
return true;
5352
}

src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use Symfony\Component\Process\Exception\RuntimeException;
2424

2525
/**
26-
* Runs Symfony application using PHP built-in web server.
26+
* Runs Symfony application using a local web server.
2727
*
2828
* @author Michał Pipa <[email protected]>
2929
*/
@@ -42,9 +42,9 @@ protected function configure()
4242
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
4343
))
4444
->setName('server:run')
45-
->setDescription('Runs PHP built-in web server')
45+
->setDescription('Runs a local web server')
4646
->setHelp(<<<'EOF'
47-
The <info>%command.name%</info> runs PHP built-in web server:
47+
The <info>%command.name%</info> runs a local web server:
4848
4949
<info>%command.full_name%</info>
5050
@@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
108108
}
109109

110110
if ('prod' === $env) {
111-
$io->error('Running PHP built-in server in production environment is NOT recommended!');
111+
$io->error('Running this server in production environment is NOT recommended!');
112112
}
113113

114114
$io->success(sprintf('Server listening on http://%s', $address));
@@ -140,7 +140,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
140140
$process->run($callback);
141141

142142
if (!$process->isSuccessful()) {
143-
$errorMessages = array('Built-in server terminated unexpectedly.');
143+
$errorMessages = array('Server terminated unexpectedly.');
144144

145145
if ($process->isOutputDisabled()) {
146146
$errorMessages[] = 'Run the command again with -v option for more details.';

src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Symfony\Component\Process\Process;
2121

2222
/**
23-
* Runs PHP's built-in web server in a background process.
23+
* Runs a local web server in a background process.
2424
*
2525
* @author Christian Flothmann <[email protected]>
2626
*/
@@ -40,9 +40,9 @@ protected function configure()
4040
new InputOption('force', 'f', InputOption::VALUE_NONE, 'Force web server startup'),
4141
))
4242
->setName('server:start')
43-
->setDescription('Starts PHP built-in web server in the background')
43+
->setDescription('Starts a local web server in the background')
4444
->setHelp(<<<'EOF'
45-
The <info>%command.name%</info> runs PHP's built-in web server:
45+
The <info>%command.name%</info> runs a local web server:
4646
4747
<info>php %command.full_name%</info>
4848
@@ -79,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7979
if (!extension_loaded('pcntl')) {
8080
$io->error(array(
8181
'This command needs the pcntl extension to run.',
82-
'You can either install it or use the "server:run" command instead to run the built-in web server.',
82+
'You can either install it or use the "server:run" command instead.',
8383
));
8484

8585
if ($io->ask('Do you want to execute <info>server:run</info> immediately? [Yn] ', true)) {
@@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
124124
}
125125

126126
if ('prod' === $env) {
127-
$io->error('Running PHP built-in server in production environment is NOT recommended!');
127+
$io->error('Running this server in production environment is NOT recommended!');
128128
}
129129

130130
$pid = pcntl_fork();
@@ -154,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
154154
$process->disableOutput();
155155
$process->start();
156156
$lockFile = $this->getLockFile($address);
157-
touch($lockFile);
157+
file_put_contents($lockFile, $documentRoot);
158158

159159
if (!$process->isRunning()) {
160160
$io->error('Unable to start the server process');
@@ -174,7 +174,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
174174
}
175175

176176
/**
177-
* Creates a process to start PHP's built-in web server.
177+
* Creates a process to start a local web server.
178178
*
179179
* @param SymfonyStyle $io A SymfonyStyle instance
180180
* @param string $address IP address and port to listen to

src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function configure()
3636
new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
3737
))
3838
->setName('server:status')
39-
->setDescription('Outputs the status of the built-in web server for the given address')
39+
->setDescription('Outputs the status of the local web server for the given address')
4040
;
4141
}
4242

src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Symfony\Component\Console\Style\SymfonyStyle;
1919

2020
/**
21-
* Stops a background process running PHP's built-in web server.
21+
* Stops a background process running a local web server.
2222
*
2323
* @author Christian Flothmann <[email protected]>
2424
*/
@@ -35,9 +35,9 @@ protected function configure()
3535
new InputOption('port', 'p', InputOption::VALUE_REQUIRED, 'Address port number', '8000'),
3636
))
3737
->setName('server:stop')
38-
->setDescription('Stops PHP\'s built-in web server that was started with the server:start command')
38+
->setDescription('Stops the local web server that was started with the server:start command')
3939
->setHelp(<<<'EOF'
40-
The <info>%command.name%</info> stops PHP's built-in web server:
40+
The <info>%command.name%</info> stops the local web server:
4141
4242
<info>php %command.full_name%</info>
4343

0 commit comments

Comments
 (0)