src/Biz/Util/SystemUtil.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\Util;

use Topxia\Service\Common\ServiceKernel;
use AppBundle\Common\RandMachine;

class SystemUtil
{
    private static $mockedDump;

    public static function getDownloadPath()
    {
        return ServiceKernel::instance()->getParameter('topxia.disk.upgrade_dir');
    }

    public static function getBackUpPath()
    {
        return ServiceKernel::instance()->getParameter('topxia.disk.backup_dir');
    }

    public static function getCachePath()
    {
        $realPath = ServiceKernel::instance()->getParameter('kernel.root_dir');
        $realPath .= DIRECTORY_SEPARATOR.'cache';

        return $realPath;
    }

    public static function getSystemRootPath()
    {
        $realPath = ServiceKernel::instance()->getParameter('kernel.root_dir');

        return dirname($realPath);
    }

    public static function getUploadTmpPath()
    {
        $realPath = self::getSystemRootPath().DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.'tmp';

        return $realPath;
    }

    public static function backupdb()
    {
        $backUpdir = self::getUploadTmpPath();
        $backUpdir .= DIRECTORY_SEPARATOR.RandMachine::uniqidWithMtRand().'.txt';
        $dbSetting = array('exclude' => array('session', 'cache'));

        if (empty(self::$mockedDump)) {
            $dump = new MySQLDumper(ServiceKernel::instance()->getConnection(), $dbSetting);
        } else {
            $dump = self::$mockedDump;
        }

        if (empty(self::$mockedDump)) {
            $dump = new MySQLDumper(ServiceKernel::instance()->getConnection(), $dbSetting);

            return $dump->export($backUpdir);
        } else {

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。