Skip to content

Commit b072900

Browse files
committed
added server console command
1 parent 4003111 commit b072900

3 files changed

Lines changed: 42 additions & 6 deletions

File tree

application/Console/Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function fire() {
1515
$this->register(new CreateControllerCommand()); //create:controller
1616
$this->register(new CreateModelCommand()); //create:model
1717
$this->register(new DatabaseBackupCommand()); //database:backup
18+
$this->register(new ServerCommand()); //server
1819
$this->run();
1920
}
2021
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
namespace App\Console;
3+
4+
use Shadow\Console\Genarators;
5+
use Shadow\Console\KapitanNotify;
6+
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
7+
use Symfony\Component\Console\Command\Command;
8+
use Symfony\Component\Console\Input\InputArgument;
9+
use Symfony\Component\Console\Input\InputInterface;
10+
use Symfony\Component\Console\Output\OutputInterface;
11+
12+
class ServerCommand extends Command
13+
{
14+
protected function configure()
15+
{
16+
$this
17+
->addArgument('option', InputArgument::OPTIONAL, 'Enter port.')
18+
->setName('server')
19+
->setDescription('Starts development server.')
20+
->setHelp("This command starts development server...")
21+
;
22+
}
23+
24+
protected function execute(InputInterface $input, OutputInterface $output)
25+
{
26+
$port = $input->getArgument('option') ?: '8000';
27+
28+
KapitanNotify::render("success", "Listening on {$port}", $output, $this);
29+
30+
exec("php -S localhost:{$port} -t public");
31+
32+
return true;
33+
34+
}
35+
}

remote.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
[application]
22
APP_NAME=Shadow
3-
APP_EMAIL=mailer@shadow.com
3+
APP_EMAIL=mail@example.com
44
APP_URL=http://localhost/
55
APP_DEBUG=true
66
APP_KEY=SomeRandomString
77

88
[database]
99
DB_TYPE=mysql
1010
DB_HOST=127.0.0.1
11-
DB_NAME=shadow
12-
DB_USER=root
13-
DB_PASSWORD=secret
11+
DB_NAME=
12+
DB_USER=
13+
DB_PASSWORD=
1414

1515
[mail]
1616
MAIL_DRIVER=smtp
1717
MAIL_HOST=smtp.gmail.com
1818
MAIL_PORT=587
19-
MAIL_USERNAME=codexen7@gmail.com
20-
MAIL_PASSWORD=evxmseehhiviikkk
19+
MAIL_USERNAME=
20+
MAIL_PASSWORD=
2121
MAIL_ENCRYPTION=tls
2222

2323
[hash]

0 commit comments

Comments
 (0)