Commit 8ab1d841 by 王召彬

测试

parent 5a9d5aba
......@@ -8,7 +8,8 @@
}
],
"require": {
"qcloud/cos-sdk-v5": ">=1.0"
"qcloud/cos-sdk-v5": ">=1.0",
"envms/fluentpdo": "^2.1"
},
"autoload": {
"psr-4": {
......
#线上环境公共配置项:
<?php
namespace Hdll\Services\Common\Config;
class CfgCenter
{
public static function get($keyStr)
{
self::dbFetch($keyStr);
}
protected static function dbFetch($keyStr) {
$keyArr = explode(">", trim($keyStr, '>'));
foreach($keyArr as $k => $v) {
$v = trim($v);
if($v == "") {
unset($keyArr[$k]);
} else {
$keyArr[$k] = $v;
}
}
if(empty($keyArr)) {
throw new \Exception("[CfgCenter]未指定需查询的Key");
}
$pdo = new \PDO("mysql:host=192.168.3.202;port=3306;dbname=config_center", "hdller", "Hdlltest888");
$query = new \Envms\FluendPDO\Query($pdo);
$result = $query->from('config')->where('config.name = ?', $keyArr[0]);
var_dump($result);
}
}
<?php
/*
* This file is part of Swoft.
* (c) Swoft <group@swoft.org>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'clsErrorLogHandler' => [
'class' => \Hdll\Services\Common\ClsLogger\LogHandler::class,
'topicId' => \Hdll\Services\Common\ClsLogger\ClsLog::TOPICID_ERROR,
'formatter' => '${lineFormatter}',
'levels' => [
\Swoft\Log\Logger::ERROR,
\Swoft\Log\Logger::WARNING,
\Swoft\Log\Logger::CRITICAL,
],
],
'clsNoticeLogHandler' => [
'class' => \Hdll\Services\Common\ClsLogger\LogHandler::class,
'topicId' => \Hdll\Services\Common\ClsLogger\ClsLog::TOPICID_NOTICE,
'formatter' => '${lineFormatter}',
'levels' => [
\Swoft\Log\Logger::NOTICE,
\Swoft\Log\Logger::INFO,
\Swoft\Log\Logger::DEBUG,
\Swoft\Log\Logger::TRACE,
],
],
'logger' => [
'name' => APP_NAME,
'enable' => true,
'flushInterval' => 100,
'flushRequest' => true,
'handlers' => [
'${clsErrorLogHandler}',
'${clsNoticeLogHandler}',
],
],
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment