40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
![]() |
<?php
|
|||
|
|
|||
|
/**
|
|||
|
* tpshop
|
|||
|
* ============================================================================
|
|||
|
* 版权所有 2015-2027 深圳搜豹网络科技有限公司,并保留所有权利。
|
|||
|
* 网站地址: http://www.tp-shop.cn
|
|||
|
* ----------------------------------------------------------------------------
|
|||
|
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
|
|||
|
* 不允许对程序代码以任何形式任何目的的再发布。
|
|||
|
* 采用最新Thinkphp5助手函数特性实现单字母函数M D U等简写方式
|
|||
|
* ============================================================================
|
|||
|
* Author: 当燃
|
|||
|
* Date: 2015-09-09
|
|||
|
*/
|
|||
|
namespace app\admin\controller;
|
|||
|
use think\Controller;
|
|||
|
use think\Db;
|
|||
|
use think\response\Json;
|
|||
|
class UpgradeLogic extends Controller {
|
|||
|
|
|||
|
/**
|
|||
|
* 析构函数
|
|||
|
*/
|
|||
|
function __construct() {
|
|||
|
parent::__construct();
|
|||
|
@ini_set('memory_limit', '1024M'); // 设置内存大小
|
|||
|
@ini_set("max_execution_time", "0"); // 请求超时时间 0 为不限时
|
|||
|
@ini_set('default_socket_timeout', 3600); // 设置 file_get_contents 请求超时时间 官方的说明,似乎没有不限时间的选项,也就是不能填0,你如果填0,那么socket就会立即返回失败,
|
|||
|
}
|
|||
|
/**
|
|||
|
* 一键升级
|
|||
|
*/
|
|||
|
function OneKeyUpgrade(){
|
|||
|
// sleep(3);
|
|||
|
$upgradeLogic = new \app\admin\logic\UpgradeLogic();
|
|||
|
$msg = $upgradeLogic->OneKeyUpgrade(); //升级包消息
|
|||
|
exit("$msg");
|
|||
|
}
|
|||
|
}
|