file(); if (!is_file($file)) { $this->create(); } $config = include($file); return $config; } public function get($id) { $config = $this->import(); if (isset($config['upload'][$id])) { if ($config['upload'][$id]['save_type'] >= 2 && $config['upload'][$id]['yun'] > 0) { $config['upload'][$id]['yun'] = $config['yun'][$config['upload'][$id]['yun']]; } else { $config['upload'][$id]['yun'] = false; } return $config['upload'][$id]; } } # 从数据库生成维度和项目的配置文件 public function create() { $config = array(); $upload = Dever::db('upload/upload')->state(); if ($upload) { foreach ($upload as $k => $v) { $config['upload'][$v['id']] = $v; } } $yun = Dever::db('upload/yun')->state(); if ($yun) { foreach ($yun as $k => $v) { $config['yun'][$v['id']] = $v; } } $data = 'file(), $data); return true; } }