# Zhamao Framework: src/Globals/global_defines_app.php 文件参考

global_defines_app.php 文件参考

## 变量

const | ZM_VERSION_ID = Framework::VERSION_ID
const | ZM_VERSION = Framework::VERSION
const | TRUE_LIST = ['yes', 'y', 'true', 'on', '是', '对', true]
const | FALSE_LIST = ['no', 'n', 'false', 'off', '否', '错', false]
const | ZM_PROCESS_MASTER = ONEBOT_PROCESS_MASTER
const | ZM_PROCESS_MANAGER = ONEBOT_PROCESS_MANAGER
const | ZM_PROCESS_WORKER = ONEBOT_PROCESS_WORKER
const | ZM_PROCESS_USER = ONEBOT_PROCESS_USER
const | ZM_PROCESS_TASKWORKER = ONEBOT_PROCESS_TASKWORKER
const | ZM_ERR_NONE = 0
const | ZM_ERR_METHOD_NOT_FOUND = 1
const | ZM_ERR_ROUTE_NOT_FOUND = 2
const | ZM_ERR_ROUTE_METHOD_NOT_ALLOWED = 3
const | LOAD_MODE_VENDOR = 0
const | LOAD_MODE_SRC = 1
const | WORKING_DIR getcwd()
const | SOURCE_ROOT_DIR Phar::running() !== '' ? Phar::running() : WORKING_DIR
if(DIRECTORY_SEPARATOR==='\\') elseif(!empty(getenv('TMPDIR'))) elseif(is_writable('/tmp')) | else
const | LOAD_MODE is_dir(zm_dir(SOURCE_ROOT_DIR . '/src/ZM')) ? LOAD_MODE_VENDOR : LOAD_MODE_SRC
const | ZM_INIT_TIME microtime(true)
const | ZM_STATE_DIR TMP_DIR . '/.zm_' . sha1(ZM_INIT_TIME . FRAMEWORK_ROOT_DIR)
const | SWOOLE_PROCESS 2
const | SWOOLE_HOOK_UDP 4

## 变量说明

## else

if (Phar::running() !=='') else

初始值:
{
define('TMP_DIR', getcwd() . '/.zm-tmp')

## FALSE_LIST

const FALSE_LIST = ['no', 'n', 'false', 'off', '否', '错', false]

## LOAD_MODE

const LOAD_MODE is_dir(zm_dir(SOURCE_ROOT_DIR . '/src/ZM')) ? LOAD_MODE_VENDOR : LOAD_MODE_SRC

## LOAD_MODE_SRC

const LOAD_MODE_SRC = 1

## LOAD_MODE_VENDOR

const LOAD_MODE_VENDOR = 0

## SOURCE_ROOT_DIR

const SOURCE_ROOT_DIR Phar::running() !== '' ? Phar::running() : WORKING_DIR

## SWOOLE_HOOK_UDP

const SWOOLE_HOOK_UDP 4

## SWOOLE_PROCESS

const SWOOLE_PROCESS 2

## TRUE_LIST

const TRUE_LIST = ['yes', 'y', 'true', 'on', '是', '对', true]

机器人用的，用于判断二元语意

## WORKING_DIR

const WORKING_DIR getcwd()

## ZM_ERR_METHOD_NOT_FOUND

const ZM_ERR_METHOD_NOT_FOUND = 1

## ZM_ERR_NONE

const ZM_ERR_NONE = 0

定义一些内部引用的错误ID

## ZM_ERR_ROUTE_METHOD_NOT_ALLOWED

const ZM_ERR_ROUTE_METHOD_NOT_ALLOWED = 3

## ZM_ERR_ROUTE_NOT_FOUND

const ZM_ERR_ROUTE_NOT_FOUND = 2

## ZM_INIT_TIME

const ZM_INIT_TIME microtime(true)

## ZM_PROCESS_MANAGER

const ZM_PROCESS_MANAGER = ONEBOT_PROCESS_MANAGER

## ZM_PROCESS_MASTER

const ZM_PROCESS_MASTER = ONEBOT_PROCESS_MASTER

定义多进程的全局变量

## ZM_PROCESS_TASKWORKER

const ZM_PROCESS_TASKWORKER = ONEBOT_PROCESS_TASKWORKER

## ZM_PROCESS_USER

const ZM_PROCESS_USER = ONEBOT_PROCESS_USER

## ZM_PROCESS_WORKER

const ZM_PROCESS_WORKER = ONEBOT_PROCESS_WORKER

## ZM_STATE_DIR

const ZM_STATE_DIR TMP_DIR . '/.zm_' . sha1(ZM_INIT_TIME . FRAMEWORK_ROOT_DIR)

## ZM_VERSION

const ZM_VERSION = Framework::VERSION

全局版本名称

## ZM_VERSION_ID

const ZM_VERSION_ID = Framework::VERSION_ID

全局版本ID