<?php
// 基础
const TIMEZONE     = 'PRC';              // 时区设置
const CONTENT_TYPE = 'application/json'; //默认输出类型 application/json , text/html, text/plain, application/xml
// 基础路径
const DIR_SRC       = __DIR__ . '/../../';
const DIR_RUNTIME   = DIR_SRC . '../runtime/';
const DIR_CACHE     = DIR_RUNTIME . 'cache/';
const DIR_LOG       = DIR_RUNTIME . 'log/';
const DIR_METADATA  = DIR_RUNTIME . 'metadata/';
const DIR_COMMON    = DIR_SRC . 'common/';
const DIR_CONSTANTS = DIR_SRC . 'applet/app/constants/';
const DIR_MODEL     = DIR_COMMON . 'model/';
const DIR_VENDOR    = DIR_SRC . 'vendor/';

// 数据库缓存设置,部分网站设置缓存到文件配置里面
const CACHE_DB_CFG = DIR_CACHE . 'db_cache_cfg.php';

// 是否开启调试模式
const DEBUG   = 1;
const APP_ENV = 'dev';

// APP API 接口地址
const DEV_APP_URL   = 'http://inapi.izhyin.cn';
const PROD_APP_URL  = 'http://zyos';

const OSS_URL      = 'http://inapi.izhyin.cn';

//phalcon internal setting
Phalcon\Mvc\Model::setup([
    'notNullValidations'    => false,
    'exceptionOnFailedSave' => true,
    'ignoreUnknownColumns'  => true
]);
// return config
return new Phalcon\Config([
    'application' => [
        'baseUri'        => '/',
        'commDir'        => DIR_COMMON,
        'modelsDir'      => DIR_MODEL,
        'cacheDir'       => DIR_CACHE,
        'metaDataDir'    => DIR_METADATA,
        'controllersDir' => DIR_SRC . APP_NAME . '/app/controllers',
        'constantsDir'   => DIR_CONSTANTS,
    ],
    //主从DB
    'database'    => [
        'adapter'    => 'mysql',
        'host'       => '119.23.182.117',
        'port'       => '3306',
        'username'   => 'root',
        'password'   => 'Fnuo123com@',
        'dbname'     => 'zhios_pay',
        'charset'    => 'utf8',
        'persistent' => false,  //TRUE, //线上开启长连接
        'log_file'   => DIR_SRC . '../db_debug.log'
    ],
    //redis
    'redis'       => [
        'host'        => '120.24.28.6',
        'port'        => '32572',
        'timeout'     => '2.5',
        'persistent'  => false,
        'prefix'      => 'zyos_',
        'sess_prefix' => 'sid',
        'ttl'         => 86400,
        'lifetime'    => 3600,
    ],
    'version'     => 'v1.0.0',
]);