1 Star 0 Fork 2

拽拽阿勒哥 / CrontabWorker

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
common.php 613 Bytes
Copy Edit Web IDE Raw Blame History
一个作词家 authored 2017-11-16 09:45 . 检测目录
<?php
define('ROOT_PATH', str_replace('\\', '/', __DIR__) . '/');
define('TMP_PATH', ROOT_PATH . '/tmp/');
/**
* 获取配置 db.user.test
*/
function C($path) {
$config_dir = ROOT_PATH . '/config/';
$config = explode('.', trim($path, '.'));
$len = count($config);
if ($len === 1) {
if (file_exists($config_dir . $config[0] . '.php')) {
return require $config_dir . $config[0] . '.php';
}
return array();
}
$c = require $config_dir . array_shift($config) . '.php';
$eval_str = '$c';
foreach ($config as $k) {
$eval_str .= "['{$k}']";
}
@eval('$c = ' . $eval_str . ';');
return $c;
}

Comment ( 0 )

Sign in for post a comment

PHP
1
https://gitee.com/yanzw/CrontabWorker.git
git@gitee.com:yanzw/CrontabWorker.git
yanzw
CrontabWorker
CrontabWorker
master

Search

181749 a2d7925e 1850385 181749 9f8568a7 1850385