2020-05-02 23:27:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
2020-08-31 10:11:06 +08:00
|
|
|
namespace ZM\Utils;
|
2020-05-02 23:27:26 +08:00
|
|
|
|
|
|
|
|
|
2020-08-31 10:11:06 +08:00
|
|
|
use ZM\Config\ZMConfig;
|
2020-05-23 17:23:29 +08:00
|
|
|
|
2020-05-02 23:27:26 +08:00
|
|
|
class DataProvider
|
|
|
|
|
{
|
|
|
|
|
public static $buffer_list = [];
|
|
|
|
|
|
|
|
|
|
public static function getResourceFolder() {
|
|
|
|
|
return self::getWorkingDir() . '/resources/';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getWorkingDir() {
|
2021-02-09 17:09:09 +08:00
|
|
|
if (LOAD_MODE == 0) return WORKING_DIR;
|
2020-06-05 13:36:30 +08:00
|
|
|
elseif (LOAD_MODE == 1) return LOAD_MODE_COMPOSER_PATH;
|
|
|
|
|
elseif (LOAD_MODE == 2) return realpath('.');
|
|
|
|
|
return null;
|
2020-05-02 23:27:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getFrameworkLink() {
|
2020-08-31 10:11:06 +08:00
|
|
|
return ZMConfig::get("global", "http_reverse_link");
|
2020-05-02 23:27:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getDataFolder() {
|
|
|
|
|
return ZM_DATA;
|
|
|
|
|
}
|
|
|
|
|
}
|