skycaiji/SkycaijiApp/admin/model/Task.php

57 lines
1.6 KiB
PHP
Raw Normal View History

2019-02-19 09:52:13 +00:00
<?php
/*
|--------------------------------------------------------------------------
| SkyCaiji (蓝天采集器)
|--------------------------------------------------------------------------
2019-06-23 02:20:58 +00:00
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
2019-02-19 09:52:13 +00:00
|--------------------------------------------------------------------------
2019-06-23 02:20:58 +00:00
| 使用协议 https://www.skycaiji.com/licenses
2019-02-19 09:52:13 +00:00
|--------------------------------------------------------------------------
*/
namespace skycaiji\admin\model;
class Task extends BaseModel{
public function loadConfig($config){
if(empty($config)){
$config=array();
}
if(!is_array($config)){
$config=unserialize($config);
}
static $global_config=null;
if(!isset($global_config)){
$global_config=$GLOBALS['config'];
}
if(!empty($global_config['caiji']['download_img'])){
if($config['download_img']=='n'){
$GLOBALS['config']['caiji']['download_img']=0;
}else{
$GLOBALS['config']['caiji']['download_img']=1;
}
}else{
$GLOBALS['config']['caiji']['download_img']=0;
}
if(!empty($global_config['proxy']['open'])){
if($config['proxy']=='n'){
$GLOBALS['config']['proxy']['open']=0;
}else{
$GLOBALS['config']['proxy']['open']=1;
}
}else{
$GLOBALS['config']['proxy']['open']=0;
}
$GLOBALS['config']['caiji']['img_path']=empty($config['img_path'])?$global_config['caiji']['img_path']:$config['img_path'];
$GLOBALS['config']['caiji']['img_url']=empty($config['img_url'])?$global_config['caiji']['img_url']:$config['img_url'];
}
}
?>