<?php
/**
 * Copyright: Shanghai NuLang Network Technology Co., Ltd.
 * Faith: Some things do not need others to understand.
 * Project: CoverCMS <Your world, your ambition>
 * License: http://www.svipplus.cn/license/
 * Author: The Rain° <rain@svipplus.cn>
 * File: EnvironmentKit.php
 * Time: 23:27
 */

namespace app\common\toolKit;


class EnvironmentKit
{
    public static function gd()
    {
        return extension_loaded('gd');
    }

    public static function maxUploadFileSize($int=false)
    {
        $v = ini_get('upload_max_filesize');
        if ($int){
            return intval($v);
        }
        return $v;
    }

    public static function softInfo()
    {
        $version = require ROOT_PATH.'vendor'.DS.'covercms'.DS.'framework'.DS.'src'.DS.'version.php';
        $relaseAt = require ROOT_PATH.'vendor'.DS.'covercms'.DS.'framework'.DS.'src'.DS.'release_at.php';
        $licenseType = '未授权';
        if (config('cloud.secret')){
            $licenseType = '已获取商业授权';
        }
        return [
            'type'=>'CoverPrise品牌官网系统',
            'version'=>$version,
            'release_at'=>$relaseAt,
            'developer'=>'上海怒狼网络科技有限公司',
            'team'=>'怒狼公司Cover系列项目组',
            'designer'=>'情人眼泪 °',
            'website'=>'http://www.svipplus.com',
            'license_type'=>$licenseType,
            'buy_page'=>'http://www.svipplus.com/purchase'
        ];
    }
}