-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize ConfigService && add cache command for route&config
- Loading branch information
Showing
9 changed files
with
193 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace TastPHP\Framework\Console\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use TastPHP\Framework\Config\ConfigService; | ||
use TastPHP\Framework\Kernel; | ||
|
||
class CacheConfigCommand extends BaseCommand | ||
{ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('cache:config') | ||
->setDescription('Cache config'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$configService = new ConfigService(new Kernel()); | ||
$configService->setEnabledCache(); | ||
$configService->register(); | ||
$output->writeln("<fg=black;bg=green>You have success cached config!</>"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace TastPHP\Framework\Console\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use TastPHP\Framework\Kernel; | ||
use TastPHP\Framework\Router\RouterServiceProvider; | ||
|
||
class CacheRouteCommand extends BaseCommand | ||
{ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('cache:route') | ||
->setDescription('Cache route'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$routerService = new RouterServiceProvider(new Kernel()); | ||
$routerService->register(); | ||
$output->writeln("<fg=black;bg=green>You have success cached route!</>"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
src/Framework/Console/Command/GenerateAdminRoutesCommand.php
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
src/Framework/Console/Command/Template/adminController.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.