优化打包

master
ELF 5 years ago
parent a907d53bd3
commit d5d6c255b0

@ -21,6 +21,7 @@ use BaiduBce\Log\LogFactory;
use Think\Think;
use Base\Service\GameSourceService;
use Base\Tool\Printer;
use Base\Tool\Redis;
/**
* 后台首页控制器
@ -49,11 +50,17 @@ class AutoPackController extends Think
exit;
}
if (Redis::get('console_packing') == 1) {
Printer::export('正在打包', true);
}
Redis::set('console_packing', 1);
$this->checkPackageStatus();
// $this->app_package();//app渠道自动打包
$this->channel();
// $this->launch_package(false);
// $this->leak_detection();
Redis::delete('console_packing');
}
/**

@ -0,0 +1,38 @@
<?php
namespace Base\Tool;
use Redis as Handler;
class Redis
{
private static $handler;
public static function getHandler()
{
if(self::$handler == null) {
self::$handler = self::createHandler();
}
return self::$handler;
}
private static function createHandler()
{
$host = C('REDIS_HOST', null, '127.0.0.1');
$port = C('REDIS_PORT', null, 6379);
$timeout = C('REDIS_TIMEOUT', null, 300);
$auth = C('REDIS_AUTH');
$handler = new Handler();
$handler->connect($host, $port, $timeout);
if($auth !== null) {
$handler->auth($auth);
}
return $handler;
}
public static function __callStatic($method, $arguments)
{
return call_user_func_array([self::getHandler(), $method], $arguments);
}
}
Loading…
Cancel
Save