first commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use Flight;
|
||||
use flight\commands\AbstractBaseCommand;
|
||||
use Webapp\Data\Cache;
|
||||
|
||||
/**
|
||||
* Generate all js app cache for all user
|
||||
*
|
||||
* Usage: php runway user:cache
|
||||
*
|
||||
*/
|
||||
|
||||
class CacheCommand extends AbstractBaseCommand {
|
||||
/**
|
||||
* Construct
|
||||
* @param array<string,mixed> $config From .runway-config.json
|
||||
*/
|
||||
public function __construct(array $config) {
|
||||
parent::__construct('user:cache', 'Generate all js app cache for all user', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the function
|
||||
* @return void
|
||||
*/
|
||||
public function execute() {
|
||||
$io = $this->io();
|
||||
|
||||
require ($this->projectRoot . '/app/config/runway.php');
|
||||
$asset = require($this->projectRoot . '/app/config/asset.php');
|
||||
|
||||
$cache = new Cache($app);
|
||||
$cache->set_asset($asset);
|
||||
$ares = $cache->Make_Cache();
|
||||
if (is_array($ares)) $io->info("Processed of {$ares['user_count']} user.", true);
|
||||
$io->ok("Done.", true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user