2.1版本提交 初始化代码
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
date_default_timezone_set('PRC');
|
||||
@ini_set('display_errors',0);
|
||||
@ini_set('session.cache_expire',600);
|
||||
@set_time_limit(600);//30min pathInfoMuti,search,upload,download...
|
||||
|
||||
function P($path){return str_replace('\\','/',$path);}
|
||||
define('WEB_ROOT', str_replace(P($_SERVER['SCRIPT_NAME']),'',P(dirname(dirname(__FILE__))).'/index.php').'/');
|
||||
define('HOST', 'http://'.$_SERVER['HTTP_HOST'].'/');
|
||||
define('BASIC_PATH', P(dirname(dirname(__FILE__))).'/');
|
||||
define('APPHOST', HOST.str_replace(WEB_ROOT,'',BASIC_PATH));//程序根目录
|
||||
define('TEMPLATE', BASIC_PATH .'template/'); //模版文件路径
|
||||
define('CONTROLLER_DIR',BASIC_PATH .'controller/'); //控制器目录
|
||||
define('MODEL_DIR', BASIC_PATH .'model/'); //模型目录
|
||||
define('LIB_DIR', BASIC_PATH .'lib/'); //库目录
|
||||
define('FUNCTION_DIR', LIB_DIR .'function/'); //函数库目录
|
||||
define('CLASS_DIR', LIB_DIR .'class/'); //内目录
|
||||
define('CORER_DIR', LIB_DIR .'core/'); //核心目录
|
||||
define('LOG_PATH', BASIC_PATH .'data/log/'); //日志目录
|
||||
define('USER_PATH', BASIC_PATH .'data/User/'); //用户目录
|
||||
define('USER_SYSTEM', BASIC_PATH .'data/system/');//用户数据存储目录
|
||||
define('LANGUAGE_PATH', BASIC_PATH .'data/i18n/');//库目录
|
||||
|
||||
define('STATIC_JS',"app");//_dev app js编译||开发状态
|
||||
define('STATIC_PATH',"./static/");//静态文件目录
|
||||
//define('STATIC_PATH','http://static.kalcaddle.com/static/');
|
||||
define('STATIC_LESS','css');
|
||||
|
||||
include(FUNCTION_DIR.'web.function.php');
|
||||
include(FUNCTION_DIR.'file.function.php');
|
||||
include(CLASS_DIR.'fileCache.class.php');
|
||||
include(CONTROLLER_DIR.'util.php');
|
||||
|
||||
include(CORER_DIR.'Application.class.php');
|
||||
include(CORER_DIR.'Controller.class.php');
|
||||
include(CORER_DIR.'Model.class.php');
|
||||
include(FUNCTION_DIR.'common.function.php');
|
||||
include(BASIC_PATH.'config/setting.php');
|
||||
include(BASIC_PATH.'config/version.php');
|
||||
|
||||
//数据地址定义。
|
||||
$config['pic_thumb'] = BASIC_PATH.'data/thumb/'; // 缩略图生成存放地址
|
||||
$config['cache_dir'] = BASIC_PATH.'data/cache/'; // 缓存文件地址
|
||||
$config['system_os'] = 'windows'; //windows,linux,mac
|
||||
$config['system_charset']='gbk'; //系统编码
|
||||
$config['app_charset'] ='utf-8'; //该程序整体统一编码
|
||||
$config['app_startTime'] = mtime(); //起始时间
|
||||
$config['check_charset'] = 'ASCII,UTF-8,GBK';//文件打开自动检测编码
|
||||
//when edit a file ;check charset and auto converto utf-8;
|
||||
|
||||
//系统编码配置
|
||||
if (strtoupper(substr(PHP_OS, 0,3)) === 'WIN') {
|
||||
$config['system_os']='windows';
|
||||
$config['system_charset']='gbk';
|
||||
} else {
|
||||
$config['system_os']='linux';
|
||||
$config['system_charset']='utf-8';
|
||||
}
|
||||
|
||||
init_lang();
|
||||
$in = parse_incoming();//所有过滤处理。
|
||||
session_start();
|
||||
session_write_close();//之后要修改$_SESSION 需要先调用session_start()
|
||||
$config['autorun'] = array(
|
||||
array('controller'=>'user','function'=>'loginCheck'),
|
||||
array('controller'=>'user','function'=>'authCheck'),
|
||||
);
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
// 配置项可选值
|
||||
$config['setting_all'] = array(
|
||||
'themeall' => "default/:<b>areo blue</b>:default,simple/:<b>simple</b>:simple,metro/:<b>metro</b>:metro,metro/blue_:metro-blue:color, metro/leaf_:metro-green:color,metro/green_:metro-green+:color,metro/grey_:metro-grey:color,metro/purple_:metro-purple:color,metro/pink_:metro-pink:color,metro/orange_:metro-orange:color",
|
||||
'codethemeall' => "chrome,clouds,crimson_editor,eclipse,github,solarized_light,tomorrow,xcode,ambiance,idle_fingers,monokai,pastel_on_dark,solarized_dark,tomorrow_night_blue,tomorrow_night_eighties",
|
||||
'wallall' => "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15",
|
||||
'musicthemeall' => "ting,beveled,kuwo,manila,mp3player,qqmusic,somusic,xdj",
|
||||
'moviethemeall' => "webplayer,qqplayer,vplayer,tvlive,youtube"
|
||||
);
|
||||
$config['setting_all']['language'] = "en:English,zh_CN:简体中文,zh_TW:簡體中文";
|
||||
|
||||
// 默认配置
|
||||
$config['setting_default'] = array(
|
||||
'list_type' => "icon", // list||icon
|
||||
'list_sort_field' => "mtime", // name||size||ext||mtime
|
||||
'list_sort_order' => "up", // asc||desc
|
||||
'theme' => "metro/", // app theme
|
||||
'codetheme' => "github", // code editor theme
|
||||
'wall' => "1", // wall picture
|
||||
'musictheme' => "mp3player", // music player theme
|
||||
'movietheme' => "webplayer" // movie player theme
|
||||
);
|
||||
|
||||
// 默认配置
|
||||
$config['system_file'] = array(
|
||||
'member'=> USER_SYSTEM.'member.php',
|
||||
'group' => USER_SYSTEM.'group.php',
|
||||
'apps' => USER_SYSTEM.'apps.php'
|
||||
);
|
||||
|
||||
//权限路由配置;精确到需要做权限控制的控制器和方法
|
||||
$config['role_setting'] = array(
|
||||
'explorer' => array(
|
||||
'mkdir','mkfile','pathRname','pathDelete','zip','unzip','pathCopy',
|
||||
'pathCute','pathCuteDrag','clipboard','pathPast','pathInfo',
|
||||
'pathInfoMuti','serverDownload','fileUpload','search'),
|
||||
'app' => array('user_app','add','edit','del'),//
|
||||
'user' => array('changePassword'),//可以设立公用账户
|
||||
'editor' => array('fileSave'),
|
||||
'setting' => array('set'),
|
||||
'fav' => array('add','del','edit'),
|
||||
'member' => array('get','add','del','edit'),
|
||||
'group' => array('get','add','del','edit'),
|
||||
);
|
|
@ -0,0 +1,2 @@
|
|||
<?php
|
||||
define('KOD_VERSION','2.1');//2014.4.2
|
|
@ -0,0 +1,112 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class app extends Controller{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$role = $_SESSION['user']['role'];
|
||||
$this->sql=new fileCache($this->config['system_file']['apps']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户首页展示
|
||||
*/
|
||||
public function index() {
|
||||
$this->display(TEMPLATE.'app/index.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户app 添加、编辑
|
||||
*/
|
||||
public function user_app() {
|
||||
$path = _DIR($this->in['path']);
|
||||
if ($this->in['action'] == 'add'){
|
||||
$path .= '.oexe';
|
||||
|
||||
}
|
||||
$data = json_decode(rawurldecode($this->in['data']),true);
|
||||
unset($data['name']);unset($data['desc']);unset($data['group']);
|
||||
|
||||
$res = file_put_contents($path, json_encode($data));
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
public function get() {
|
||||
$list = array();
|
||||
if (!$this->in['group'] || $this->in['group']=='all') {
|
||||
$list = $this->sql->get();
|
||||
}else{
|
||||
$list = $this->sql->get('group','',$this->in['group']);
|
||||
}
|
||||
$list = array_reverse($list);
|
||||
show_json($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add() {
|
||||
if (!$GLOBALS['is_root']) show_json($this->L['no_permission'],false);
|
||||
$res=$this->sql->add(rawurldecode($this->in['name']),$this->_init());
|
||||
if($res) show_json($this->L['success']);
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit() {
|
||||
if (!$GLOBALS['is_root']) show_json($this->L['no_permission'],false);
|
||||
//查找到一条记录,修改为该数组
|
||||
if($this->sql->replace_update(
|
||||
rawurldecode($this->in['old_name']),
|
||||
rawurldecode($this->in['name']),$this->_init())){
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
if (!$GLOBALS['is_root']) show_json($this->L['no_permission'],false);
|
||||
if($this->sql->delete(rawurldecode($this->in['name']))){
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error'],false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function _init(){
|
||||
return json_decode(rawurldecode($this->in['data']));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户app初始化
|
||||
*/
|
||||
public function init_app($user) {
|
||||
$sql=new fileCache($this->config['system_file']['apps']);
|
||||
$list = $sql->get();
|
||||
$desktop = USER_PATH.$user.'/home/desktop/';
|
||||
foreach ($list as $key => $data) {
|
||||
//touch($path);
|
||||
$path = iconv_system($desktop.$key.'.oexe');
|
||||
unset($data['name']);
|
||||
unset($data['desc']);
|
||||
unset($data['group']);
|
||||
file_put_contents($path, json_encode($data));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,247 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class debug extends Controller{
|
||||
public $path_app;
|
||||
public $path_to;
|
||||
function __construct() {
|
||||
$this->path_app = BASIC_PATH;
|
||||
$this->parent = dirname(BASIC_PATH);
|
||||
$this->path_to = $this->parent.'/release';
|
||||
$this->zip_to = $this->parent.'/tag/kodexplorer'.KOD_VERSION.'.zip';
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
public function index() {
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
|
||||
debug_out(HOST,WEB_ROOT,BASIC_PATH,APPHOST,$config,$_COOKIE,$_SESSION,$_SERVER);
|
||||
}
|
||||
function less(){
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
ob_end_clean();
|
||||
echo str_pad('',1024);
|
||||
echo '<h3>开始编译less</h3><hr/>';flush();
|
||||
$this->_less();
|
||||
echo '成功!<br/>';flush();
|
||||
}
|
||||
|
||||
function export(){
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
ob_end_clean(); //在循环输出前,要关闭输出缓冲区
|
||||
echo str_pad('',1024); //浏览器在接受输出一定长度内容之前不会显示缓冲输出
|
||||
|
||||
echo '<h1>开始导出!</h1><hr/><h3>删除初始文件</h3><hr/>';flush();
|
||||
del_dir($this->path_to);
|
||||
echo '删除完成!<br/><h3>删除成功,开始编译less</h3><hr/>';flush();
|
||||
//$this->_less();
|
||||
echo '编译成功!<br/><h3>开始复制文件</h3><hr/>';flush();
|
||||
$this->_fileInit();
|
||||
echo '复制成功!<br/><h3>删除开发相关文件</h3><hr/>';flush();
|
||||
$this->_remove();
|
||||
echo '删除成功!<br/><h3>开始替换模板种less相关内容</h3><hr/>';flush();
|
||||
$this->_fileReplace();
|
||||
echo '替换成功!<br/><h3>打包程序</h3><hr/>';flush();
|
||||
|
||||
load_class('pclzip');
|
||||
ini_set('memory_limit', '2028M');//2G;
|
||||
$archive = new PclZip($this->zip_to);
|
||||
$v_list = $archive->create($this->path_to,PCLZIP_OPT_REMOVE_PATH,$this->parent.'/kod_export');
|
||||
echo '打包成功!<br/><h3>初始化配置文件</h3><hr/>';flush();
|
||||
|
||||
$this->_initUser();
|
||||
echo '更新成功!<br/><h1>导出处理完成!^_^</h1>';flush();
|
||||
}
|
||||
|
||||
//----------------------------
|
||||
function _less(){
|
||||
load_class('lessc.inc');
|
||||
$path = BASIC_PATH.'static/style/skin/';
|
||||
$app_theme = array('default','metro','simple');
|
||||
$app_less = array(
|
||||
'app_code_edit',
|
||||
'app_desktop',
|
||||
'app_editor',
|
||||
'app_explorer',
|
||||
'app_setting'
|
||||
);
|
||||
$num = count($app_theme)*count($app_less);$i=1;
|
||||
foreach($app_theme as $theme){
|
||||
foreach($app_less as $app){
|
||||
$less = new lessc();
|
||||
$path_in = $path.$theme.'/'.$app.'.less';
|
||||
$path_out = $path.$theme.'/'.$app.'.css';
|
||||
try {
|
||||
$cache = $less->cachedCompile($path_in);
|
||||
$out = str_replace(array("{\n",";\n",",\n",' '),
|
||||
array('{',';',',',' '),$cache["compiled"]);
|
||||
file_put_contents($path_out,$out);
|
||||
echo $path_out,' ...成功!('.$i++.'/'.$num.')','<br/>';
|
||||
unset($less);unset($out);
|
||||
}catch (exception $e) {
|
||||
echo "<p style='color:#f66'>fatal error: " . $e->getMessage(),'</p>';
|
||||
}
|
||||
flush();
|
||||
}
|
||||
}
|
||||
//编译metro多主题
|
||||
$color_arr = array(
|
||||
'blue' => '#5db2ff',
|
||||
'leaf' => '#03B3B2',
|
||||
'green' => '#008a17',
|
||||
'grey' => '#444',
|
||||
'purple' => '#8D3CC4',
|
||||
'pink' => '#DC4FAD',
|
||||
'orange' => '#FF8F32'
|
||||
);
|
||||
|
||||
$config = $path.'metro/config.less';
|
||||
$file = file_get_contents($config);
|
||||
preg_match('/\/\*replace_start\*\/(.*)\/\*replace_end/isU',$file,$res);
|
||||
$default = $res[1];
|
||||
preg_match('/\/\*replace_start_color\*\/(.*)\/\*replace_end_color/isU',$file,$res2);
|
||||
$new = $res2[1];
|
||||
foreach ($color_arr as $name => $color) {
|
||||
$theme = preg_replace('/@main_color:(.*);/isU',"@main_color:".$color.";",$new);
|
||||
$file_str = preg_replace('/\/\*replace_start\*\/(.*)\/\*replace_end/isU',
|
||||
"/*replace_start*/".$theme."/*replace_end",$file);
|
||||
file_put_contents($config,$file_str);
|
||||
foreach($app_less as $app){
|
||||
$less = new lessc();
|
||||
$path_in = $path.'metro/'.$app.'.less';
|
||||
$path_out = $path.'metro/'.$name.'_'.$app.'.css';
|
||||
try {
|
||||
$cache = $less->cachedCompile($path_in);
|
||||
$out = str_replace(array("{\n",";\n",",\n",' '),
|
||||
array('{',';',',',' '),$cache["compiled"]);
|
||||
file_put_contents($path_out,$out);
|
||||
echo $path_out,' ...成功!('.$i++.'/'.$num.')','<br/>';
|
||||
}catch (exception $e) {
|
||||
echo "<p style='color:#f66'>fatal error: " . $e->getMessage(),'</p>';
|
||||
}
|
||||
flush();
|
||||
}
|
||||
}
|
||||
$file_str = preg_replace('/\/\*replace_start\*\/(.*)\/\*replace_end/isU',
|
||||
"/*replace_start*/".$default."/*replace_end",$file);
|
||||
file_put_contents($config,$file_str);
|
||||
}
|
||||
|
||||
function _fileInit(){
|
||||
mk_dir($this->path_to);
|
||||
echo '<br/>新建文件夹成功,开始复制文件';flush();
|
||||
copy_dir($this->path_app, $this->path_to);
|
||||
echo '<br/>复制文件成功,开始清除调试相关信息<hr/>';flush();
|
||||
echo $this->path_app,'<br/>',$this->path_to;
|
||||
}
|
||||
// 删除
|
||||
function _remove(){
|
||||
$file_list = array(
|
||||
$this->path_to.'/controller/debug.class.php',
|
||||
$this->path_to.'/lib/class/lessc.inc.class.php',
|
||||
$this->path_to.'/static/style/base.less',
|
||||
$this->path_to.'/static/js/lib/less-1.4.2.min.js',
|
||||
$this->path_to.'/static/js/lib/webuploader/webuploader.js',
|
||||
$this->path_to.'/static/style/skin/common.less',
|
||||
$this->path_to.'/static/js/Gruntfile.js',
|
||||
$this->path_to.'/static/js/package.json',
|
||||
$this->path_to.'/static/js/readme.txt',
|
||||
$this->path_to.'/todo.txt',
|
||||
);
|
||||
$path_list = array(
|
||||
$this->path_to.'/data/log',
|
||||
$this->path_to.'/data/User',
|
||||
$this->path_to.'/data/thumb',
|
||||
$this->path_to.'/static/js/_dev',
|
||||
$this->path_to.'/static/js/app/update',
|
||||
$this->path_to.'/static/js/node_modules'
|
||||
);
|
||||
foreach($file_list as $val){
|
||||
del_file($val);
|
||||
}
|
||||
echo '<br/>1.文件删除完成:';flush();
|
||||
mkdir($this->path_to.'/data/User');
|
||||
foreach($path_list as $val){
|
||||
del_dir($val);
|
||||
}
|
||||
echo '<br/>2.文件夹删除完成:';flush();
|
||||
$path = $this->path_to.'/static/style/skin/';
|
||||
$app_theme = array('default','metro','simple');
|
||||
$app_less = array(
|
||||
'app_code_edit','app_desktop','app_editor','app_explorer','app_setting',
|
||||
'button','config','dialog','filelist','right_menu','tree'
|
||||
);
|
||||
foreach($app_theme as $theme){
|
||||
foreach($app_less as $app){
|
||||
$temp = $path.$theme.'/'.$app.'.less';
|
||||
del_file($temp);
|
||||
}
|
||||
}
|
||||
echo '<br/>3.less文件删除完成<hr/>';flush();
|
||||
}
|
||||
|
||||
// 删除less相关信息
|
||||
function _fileReplace(){
|
||||
$file_list = array(
|
||||
$this->path_to.'/template/app/index.php',
|
||||
$this->path_to.'/template/desktop/index.php',
|
||||
$this->path_to.'/template/editor/edit.php',
|
||||
$this->path_to.'/template/editor/editor.php',
|
||||
$this->path_to.'/template/explorer/index.php',
|
||||
$this->path_to.'/template/setting/index.php'
|
||||
);
|
||||
foreach($file_list as $val){
|
||||
$content = file_get_contents($val);
|
||||
$content = str_replace("<?php if(STATIC_LESS == 'css'){ ?>",'',$content);
|
||||
$content = str_replace("<?php echo STATIC_JS;?>",'app',$content);
|
||||
$content = preg_replace('/<\?php }else{\/\/less_compare_online \?>.*<\?php } \?>/isU','',$content);
|
||||
file_put_contents($val,$content);
|
||||
echo '<br/>处理template文件:'.$val,'成功';flush();
|
||||
}
|
||||
|
||||
$config = $this->path_to.'/config/config.php';
|
||||
$content = file_get_contents($config);
|
||||
$content = str_replace('define(\'STATIC_JS\'.*','',$content);
|
||||
$content = str_replace('define(\'STATIC_LESS\'.*','',$content);
|
||||
file_put_contents($config,$content);
|
||||
}
|
||||
|
||||
// 默认用户初始化 admin/admin
|
||||
function _initUser(){
|
||||
echo '<br/>开始创建用户';flush();
|
||||
$root = array('home','recycle','data');
|
||||
$home = array('desktop','doc','download','image','movie','music');
|
||||
$user = array(
|
||||
'admin'=>array('admin','root'),
|
||||
'demo'=>array('demo','default'),
|
||||
'guest'=>array('guest','guest')
|
||||
);
|
||||
|
||||
foreach ($user as $name => $v) {
|
||||
$user_path = $this->path_to.'/data/User/'.$name.'/';
|
||||
mk_dir($user_path);
|
||||
foreach ($root as $dir) {
|
||||
mk_dir($user_path.$dir);
|
||||
}
|
||||
foreach ($home as $dir) {
|
||||
mk_dir($user_path.'home/'.$dir);
|
||||
}
|
||||
fileCache::save($user_path.'data/config.php',$this->config['setting_default']);
|
||||
|
||||
}
|
||||
$this->_initUserData();
|
||||
}
|
||||
function _initUserData(){
|
||||
echo '<br/>初始化用户数据';flush();
|
||||
$role = '<?php exit;?>{"root":{"role":"root","name":"Administrator","path":"","ext_not_allow":""},"default":{"role":"default","name":"default","ext_not_allow":"php|asp|jsp","explorer:mkdir":1,"explorer:mkfile":1,"explorer:pathRname":1,"explorer:pathDelete":1,"explorer:zip":1,"explorer:unzip":1,"explorer:pathCopy":1,"explorer:pathCute":1,"explorer:pathCuteDrag":1,"explorer:clipboard":1,"explorer:pathPast":1,"explorer:pathInfo":1,"explorer:pathInfoMuti":1,"explorer:serverDownload":1,"explorer:fileUpload":1,"explorer:search":1,"app:user_app":1,"editor:fileSave":1},"guest":{"role":"guest","name":"guest","ext_not_allow":"php|asp|jsp"}}';
|
||||
$user = '<?php exit;?>{"admin":{"name":"admin","password":"21232f297a57a5a743894a0e4a801fc3","role":"root","status":0},"guest":{"name":"guest","password":"084e0343a0486ff05530df6c705c8bb4","role":"guest","status":0},"demo":{"name":"demo","password":"fe01ce2a7fbac8fafaed7c982a04e229","role":"default","status":0}}';
|
||||
file_put_contents($this->path_to.'/data/system/group.php',$role);
|
||||
file_put_contents($this->path_to.'/data/system/member.php',$user);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class desktop extends Controller{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->tpl = TEMPLATE.'desktop/';
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页
|
||||
*/
|
||||
public function index() {
|
||||
$wall = $this->config['user']['wall'];
|
||||
if(strlen($wall)>3){
|
||||
$this->assign('wall',$wall);
|
||||
}else{
|
||||
$this->assign('wall',STATIC_PATH.'images/wall_page/'.$wall.'.jpg');
|
||||
}
|
||||
|
||||
$upload_max = get_post_max();
|
||||
$this->assign('upload_max',$upload_max);
|
||||
$this->display('index.php');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class editor extends Controller{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->tpl = TEMPLATE . 'editor/';
|
||||
}
|
||||
|
||||
// 多文件编辑器
|
||||
public function index(){
|
||||
$this->display('editor.php');
|
||||
}
|
||||
// 单文件编辑
|
||||
public function edit(){
|
||||
$this->display('edit.php');
|
||||
}
|
||||
|
||||
// 获取文件数据
|
||||
public function fileGet(){
|
||||
$filename=_DIR($this->in['filename']);
|
||||
if (!is_readable($filename)) show_json($this->L['no_permission'],false);
|
||||
if (filesize($filename) >= 1024*1024*20) show_json($this->L['edit_too_big'],false);
|
||||
|
||||
$filecontents=file_get_contents($filename);//文件内容
|
||||
$charset=$this->_get_charset($filecontents);
|
||||
if ($charset!='' || $charset!='utf-8') {
|
||||
$filecontents=mb_convert_encoding($filecontents,'utf-8',$charset);
|
||||
}
|
||||
$data = array(
|
||||
'ext' => end(explode('.',$filename)),
|
||||
'name' => iconv_app(end(explode('/',$filename))),
|
||||
'filename' => rawurldecode($this->in['filename']),
|
||||
'charset' => $charset,
|
||||
'content' => $filecontents
|
||||
);
|
||||
show_json($data);
|
||||
}
|
||||
public function fileSave(){
|
||||
$filestr = rawurldecode($this->in['filestr']);
|
||||
$charset = $this->in['charset'];
|
||||
$path =_DIR($this->in['path']);
|
||||
if (!is_writable($path)) show_json($this->L['no_permission'],false);
|
||||
|
||||
if ($charset !='' || $charset != 'utf-8') {
|
||||
$filestr=mb_convert_encoding($filestr,$this->in['charset'],'utf-8');
|
||||
}
|
||||
$fp=fopen($path,'wb');
|
||||
fwrite($fp,$filestr);
|
||||
fclose($fp);
|
||||
show_json($this->L['save_success']);
|
||||
}
|
||||
//-----------------------------------------------
|
||||
/*
|
||||
* 获取字符串编码
|
||||
* @param:$ext 传入字符串
|
||||
*/
|
||||
private function _get_charset(&$str) {
|
||||
if ($str == '') return 'utf-8';
|
||||
//前面检测成功则,自动忽略后面
|
||||
$charset=strtolower(mb_detect_encoding($str,$this->config['check_charset']));
|
||||
if (substr($str,0,3)==chr(0xEF).chr(0xBB).chr(0xBF)){
|
||||
$charset='utf-8';
|
||||
}else if($charset=='cp936'){
|
||||
$charset='gbk';
|
||||
}
|
||||
if ($charset == 'ascii') $charset = 'utf-8';
|
||||
return strtolower($charset);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,501 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class explorer extends Controller{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public $path;
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->tpl = TEMPLATE.'explorer/';
|
||||
if (isset($this->in['path'])) {
|
||||
$this->path = _DIR($this->in['path']);
|
||||
}
|
||||
}
|
||||
|
||||
public function index(){
|
||||
if($this->in['path'] !=''){
|
||||
$dir = $_GET['path'];
|
||||
}else if(isset($_SESSION['this_path'])){
|
||||
$dir = $_SESSION['this_path'];
|
||||
}else{
|
||||
$dir = '/';//首次进入系统,不带参数
|
||||
if ($GLOBALS['is_root']) $dir = WEB_ROOT;
|
||||
}
|
||||
$dir = rtrim($dir,'/').'/';
|
||||
$is_frame = false;//是否以iframe方式打开
|
||||
if ($this->in['type'] == 'iframe') $is_frame = true;//
|
||||
$upload_max = get_post_max();
|
||||
$this->assign('upload_max',$upload_max);
|
||||
$this->assign('is_frame',$is_frame);
|
||||
$this->assign('dir',$dir);
|
||||
$this->display('index.php');
|
||||
}
|
||||
|
||||
public function pathInfo(){
|
||||
$path = $this->path;
|
||||
$type=$this->in['type'];
|
||||
if ($type=="folder"){
|
||||
$data = path_info($path,$this->L['time_type_info']);
|
||||
}else{
|
||||
$data = file_info($path,$this->L['time_type_info']);
|
||||
}
|
||||
show_json($data);
|
||||
}
|
||||
public function pathInfoMuti(){
|
||||
$info_list = json_decode($this->in['list'],true);
|
||||
foreach ($info_list as &$val) {
|
||||
$val['path'] = _DIR($val['path']);
|
||||
}
|
||||
$data = path_info_muti($info_list);
|
||||
show_json($data);
|
||||
}
|
||||
public function pathRname(){
|
||||
if (!is_writable($this->path)) {
|
||||
show_json($this->L['no_permission'],false);
|
||||
}
|
||||
$rname_to=_DIR($this->in['rname_to']);
|
||||
if (file_exists($rname_to)) {
|
||||
show_json($this->L['name_isexists'],false);
|
||||
}
|
||||
rename($this->path,$rname_to);
|
||||
show_json($this->L['rname_success']);
|
||||
}
|
||||
public function pathList(){
|
||||
load_class('history');
|
||||
session_start();//re start
|
||||
$session=$_SESSION['history'];
|
||||
$user_path = $this->in['path'];
|
||||
|
||||
if (is_array($session)){
|
||||
$hi=new history($session);
|
||||
if ($user_path==""){
|
||||
$user_path=$hi->getFirst();
|
||||
}else {
|
||||
$hi->add($user_path);
|
||||
$_SESSION['history']=$hi->getHistory();
|
||||
}
|
||||
}else {
|
||||
$hi=new history(array(),20);
|
||||
if ($user_path=="") $user_path='/';
|
||||
$hi->add($user_path);
|
||||
$_SESSION['history']=$hi->getHistory();
|
||||
}
|
||||
$_SESSION['this_path']=$user_path;
|
||||
$list=$this->path($this->path);
|
||||
$list['history_status']= array('back'=>$hi->isback(),'next'=>$hi->isnext());
|
||||
show_json($list);
|
||||
}
|
||||
public function search(){
|
||||
if (!isset($this->in['search'])) show_json($this->L['please_inpute_search_words'],false);
|
||||
$is_content = false;
|
||||
$is_case = false;
|
||||
$ext = '';
|
||||
if (isset($this->in['is_content'])) $is_content = true;
|
||||
if (isset($this->in['is_case'])) $is_case = true;
|
||||
if (isset($this->in['ext'])) $ext= str_replace(' ','',$this->in['ext']);
|
||||
$list = path_search(
|
||||
$this->path,
|
||||
iconv_system($this->in['search']),
|
||||
$is_content,$ext,$is_case);
|
||||
_DIR_OUT($list);
|
||||
show_json($list);
|
||||
}
|
||||
public function treeList(){//树结构
|
||||
$app = $this->in['app'];//是否获取文件 传folder|file
|
||||
if ($this->in['type']=='init') $this->_tree_init($app);
|
||||
if ($this->in['this_path']){
|
||||
$path=_DIR($this->in['this_path']);
|
||||
}else{
|
||||
$path=_DIR($this->in['path'].$this->in['name']);
|
||||
}
|
||||
//if (!is_readable($path)) show_json($path,false);
|
||||
|
||||
$list_file = ($app == 'editor'?true:false);//编辑器内列出文件
|
||||
$list=$this->path($path,$list_file,true);
|
||||
function sort_by_key($a, $b){
|
||||
if ($a['name'] == $b['name']) return 0;
|
||||
return ($a['name'] > $b['name']) ? 1 : -1;
|
||||
}
|
||||
usort($list['folderlist'], "sort_by_key");
|
||||
usort($list['filelist'], "sort_by_key");
|
||||
if ($app == 'editor') {
|
||||
$res = array_merge($list['folderlist'],$list['filelist']);
|
||||
show_json($res,true);
|
||||
}else{
|
||||
show_json($list['folderlist'],true);
|
||||
}
|
||||
}
|
||||
private function _tree_init($app){
|
||||
$check_file = ($app == 'editor'?true:false);
|
||||
$favData=new fileCache($this->config['user_fav_file']);
|
||||
$fav_list = $favData->get();
|
||||
$fav = array();
|
||||
foreach($fav_list as $key => $val){
|
||||
$fav[] = array(
|
||||
'ext' => 'folder',
|
||||
'name' => $val['name'],
|
||||
'this_path' => $val['path'],
|
||||
'iconSkin' => "fav",
|
||||
'type' => 'folder',
|
||||
'isParent' => path_haschildren(_DIR($val['path']),$check_file)
|
||||
);
|
||||
}
|
||||
$tree_path = WEB_ROOT;
|
||||
if (!$GLOBALS['is_root']) {
|
||||
$tree_path = '/';
|
||||
}
|
||||
if ($check_file) {//编辑器
|
||||
$list=$this->path(_DIR($tree_path),true,true);
|
||||
$res = array_merge($list['folderlist'],$list['filelist']);
|
||||
$tree_data = array(
|
||||
array('name'=>$this->L['fav'],'ext'=>'__fav__','iconSkin'=>"fav",'open'=>true,'children'=>$fav),
|
||||
array('name'=>$this->L['root_path'],'ext'=>'__root__','children'=>$res,'iconSkin'=>"my",'open'=>true,'this_path'=> $tree_path,'isParent'=>true)
|
||||
);
|
||||
}else{//文件管理器
|
||||
$lib_array = array(
|
||||
array('name'=>$this->L['desktop'],'ext'=>'_null_','iconSkin'=>"my",'this_path'=> MYHOME.'desktop/','isParent'=>true),
|
||||
array('name'=>$this->L['my_document'],'ext'=>'_null_','iconSkin'=>"doc",'this_path'=> MYHOME.'doc/','isParent'=>true),
|
||||
array('name'=>$this->L['my_picture'],'ext'=>'_null_','iconSkin'=>"pic",'this_path'=> MYHOME.'image/','isParent'=>true),
|
||||
array('name'=>$this->L['my_music'],'ext'=>'_null_','iconSkin'=>"music",'this_path'=> MYHOME.'music/','isParent'=>true),
|
||||
array('name'=>$this->L['my_movie'],'ext'=>'_null_','iconSkin'=>"movie",'this_path'=> MYHOME.'movie/','isParent'=>true),
|
||||
array('name'=>$this->L['my_download'],'ext'=>'_null_','iconSkin'=>"download",'this_path'=> MYHOME.'download/','isParent'=>true)
|
||||
);
|
||||
$tree_data = array(
|
||||
array('name'=>$this->L['fav'],'ext'=>'__fav__','iconSkin'=>"fav",'open'=>true,'children'=>$fav),
|
||||
array('name'=>$this->L['lib'],'ext'=>'__lib__','iconSkin'=>"lib",'open'=>true,'children'=>$lib_array),
|
||||
array('name'=>$this->L['root_path'],'ext'=>'__root__','iconSkin'=>"my",'open'=>true,'this_path'=> $tree_path,'isParent'=>true)
|
||||
);
|
||||
}
|
||||
show_json($tree_data);
|
||||
}
|
||||
|
||||
public function historyBack(){
|
||||
load_class('history');
|
||||
session_start();//re start
|
||||
$session=$_SESSION['history'];
|
||||
if (is_array($session)){
|
||||
$hi=new history($session);
|
||||
$path=$hi->goback();
|
||||
$_SESSION['history']=$hi->getHistory();
|
||||
$folderlist=$this->path(_DIR($path));
|
||||
$_SESSION['this_path']=$path;
|
||||
show_json(array(
|
||||
'history_status'=>array('back'=>$hi->isback(),'next'=>$hi->isnext()),
|
||||
'thispath'=>$path,
|
||||
'list'=>$folderlist
|
||||
));
|
||||
}
|
||||
}
|
||||
public function historyNext(){
|
||||
load_class('history');
|
||||
session_start();//re start
|
||||
$session=$_SESSION['history'];
|
||||
if (is_array($session)){
|
||||
$hi=new history($session);
|
||||
$path=$hi->gonext();
|
||||
$_SESSION['history']=$hi->getHistory();
|
||||
$folderlist=$this->path(_DIR($path));
|
||||
$_SESSION['this_path']=$path;
|
||||
show_json(array(
|
||||
'history_status'=>array('back'=>$hi->isback(),'next'=>$hi->isnext()),
|
||||
'thispath'=>$path,
|
||||
'list'=>$folderlist
|
||||
));
|
||||
}
|
||||
}
|
||||
public function pathDelete(){
|
||||
$list = json_decode($this->in['list'],true);
|
||||
$success = 0;
|
||||
$error = 0;
|
||||
foreach ($list as $val) {
|
||||
$path_full = _DIR($val['path']);
|
||||
if ($val['type'] == 'folder') {
|
||||
if(del_dir($path_full)) $success ++;
|
||||
else $error++;
|
||||
}else{
|
||||
if(del_file($path_full)) $success++;
|
||||
else $error++;
|
||||
}
|
||||
}
|
||||
if (count($list) == 1) {
|
||||
if ($success) show_json($this->L['remove_success']);
|
||||
else show_json($this->L['remove_fali'],false);
|
||||
}else{
|
||||
$code = $error==0?true:false;
|
||||
show_json($this->L['remove_success'].$success.'success,'.$error.'error',$code);
|
||||
}
|
||||
}
|
||||
public function mkfile(){
|
||||
$new= rtrim($this->path,'/');
|
||||
if(touch($new)){
|
||||
show_json($this->L['create_success']);
|
||||
}else{
|
||||
show_json($this->L['create_error'],false);
|
||||
}
|
||||
}
|
||||
public function mkdir(){
|
||||
$new = rtrim($this->path,'/');
|
||||
if(mkdir($new,0777)){
|
||||
show_json($this->L['create_success']);
|
||||
}else{
|
||||
show_json($this->L['create_error']);
|
||||
}
|
||||
}
|
||||
public function pathCopy(){
|
||||
session_start();//re start
|
||||
$copy_list = json_decode($this->in['list'],true);
|
||||
$list_num = count($copy_list);
|
||||
for ($i=0; $i < $list_num; $i++) {
|
||||
$copy_list[$i]['path'] =$copy_list[$i]['path'];
|
||||
}
|
||||
$_SESSION['path_copy']= json_encode($copy_list);
|
||||
$_SESSION['path_copy_type']='copy';
|
||||
show_json($this->L['copy_success']);
|
||||
}
|
||||
public function pathCute(){
|
||||
session_start();//re start
|
||||
$cute_list = json_decode($this->in['list'],true);
|
||||
$list_num = count($cute_list);
|
||||
for ($i=0; $i < $list_num; $i++) {
|
||||
$cute_list[$i]['path'] = $cute_list[$i]['path'];
|
||||
}
|
||||
$_SESSION['path_copy']= json_encode($cute_list);
|
||||
$_SESSION['path_copy_type']='cute';
|
||||
show_json($this->L['cute_success']);
|
||||
}
|
||||
public function pathCuteDrag(){
|
||||
$clipboard = json_decode($this->in['list'],true);
|
||||
$path_past=$this->path;
|
||||
if (!is_writable($path_past)) show_json($this->L['no_permission'],false);
|
||||
foreach ($clipboard as $val) {
|
||||
$path_copy = _DIR($val['path']);
|
||||
$filename = get_path_this($path_copy);
|
||||
if ($clipboard[$i]['type'] == 'folder') {
|
||||
@rename($path_copy,$path_past.$filename.'/');
|
||||
}else{
|
||||
@rename($path_copy,$path_past.$filename);
|
||||
}
|
||||
}
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
public function clipboard(){
|
||||
$clipboard = json_decode($_SESSION['path_copy'],true);
|
||||
$msg = '';
|
||||
if (count($clipboard) == 0){
|
||||
$msg = '<div style="padding:20px;">null!</div>';
|
||||
}else{
|
||||
$msg='<div style="height:200px;overflow:auto;padding:10px;width:400px"><b>'.$this->L['clipboard_state']
|
||||
.($_SESSION['path_copy_type']=='cute'?$this->L['cute']:$this->L['copy']).'</b><br/>';
|
||||
$len = 40;
|
||||
foreach ($clipboard as $val) {
|
||||
$val['path'] = rawurldecode($val['path']);
|
||||
$path=(strlen($val['path'])<$len)?$val['path']:'...'.substr($val['path'],-$len);
|
||||
$msg.= '<br/>'.$val['type'].' : '.$path;
|
||||
}
|
||||
$msg.="</div>";
|
||||
}
|
||||
show_json($msg);
|
||||
}
|
||||
public function pathPast(){
|
||||
session_start();//re start
|
||||
$info = '';$data = array();
|
||||
$clipboard = json_decode($_SESSION['path_copy'],true);
|
||||
if (count($clipboard) == 0){
|
||||
show_json($data,false,$this->L['clipboard_null']);
|
||||
}
|
||||
$copy_type = $_SESSION['path_copy_type'];
|
||||
$path_past=$this->path;
|
||||
if (!is_writable($path_past)) show_json($data,false,$this->L['no_permission_write']);
|
||||
|
||||
$list_num = count($clipboard);
|
||||
if ($list_num == 0) {
|
||||
show_json($data,false,$this->L['clipboard_null']);
|
||||
}
|
||||
for ($i=0; $i < $list_num; $i++) {
|
||||
$path_copy = _DIR($clipboard[$i]['path']);
|
||||
$filename = get_path_this($path_copy);
|
||||
$filename_out = iconv_app($filename);
|
||||
|
||||
if (!file_exists($path_copy) && !is_dir($path_copy)){
|
||||
$info .=$path_copy."<li>{$filename_out}'.$this->L['copy_not_exists'].'</li>";
|
||||
continue;
|
||||
}
|
||||
if ($clipboard[$i]['type'] == 'folder'){
|
||||
if ($path_copy == substr($path_past,0,strlen($path_copy))){
|
||||
$info .="<li style='color:#f33;'>{$filename_out}'.$this->L['current_has_parent'].'</li>";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($copy_type == 'copy') {
|
||||
if ($clipboard[$i]['type'] == 'folder') {
|
||||
copy_dir($path_copy,$path_past.$filename);
|
||||
}else{
|
||||
copy($path_copy,$path_past.$filename);
|
||||
}
|
||||
|
||||
}else{
|
||||
if ($cute_list[$i]['type'] == 'folder') {
|
||||
rename($path_copy,$path_past.$filename.'/');
|
||||
}else{
|
||||
rename($path_copy,$path_past.$filename);
|
||||
}
|
||||
}
|
||||
$data[] = iconv_app($filename);
|
||||
}
|
||||
if ($copy_type == 'copy') {
|
||||
$info=$this->L['past_success'].$info;
|
||||
}else{
|
||||
$_SESSION['path_copy'] = json_encode(array());
|
||||
$_SESSION['path_copy_type'] = '';
|
||||
$info=$this->L['cute_past_success'].$info;
|
||||
}
|
||||
show_json($data,true,$info);
|
||||
}
|
||||
public function fileDownload(){
|
||||
file_download($this->path);
|
||||
}
|
||||
public function zip(){
|
||||
load_class('pclzip');
|
||||
ini_set('memory_limit', '2028M');//2G;
|
||||
$zip_list = json_decode($this->in['list'],true);
|
||||
$list_num = count($zip_list);
|
||||
for ($i=0; $i < $list_num; $i++) {
|
||||
$zip_list[$i]['path'] = _DIR($zip_list[$i]['path']);
|
||||
}
|
||||
$basic_path =get_path_father($zip_list[0]['path']);
|
||||
if ($list_num == 1) {
|
||||
$path_this_name=get_path_this($zip_list[0]['path']);
|
||||
$zipname = $basic_path.$path_this_name.'.zip';
|
||||
}else{
|
||||
//$zipname = $basic_path.'temp_'.substr(md5(time()),5,3).'.zip';
|
||||
$path_this_name=get_path_this(get_path_father($zip_list[0]['path']));
|
||||
$zipname = $basic_path.$path_this_name.'.zip';
|
||||
}
|
||||
$zipname = get_filename_auto($zipname);
|
||||
if (!is_writeable($basic_path)) {
|
||||
show_json("{$zipname}".$this->L['no_permission_write'],false);
|
||||
}else{
|
||||
$files = array();
|
||||
for ($i=0; $i < $list_num; $i++) {
|
||||
$files[] = $zip_list[$i]['path'];
|
||||
}
|
||||
$archive = new PclZip($zipname);
|
||||
$v_list = $archive->create(implode(',',$files),PCLZIP_OPT_REMOVE_PATH,$basic_path);
|
||||
if ($v_list == 0) {
|
||||
show_json("Error : ".$archive->errorInfo(true),false);
|
||||
}
|
||||
$info = $this->L['zip_success'].$this->L['size'].":".size_format(filesize($zipname));
|
||||
show_json($info);
|
||||
}
|
||||
}
|
||||
public function unzip(){
|
||||
load_class('pclzip');
|
||||
ini_set('memory_limit', '2028M');//2G;
|
||||
$path=$this->path;
|
||||
$name = get_path_this($path);
|
||||
$name = substr($name,0,strrpos($name,'.'));
|
||||
$path_father_name=get_path_father($path);
|
||||
$unzip_to = $path_father_name.$path_this_name;
|
||||
if (isset($this->in['path_to'])) {//解压到指定位置
|
||||
$unzip_to = _DIR($this->in['path_to']);
|
||||
}
|
||||
|
||||
$zip = new PclZip($path);
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$unzip_to,
|
||||
PCLZIP_OPT_SET_CHMOD,0777,
|
||||
PCLZIP_OPT_REPLACE_NEWER);//解压到某个地方,覆盖方式
|
||||
if ($result == 0) {
|
||||
show_json("Error : ".$zip->errorInfo(true),fasle);
|
||||
}else{
|
||||
show_json($this->L['unzip_success']);
|
||||
}
|
||||
}
|
||||
public function image(){
|
||||
if (filesize($this->path) <= 1024*10) {//小于10k 不再生成缩略图
|
||||
file_proxy_out($this->path);
|
||||
}
|
||||
load_class('imageThumb');
|
||||
$image= $this->path;
|
||||
$image_md5 = md5($image);
|
||||
$image_thum = $this->config['pic_thumb'].$image_md5.'.png';
|
||||
if (!is_dir($this->config['pic_thumb'])){
|
||||
mkdir($this->config['pic_thumb'],0777);
|
||||
}
|
||||
if (!file_exists($image_thum)){//如果拼装成的url不存在则没有生成过
|
||||
if ($_SESSION['this_path']==$this->config['pic_thumb']){//当前目录则不生成缩略图
|
||||
$image_thum=$this->path;
|
||||
}else {
|
||||
$cm=new CreatMiniature();
|
||||
$cm->SetVar($image,'file');
|
||||
//$cm->Prorate($image_thum,72,64);//生成等比例缩略图
|
||||
$cm->BackFill($image_thum,72,64,true);//等比例缩略图,空白处填填充透明色
|
||||
}
|
||||
}
|
||||
if (!file_exists($image_thum) || filesize($image_thum)<100){//缩略图生成失败则用默认图标
|
||||
$image_thum=STATIC_PATH.'images/image.png';
|
||||
}
|
||||
//输出
|
||||
file_proxy_out($image_thum);
|
||||
}
|
||||
|
||||
// 远程下载
|
||||
public function serverDownload() {
|
||||
$url = rawurldecode($this->in['url']);
|
||||
$save_path = _DIR($this->in['save_path']);
|
||||
$save_path = $save_path.'download_'.rand(100,999).'.tmp';
|
||||
$result = file_download_this($url,$save_path);
|
||||
if ($result == 1){
|
||||
show_json($this->L['download_success'],true,$save_path);
|
||||
}else{
|
||||
if ($result == -1){
|
||||
show_json($this->L['download_error_create'],false);
|
||||
}else{
|
||||
show_json($this->L['download_error_exists'],false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 远程下载
|
||||
public function fileProxy() {
|
||||
if (!$GLOBALS['is_root']) show_json($this->L['no_permission'],false);
|
||||
file_proxy_out($this->path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传,html5拖拽 flash 多文件
|
||||
*/
|
||||
public function fileUpload(){
|
||||
$save_path = $this->path;
|
||||
if ($save_path == '') show_json($this->L['upload_error_big'],false);
|
||||
if (strlen($this->in['fullPath']) > 1) {//folder drag upload
|
||||
$full_path = _DIR_CLEAR(rawurldecode($this->in['fullPath']));
|
||||
$full_path = get_path_father($full_path);
|
||||
$full_path = iconv_system($full_path);
|
||||
if (mk_dir($save_path.$full_path)) {
|
||||
$save_path = $save_path.$full_path;
|
||||
}
|
||||
}
|
||||
upload('file',$save_path);
|
||||
}
|
||||
|
||||
//获取文件列表&哦exe文件json解析
|
||||
private function path($dir,$list_file=true,$check_children=false){
|
||||
$list = path_list($dir,$list_file,$check_children);
|
||||
foreach ($list['filelist'] as $key => $val) {
|
||||
if ($val['ext'] == 'oexe') {
|
||||
$path = iconv_system($val['path']).'/'.iconv_system($val['name']);
|
||||
$json = json_decode(file_get_contents($path),true);
|
||||
if(is_array($json)) $list['filelist'][$key] = array_merge($val,$json);
|
||||
}
|
||||
}
|
||||
_DIR_OUT($list);
|
||||
return $list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class fav extends Controller{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
private $sql;
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->sql=new fileCache($this->config['user_fav_file']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收藏夹json
|
||||
*/
|
||||
public function get() {
|
||||
show_json($this->sql->get());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add() {
|
||||
$res=$this->sql->add($this->in['name'],
|
||||
array(
|
||||
'name'=>$this->in['name'],
|
||||
'path'=>$this->in['path']
|
||||
)
|
||||
);
|
||||
if($res)show_json($this->L['success']);
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit() {
|
||||
//查找到一条记录,修改为该数组
|
||||
$to_array=array(
|
||||
'name'=>$this->in['name_to'],
|
||||
'path'=>$this->in['path_to']
|
||||
);
|
||||
if($this->sql->replace_update(
|
||||
$this->in['name'],$this->in['name_to'],$to_array)){
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
if($this->sql->delete($this->in['name'])){
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error'],false);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class group extends Controller
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
private $sql;
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->sql=new fileCache($this->config['system_file']['group']);
|
||||
}
|
||||
|
||||
public function get() {
|
||||
show_json($this->sql->get());
|
||||
}
|
||||
/**
|
||||
* 用户添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$group = $this->_init_data();
|
||||
if($this->sql->add($this->in['role'],$group)){
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$group = $this->_init_data();
|
||||
$role_old = $this->in['role_old'];
|
||||
if (!$role_old) show_json($this->L["groupname_can_not_null"],false);
|
||||
if ($role_old == 'root') show_json($this->L['default_group_can_not_do'],false);
|
||||
|
||||
if ($this->sql->replace_update($role_old,$this->in['role'],$group)){
|
||||
$member = new fileCache($this->config['system_file']['member']);
|
||||
if ($member -> update('role',$this->in['role'],$role_old)) {
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['group_move_user_error'],false);
|
||||
}
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
$role = $this->in['role'];
|
||||
if (!$role) show_json($this->L["groupname_can_not_null"],false);
|
||||
if ($role == 'root') show_json($this->L['default_group_can_not_do'],false);
|
||||
if($this->sql->delete($role)){
|
||||
$member = new fileCache($this->config['system_file']['member']);
|
||||
$member -> update('role','',$role);//改组用户设置为空
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error'],false);
|
||||
}
|
||||
|
||||
|
||||
//===========内部调用============
|
||||
/**
|
||||
* 初始化数据 get
|
||||
* 只传键即可 &ext_not_allow=''&explorer-mkfile&explorer-pathRname
|
||||
*/
|
||||
private function _init_data(){
|
||||
if (strlen($this->in['role'])<1) show_json($this->L["groupname_can_not_null"],false);
|
||||
if (strlen($this->in['name'])<1) show_json($this->L["groupdesc_can_not_null"],false);
|
||||
|
||||
$role_arr = array('role'=>$this->in['role'],'name'=>$this->in['name']);
|
||||
$role_arr['ext_not_allow'] = $this->in['ext_not_allow'];
|
||||
foreach ($this->config['role_setting'] as $key => $actions) {
|
||||
foreach ($actions as $action) {
|
||||
$k = $key.':'.$action;
|
||||
if (isset($this->in[$k])) {
|
||||
$role_arr[$k] = 1;
|
||||
}else{
|
||||
//$role_arr[$k] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $role_arr;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class member extends Controller
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
private $sql;
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
$this->tpl = TEMPLATE.'member/';
|
||||
$this->sql=new fileCache(USER_SYSTEM.'member.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表数据
|
||||
*/
|
||||
public function get() {
|
||||
show_json($this->sql->get());
|
||||
}
|
||||
/**
|
||||
* 用户添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (!$this->in['name'] ||
|
||||
!$this->in['password'] ||
|
||||
!$this->in['role'] ) show_json($this->L["data_not_full"],false);
|
||||
$user = array(
|
||||
'name' => $this->in['name'],
|
||||
'password' => md5($this->in['password']),
|
||||
'role' => $this->in['role'],
|
||||
'status' => 0,
|
||||
);
|
||||
if ($this->sql->add($this->in['name'],$user)) {
|
||||
$this->_initUser($this->in['name']);
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
if (!$this->in['name'] ||
|
||||
!$this->in['name_to'] ||
|
||||
!$this->in['role_to'] ) show_json($this->L["data_not_full"],false);
|
||||
if ($this->in['name'] == 'admin') show_json($this->L['default_user_can_not_do'],false);
|
||||
|
||||
//查找到一条记录,修改为该数组
|
||||
$user = $this->sql->get($this->in['name']);
|
||||
$user['name'] = $this->in['name_to'];
|
||||
$user['role'] = $this->in['role_to'];
|
||||
|
||||
if (strlen($this->in['password_to'])>=1) {
|
||||
$user['password'] = md5($this->in['password_to']);
|
||||
}
|
||||
if($this->sql->replace_update($this->in['name'],$user['name'],$user)){
|
||||
rename(USER_PATH.$this->in['name'],USER_PATH.$this->in['name_to']);
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error_repeat'],false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
$name = $this->in['name'];
|
||||
if (!$name) show_json($this->L["username_can_not_null"],false);
|
||||
if ($name == 'admin') show_json($this->L['default_user_can_not_do'],false);
|
||||
if($this->sql->delete($name)){
|
||||
del_dir(USER_PATH.$name.'/');
|
||||
show_json($this->L['success']);
|
||||
}
|
||||
show_json($this->L['error'],false);
|
||||
}
|
||||
|
||||
//============内部处理函数=============
|
||||
/**
|
||||
*初始化用户数据和配置。
|
||||
*/
|
||||
public function _initUser($name){
|
||||
$root = array('home','recycle','data');
|
||||
$home = array('desktop','doc','download','image','movie','music');
|
||||
$user_path = USER_PATH.$name.'/';
|
||||
|
||||
mk_dir($user_path);
|
||||
foreach ($root as $dir) {
|
||||
mk_dir($user_path.$dir);
|
||||
}
|
||||
foreach ($home as $dir) {
|
||||
mk_dir($user_path.'home/'.$dir);
|
||||
}
|
||||
fileCache::save($user_path.'data/config.php',$this->config['setting_default']);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class setting extends Controller{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
private $sql;
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户首页展示
|
||||
*/
|
||||
public function index() {
|
||||
$this->tpl = TEMPLATE.'setting/';
|
||||
$this->display('index.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户首页展示
|
||||
*/
|
||||
public function slider() {
|
||||
$this->tpl = TEMPLATE . 'setting/slider/';
|
||||
$this->display($this->in['slider'].'.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数设置
|
||||
* 可以同时修改多个:key=a,b,c&value=1,2,3
|
||||
*/
|
||||
public function set(){
|
||||
$key = $this->in['k'];
|
||||
$value = $this->in['v'];
|
||||
if ($key !='' && $value != '') {
|
||||
$conf = $this->config['user'];
|
||||
$arr_k = explode(',', $key);
|
||||
$arr_v = explode(',',$value);
|
||||
$num = count($arr_k);
|
||||
|
||||
for ($i=0; $i < $num; $i++) {
|
||||
$conf[$arr_k[$i]] = $arr_v[$i];
|
||||
}
|
||||
fileCache::save($this->config['user_seting_file'],$conf);
|
||||
show_json($this->L["setting_success"]);
|
||||
}else{
|
||||
show_json($this->L['error'],false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,232 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
class user extends Controller
|
||||
{
|
||||
private $user; //用户相关信息
|
||||
private $auth; //用户所属组权限
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->tpl = TEMPLATE . 'user/';
|
||||
$this->user = &$_SESSION['user'];
|
||||
}
|
||||
/**
|
||||
* 登陆状态检测;并初始化数据状态
|
||||
*/
|
||||
public function loginCheck()
|
||||
{
|
||||
if($_SESSION['isLogin'] === true){
|
||||
define('USER',USER_PATH.$this->user['name'].'/');
|
||||
if ($this->user['role'] == 'root') {
|
||||
define('MYHOME',USER.'home/');
|
||||
define('HOME','');
|
||||
$GLOBALS['web_root'] = WEB_ROOT;//服务器目录
|
||||
$GLOBALS['is_root'] = 1;
|
||||
}else{
|
||||
define('MYHOME','/');
|
||||
define('HOME',USER.'home/');
|
||||
$GLOBALS['web_root'] = str_replace(WEB_ROOT,'',HOME);//从服务器开始到用户目录
|
||||
$GLOBALS['is_root'] = 0;
|
||||
}
|
||||
$this->config['user_fav_file'] = USER.'data/fav.php'; // 收藏夹文件存放地址.
|
||||
$this->config['user_seting_file'] = USER.'data/config.php'; //用户配置文件
|
||||
$this->config['user'] = fileCache::load($this->config['user_seting_file']);
|
||||
return;
|
||||
}else if(ACT == 'loginSubmit' || ACT=='checkCode'){//登陆提交判断;或者获取验证码
|
||||
return;
|
||||
}else if(isset($_COOKIE['kod_name']) && isset($_COOKIE['kod_token'])){
|
||||
$member = new fileCache($this->config['system_file']['member']);
|
||||
$user = $member->get($_COOKIE['kod_name']);
|
||||
if(md5($user['password'].get_client_ip()) == $_COOKIE['kod_token']){
|
||||
session_start();//记录session 写入文件
|
||||
$_SESSION['isLogin'] = true;
|
||||
$_SESSION['user']= $user;
|
||||
setcookie('kod_name', $_COOKIE['kod_name'], time()+3600*24*365);
|
||||
setcookie('kod_token',$_COOKIE['kod_token'],time()+3600*24*365); //密码的MD5值再次md5
|
||||
header('location:'.get_url());
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->login();
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆view
|
||||
*/
|
||||
public function login($msg = '')
|
||||
{
|
||||
$this->assign('msg',$msg);
|
||||
$this->display('login.html');
|
||||
exit;
|
||||
}
|
||||
/**
|
||||
* 登陆数据提交处理
|
||||
*/
|
||||
public function loginSubmit()
|
||||
{
|
||||
$name = $this->in['name'];
|
||||
if(empty($name) || empty($this->in['password'])) {
|
||||
$msg = $this->L['login_not_null'];
|
||||
}else{
|
||||
//错误三次输入验证码
|
||||
session_start();//re start
|
||||
if(intval($_SESSION['code_error_time']) >=3 &&
|
||||
$_SESSION['check_code'] !== strtolower($this->in['check_code'])){
|
||||
$this->login($this->L['code_error']);
|
||||
}
|
||||
$member = new fileCache($this->config['system_file']['member']);
|
||||
$user = $member->get($name);
|
||||
if ($user ===false){
|
||||
$msg = $this->L['user_not_exists'];
|
||||
$_SESSION['code_error_time'] = intval($_SESSION['code_error_time']) + 1;
|
||||
}else if(md5($this->in['password'])==$user['password']){
|
||||
if($user['status'] == 0){//初始化app
|
||||
$this->init_app($user);
|
||||
}
|
||||
$group = new fileCache($this->config['system_file']['group']);
|
||||
$_SESSION['isLogin'] = true;
|
||||
$_SESSION['user']= $user;
|
||||
if ($this->in['rember_password'] == 'on') {
|
||||
setcookie('kod_name', $user['name'], time()+3600*24*365);
|
||||
setcookie('kod_token',md5($user['password'].get_client_ip()), time()+3600*24*365);
|
||||
}
|
||||
header('location:./');
|
||||
return;
|
||||
}else{
|
||||
$_SESSION['code_error_time'] = intval($_SESSION['code_error_time']) + 1;
|
||||
$msg = $this->L['password_error'];
|
||||
}
|
||||
}
|
||||
$this->login($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出处理
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
session_start();
|
||||
setcookie('kod_name', null, time()-3600);
|
||||
setcookie('kod_token', null, time()-3600);
|
||||
session_destroy();
|
||||
header('location:./?user/login');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
public function changePassword()
|
||||
{
|
||||
$password_now=$this->in['password_now'];
|
||||
$password_new=$this->in['password_new'];
|
||||
if (!$password_now && !$password_new)show_json($this->L['password_not_null'],false);
|
||||
if ($this->user['password']==md5($password_now)){
|
||||
$sql=new fileCache($this->config['system_file']['member']);
|
||||
$this->user['password'] = md5($password_new);
|
||||
$sql->update($this->user['name'],$this->user);
|
||||
setcookie('kod_token',md5(md5($password_new)),time()+3600*24*365);
|
||||
show_json('success');
|
||||
}else {
|
||||
show_json($this->L['old_password_error'],false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限验证;统一入口检验
|
||||
*/
|
||||
public function authCheck(){
|
||||
if ($GLOBALS['is_root']) return;
|
||||
if(ACT == 'loginSubmit' || ACT=='checkCode') return;
|
||||
if (!array_key_exists(ST,$this->config['role_setting']) ){
|
||||
return;
|
||||
}else{
|
||||
if (!in_array(ACT,$this->config['role_setting'][ST])){
|
||||
return;
|
||||
}else{
|
||||
//有权限限制的函数
|
||||
$key = ST.':'.ACT;
|
||||
$group = new fileCache($this->config['system_file']['group']);
|
||||
$GLOBALS['auth'] = $auth = $group->get($this->user['role']);
|
||||
if ($auth[$key] !== 1) {
|
||||
show_json($this->L['no_permission'],false);
|
||||
}
|
||||
//扩展名限制:新建文件&上传文件&重命名文件&保存文件&zip解压文件
|
||||
$check_arr = array(
|
||||
'mkfile' => $this->in['path'],
|
||||
'pathRname' => $this->in['rname_to'],
|
||||
'fileUpload'=> $_FILES['file']['name'],
|
||||
'fileSave' => $this->in['path'],
|
||||
);
|
||||
|
||||
if (array_key_exists(ACT,$check_arr)){
|
||||
$ext = get_path_ext($check_arr[ACT]);
|
||||
$ext_arr = explode('|',$auth['ext_not_allow']);
|
||||
if (in_array($ext,$ext_arr)){
|
||||
show_json($this->L['no_permission_ext'],false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
public function checkCode() {
|
||||
session_start();//re start
|
||||
header("Content-type: image/png");
|
||||
$fontsize = 18;$len = 4;
|
||||
$width = 70;$height=27;
|
||||
$im = @imagecreatetruecolor($width, $height) or die("create image error!");
|
||||
$background_color = imagecolorallocate($im, 255, 255, 255);
|
||||
imagefill($im, 0, 0, $background_color);
|
||||
for ($i = 0; $i < 2000; $i++) {//获取随机淡色
|
||||
$line_color = imagecolorallocate($im, mt_rand(180,255),mt_rand(160, 255),mt_rand(100, 255));
|
||||
imageline($im,mt_rand(0,$width),mt_rand(0,$height), //画直线
|
||||
mt_rand(0,$width), mt_rand(0,$height),$line_color);
|
||||
imagearc($im,mt_rand(0,$width),mt_rand(0,$height), //画弧线
|
||||
mt_rand(0,$width), mt_rand(0,$height), $height, $width,$line_color);
|
||||
}
|
||||
$border_color = imagecolorallocate($im, 160, 160, 160);
|
||||
imagerectangle($im, 0, 0, $width-1, $height-1, $border_color);//画矩形,边框颜色200,200,200
|
||||
|
||||
$str = "ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789";
|
||||
$code = '';
|
||||
for ($i = 0; $i < $len; $i++) {//写入随机字串
|
||||
$current = $str[mt_rand(0, strlen($str)-1)];
|
||||
$text_color = imagecolorallocate($im,mt_rand(30, 140),mt_rand(30,140),mt_rand(30,140));
|
||||
imagechar($im,10,$i*$fontsize+6,rand(1,$height/3),$current,$text_color);
|
||||
$code.= $current;
|
||||
}
|
||||
imagepng($im);//显示图
|
||||
imagedestroy($im);//销毁图片
|
||||
$_SESSION['check_code'] = strtolower($code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户app初始化
|
||||
*/
|
||||
private function init_app($user) {
|
||||
$sql=new fileCache($this->config['system_file']['apps']);
|
||||
$list = $sql->get();
|
||||
$desktop = USER_PATH.$user['name'].'/home/desktop/';
|
||||
foreach ($list as $key => $data) {
|
||||
$path = iconv_system($desktop.$key.'.oexe');
|
||||
unset($data['name']);
|
||||
unset($data['desc']);
|
||||
unset($data['group']);
|
||||
file_put_contents($path, json_encode($data));
|
||||
}
|
||||
$user['status'] = 1;
|
||||
$member = new fileCache($this->config['system_file']['member']);
|
||||
$member->update($user['name'],$user);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
//处理成标准目录
|
||||
function _DIR_CLEAR($path){
|
||||
$path = str_replace('\\','/',trim($path));
|
||||
if (strstr($path,'../')) {//preg耗性能
|
||||
$path = preg_replace('/\.+\/+/', '/', $path);
|
||||
$path = preg_replace('/\/+/', '/', $path);
|
||||
}
|
||||
return str_replace('//','/',$path);
|
||||
}
|
||||
|
||||
//处理成用户目录,并且不允许相对目录的请求操作
|
||||
function _DIR($path,$pre_path=HOME){
|
||||
$path = _DIR_CLEAR(rawurldecode($path));
|
||||
$path = iconv_system($path);
|
||||
if (is_dir($path)) $path.='/';
|
||||
return $pre_path.$path;
|
||||
}
|
||||
|
||||
//处理成用户目录,并且不允许相对目录的请求操作
|
||||
function _DIR_OUT(&$arr,$pre_path=HOME){
|
||||
if ($GLOBALS['is_root']) return;
|
||||
if (is_array($arr)) {
|
||||
foreach ($arr['filelist'] as $key => $value) {
|
||||
$arr['filelist'][$key]['path'] = '/'.str_replace(HOME, '', $value['path']);
|
||||
}
|
||||
foreach ($arr['folderlist'] as $key => $value) {
|
||||
$arr['folderlist'][$key]['path'] = '/'.str_replace(HOME, '', $value['path']);
|
||||
}
|
||||
}else{
|
||||
$arr = str_replace(HOME, '',$arr);
|
||||
}
|
||||
}
|
||||
|
||||
//处理成url连接;返回是否是在web路径下
|
||||
function _URL($path,$pre_path=HOME){
|
||||
$path = _DIR_CLEAR(rawurldecode($path));
|
||||
$path = $pre_path.$path;
|
||||
$path = iconv_system($path);
|
||||
if (substr($path,0,strlen(WEB_ROOT)) == WEB_ROOT) {
|
||||
return array(true,HOST.str_replace(WEB_ROOT, '', $path));
|
||||
}else{
|
||||
return array(false,$pre_path.$path);
|
||||
}
|
||||
}
|
||||
|
||||
//语言包加载:优先级:cookie获取>自动识别
|
||||
//首次没有cookie则自动识别——存入cookie,过期时间无限
|
||||
function init_lang(){
|
||||
$lang = $_COOKIE['kod_user_language'];
|
||||
if (strlen($lang)<=0) {//没有cookie
|
||||
preg_match('/^([a-z\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);
|
||||
$lang = $matches[1];
|
||||
switch (substr($lang,0,2)) {
|
||||
case 'zh':
|
||||
if ($lang != 'zn-TW'){
|
||||
$lang = 'zh-CN';
|
||||
}
|
||||
break;
|
||||
case 'en':$lang = 'en';break;
|
||||
default:$lang = 'en';break;
|
||||
}
|
||||
$lang = str_replace('-', '_',$lang);
|
||||
setcookie('kod_user_language',$lang, time()+3600*24*365);
|
||||
}
|
||||
|
||||
$GLOBALS['language'] = $lang;
|
||||
define('LANGUAGE_TYPE', $lang);
|
||||
include(LANGUAGE_PATH.$lang.'/main.php');
|
||||
$GLOBALS['L'] = $L;
|
||||
$GLOBALS['lang'] = $L;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"idle_fingers","wall":"4","musictheme":"mp3player","movietheme":"webplayer"}
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>{"0.000":{"name":"0.000","path":"D:\/wwwroot\/0.000\/"},"config":{"name":"config","path":"D:\/wwwroot\/tools\/eXtplorer\/config"},"kod":{"name":"kod","path":"D:\/wwwroot\/www\/kod"}}
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>{"list_type":"icon","list_sort_field":"mtime","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"1","musictheme":"kuwo","movietheme":"webplayer"}
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>[]
|
|
@ -0,0 +1,24 @@
|
|||
Copyright (C) 2013 Matt Pass
|
||||
Website: mattpass.com
|
||||
Email: matt@mattpass.com
|
||||
Twitter: @mattpass
|
||||
|
||||
#ICErepo License
|
||||
##Standard Open Source Initiative MIT License
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1 @@
|
|||
<?php exit;?>{"list_type":"icon","list_sort_field":"mtime","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"1","musictheme":"kuwo","movietheme":"webplayer"}
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>[]
|
|
@ -0,0 +1,34 @@
|
|||
<div class="box">
|
||||
<div class="title"><span> What's KODExplorer ?</span></div>
|
||||
<p>KODExplorer is an open-source explorer and code editor based on web browser. It provides a kind of classic UI like Windows, file management, file preview, edit, upload and download, File compression and decompression, music playback you can do that’ll on line. You can develop in the web browser side, the source file preview, and deploy the website directly, just like local operation as convenient, fast and safe experience.</p>
|
||||
<p><b>——Design concept——</b></p>
|
||||
<p>Inherit the classic traditions & strive for the innovation. To provide users with convenient, safe and easy to use online cloud management system.</p>
|
||||
<p>Whenever, Wherever, Web browser, Want (if you want to do it), KODExplorer is your best choice.</p>
|
||||
<p><b>——Users——</b></p>
|
||||
<p>KODExplorer is a good solution for personal cloud system, SME resource management on line, Network-attached storage, Small and medium-sized Website management and so on.</p>
|
||||
<p>If you are a Website programmer, you can do anything online, for example edit the source code file, compressed backup, deploy website… It will keep you away linux terminal command.</p>
|
||||
<p>If you are a regular user, only need to install the KODExplorer on your server, you can listen to music, watch movies, upload (download) file to (from) your server.</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>Features</span></div>
|
||||
<p>Comprehensive document management, powerful online file.</p>
|
||||
<p>Managing file wherever you go, coding online, listening music online at the same time, do it like in local system.</p>
|
||||
<p>Just like the experience in the classic Windows: right-click, drag-and-drop, shortcuts and find file…</p>
|
||||
<p>Select by dragging mouse pointer, move or upload with drag-and-drop, online editor, video player, pack and unpack files Comprehensive.</p>
|
||||
<p>Seamless integration of all parts; in the form of dialog box, multi-task manager and other functions.</p>
|
||||
<p>Online editor supports multiple label and more style such as Zen Coding, html,css,js…Higher coding efficiency!</p>
|
||||
<p>Perfect Chinese language support, no messy codes</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>Open source technology</span></div>
|
||||
<p><b>1.Jquery:</b>jpuery(plugin:Hotkeys.ztree.contentmenu).js A fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.</p>
|
||||
<p><b>2.ArtDialog:</b> A UI dialog on javascript, which is nice and easy to use for javascript effect. This module migrate artDialog to Drupal and help drupal developer to use artDialog in the projects.</p>
|
||||
<p><b>3.Ztree:</b> A powerful and fast jQuery 'Tree' Plugin for creating Multi-functional Folder Trees with excellent performance and flexible configurations.</p>
|
||||
<p><b>4.codemirror:</b> A versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.</p>
|
||||
<p><b>5.ZenCoding:</b> An editor plugin for high-speed HTML, XML, XSL (or any other structured code format) coding and editing. The core of this plugin is a powerful abbreviation engine which allows you to expand expressions—similar to CSS selectors—into HTML code.</p>
|
||||
<p><b>6.less:</b> A CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.</p>
|
||||
<p><b>7.SWFUpload:</b> A JavaScript Library that wraps the Flash Player's upload function. It brings your uploads to the next level with Multiple File Selection, Upload Progress and Client-side File Size Checking.</p>
|
||||
<p><b>8.CMP4:</b> A very good flash player plug-in, support for streaming media, music video playback tool commonly used. Support for the skin, highly configurable settings. The play list is loading dynamically by XML, MMS streaming media, and support RSTP.</p>
|
||||
</div>
|
|
@ -0,0 +1,65 @@
|
|||
<div class="intro_left">
|
||||
<div class="tips blue">
|
||||
<h1> <span>Feature & functionally rich</span> </h1>
|
||||
<p>code snippet automatically implemented property.</p>
|
||||
<p>Multiple Style: Choose your favorite programming style</p>
|
||||
<p>Custom Fonts: For using under a variety of scenarios</p>
|
||||
<p>Multi-cursor editor, block editing online programming experience comparable to sublime</p>
|
||||
<p>Code folding & unfolding;line wrap.</p>
|
||||
<p>Support for multi-label;Drag to adjust the order.</p>
|
||||
<p>Edit multiple documents simultaneously, find & replace;Anti maintain History.</p>
|
||||
<p>Word completion such as [],{},(),"",''</p>
|
||||
<p>Preview the result of programming online,make you like coding online!</p>
|
||||
<p>Support Zen coding; Higher coding efficiency!</p>
|
||||
<p>More features, waiting for your discovery…</p>
|
||||
</div>
|
||||
<div class="tips orange">
|
||||
<h1> <span>A variety of code highlighting</span> </h1>
|
||||
<p>Web Side:html,JavaScript,css,less,sass,scss</p>
|
||||
<p>Web developing:php,perl,python,ruby,elang,go...</p>
|
||||
<p>Traditional language:java,c,c++,c#,actionScript,VBScript...</p>
|
||||
<p>Others:markdown,shell,sql,lua,xml,yaml...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="intro_right">
|
||||
<div class="tips green">
|
||||
<h1> <span>Shortcuts</span> </h1>
|
||||
<pre>Common Shortcuts:
|
||||
ctrl+s Save
|
||||
ctrl+c Copy ctrl+v Paste
|
||||
ctrl+z Undo ctrl+y Redo
|
||||
ctrl+x Cut ctrl+a Select All
|
||||
ctrl+f Find ctrl+f+f Replace
|
||||
alt+0 Code folding All alt+shift+0 Code unfolding All
|
||||
esc [exit searching, cancel auto-prompts...]</pre>
|
||||
<pre>Select:
|
||||
Mouse select——drag
|
||||
shift+home/end/up/left/down/right
|
||||
shift+PageUp/PageDown Page UP & Down
|
||||
ctrl+shift+ home/end Move the cursor to the beginning/end of line
|
||||
alt+mouse Block selection</pre>
|
||||
<pre> Cursor:
|
||||
home/end/up/left/down/right
|
||||
ctrl+p Jump to matching tag
|
||||
PageUp/PageDown Page UP & Down
|
||||
ctrl+home/end Move the cursor to the beginning/end of line
|
||||
alt+left/right Move the cursor to the beginning of line
|
||||
shift+left/right Move the cursor to the beginning/end of line
|
||||
ctrl+l Jump to the specified line
|
||||
ctrl+alt+up/down Up(Down)adding cursor</pre>
|
||||
<pre>Editing:
|
||||
ctrl+/ Mask & Unmask ctrl+alt+a Justified
|
||||
table tab Alignment shift+table Overall forward a table
|
||||
delete delete ctrl+d delete a line
|
||||
ctrl+delete Delete the word to the right of the line
|
||||
ctrl/shift+backspace Delete the word on the left
|
||||
alt+shift+up/down copy the line & paste up/down of the line
|
||||
alt+delete Delete the contents of the cursor to the right
|
||||
alt+up/down The current line and the up/down line switching
|
||||
ctrl+shift+d And add the following line to copy
|
||||
ctrl+delete Delete the word to the right
|
||||
ctrl+shift+u Converted to lowercase
|
||||
ctrl+u Select the contents to uppercase</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<div class="box">
|
||||
<div class="title"><span>Explorer</span></div>
|
||||
<p><i class="icon-tags"></i>File select: Select objects by single-click, dragging the mouse pointer, shift + click, ctrl + click,or with the keyboard buttons up, down, left, right, home and end.</p>
|
||||
<p><i class="icon-folder-open"></i>Files operation: Do more operations to the selected files such as copy, cut, delete, properties, pack, rename, preview and so on…</p>
|
||||
<p><i class="icon-cloud-upload"></i>Files upload: multi-files upload; HTML5 upload by dragging to the window.</p>
|
||||
<p><i class="icon-cogs"></i>Right-click: right-click function for files, folders, after selecting multiple objects, on the desktop, tree directory, shortcuts right-click menu.<br/>
|
||||
(select all——copy——cut——paste——delete——rename——settings…)</p>
|
||||
<p><i class="icon-sitemap"></i>File browser: view in list, icons; open a subfolder by double-click; address bar edit; back and forward in folder tree.</p>
|
||||
<p><i class="icon-move"></i>Drag-and-drop: Cut the selected objects with drag-and-drop.</p>
|
||||
<p><i class="icon-reply"></i>Shortcuts: delete, ctrl + A, ctrl + C, ctrl + X, up/down/left/right/home/end select icons.</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="title"><span>Preview Online</span></div>
|
||||
<p><i class="icon-edit"></i>Files preview: view, edit and save the text files;Preview of HTML and SWF files.</p>
|
||||
<p><i class="icon-picture"></i>Picture preview: automatically generate thumbnails, play slide show.</p>
|
||||
<p><i class="icon-music"></i>Audio player: streaming music, video files; supporting MP3/4, WMA, MID, AAC, WAV.</p>
|
||||
<p><i class="icon-play"></i>Video player: streaming video files: supporting FLV, F4V, 3gp.</p>
|
||||
<p><i class="icon-play"></i>office:office preview online: supporting doc,docx,ppt,pptx,xls,xlsx.</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="title"><span>Shortcuts</span></div>
|
||||
<p><i class="icon-tags"></i>enter Open</p>
|
||||
<p><i class="icon-tags"></i>ctrl+a Select All</p>
|
||||
<p><i class="icon-tags"></i>ctrl+c Copy</p>
|
||||
<p><i class="icon-tags"></i>ctrl+v Paste</p>
|
||||
<p><i class="icon-tags"></i>ctrl+x Cut</p>
|
||||
<p><i class="icon-tags"></i>ctrl+f Find</p>
|
||||
<p><i class="icon-tags"></i>alt+n New file</p>
|
||||
<p><i class="icon-tags"></i>alt+m New folder</p>
|
||||
<p><i class="icon-tags"></i>delete Delete</p>
|
||||
<p><i class="icon-tags"></i>backspace Back</p>
|
||||
<p><i class="icon-tags"></i>ctrl+backspace Forword</p>
|
||||
<p><i class="icon-tags"></i>f2 Rename</p>
|
||||
<p><i class="icon-tags"></i>home/end/up/down/left/right Select file</p>
|
||||
<p><i class="icon-tags"></i>anykey After you start typing the first characters of your query, it will show any findings.</p>
|
||||
</div>
|
|
@ -0,0 +1,353 @@
|
|||
<?php
|
||||
$L = array(
|
||||
"config" => array(
|
||||
"type" => "en",
|
||||
"name" => "english",
|
||||
"authoer" => "warlee"
|
||||
),
|
||||
|
||||
//login
|
||||
"login" => "login",
|
||||
"guest_login" => "Guest",
|
||||
"username" => "name",
|
||||
"password" => "password",
|
||||
"login_code" => "verification",
|
||||
"login_rember_password" => "remember me",
|
||||
"us" => "千帆网络工作室",
|
||||
"login_not_null" => "username and password cant't empty!",
|
||||
"code_error" => "verification code error",
|
||||
"user_not_exists" => "user not exists!",
|
||||
"password_error" => "password error!",
|
||||
"password_not_null" => "password cant't empty!",
|
||||
"old_password_error" => "old password error!",
|
||||
"permission" => "permission",
|
||||
"no_permission" => "no permission!",
|
||||
"no_permission_ext" => "This type of file without permission",
|
||||
"dialog_min" => "hide",
|
||||
"dialog_min_all" => "hide all",
|
||||
"dialog_display_all" => "display all",
|
||||
"dialog_close_all" => "close all",
|
||||
|
||||
//desc
|
||||
"title" => "kodexplorer-online explorer",
|
||||
"title_name" => "kod online explorer",
|
||||
|
||||
//general
|
||||
"open" => "open",
|
||||
"open_with" => "open with",
|
||||
"others" => "others",
|
||||
"close" => "close",
|
||||
"close_all" => "close all",
|
||||
"close_right" => "close right item",
|
||||
"close_others" => "close others",
|
||||
"loading" => "loading...",
|
||||
"warning" => "warning",
|
||||
"getting" => "data getting...",
|
||||
"sending" => "sending...",
|
||||
"data_error" => "data error! ",
|
||||
"get_success" => "success!",
|
||||
"save_success" => "saved successfully!",
|
||||
"success" => "successful operation",
|
||||
"error" => "operation failed",
|
||||
"error_repeat" => "named already exists!",
|
||||
"system_error" => "system error",
|
||||
"name" => "name",
|
||||
"type" => "type",
|
||||
"contain" => "contains",
|
||||
"address" => "position",
|
||||
"size" => "size",
|
||||
"byte" => "byte",
|
||||
"path" => "path",
|
||||
"action" => "operation",
|
||||
"create_time" => "create time",
|
||||
"modify_time" => "modified",
|
||||
"last_time" => "last visited",
|
||||
"sort_type" => "sort of way",
|
||||
"time_type" => "Y/m/d h:i",
|
||||
"time_type_info" => "F j, Y, g:i a",
|
||||
|
||||
//right
|
||||
"file" => "file",
|
||||
"folder" => "folder",
|
||||
"copy" => "copy",
|
||||
"past" => "paste",
|
||||
"cute" => "cut",
|
||||
"remove" => "delete",
|
||||
"info" => "get info",
|
||||
"list_type" => "view",
|
||||
"list_icon" => "icons",
|
||||
"list_list" => "list",
|
||||
"sort_up" => "asc",
|
||||
"sort_down" => "desc",
|
||||
"order_type" => "sort by",
|
||||
"order_desc" => "desc",
|
||||
"order_asc" => "asc",
|
||||
"rename" => "rename",
|
||||
"add_to_fav" => "add to bookmark",
|
||||
"search_in_path" => "folder",
|
||||
"add_to_play" => "add to playlist",
|
||||
"manage_fav" => "manage bookmark",
|
||||
"refresh_tree" => "reload tree",
|
||||
"manage_folder" => "explorer",
|
||||
"close_menu" => "close menu",
|
||||
"zip" => "zip archive",
|
||||
"unzip" => "unzip the file",
|
||||
"clipboard" => "view the clipboard",
|
||||
"full_screen" => "full screen(toggle)",
|
||||
"tips" => "tips",
|
||||
"ziping" => "archive loading...",
|
||||
"unziping" => "unzip loading...",
|
||||
"moving" => "move file",
|
||||
"remove_title" => "delete confirmation",
|
||||
"remove_not" => "system folder,cannot be deleted",
|
||||
"remove_info" => "confirmation remove the selected?",
|
||||
"name_isexists" => "wrong,the name already exists! ",
|
||||
|
||||
"install" => 'install',
|
||||
"width" => 'width',
|
||||
"height" => 'height',
|
||||
"app" => 'app',
|
||||
"app_store" => 'app store',
|
||||
"app_create" => 'create app',
|
||||
"app_edit" => 'edit app',
|
||||
"app_group_all" => 'all',
|
||||
"app_group_game" => 'game',
|
||||
"app_group_tools" => 'tools',
|
||||
"app_group_reader" => 'read',
|
||||
"app_group_movie" => 'movie',
|
||||
"app_group_music" => 'music',
|
||||
"app_group_life" => 'life',
|
||||
"app_group_others" => 'others',
|
||||
|
||||
"app_desc" => 'description',
|
||||
"app_icon" => 'logo',
|
||||
"app_icon_show" => 'image url or such:',
|
||||
"app_group" => 'group',
|
||||
"app_type" => 'type',
|
||||
"app_type_url" => 'link frame',
|
||||
"app_type_code" => 'widget',
|
||||
"app_display" => 'display',
|
||||
"app_display_border" => 'no border(if selected)',
|
||||
"app_display_size" => 'can resize(if selected)',
|
||||
"app_size" => 'size',
|
||||
"app_url" => 'url address',
|
||||
"app_code" => 'js code',
|
||||
|
||||
|
||||
//file management
|
||||
"edit" => "edit",
|
||||
"edit_can_not" => "is not a text file",
|
||||
"edit_too_big" => "Cannot be greater than 20M",
|
||||
"open_default" => "default mode",
|
||||
"open_ie" => "browser opens",
|
||||
"refresh" => "reload",
|
||||
"refresh_all" => "reload forced",
|
||||
"newfile" => "new file",
|
||||
"newfolder" => "new folder",
|
||||
"newothers" => "new other",
|
||||
"path_loading" => "loading...",
|
||||
"go" => "go!",
|
||||
"go_up" => "go to parent directory",
|
||||
"history_next" => "forward",
|
||||
"history_back" => "back",
|
||||
"address_in_edit" => "Click to enter the edit",
|
||||
"double_click_rename" => "double click the title rename",
|
||||
"double_click_open" => "double click to open",
|
||||
"path_null" => "this folder is empty,you can drag and drop files to upload the window. ",
|
||||
|
||||
//download / upload
|
||||
"upload" => "upload",
|
||||
"upload_ready" => "loading...",
|
||||
"uploading" => "uploading...",
|
||||
"upload_success" => "uploaded successfully",
|
||||
"upload_path_current" => "current",
|
||||
"upload_select" => "select",
|
||||
"upload_max_size" => "upload max size",
|
||||
"upload_size_info" => "Please amend the maximum value allowed upload in php.ini. Greater than the configuration will be automatically filtered.",
|
||||
"upload_error" => "upload failed",
|
||||
"upload_muti" => "multiple file upload",
|
||||
"upload_drag" => "drag and drop upload",
|
||||
"upload_drag_tips" => "release can be uploaded!",
|
||||
"path_not_allow" => "file name not allowed",
|
||||
"download" => "download",
|
||||
"download_address" => "url ",
|
||||
"download_ready" => "download start",
|
||||
"download_success" => "download success! ",
|
||||
"download_error_create" => "download failed! create a new file or write error. ",
|
||||
"download_error_exists" => "download failed! remote file does not exist or failed to open.",
|
||||
"upload_error_null" => "no files!",
|
||||
"upload_error_big" => "file size too big",
|
||||
"upload_error_move" => "move file failed! ",
|
||||
"upload_error_exists" => "file already exists",
|
||||
"upload_local" => "local upload",
|
||||
"download_from_server" => "remote download",
|
||||
"save_path" => "save path",
|
||||
"upload_select_muti" => "select multiple files upload",
|
||||
|
||||
//search
|
||||
"search" => "search",
|
||||
"searching" => "searching...",
|
||||
"search_null" => "no search results!",
|
||||
"search_uplow" => "ignore case",
|
||||
"search_content" => "file contents ",
|
||||
"search_info" => "please enter a search term and path search! ",
|
||||
"search_ext_tips" => "separated by |;such as php|js|css<br/>if null search in default text file",
|
||||
"file_type" => "file type",
|
||||
"goto" => "jump to",
|
||||
"contain" => "contains",
|
||||
"server_dwonload_desc" => "task is added to the download list",
|
||||
"parent_permission" => "parent permission",
|
||||
|
||||
"root_path" => "root directory",
|
||||
"lib" => "library",
|
||||
"fav" => "bookmark",
|
||||
"desktop" => "desktop",
|
||||
"browser" => "browser",
|
||||
"my_cumputer" => "my computer",
|
||||
"recycle" => "recycle",
|
||||
"my_document" => "my documents",
|
||||
"my_picture" => "my photos",
|
||||
"my_music" => "my music",
|
||||
"my_movie" => "my video",
|
||||
"my_download" => "my download",
|
||||
|
||||
"ui_desktop" => "desktop",
|
||||
"ui_filemanage" => "explorer",
|
||||
"ui_editor" => "editor",
|
||||
"adminer" => "adminer",
|
||||
"ui_project_home" => "project home",
|
||||
"ui_login" => "login",
|
||||
"ui_logout" => "logout",
|
||||
|
||||
//set up
|
||||
"setting" => "setting",
|
||||
"setting_title" => "option",
|
||||
"setting_user" => "basic",
|
||||
"setting_password" => "change password",
|
||||
"setting_password_old" => "old password",
|
||||
"setting_password_new" => "new password",
|
||||
"setting_language" => "Language",
|
||||
"setting_member" => "member",
|
||||
"setting_group" => "group",
|
||||
"setting_group_add" => "add user group",
|
||||
"setting_group_edit" => "edit user group",
|
||||
"setting_theme" => "theme",
|
||||
"setting_wall" => "wallpaper",
|
||||
"setting_wall_diy" => "custom wallpaper:",
|
||||
"setting_wall_info" => "url address,the local images can right picture browser open to get",
|
||||
"setting_fav" => "bookmark",
|
||||
"setting_player" => "player",
|
||||
"setting_player_music" => "music player settings",
|
||||
"setting_player_movie" => "video player settings",
|
||||
"setting_help" => "help",
|
||||
"setting_about" => "about",
|
||||
"setting_success" => "setting successfully.",
|
||||
"can_not_repeat" => "name already exists!",
|
||||
"absolute_path" => "absolute address",
|
||||
|
||||
//setting page
|
||||
"group" => "user group",
|
||||
"data_not_full" => "data submission incomplete! ",
|
||||
"default_user_can_not_do" => "default user cannot operate",
|
||||
"default_group_can_not_do" => "default user groups cannot operate",
|
||||
"username_can_not_null" => "user name cannot be empty! ",
|
||||
"groupname_can_not_null" => "group name cannot be empty! ",
|
||||
"groupdesc_can_not_null" => "user group description cannot be empty! ",
|
||||
"group_move_user_error" => "belong to groups of users move failed",
|
||||
"group_already_remove" => "the user group is deleted",
|
||||
"group_not_exists" => "the user group does not exist",
|
||||
"member_add" => "add user",
|
||||
"password_null_not_update" => "empty representative doesn't modify the password",
|
||||
"if_save_file" => "file has not been saved",
|
||||
"if_remove" => "to confirm the deletion",
|
||||
"member_remove_tips" => "delete the user directory will be empty",
|
||||
"group_remove_tips" => "delete the user group<br/> (need to set user group)",
|
||||
"group_name" => "group name",
|
||||
"group_name_tips" => "Not allowed to repeat",
|
||||
"group_desc" => "group desc",
|
||||
"group_desc_tips" => "group display",
|
||||
"group_role_ext" => "extension permission",
|
||||
"group_role_ext_tips" => "separated by |;such as php|js|css",
|
||||
"group_role_file" => "file explorer",
|
||||
"group_role_upload" => "upload&download",
|
||||
"group_role_user" => "user data",
|
||||
"group_role_group" => "group",
|
||||
"group_role_member" => "member",
|
||||
"group_role_mkfile" => "make file",
|
||||
"group_role_mkdir" => "make dir",
|
||||
"group_role_pathrname" => "path rename",
|
||||
"group_role_pathdelete" => "path remove",
|
||||
"group_role_pathinfo" => "path get info",
|
||||
"group_role_pathmove" => "move(copy/cute/past/drag to)",
|
||||
"group_role_zip" => "zip",
|
||||
"group_role_unzip" => "unzip",
|
||||
"group_role_search" => "search",
|
||||
"group_role_filesave" => "edit and save",
|
||||
"group_role_can_upload" => "upload",
|
||||
"group_role_upload" => "upload",
|
||||
"group_role_download" => "server download",
|
||||
"group_role_passowrd" => "change password",
|
||||
"group_role_config" => "save user config to server",
|
||||
"group_role_fav" => "favourite(add/edit/delete)",
|
||||
"group_role_list" => "list",
|
||||
"group_role_member_add" => "member add",
|
||||
"group_role_member_edit" => "member edit",
|
||||
"group_role_member_del" => "member remove",
|
||||
"group_role_group_add" => "group add",
|
||||
"group_role_group_edit" => "group edit",
|
||||
"group_role_group_del" => "group remove",
|
||||
"group_role_ext_warning" => "Not allowed to specify the type of file upload,<br/> rename (renamed the specified extension), <br/>edit,save, remote download,unzip",
|
||||
"group_tips"=>"<li>1.group name can not be repeated, modify group name belongs to the reorganization of the user is automatically associated </li><li>2. extension restriction relation system safety, please be careful operation <i> (fruit in the web directory of new PHP; means reform program permissions for this user name) </i></li><li>3. user management, privilege management; access and to the authority is bound; the program will automatically associated </li><li>4. set permissions can add permissions set, subsequent permission is not inherited <i> (this permission is equivalent to the highest authority) </i></li>",
|
||||
|
||||
//explorer_ajax
|
||||
"not_null" => "required cannot be empty!",
|
||||
"picture_can_not_null" => "picture address can not be empty!",
|
||||
"rname_success" => "rename success! ",
|
||||
"please_inpute_search_words" => "keypress 'enter' to search",
|
||||
"remove_success" => "deleted successfully! ",
|
||||
"remove_fali" => "delete failed!",
|
||||
"clipboard_null" => "clipboard is empty! ",
|
||||
"create_success" => "create successful! ",
|
||||
"create_error" => "create failed,please check the directory permissions! ",
|
||||
"copy_success" => "[copy]covering the clipboard copy success!",
|
||||
"cute_success" => "[cut]covering the clipboard success!",
|
||||
"clipboard_state" => "clipboard state:",
|
||||
"no_permission_write" => "can't write,check the path or permission",
|
||||
"copy_not_exists" => "source does not exist",
|
||||
"current_has_parent" => "the destination folder is a subfolder of the source folder!",
|
||||
"past_success" => "<b> paste operation to complete the </b>",
|
||||
"cute_past_success" => "<b>cute</b> (cut complete,the clipboard is empty)",
|
||||
"zip_success" => "compressed",
|
||||
"not_zip" => "not compressed file",
|
||||
"zip_null" => "did not choose the file or directory",
|
||||
"unzip_success" => "unzip",
|
||||
"gotoline" => "jump to line",
|
||||
"path_is_current" => "open path and the path!",
|
||||
"path_exists" => "name already exists! ",
|
||||
|
||||
// editor
|
||||
"undo" => "undo",
|
||||
"redo" => "redo",
|
||||
"preview" => "preview",
|
||||
"wordwrap" => "wrapping",
|
||||
"char_all_display" => "show & invisible character",
|
||||
"auto_complete" => "auto complete or not",
|
||||
"code_theme" => "code theme",
|
||||
"font_size" => "font",
|
||||
|
||||
//button
|
||||
"button_ok" => "ok",
|
||||
"button_submit" => "submit",
|
||||
"button_set" => "set",
|
||||
"button_cancle" => "cancel",
|
||||
"button_edit" => "edit",
|
||||
"button_save" => "save",
|
||||
"button_save_all" => "save all",
|
||||
"button_not_save" => "don't save",
|
||||
"button_add" => "add",
|
||||
"button_back_add" => "add and back",
|
||||
"button_del" => "delete",
|
||||
"button_save_edit" => "save",
|
||||
"button_save_submit" => "save and send",
|
||||
"button_select_all" => "Select / unselect all"
|
||||
);
|
|
@ -0,0 +1,33 @@
|
|||
<div class="box">
|
||||
<div class="title"><span>是什么?</span></div>
|
||||
<p>KODExplorer是一个公开源码的基于Web的在线文件管理、代码编辑器。它提供了类windows经典用户界面,一整套在线文件管理、文件预览、编辑、上传下载、在线解压缩、音乐播放功能。让你直接在浏览器端实现web开发、源码文件预览、网站部署的同时拥有与本地操作一样方便、快捷、安全的体验。</p>
|
||||
<p><b>——设计理念——</b></p>
|
||||
<p>传承经典,追求创新,为用户提供方便快捷、安全易用的在线云管理系统。</p>
|
||||
<p>无论何时(when)、何地(where),拥有web只要你想(want)它就是你的管理利器(4W策略)。</p>
|
||||
<p><b>——面向用户——</b></p>
|
||||
<p>目前KODExplorer系统管理主要定位在个人云主机、中小企业云资源管理、网盘管理、中小型网站管理等。Web开发者&站长(老鸟):在线编辑、压缩备份、部署,经典windows界面操作,上手容易,远离了主机的SSH、ftp复杂枯燥的命令操作。</p>
|
||||
<p>个人私有云(菜鸟):管理网盘资源,同样经典windows界面操作,可以就地浏览网盘音乐、视屏文件,上传下载快捷方便。</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>特色</span></div>
|
||||
<p>完备的文件管理,强大的在线文件编辑器</p>
|
||||
<p>无论您在哪里,都可以管理您的文件;并可以在线娱乐,在线写代码!就像适宜用操作系统那样。</p>
|
||||
<p>丰富的本地体验移植,右键操作,拖拽,框中选择,快捷键,文件搜索(内容中搜索)……</p>
|
||||
<p>框中选择,拖拽移动,拖拽上传,在线编辑器,影音播放器,解压缩。全面ajax保证性能和体验!</p>
|
||||
<p>各个功能直接无缝连接;以对话框形式存在,多任务管理等功能</p>
|
||||
<p>编辑器支持多文档;支持ZendCoding html,css,js代码编写效率更高!</p>
|
||||
<p>完美中文支持,各种情况下乱码解决;</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>开源技术采用</span></div>
|
||||
<p><b>1.Jquery:</b>jpuery(plugin:Hotkeys.ztree.contentmenu).js主流开发框架。对Dom操作、BOM操作、css操作,以及Ajax封装</p>
|
||||
<p><b>2.ArtDialog:</b>一个设计优美,对浏览器兼容性极强的对话框插件。使弹出窗口处理,事件以及数据的传输得到了更好的统一管理方式</p>
|
||||
<p><b>3.Ztree:</b>列表树控件,扩展性很强的树形数据操作插件</p>
|
||||
<p><b>4.codemirror:</b>一个代码编辑js插件,支持各种编程语言的高亮处理</p>
|
||||
<p><b>5.zendcoding:</b>一个支持html代码快速编写插件。定义方式简化代码编写。有简单编译功能</p>
|
||||
<p><b>6.less:</b>一种高效的,函数式css开发模式,提高前端css样式表的可复用性。有简单编译功能</p>
|
||||
<p><b>7.SWFUpload:</b>flash多文件上传</p>
|
||||
<p><b>8.CMP4:</b>一个非常优秀的flash媒体文件播放插件,支持流媒体,常用音乐视频的播放工具。支持换皮肤,高可配置性的设置。列表xml的动态加载。mms流媒体,rstp开源协议媒体播放支持</p>
|
||||
</div>
|
|
@ -0,0 +1,64 @@
|
|||
<div class="intro_left">
|
||||
<div class="tips blue">
|
||||
<h1> <span>丰富的功能</span> </h1>
|
||||
<p>代码自动提示</p>
|
||||
<p>多主题:选择你喜欢的编程风格</p>
|
||||
<p>自定义字体:适合种场景下使用</p>
|
||||
<p>多光标编辑,块编辑等媲美sublime的在线编程体验</p>
|
||||
<p>代码块折叠、展开;自动换行</p>
|
||||
<p>支持多标签,拖动切换顺序;</p>
|
||||
<p>维持多个文档、查找替换;历史记录;</p>
|
||||
<p>自动补全[],{},(),"",''</p>
|
||||
<p>在线实时预览,使您爱上在线编程!</p>
|
||||
<p>zendcodeing支持,写代码健步如飞</p>
|
||||
<p>更多功能,等待你的发现……</p>
|
||||
</div>
|
||||
<div class="tips orange">
|
||||
<h1> <span>多种代码高亮</span> </h1>
|
||||
<p>前端:html,JavaScript,css,less,sass,scss</p>
|
||||
<p>web开发:php,perl,python,ruby,elang,go...</p>
|
||||
<p>传统语言:java,c,c++,c#,actionScript,VBScript...</p>
|
||||
<p>其他:markdown,shell,sql,lua,xml,yaml...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="intro_right">
|
||||
<div class="tips green">
|
||||
<h1> <span>快捷键操作</span> </h1>
|
||||
<pre>常用快捷键:
|
||||
ctrl+s 保存
|
||||
ctrl+a 全选 ctrl+x 剪切
|
||||
ctrl+c 复制 ctrl+v 粘贴
|
||||
ctrl+z 撤销 ctrl+y 反撤销
|
||||
ctrl+f 查找 ctrl+f+f 替换
|
||||
alt+0 折叠所有 alt+shift+0 展开所有
|
||||
esc [退出搜索,取消自动提示...]</pre>
|
||||
<pre>选择:
|
||||
鼠标框选——拖动
|
||||
shift+home/end/up/left/down/right
|
||||
shift+pageUp/PageDown 上下翻页选中
|
||||
ctrl+shift+ home/end 当前光标到头尾
|
||||
alt+鼠标拖动 块选择</pre>
|
||||
<pre> 光标移动:
|
||||
home/end/up/left/down/right
|
||||
ctrl+home/end 光标移动到文档首/尾
|
||||
ctrl+p 跳转到匹配的标签
|
||||
pageUp/PageDown 光标上下翻页
|
||||
alt+left/right 光标移动到行首位
|
||||
shift+left/right 光标移动到行首&尾
|
||||
ctrl+l 跳转到指定行
|
||||
ctrl+alt+up/down 上(下)增加光标</pre>
|
||||
<pre>编辑:
|
||||
ctrl+/ 注释&取消注释 ctrl+alt+a 左右对齐
|
||||
table tab对齐 shift+table 整体前移table
|
||||
delete 删除 ctrl+d 删除整行
|
||||
ctrl+delete 删除该行右侧单词
|
||||
ctrl/shift+backspace 删除左侧单词
|
||||
alt+shift+up/down 复制行并添加到上(下面)面
|
||||
alt+delete 删除光标右侧内容
|
||||
alt+up/down 当前行和上一行(下一行交换)
|
||||
ctrl+shift+d 复制行并添加到下面
|
||||
ctrl+delete 删除右侧单词
|
||||
ctrl+shift+u 转换成小写 ctrl+u 选中内容转换成大写</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<div class="box">
|
||||
<div class="title"><span>文件管理</span></div>
|
||||
<p><i class="icon-tags"></i>文件选择:单选,鼠标框选,shift连选,ctrl随意选择,键盘上下左右、home、end选择。</p>
|
||||
<p><i class="icon-folder-open"></i>文件操作:选择文件后,可以进行复制,剪切,删除,属性查看,压缩,重命名,打开预览等操作……</p>
|
||||
<p><i class="icon-cloud-upload"></i>文件上传:多文件批量上传;html5拖拽上传(拖拽到窗口实现无缝上传,支持文件夹拖拽)</p>
|
||||
<p><i class="icon-cogs"></i>右键功能:文件右键,文件夹右键,多选后右键操作,桌面右键,树目录右键操作,右键菜单绑定快捷键<br/>
|
||||
(全选——复制——剪切——粘贴——删除——重命名,设置……)</p>
|
||||
<p><i class="icon-sitemap"></i>文件浏览:列表模式,图标模式;双击进入子文件夹;地址栏操作;打开文件夹记录逆势操作记录(前进后退)</p>
|
||||
<p><i class="icon-move"></i>支持拖拽操作:选中后拖拽,实现剪切到指定文件夹功能</p>
|
||||
<p><i class="icon-reply"></i>快捷键操作:delete删除,ctrl+A全选,ctrl+C复制,ctrl+X剪切,文件搜索(内容中搜索)</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="title"><span>文件预览</span></div>
|
||||
<p><i class="icon-edit"></i>文件预览:文本文件内容查看编辑保存;html,swf文件预览,</p>
|
||||
<p><i class="icon-picture"></i>图片预览:自动生成缩略图,图片幻灯片播放;</p>
|
||||
<p><i class="icon-music"></i>音频播放:在线播放音乐,视频文件;支持mp3,wma,mid,aac,wav;mp4,</p>
|
||||
<p><i class="icon-play"></i>视频播放:在线视频文件播放,支持格式:flv,f4v,3gp</p>
|
||||
<p><i class="icon-play"></i>office:office在线预览,支持格式:doc,docx,ppt,pptx,xls,xlsx</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="title"><span>快捷键</span></div>
|
||||
<p><i class="icon-tags"></i>enter 打开</p>
|
||||
<p><i class="icon-tags"></i>ctrl+a 全选</p>
|
||||
<p><i class="icon-tags"></i>ctrl+c 复制选中</p>
|
||||
<p><i class="icon-tags"></i>ctrl+v 粘贴</p>
|
||||
<p><i class="icon-tags"></i>ctrl+x 剪切</p>
|
||||
<p><i class="icon-tags"></i>ctrl+f 当前目录进行搜索</p>
|
||||
<p><i class="icon-tags"></i>alt+n 新建文件</p>
|
||||
<p><i class="icon-tags"></i>alt+m 新建文件夹</p>
|
||||
<p><i class="icon-tags"></i>delete 删除选中</p>
|
||||
<p><i class="icon-tags"></i>backspace 后退</p>
|
||||
<p><i class="icon-tags"></i>ctrl+backspace 前进</p>
|
||||
<p><i class="icon-tags"></i>f2 重命名选中(文件文件夹)</p>
|
||||
<p><i class="icon-tags"></i>home/end/up/down/left/right 选择文件</p>
|
||||
<p><i class="icon-tags"></i>anykey 选中以按下字符首字母的文件&文件夹 自动循环选中</p>
|
||||
</div>
|
|
@ -0,0 +1,358 @@
|
|||
<?php
|
||||
|
||||
$L= array(
|
||||
"config" => array(
|
||||
"type" => "zh_CN",
|
||||
"name" => "简体中文",
|
||||
"authoer" => "warlee"
|
||||
),
|
||||
|
||||
//login
|
||||
"login" => "登陆",
|
||||
"guest_login" => "游客登录",
|
||||
"username" => "用户名",
|
||||
"password" => "密码",
|
||||
"login_code" => "验证码",
|
||||
"login_rember_password" => "记住密码",
|
||||
"us" => "千帆网络工作室",
|
||||
"login_not_null" => "用户名密码不能为空!",
|
||||
"code_error" => "验证码错误",
|
||||
"user_not_exists" => "用户名不存在!",
|
||||
"password_error" => "密码错误!",
|
||||
"password_not_null" => "密码不能为空!",
|
||||
"old_password_error" => "原密码错误!",
|
||||
"permission" => "权限!",
|
||||
"no_permission" => "没有权限!",
|
||||
"no_permission_ext" => "该类型文件没有权限",
|
||||
"dialog_min" => "最小化",
|
||||
"dialog_min_all" => "最小化所有",
|
||||
"dialog_display_all" => "显示所有窗口",
|
||||
"dialog_close_all" => "关闭所有窗口",
|
||||
|
||||
//网站描述
|
||||
"title" => "KODExplorer-芒果云•资源管理器",
|
||||
"title_name" => "芒果云•资源管理器",
|
||||
|
||||
//通用
|
||||
"open" => "打开",
|
||||
"others" => "其他",
|
||||
"open_with" => "打开方式",
|
||||
"close" => "关闭",
|
||||
"close_all" => "关闭全部",
|
||||
"close_right" => "关闭右侧标签",
|
||||
"close_others" => "关闭其他",
|
||||
"loading" => "操作中...",
|
||||
"warning" => "警告",
|
||||
"getting" => "获取中...",
|
||||
"sending" => "数据发送中...",
|
||||
"data_error" => "数据出错!",
|
||||
"get_success" => "获取成功!",
|
||||
"save_success" => "保存成功!",
|
||||
"success" => "操作成功",
|
||||
"error" => "操作失败",
|
||||
"error_repeat" => "'操作失败,请注意名称不能重复!'",
|
||||
"system_error" => "系统错误",
|
||||
"name" => "名称",
|
||||
"type" => "类型",
|
||||
"contain" => "包含",
|
||||
"address" => "位置",
|
||||
"size" => "大小",
|
||||
"byte" => "字节",
|
||||
"path" => "路径",
|
||||
"action" => "操作",
|
||||
"create_time" => "创建时间",
|
||||
"modify_time" => "修改时间",
|
||||
"last_time" => "最后访问",
|
||||
"sort_type" => "排序方式",
|
||||
"time_type" => "Y/m/d H:i",
|
||||
"time_type_info" => "Y年m月d日 H:i:s",
|
||||
|
||||
//右键
|
||||
"file" => "文件",
|
||||
"folder" => "文件夹",
|
||||
"copy" => "复制",
|
||||
"past" => "粘贴",
|
||||
"cute" => "剪切",
|
||||
"remove" => "删除",
|
||||
"info" => "属性",
|
||||
"list_type" => "查看",
|
||||
"list_icon" => "图标排列",
|
||||
"list_list" => "列表排列",
|
||||
"sort_up" => "递增",
|
||||
"sort_down" => "递减",
|
||||
"order_type" => "排序方式",
|
||||
"order_desc" => "降序",
|
||||
"order_asc" => "升序",
|
||||
"rename" => "重命名",
|
||||
"add_to_fav" => "添加到收藏夹",
|
||||
"search_in_path" => "文件夹中搜索",
|
||||
"add_to_play" => "添加到播放列表",
|
||||
"manage_fav" => "管理收藏夹",
|
||||
"refresh_tree" => "刷新树目录",
|
||||
"manage_folder" => "管理目录",
|
||||
"close_menu" => "关闭菜单",
|
||||
"zip" => "zip压缩",
|
||||
"unzip" => "zip解压到当前",
|
||||
"clipboard" => "查看剪贴板",
|
||||
"full_screen" => "全屏/退出全屏",
|
||||
|
||||
"tips" => "提示",
|
||||
"ziping" => "正在压缩...",
|
||||
"unziping" => "正在解压...",
|
||||
"moving" => "移动操作中...",
|
||||
"remove_title" => "删除确认",
|
||||
"remove_not" => "系统文件夹,不能删除",
|
||||
"remove_info" => "确认将选中内容移至回收站吗?",
|
||||
"name_isexists" => "出错了,该名称已存在!",
|
||||
|
||||
"install" => '安装',
|
||||
"width" => '宽',
|
||||
"height" => '高',
|
||||
"app" => '应用',
|
||||
"app_store" => '应用商店',
|
||||
"app_create" => '创建应用',
|
||||
"app_edit" => '修改应用',
|
||||
"app_group_all" => '全部',
|
||||
"app_group_game" => '游戏',
|
||||
"app_group_tools" => '工具',
|
||||
"app_group_reader" => '阅读',
|
||||
"app_group_movie" => '影视',
|
||||
"app_group_music" => '音乐',
|
||||
"app_group_life" => '生活',
|
||||
"app_group_others" => '其他',
|
||||
|
||||
"app_desc" => '描述',
|
||||
"app_icon" => '应用图标',
|
||||
"app_icon_show" => 'url地址或该目录',
|
||||
"app_group" => '应用分组',
|
||||
"app_type" => '类型',
|
||||
"app_type_url" => '链接',
|
||||
"app_type_code" => 'js扩展',
|
||||
"app_display" => '外观',
|
||||
"app_display_border" => '无边框(选中即无边框)',
|
||||
"app_display_size" => '调整大小(选中即可调整)',
|
||||
"app_size" => '尺寸',
|
||||
"app_url" => '链接地址',
|
||||
"app_code" => 'js 代码',
|
||||
|
||||
|
||||
//文件管理
|
||||
"edit" => "编辑",
|
||||
"edit_can_not" => "不是文本文件",
|
||||
"edit_too_big" => "文件太大,不能大于20M",
|
||||
"open_default" => "默认方式打开",
|
||||
"open_ie" => "浏览器打开",
|
||||
"refresh" => "刷新",
|
||||
"refresh_all" => "强制刷新",
|
||||
"newfile" => "新建文件",
|
||||
"newfolder" => "新建文件夹",
|
||||
"newothers" => "新建其他",
|
||||
"path_loading" => "载入中...",
|
||||
"go" => "走着!",
|
||||
"go_up" => "上层",
|
||||
"history_next" => "前进",
|
||||
"history_back" => "后退",
|
||||
"address_in_edit" => "点击进入编辑状态",
|
||||
"double_click_rename" => "双击名称重命名",
|
||||
"double_click_open" => "双击打开",
|
||||
"path_null" => "该文件夹为空,可以拖拽文件到该窗口上传。",
|
||||
|
||||
//上传下载
|
||||
"upload" => "上传",
|
||||
"upload_ready" => "等待上传...",
|
||||
"uploading" => "上传中...",
|
||||
"upload_success" => "上传成功",
|
||||
"upload_path_current" => "切换到当前目录",
|
||||
"upload_select" => "选择文件",
|
||||
"upload_max_size" => "最大允许",
|
||||
"upload_size_info" => "如果想配置更大,请修改php.ini中允许上传的最大值。选择文件时,大于该配置的将自动过滤掉。",
|
||||
"upload_error" => "上传失败",
|
||||
"upload_muti" => "多文件上传",
|
||||
"upload_drag" => "拖拽上传",
|
||||
"upload_drag_tips" => "松开即可上传!",
|
||||
"path_not_allow" => "文件名不允许出现",
|
||||
"download" => "下载",
|
||||
"download_address" => "下载地址",
|
||||
"download_ready" => "即将开始下载",
|
||||
"download_success" => "下载成功!",
|
||||
"download_error_create" => "下载失败!新建文件或写入出错。",
|
||||
"download_error_exists" => "下载失败!远程文件不存 或打开失败。",
|
||||
"upload_error_null" => "没有文件!",
|
||||
"upload_error_big" => "文件大小超过服务器限制",
|
||||
"upload_error_move" => "移动文件失败!",
|
||||
"upload_error_exists" => "该文件已存在",
|
||||
"upload_local" => "本地上传",
|
||||
"download_from_server" => "远程下载",
|
||||
"save_path" => "保存路径",
|
||||
"upload_select_muti" => "可选择多个文件上传",
|
||||
|
||||
//搜索
|
||||
"search" => "搜索",
|
||||
"searching" => "搜索中...",
|
||||
"search_null" => "没有搜索结果!",
|
||||
"search_uplow" => "区分大小写",
|
||||
"search_content" => "搜索文件内容",
|
||||
"search_info" => "请输入搜索词和路径进行搜索!",
|
||||
"search_ext_tips" => "用|隔开;例如 php|js|css<br/>不填则搜索默认文本文件",
|
||||
"file_type" => "文件类型",
|
||||
"goto" => "跳转到",
|
||||
"contain" => "包含",
|
||||
"server_dwonload_desc" => "个任务加入到下载列表",
|
||||
"parent_permission" => "父目录权限",
|
||||
|
||||
"root_path" => "根目录",
|
||||
"lib" => "库",
|
||||
"fav" => "收藏夹",
|
||||
"desktop" => "桌面",
|
||||
"browser" => "浏览器",
|
||||
"my_cumputer" => "我的电脑",
|
||||
"recycle" => "回收站",
|
||||
"my_document" => "我的文档",
|
||||
"my_picture" => "我的照片",
|
||||
"my_music" => "我的音乐",
|
||||
"my_movie" => "我的视频",
|
||||
"my_download" => "我的下载",
|
||||
|
||||
|
||||
//界面
|
||||
"ui_desktop" => "桌面",
|
||||
"ui_filemanage" => "文件管理",
|
||||
"ui_editor" => "编辑器",
|
||||
"adminer" => "adminer",
|
||||
"ui_project_home" => "项目主页",
|
||||
"ui_login" => "登陆",
|
||||
"ui_logout" => "退出",
|
||||
|
||||
|
||||
//设置
|
||||
"setting" => "系统设置",
|
||||
"setting_title" => "选项",
|
||||
"setting_user" => "基础设置",
|
||||
"setting_password" => "修改密码",
|
||||
"setting_password_old" => "原密码",
|
||||
"setting_password_new" => "修改为",
|
||||
"setting_language" => "语言设置",
|
||||
"setting_member" => "用户管理",
|
||||
"setting_group" => "用户组管理",
|
||||
"setting_group_add" => "添加用户组",
|
||||
"setting_group_edit" => "编辑用户组",
|
||||
"setting_theme" => "主题切换",
|
||||
"setting_wall" => "更换壁纸",
|
||||
"setting_wall_diy" => "自定义壁纸:",
|
||||
"setting_wall_info" => "图片url地址,本地图片可以右键图片浏览器打开即可得到",
|
||||
"setting_fav" => "收藏夹管理",
|
||||
"setting_player" => "播放器",
|
||||
"setting_player_music" => "音乐播放器设置",
|
||||
"setting_player_movie" => "视频播放器设置",
|
||||
"setting_help" => "使用帮助",
|
||||
"setting_about" => "关于作品",
|
||||
"setting_success" => "修改已生效!",
|
||||
"can_not_repeat" => "不允许重复",
|
||||
"absolute_path" => "绝对地址",
|
||||
|
||||
// setting page
|
||||
"group" => "用户组",
|
||||
"data_not_full" => "数据提交不完整!",
|
||||
"default_user_can_not_do" => "默认用户不能操作",
|
||||
"default_group_can_not_do" => "默认用户组不能操作",
|
||||
"username_can_not_null" => "用户名不能为空!",
|
||||
"groupname_can_not_null" => "用户组名不能为空!",
|
||||
"groupdesc_can_not_null" => "用户组描述不能为空!",
|
||||
"group_move_user_error" => "所属用户组用户移动失败",
|
||||
"group_already_remove" => "该用户组已被删除",
|
||||
"group_not_exists" => "该用户组不存在",
|
||||
"member_add" => "添加用户",
|
||||
"password_null_not_update" => "密码不填表示不更改",
|
||||
"if_save_file" => "文件尚未保存,是否保存?",
|
||||
"if_remove" => "确认删除",
|
||||
"member_remove_tips" => "删除后该用户目录会被清空",
|
||||
"group_remove_tips" => "删除后该用户组用户无法登陆<br/>(需要重新设置用户组)",
|
||||
"group_name" => "用户组名",
|
||||
"group_name_tips" => "建议英文名,不能重复",
|
||||
"group_desc" => "展示名称",
|
||||
"group_desc_tips" => "组名描述",
|
||||
"group_role_ext" => "扩展名限制",
|
||||
"group_role_ext_tips" => "多个用|分隔开",
|
||||
"group_role_file" => "文件管理",
|
||||
"group_role_upload" => "上传下载",
|
||||
"group_role_user" => "用户数据",
|
||||
"group_role_group" => "用户组管理",
|
||||
"group_role_member" => "用户管理",
|
||||
"group_role_mkfile" => "新建文件",
|
||||
"group_role_mkdir" => "新建文件夹",
|
||||
"group_role_pathrname" => "重命名",
|
||||
"group_role_pathdelete" => "文件(夹)删除",
|
||||
"group_role_pathinfo" => "文件(夹)属性",
|
||||
"group_role_pathmove" => "移动(复制/剪切/粘贴/拖拽操作)",
|
||||
"group_role_zip" => "zip压缩",
|
||||
"group_role_unzip" => "zip解压",
|
||||
"group_role_search" => "搜索",
|
||||
"group_role_filesave" => "编辑保存文件",
|
||||
"group_role_can_upload" => "上传下载",
|
||||
"group_role_upload" => "允许上传",
|
||||
"group_role_download" => "远程下载",
|
||||
"group_role_passowrd" => "修改密码",
|
||||
"group_role_config" => "保存用户配置",
|
||||
"group_role_fav" => "收藏夹操作(添加/编辑/删除)",
|
||||
"group_role_list" => "列表查看",
|
||||
"group_role_member_add" => "添加用户",
|
||||
"group_role_member_edit" => "编辑用户",
|
||||
"group_role_member_del" => "删除用户",
|
||||
"group_role_group_add" => "添加用户组",
|
||||
"group_role_group_edit" => "编辑用户组",
|
||||
"group_role_group_del" => "删除用户组",
|
||||
"group_role_ext_warning" => "不允许此类文件的上传,<br/>重命名(重命名为指定扩展名),<br/>编辑保存,远程下载,解压",
|
||||
"group_tips"=>"<li>1.用户组名不能重复,修改组名后原属于改组用户会自动关联</li><li>2.扩展名限制关系系统安全性,请务必谨慎操作<i>(果在web目录下新建php;就意味着改程序的权限对此用户形同虚设)</i></li><li>3.户管理、权限组管理;查看权限和增删改权限是绑定的;程序会自动关联</li><li>4.设定权限组能添加权限组后,后续权限是不继承的<i>(此权限相当于最高权限)</i></li>",
|
||||
|
||||
//explorer_ajax
|
||||
"not_null" => "必填项不能为空!",
|
||||
"picture_can_not_null" => "图片地址不能为空!",
|
||||
"rname_success" => "重命名成功!",
|
||||
"please_inpute_search_words" => "请输入要搜索的字符串",
|
||||
"remove_success" => "删除成功!",
|
||||
"remove_fali" => "删除失败!",
|
||||
"clipboard_null" => "剪贴板为空!",
|
||||
"create_success" => "新建成功!",
|
||||
"create_error" => "新建失败,请检查目录权限!",
|
||||
"copy_success" => "【复制】—— 覆盖剪贴板成功!",
|
||||
"cute_success" => "【剪切】—— 覆盖剪贴板成功!",
|
||||
"clipboard_state" => "剪切板状态:",
|
||||
"no_permission_write" => "不能写入,检查路径或权限",
|
||||
"copy_not_exists" => "来源不存在",
|
||||
"current_has_parent" => "目标文件夹是源文件夹的子文件夹!",
|
||||
"past_success" => "<b>粘贴操作完成</b>",
|
||||
"cute_past_success" => "<b>剪切操作完成</b>(源文件被删除,剪贴板清空)",
|
||||
"zip_success" => "压缩完成",
|
||||
"not_zip" => "不是压缩文件",
|
||||
"zip_null" => "没有选择的文件或目录",
|
||||
"unzip_success" => "解压完成",
|
||||
"gotoline" => "跳转到行",
|
||||
"path_is_current" => "所打开路径和当前路径一样!",
|
||||
"path_exists" => "该名称已存在!",
|
||||
|
||||
//编辑器
|
||||
"undo" => "撤销",
|
||||
"redo" => "反撤销",
|
||||
"preview" => "预览",
|
||||
"wordwrap" => "自动换行(不自动换行)",
|
||||
"char_all_display" => "显示不可见字符(隐藏)",
|
||||
"auto_complete" => "自动提示(取消)",
|
||||
"code_theme" => "代码风格",
|
||||
"font_size" => "字体",
|
||||
|
||||
//button
|
||||
"button_ok" => "确定",
|
||||
"button_submit" => "提交",
|
||||
"button_set" => "设置",
|
||||
"button_cancle" => "取消",
|
||||
"button_edit" => "编辑",
|
||||
"button_save" => "保存",
|
||||
"button_save_all" => "保存全部",
|
||||
"button_not_save" => "不保存",
|
||||
"button_add" => "添加",
|
||||
"button_back_add" => "返回添加",
|
||||
"button_del" => "删除",
|
||||
"button_save_edit" => "保存修改",
|
||||
"button_save_submit" => "保存提交",
|
||||
"button_select_all" => "全选/反选"
|
||||
);
|
|
@ -0,0 +1,33 @@
|
|||
<div class="box">
|
||||
<div class="title"><span>是什麼?</span></div>
|
||||
<p>KODExplorer是一個公開源碼的基於Web的線上檔管理、代碼編輯器。它提供了類windows經典使用者介面,一整套線上檔管理、文件預覽、編輯、上傳下載、線上解壓縮、音樂播放功能。讓你直接在流覽器端實現web開發、源碼檔預覽、網站部署的同時擁有與本地操作一樣方便、快捷、安全的體驗。</p>
|
||||
<p><b>——設計理念——</b></p>
|
||||
<p>傳承經典,追求創新,為用戶提供方便快捷、安全易用的線上雲管理系統。</p>
|
||||
<p>無論何時(when)、何地(where),擁有web只要你想(want)它就是你的管理利器(4W策略)。</p>
|
||||
<p><b>——面向用戶——</b></p>
|
||||
<p>目前KODExplorer系統管理主要定位在個人雲主機、中小企業雲資源管理、網盤管理、中小型網站管理等。Web開發者&站長(老鳥):線上編輯、壓縮備份、部署,經典windows介面操作,上手容易,遠離了主機的SSH、ftp複雜枯燥的命令操作。</p>
|
||||
<p>個人私有雲(菜鳥):管理網盤資源,同樣經典windows介面操作,可以就地流覽網盤音樂、視屏檔,上傳下載快捷方便。</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>特色</span></div>
|
||||
<p>完備的文件管理,強大的線上文件編輯器</p>
|
||||
<p>無論您在哪裡,都可以管理您的檔;並可以線上娛樂,線上寫代碼!就像適宜用作業系統那樣。</p>
|
||||
<p>豐富的本地體驗移植,右鍵操作,拖拽,框中選擇,快速鍵,檔搜索(內容中搜索)……</p>
|
||||
<p>框中選擇,拖拽移動,拖拽上傳,線上編輯器,影音播放機,解壓縮。全面ajax保證性能和體驗!</p>
|
||||
<p>各個功能直接無縫連接;以對話方塊形式存在,多工管理等功能</p>
|
||||
<p>編輯器支援多文檔;支持ZendCoding html,css,js代碼編寫效率更高!</p>
|
||||
<p>完美中文支援,各種情況下亂碼解決;</p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="title"><span>開源技術採用</span></div>
|
||||
<p><b>1.Jquery:</b>jpuery(plugin:Hotkeys.ztree.contentmenu).js主流開發框架。對Dom操作、BOM操作、css操作,以及Ajax封裝</p>
|
||||
<p><b>2.ArtDialog:</b>一個設計優美,對流覽器相容性極強的對話方塊外掛程式。使快顯視窗處理,事件以及資料的傳輸得到了更好的統一管理方式</p>
|
||||
<p><b>3.Ztree:</b>清單樹控制項,擴展性很強的樹形資料操作外掛程式</p>
|
||||
<p><b>4.codemirror:</b>一個代碼編輯js外掛程式,支援各種程式設計語言的高亮處理</p>
|
||||
<p><b>5.zendcoding:</b>一個支持html代碼快速編寫外掛程式。定義方式簡化代碼編寫。有簡單編譯功能</p>
|
||||
<p><b>6.less:</b>一種高效的,函數式css開發模式,提高前端css樣式表的可複用性。有簡單編譯功能</p>
|
||||
<p><b>7.SWFUpload:</b>flash多文件上傳</p>
|
||||
<p><b>8.CMP4:</b>一個非常優秀的flash媒體檔播放外掛程式,支持流媒體,常用音樂視頻的播放工具。支援換皮膚,高可配置性的設置。清單xml的動態載入。mms流媒體,rstp開源協定媒體播放支援</p>
|
||||
</div>
|
|
@ -0,0 +1,64 @@
|
|||
<div class="intro_left">
|
||||
<div class="tips blue">
|
||||
<h1> <span>豐富的功能</span> </h1>
|
||||
<p>代碼自動提示</p>
|
||||
<p>多主題:選擇你喜歡的程式設計風格</p>
|
||||
<p>自訂字體:適合種場景下使用</p>
|
||||
<p>多游標編輯,塊編輯等媲美sublime的線上程式設計體驗</p>
|
||||
<p>代碼塊折疊、展開;自動換行</p>
|
||||
<p>支援多標籤,拖動切換順序;</p>
|
||||
<p>維持多個文檔、查找替換;歷史記錄;</p>
|
||||
<p>自動補全[],{},(),"",''</p>
|
||||
<p>線上即時預覽,使您愛上線上程式設計!</p>
|
||||
<p>zendcodeing支持,寫代碼健步如飛</p>
|
||||
<p>更多功能,等待你的發現……</p>
|
||||
</div>
|
||||
<div class="tips orange">
|
||||
<h1> <span>多種代碼高亮</span> </h1>
|
||||
<p>前端:html,JavaScript,css,less,sass,scss</p>
|
||||
<p>web開發:php,perl,python,ruby,elang,go...</p>
|
||||
<p>傳統語言:java,c,c++,c#,actionScript,VBScript...</p>
|
||||
<p>其他:markdown,shell,sql,lua,xml,yaml...</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="intro_right">
|
||||
<div class="tips green">
|
||||
<h1> <span>快速鍵操作</span> </h1>
|
||||
<pre>常用快速鍵:
|
||||
ctrl+s 保存
|
||||
ctrl+a 全選 ctrl+x 剪切
|
||||
ctrl+c 複製 ctrl+v 粘貼
|
||||
ctrl+z 撤銷 ctrl+y 反撤銷
|
||||
ctrl+f 查找 ctrl+f+f 替換
|
||||
alt+0 折疊所有 alt+shift+0 展開所有
|
||||
esc [退出搜索,取消自動提示...]</pre>
|
||||
<pre>選擇:
|
||||
滑鼠框選——拖動
|
||||
shift+home/end/up/left/down/right
|
||||
shift+pageUp/PageDown 上下翻頁選中
|
||||
ctrl+shift+ home/end 當前游標到頭尾
|
||||
alt+滑鼠拖動 塊選擇</pre>
|
||||
<pre> 游標移動:
|
||||
home/end/up/left/down/right
|
||||
ctrl+home/end 游標移動到文檔首/尾
|
||||
ctrl+p 跳轉到匹配的標籤
|
||||
pageUp/PageDown 游標上下翻頁
|
||||
alt+left/right 游標移動到行首位
|
||||
shift+left/right 游標移動到行首&尾
|
||||
ctrl+l 跳轉到指定行
|
||||
ctrl+alt+up/down 上(下)增加游標</pre>
|
||||
<pre>編輯:
|
||||
ctrl+/ 注釋&取消注釋 ctrl+alt+a 左右對齊
|
||||
table tab對齊 shift+table 整體前移table
|
||||
delete 刪除 ctrl+d 刪除整行
|
||||
ctrl+delete 刪除該行右側單詞
|
||||
ctrl/shift+backspace 刪除左側單詞
|
||||
alt+shift+up/down 複製行並添加到上(下麵)面
|
||||
alt+delete 刪除游標右側內容
|
||||
alt+up/down 當前行和上一行(下一行交換)
|
||||
ctrl+shift+d 複製行並添加到下麵
|
||||
ctrl+delete 刪除右側單詞
|
||||
ctrl+shift+u 轉換成小寫 ctrl+u 選中內容轉換成大寫</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<div class="box">
|
||||
<div class="title"><span>文件管理</span></div>
|
||||
<p><i class="icon-tags"></i>檔選擇:單選,滑鼠框選,shift連選,ctrl隨意選擇,鍵盤上下左右、home、end選擇。</p>
|
||||
<p><i class="icon-folder-open"></i>檔操作:選擇檔後,可以進行複製,剪切,刪除,屬性查看,壓縮,重命名,打開預覽等操作……</p>
|
||||
<p><i class="icon-cloud-upload"></i>文件上傳:多檔批量上傳;html5拖拽上傳(拖拽到視窗實現無縫上傳,支持資料夾拖拽)</p>
|
||||
<p><i class="icon-cogs"></i>右鍵功能:檔右鍵,資料夾右鍵,多選後右鍵操作,桌面右鍵,樹目錄右鍵操作,右鍵功能表綁定快速鍵<br/>
|
||||
(全選——複製——剪切——粘貼——刪除——重命名,設置……)</p>
|
||||
<p><i class="icon-sitemap"></i>檔流覽:清單模式,圖示模式;按兩下進入子資料夾;位址欄操作;打開資料夾記錄逆勢操作記錄(前進後退)</p>
|
||||
<p><i class="icon-move"></i>支援拖拽操作:選中後拖拽,實現剪切到指定資料夾功能</p>
|
||||
<p><i class="icon-reply"></i>快速鍵操作:delete刪除,ctrl+A全選,ctrl+C複製,ctrl+X剪切,檔搜索(內容中搜索)</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="title"><span>文件預覽</span></div>
|
||||
<p><i class="icon-edit"></i>文件預覽:文字檔內容查看編輯保存;html,swf文件預覽,</p>
|
||||
<p><i class="icon-picture"></i>圖片預覽:自動生成縮略圖,圖片幻燈片播放;</p>
|
||||
<p><i class="icon-music"></i>音訊播放:線上播放音樂,視頻檔;支持mp3,wma,mid,aac,wav;mp4,</p>
|
||||
<p><i class="icon-play"></i>視頻播放:線上視頻檔播放,支援格式:flv,f4v,3gp</p>
|
||||
<p><i class="icon-play"></i>office:office線上預覽,支援格式:doc,docx,ppt,pptx,xls,xlsx</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="title"><span>快速鍵</span></div>
|
||||
<p><i class="icon-tags"></i>enter 打開</p>
|
||||
<p><i class="icon-tags"></i>ctrl+a 全選</p>
|
||||
<p><i class="icon-tags"></i>ctrl+c 複製選中</p>
|
||||
<p><i class="icon-tags"></i>ctrl+v 粘貼</p>
|
||||
<p><i class="icon-tags"></i>ctrl+x 剪切</p>
|
||||
<p><i class="icon-tags"></i>ctrl+f 目前的目錄進行搜索</p>
|
||||
<p><i class="icon-tags"></i>alt+n 新建文件</p>
|
||||
<p><i class="icon-tags"></i>alt+m 新建資料夾</p>
|
||||
<p><i class="icon-tags"></i>delete 刪除選中</p>
|
||||
<p><i class="icon-tags"></i>backspace 後退</p>
|
||||
<p><i class="icon-tags"></i>ctrl+backspace 前進</p>
|
||||
<p><i class="icon-tags"></i>f2 重命名選中(檔資料夾)</p>
|
||||
<p><i class="icon-tags"></i>home/end/up/down/left/right 選擇檔</p>
|
||||
<p><i class="icon-tags"></i>anykey 選中以按下字元首字母的檔&資料夾 自動迴圈選中</p>
|
||||
</div>
|
|
@ -0,0 +1,358 @@
|
|||
<?php
|
||||
|
||||
$L= array(
|
||||
"config" => array(
|
||||
"type" => "zh_TW",
|
||||
"name" => "簡體中文",
|
||||
"authoer" => "warlee"
|
||||
),
|
||||
|
||||
//login
|
||||
"login" => "登陸",
|
||||
"guest_login" => "游客登陸",
|
||||
"username" => "用戶名",
|
||||
"password" => "密碼",
|
||||
"login_code" => "驗證碼",
|
||||
"login_rember_password" => "記住密碼",
|
||||
"us" => "千帆網路工作室",
|
||||
"login_not_null" => "用戶名密碼不能為空!",
|
||||
"code_error" => "驗證碼錯誤",
|
||||
"user_not_exists" => "用戶名不存在!",
|
||||
"password_error" => "密碼錯誤!",
|
||||
"password_not_null" => "密碼不能為空!",
|
||||
"old_password_error" => "原密碼錯誤!",
|
||||
"permission" => "許可權!",
|
||||
"no_permission" => "沒有許可權!",
|
||||
"no_permission_ext" => "該類型檔沒有許可權",
|
||||
"dialog_min" => "最小化",
|
||||
"dialog_min_all" => "最小化所有",
|
||||
"dialog_display_all" => "显示所有窗口",
|
||||
"dialog_close_all" => "关闭所有窗口",
|
||||
|
||||
//網站描述
|
||||
"title" => "KODExplorer-芒果雲•資源管理器",
|
||||
"title_name" => "芒果雲•資源管理器",
|
||||
|
||||
//通用
|
||||
"open" => "打開",
|
||||
"others" => "其他",
|
||||
"open_with" => "打開方式",
|
||||
"close" => "關閉",
|
||||
"close_all" => "關閉全部",
|
||||
"close_right" => "關閉右側標籤",
|
||||
"close_others" => "關閉其他",
|
||||
"loading" => "操作中...",
|
||||
"warning" => "警告",
|
||||
"getting" => "獲取中...",
|
||||
"sending" => "數據發送中...",
|
||||
"data_error" => "數據出錯!",
|
||||
"get_success" => "獲取成功!",
|
||||
"save_success" => "保存成功!",
|
||||
"success" => "操作成功",
|
||||
"error" => "操作失敗",
|
||||
"error_repeat" => "'操作失敗,請注意名稱不能重複!'",
|
||||
"system_error" => "系統錯誤",
|
||||
"name" => "名稱",
|
||||
"type" => "類型",
|
||||
"contain" => "包含",
|
||||
"address" => "位置",
|
||||
"size" => "大小",
|
||||
"byte" => "位元組",
|
||||
"path" => "路徑",
|
||||
"action" => "操作",
|
||||
"create_time" => "創建時間",
|
||||
"modify_time" => "修改時間",
|
||||
"last_time" => "最後訪問",
|
||||
"sort_type" => "排序方式",
|
||||
"time_type" => "Y/m/d H:i",
|
||||
"time_type_info" => "Y年m月d日 H:i:s",
|
||||
|
||||
//右鍵
|
||||
"file" => "檔",
|
||||
"folder" => "檔夾",
|
||||
"copy" => "複製",
|
||||
"past" => "粘貼",
|
||||
"cute" => "剪切",
|
||||
"remove" => "刪除",
|
||||
"info" => "屬性",
|
||||
"list_type" => "查看",
|
||||
"list_icon" => "圖示排列",
|
||||
"list_list" => "列表排列",
|
||||
"sort_up" => "遞增",
|
||||
"sort_down" => "遞減",
|
||||
"order_type" => "排序方式",
|
||||
"order_desc" => "降序",
|
||||
"order_asc" => "昇冪",
|
||||
"rename" => "重命名",
|
||||
"add_to_fav" => "添加到收藏夾",
|
||||
"search_in_path" => "檔夾中搜索",
|
||||
"add_to_play" => "添加到播放列表",
|
||||
"manage_fav" => "管理收藏夾",
|
||||
"refresh_tree" => "刷新樹目錄",
|
||||
"manage_folder" => "管理目錄",
|
||||
"close_menu" => "關閉菜單",
|
||||
"zip" => "zip壓縮",
|
||||
"unzip" => "zip解壓到當前",
|
||||
"clipboard" => "查看剪貼板",
|
||||
"full_screen" => "全屏/退出全屏",
|
||||
|
||||
"tips" => "提示",
|
||||
"ziping" => "正在壓縮...",
|
||||
"unziping" => "正在解壓...",
|
||||
"moving" => "移動操作中...",
|
||||
"remove_title" => "刪除確認",
|
||||
"remove_not" => "系統檔夾,不能刪除",
|
||||
"remove_info" => "確認將選中內容移至回收站嗎?",
|
||||
"name_isexists" => "出錯了,該名稱已存在!",
|
||||
|
||||
"install" => '安裝',
|
||||
"width" => '寬',
|
||||
"height" => '高',
|
||||
"app" => '應用',
|
||||
"app_store" => '應用商店',
|
||||
"app_create" => '創建應用',
|
||||
"app_edit" => '修改應用',
|
||||
"app_group_all" => '全部',
|
||||
"app_group_game" => '遊戲',
|
||||
"app_group_tools" => '工具',
|
||||
"app_group_reader" => '閱讀',
|
||||
"app_group_movie" => '影視',
|
||||
"app_group_music" => '音樂',
|
||||
"app_group_life" => '生活',
|
||||
"app_group_others" => '其他',
|
||||
|
||||
"app_desc" => '描述',
|
||||
"app_icon" => '應用圖示',
|
||||
"app_icon_show" => 'url地址或該目錄',
|
||||
"app_group" => '應用分組',
|
||||
"app_type" => '類型',
|
||||
"app_type_url" => '鏈接',
|
||||
"app_type_code" => 'js擴展',
|
||||
"app_display" => '外觀',
|
||||
"app_display_border" => '無邊框(選中即無邊框)',
|
||||
"app_display_size" => '調整大小(選中即可調整)',
|
||||
"app_size" => '尺寸',
|
||||
"app_url" => '鏈接地址',
|
||||
"app_code" => 'js 代碼',
|
||||
|
||||
|
||||
//檔管理
|
||||
"edit" => "編輯",
|
||||
"edit_can_not" => "不是文本檔",
|
||||
"edit_too_big" => "文件太大,不能大于20M",
|
||||
"open_default" => "默認方式打開",
|
||||
"open_ie" => "流覽器打開",
|
||||
"refresh" => "刷新",
|
||||
"refresh_all" => "強制刷新",
|
||||
"newfile" => "新建檔",
|
||||
"newfolder" => "新建檔夾",
|
||||
"newothers" => "新建其他",
|
||||
"path_loading" => "載入中...",
|
||||
"go" => "走著!",
|
||||
"go_up" => "上層",
|
||||
"history_next" => "前進",
|
||||
"history_back" => "後退",
|
||||
"address_in_edit" => "點擊進入編輯狀態",
|
||||
"double_click_rename" => "雙擊名稱重命名",
|
||||
"double_click_open" => "雙擊打開",
|
||||
"path_null" => "該檔夾為空,可以拖拽檔到該窗口上傳。",
|
||||
|
||||
//上傳下載
|
||||
"upload" => "上傳",
|
||||
"upload_ready" => "等待上傳...",
|
||||
"uploading" => "上傳中...",
|
||||
"upload_success" => "上傳成功",
|
||||
"upload_path_current" => "切換到當前目錄",
|
||||
"upload_select" => "選擇檔",
|
||||
"upload_max_size" => "最大允許",
|
||||
"upload_size_info" => "如果想配置更大,請修改php.ini中允許上傳的最大值。選擇檔時,大於該配置的將自動過濾掉。",
|
||||
"upload_error" => "上傳失敗",
|
||||
"upload_muti" => "多檔上傳",
|
||||
"upload_drag" => "拖拽上傳",
|
||||
"upload_drag_tips" => "鬆開即可上傳!",
|
||||
"path_not_allow" => "檔案名不允許出現",
|
||||
"download" => "下載",
|
||||
"download_address" => "下載地址",
|
||||
"download_ready" => "即將開始下載",
|
||||
"download_success" => "下載成功!",
|
||||
"download_error_create" => "下載失敗!新建檔或寫入出錯。",
|
||||
"download_error_exists" => "下載失敗!遠程檔不存 或打開失敗。",
|
||||
"upload_error_null" => "沒有檔!",
|
||||
"upload_error_big" => "檔大小超過伺服器限制",
|
||||
"upload_error_move" => "移動檔失敗!",
|
||||
"upload_error_exists" => "該檔已存在",
|
||||
"upload_local" => "本地上傳",
|
||||
"download_from_server" => "遠程下載",
|
||||
"save_path" => "保存路徑",
|
||||
"upload_select_muti" => "可選擇多個檔上傳",
|
||||
|
||||
//搜索
|
||||
"search" => "搜索",
|
||||
"searching" => "搜索中...",
|
||||
"search_null" => "沒有搜索結果!",
|
||||
"search_uplow" => "區分大小寫",
|
||||
"search_content" => "搜索檔內容",
|
||||
"search_info" => "請輸入搜索詞和路徑進行搜索!",
|
||||
"search_ext_tips" => "用|隔開;例如 php|js|css<br/>不填則搜索默認文本檔",
|
||||
"file_type" => "檔類型",
|
||||
"goto" => "跳轉到",
|
||||
"contain" => "包含",
|
||||
"server_dwonload_desc" => "個任務加入到下載列表",
|
||||
"parent_permission" => "父目錄許可權",
|
||||
|
||||
"root_path" => "根目錄",
|
||||
"lib" => "庫",
|
||||
"fav" => "收藏夾",
|
||||
"desktop" => "桌面",
|
||||
"browser" => "流覽器",
|
||||
"my_cumputer" => "我的電腦",
|
||||
"recycle" => "回收站",
|
||||
"my_document" => "我的文檔",
|
||||
"my_picture" => "我的照片",
|
||||
"my_music" => "我的音樂",
|
||||
"my_movie" => "我的視頻",
|
||||
"my_download" => "我的下載",
|
||||
|
||||
|
||||
//介面
|
||||
"ui_desktop" => "桌面",
|
||||
"ui_filemanage" => "檔管理",
|
||||
"ui_editor" => "編輯器",
|
||||
"adminer" => "adminer",
|
||||
"ui_project_home" => "專案主頁",
|
||||
"ui_login" => "登陸",
|
||||
"ui_logout" => "退出",
|
||||
|
||||
|
||||
//設置
|
||||
"setting" => "系統設置",
|
||||
"setting_title" => "選項",
|
||||
"setting_user" => "基礎設置",
|
||||
"setting_password" => "修改密碼",
|
||||
"setting_password_old" => "原密碼",
|
||||
"setting_password_new" => "修改為",
|
||||
"setting_language" => "語言設置",
|
||||
"setting_member" => "用戶管理",
|
||||
"setting_group" => "用戶組管理",
|
||||
"setting_group_add" => "添加用戶組",
|
||||
"setting_group_edit" => "編輯用戶組",
|
||||
"setting_theme" => "主題切換",
|
||||
"setting_wall" => "更換壁紙",
|
||||
"setting_wall_diy" => "自定義壁紙:",
|
||||
"setting_wall_info" => "圖片url地址,本地圖片可以右鍵圖片流覽器打開即可得到",
|
||||
"setting_fav" => "收藏夾管理",
|
||||
"setting_player" => "播放器",
|
||||
"setting_player_music" => "音樂播放器設置",
|
||||
"setting_player_movie" => "視頻播放器設置",
|
||||
"setting_help" => "使用幫助",
|
||||
"setting_about" => "關於作品",
|
||||
"setting_success" => "修改已生效!",
|
||||
"can_not_repeat" => "不允許重複",
|
||||
"absolute_path" => "絕對地址",
|
||||
|
||||
// setting page
|
||||
"group" => "用戶組",
|
||||
"data_not_full" => "數據提交不完整!",
|
||||
"default_user_can_not_do" => "默認用戶不能操作",
|
||||
"default_group_can_not_do" => "默認用戶組不能操作",
|
||||
"username_can_not_null" => "用戶名不能為空!",
|
||||
"groupname_can_not_null" => "用戶組名不能為空!",
|
||||
"groupdesc_can_not_null" => "用戶組描述不能為空!",
|
||||
"group_move_user_error" => "所屬用戶組用戶移動失敗",
|
||||
"group_already_remove" => "該用戶組已被刪除",
|
||||
"group_not_exists" => "該用戶組不存在",
|
||||
"member_add" => "添加用戶",
|
||||
"password_null_not_update" => "密碼不填表示不更改",
|
||||
"if_save_file" => "檔尚未保存,是否保存?",
|
||||
"if_remove" => "確認刪除",
|
||||
"member_remove_tips" => "刪除後該用戶目錄會被清空",
|
||||
"group_remove_tips" => "刪除後該用戶組用戶無法登陸<br/>(需要重新設置用戶組)",
|
||||
"group_name" => "用戶組名",
|
||||
"group_name_tips" => "建議英文名,不能重複",
|
||||
"group_desc" => "展示名稱",
|
||||
"group_desc_tips" => "組名描述",
|
||||
"group_role_ext" => "擴展名限制",
|
||||
"group_role_ext_tips" => "多個用|分隔開",
|
||||
"group_role_file" => "檔管理",
|
||||
"group_role_upload" => "上傳下載",
|
||||
"group_role_user" => "用戶數據",
|
||||
"group_role_group" => "用戶組管理",
|
||||
"group_role_member" => "用戶管理",
|
||||
"group_role_mkfile" => "新建檔",
|
||||
"group_role_mkdir" => "新建檔夾",
|
||||
"group_role_pathrname" => "重命名",
|
||||
"group_role_pathdelete" => "檔(夾)刪除",
|
||||
"group_role_pathinfo" => "檔(夾)屬性",
|
||||
"group_role_pathmove" => "移動(複製/剪切/粘貼/拖拽操作)",
|
||||
"group_role_zip" => "zip壓縮",
|
||||
"group_role_unzip" => "zip解壓",
|
||||
"group_role_search" => "搜索",
|
||||
"group_role_filesave" => "編輯保存檔",
|
||||
"group_role_can_upload" => "上傳下載",
|
||||
"group_role_upload" => "允許上傳",
|
||||
"group_role_download" => "遠程下載",
|
||||
"group_role_passowrd" => "修改密碼",
|
||||
"group_role_config" => "保存用戶配置",
|
||||
"group_role_fav" => "收藏夾操作(添加/編輯/刪除)",
|
||||
"group_role_list" => "列表查看",
|
||||
"group_role_member_add" => "添加用戶",
|
||||
"group_role_member_edit" => "編輯用戶",
|
||||
"group_role_member_del" => "刪除用戶",
|
||||
"group_role_group_add" => "添加用戶組",
|
||||
"group_role_group_edit" => "編輯用戶組",
|
||||
"group_role_group_del" => "刪除用戶組",
|
||||
"group_role_ext_warning" => "不允許此類檔的上傳,<br/>重命名(重命名為指定擴展名),<br/>編輯保存,遠程下載,解壓",
|
||||
"group_tips"=>"<li>1.用戶組名不能重複,修改組名後原屬於改組用戶會自動關聯</li><li>2.擴展名限制關係系統安全性,請務必謹慎操作<i>(果在web目錄下新建php;就意味著改程式的許可權對此用戶形同虛設)</i></li><li>3.戶管理、許可權組管理;查看許可權和增刪改許可權是綁定的;程式會自動關聯</li><li>4.設定許可權組能添加許可權組後,後續許可權是不繼承的<i>(此許可權相當於最高許可權)</i></li>",
|
||||
|
||||
//explorer_ajax
|
||||
"not_null" => "必填項不能為空!",
|
||||
"picture_can_not_null" => "圖片地址不能為空!",
|
||||
"rname_success" => "重命名成功!",
|
||||
"please_inpute_search_words" => "請輸入要搜索的字串",
|
||||
"remove_success" => "刪除成功!",
|
||||
"remove_fali" => "刪除失敗!",
|
||||
"clipboard_null" => "剪貼板為空!",
|
||||
"create_success" => "新建成功!",
|
||||
"create_error" => "新建失敗,請檢查目錄許可權!",
|
||||
"copy_success" => "【複製】—— 覆蓋剪貼板成功!",
|
||||
"cute_success" => "【剪切】—— 覆蓋剪貼板成功!",
|
||||
"clipboard_state" => "剪切板狀態:",
|
||||
"no_permission_write" => "不能寫入,檢查路徑或許可權",
|
||||
"copy_not_exists" => "來源不存在",
|
||||
"current_has_parent" => "目標檔夾是原始檔案夾的子檔夾!",
|
||||
"past_success" => "<b>粘貼操作完成</b>",
|
||||
"cute_past_success" => "<b>剪切操作完成</b>(原始檔案被刪除,剪貼板清空)",
|
||||
"zip_success" => "壓縮完成",
|
||||
"not_zip" => "不是壓縮檔",
|
||||
"zip_null" => "沒有選擇的檔或目錄",
|
||||
"unzip_success" => "解壓完成",
|
||||
"gotoline" => "跳轉到行",
|
||||
"path_is_current" => "所打開路徑和當前路徑一樣!",
|
||||
"path_exists" => "該名稱已存在!",
|
||||
|
||||
//編輯器
|
||||
"undo" => "撤銷",
|
||||
"redo" => "反撤銷",
|
||||
"preview" => "預覽",
|
||||
"wordwrap" => "自動換行/不自動換行",
|
||||
"char_all_display" => "顯示&隱藏不可見字元",
|
||||
"auto_complete" => "自動提示(取消)",
|
||||
"code_theme" => "代碼風格",
|
||||
"font_size" => "字體",
|
||||
|
||||
//button
|
||||
"button_ok" => "確定",
|
||||
"button_submit" => "提交",
|
||||
"button_set" => "設置",
|
||||
"button_cancle" => "取消",
|
||||
"button_edit" => "編輯",
|
||||
"button_save" => "保存",
|
||||
"button_save_all" => "保存全部",
|
||||
"button_not_save" => "不保存",
|
||||
"button_add" => "添加",
|
||||
"button_back_add" => "返回添加",
|
||||
"button_del" => "刪除",
|
||||
"button_save_edit" => "保存修改",
|
||||
"button_save_submit" => "保存提交",
|
||||
"button_select_all" => "全選/反選"
|
||||
);
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>{"root":{"role":"root","name":"Administrator","path":"","ext_not_allow":""},"default":{"role":"default","name":"default","ext_not_allow":"php|asp|jsp","explorer:mkdir":1,"explorer:mkfile":1,"explorer:pathRname":1,"explorer:pathDelete":1,"explorer:zip":1,"explorer:unzip":1,"explorer:pathCopy":1,"explorer:pathCute":1,"explorer:pathCuteDrag":1,"explorer:clipboard":1,"explorer:pathPast":1,"explorer:pathInfo":1,"explorer:pathInfoMuti":1,"explorer:serverDownload":1,"explorer:fileUpload":1,"explorer:search":1,"app:user_app":1,"editor:fileSave":1},"guest":{"role":"guest","name":"guest","ext_not_allow":"php|asp|jsp"}}
|
|
@ -0,0 +1 @@
|
|||
<?php exit;?>{"admin":{"name":"admin","password":"21232f297a57a5a743894a0e4a801fc3","role":"root","status":1},"guest":{"name":"guest","password":"084e0343a0486ff05530df6c705c8bb4","role":"guest","status":1},"demo":{"name":"demo","password":"fe01ce2a7fbac8fafaed7c982a04e229","role":"default","status":1}}
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
include ('./config/config.php');
|
||||
$app = new Application(); //声明控制器类
|
||||
$app->setDefaultController('explorer');//设置默认控制器
|
||||
$app->setDefaultAction('index'); //设置默认控制器函数
|
||||
$app->run();
|
||||
?>
|
|
@ -0,0 +1,235 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 数据的缓存存储类;key=>value 模式;value可以是任意类型数据。
|
||||
* 完整流程测试;读取最低5000次/s 含有写的1000次/s
|
||||
* add 添加单条数据;已存在则返回false
|
||||
* reset 重置所有数据;不传参数代表清空数据
|
||||
* get: 获取数据;获取全部;获取指定key数据;获取指定多个key的数据;查找方式获取多条数据
|
||||
* 1. get();
|
||||
* 2. get("demo")
|
||||
* 3. get(array('demo','admin'))
|
||||
* 4. get('group','','root')
|
||||
* update: 更新数据;更新指定key数据;获取指定多个key的数据; 查找方式更新多条数据
|
||||
* 1. update("demo",array('name'=>'ddd',...))
|
||||
* 2. update(array('demo','admin'),array(array('name'...),array('name'...)))
|
||||
* 3. update('group','system','root')
|
||||
*
|
||||
* replace_update($key_old,$key_new,$value_new)替换方式更新;满足key更新的需求
|
||||
*
|
||||
* delete: 获取数据;获取全部;获取指定key数据;获取指定多个key的数据;查找方式获取多条数据
|
||||
* 1. delete("demo")
|
||||
* 2. delete(array('demo','admin'))
|
||||
* 3. delete('group','','root')
|
||||
* 例如:====================================
|
||||
* ['sss':['name':'sss','group':'root'],'bbb':['name':'bbb','group':'root']
|
||||
* ,'ccc':['name':'ccc','group':'system'],'ddd':['name':'ddd','group':'root']
|
||||
* 查找方式删除 delete('group','','root');
|
||||
* 查找方式更新 update('group','system','root');
|
||||
* 查找方式获取 get('group','','root');
|
||||
*/
|
||||
define('CONFIG_EXIT', '<?php exit;?>');
|
||||
class fileCache
|
||||
{
|
||||
private $data;
|
||||
private $file;
|
||||
function __construct($file) {
|
||||
$this->file = $file;
|
||||
$this->data= self::load($file);
|
||||
if (!is_array($this->data)) {
|
||||
$this->reset();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置所有数据;不传参数代表清空数据
|
||||
*/
|
||||
public function reset($list=array()){
|
||||
$this->data = $list;
|
||||
self::save($this->file,$this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一条数据,不能重复;如果已存在则返回false;1k次/s
|
||||
*/
|
||||
public function add($k,$v){
|
||||
if (!isset($this->data[$k])) {
|
||||
$this->data[$k] = $v;
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据;不存在则返回false;100w次/s
|
||||
* $k null 不传则返回全部;
|
||||
* $k string 为字符串;则根据key获取数据,只有一条数据
|
||||
* $search_value 设置时;表示以查找的方式筛选数据筛选条件为 $key=$k 值为$search_value的数据;多条
|
||||
*/
|
||||
public function get($k = '',$v='',$search_value=false){
|
||||
if ($k === '') return $this->data;
|
||||
|
||||
$search = array();
|
||||
if ($search_value === false) {
|
||||
if (is_array($k)) {
|
||||
//多条数据获取
|
||||
$num = count($k);
|
||||
for ($i=0; $i < $num; $i++) {
|
||||
$search[$k[$i]] = $this->data[$k[$i]];
|
||||
}
|
||||
return $search;
|
||||
}else if(isset($this->data[$k])){
|
||||
//单条数据获取
|
||||
return $this->data[$k];
|
||||
}
|
||||
}else{
|
||||
//查找内容数据方式获取;返回多条
|
||||
foreach ($this->data as $key => $val) {
|
||||
if ($val[$k] == $search_value) {
|
||||
$search[$key] = $this->data[$key];
|
||||
}
|
||||
}
|
||||
return $search;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新数据;不存在;或者任意一条不存在则返回false;不进行保存
|
||||
* $k $v string 为字符串;则根据key只更新一条数据
|
||||
* $k $v array array($key1,$key2,...),array($value1,$value2,...)
|
||||
* 则表示更新多条数据
|
||||
* $search_value 设置时;表示以查找的方式更新数据中的数据
|
||||
*/
|
||||
public function update($k,$v,$search_value=false){
|
||||
if ($search_value === false) {
|
||||
if (is_array($k)) {
|
||||
//多条数据更新
|
||||
$num = count($k);
|
||||
for ($i=0; $i < $num; $i++) {
|
||||
$this->data[$k[$i]] = $v[$i];
|
||||
}
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}else if(isset($this->data[$k])){
|
||||
//单条数据更新
|
||||
$this->data[$k] = $v;
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}
|
||||
}else{
|
||||
//查找方式更新;更新多条
|
||||
foreach ($this->data as $key => $val) {
|
||||
if ($val[$k] == $search_value) {
|
||||
$this->data[$key][$k] = $v;
|
||||
}
|
||||
}
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* 替换方式更新;满足key更新的需求
|
||||
*/
|
||||
public function replace_update($key_old,$key_new,$value_new){
|
||||
if(isset($this->data[$key_old])){
|
||||
$value = $this->data[$key_old];
|
||||
unset($this->data[$key_old]);
|
||||
$this->data[$key_new] = $value_new;
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除;不存在返回false
|
||||
*/
|
||||
public function delete($k,$v='',$search_value=false){
|
||||
if ($search_value === false) {
|
||||
if (is_array($k)) {
|
||||
//多条数据更新
|
||||
$num = count($k);
|
||||
for ($i=0; $i < $num; $i++) {
|
||||
unset($this->data[$k[$i]]);
|
||||
}
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}else if(isset($this->data[$k])){
|
||||
//单条数据删除
|
||||
unset($this->data[$k]);
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}
|
||||
}else{
|
||||
//查找内容数据方式删除;删除多条
|
||||
foreach ($this->data as $key => $val) {
|
||||
if ($val[$k] == $search_value){
|
||||
unset($this->data[$key]);
|
||||
}
|
||||
}
|
||||
self::save($this->file,$this->data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=====================================================
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
public static function arr_sort(&$arr,$key, $type = 'asc'){
|
||||
$keysvalue = $new_array = array();
|
||||
foreach ($arr as $k => $v) {
|
||||
$keysvalue[$k] = $v[$key];
|
||||
}
|
||||
if ($type == 'asc') {
|
||||
asort($keysvalue);
|
||||
} else {
|
||||
arsort($keysvalue);
|
||||
}
|
||||
reset($keysvalue);
|
||||
foreach ($keysvalue as $k => $v) {
|
||||
$new_array[$k] = $arr[$k];
|
||||
}
|
||||
return $new_array;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载数据;并解析成程序数据
|
||||
*/
|
||||
public static function load($file){//10000次需要4s 数据量差异不大。
|
||||
if (!file_exists($file)) touch($file);
|
||||
$str = file_get_contents($file);
|
||||
$str = substr($str, strlen(CONFIG_EXIT));
|
||||
$data= json_decode($str,true);
|
||||
return $data;
|
||||
}
|
||||
/**
|
||||
* 保存数据;
|
||||
*/
|
||||
public static function save($file,$data){//10000次需要6s
|
||||
if (!$file) return;
|
||||
if($fp = fopen($file, "w")){
|
||||
if (flock($fp, LOCK_EX)) { // 进行排它型锁定
|
||||
$str = CONFIG_EXIT.json_encode($data);
|
||||
fwrite($fp, $str);
|
||||
fflush($fp); // flush output before releasing the lock
|
||||
flock($fp, LOCK_UN); // 释放锁定
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 历史记录操作类
|
||||
* 传入或者构造一个数组。形如:
|
||||
* array(
|
||||
* 'history_num'=>20, //队列节点总共个数
|
||||
* 'first'=>0, //起始位置,从0开始。数组索引值
|
||||
* 'last'=>0, //终点位置,从0开始。
|
||||
* 'back'=>0, //从first位置倒退了多少步,差值。
|
||||
* 'history'=>array( //数组,存放操作队列。
|
||||
* array('path'=>'D:/'),
|
||||
* array('path'=>'D:/www/'),
|
||||
* array('path'=>'E:/'),
|
||||
* array('path'=>'/home/')
|
||||
* ……
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
|
||||
class history{
|
||||
var $history_num;
|
||||
var $first;
|
||||
var $last;
|
||||
var $back;
|
||||
var $history=array();
|
||||
|
||||
function __construct($array=array(),$num=20){
|
||||
if (!$array) {//数组为空.构造一个循环队列。
|
||||
$history=array();
|
||||
for ($i=0; $i < $num; $i++) {
|
||||
array_push($history,array('path'=>''));
|
||||
}
|
||||
$array=array(
|
||||
'history_num'=>$num,
|
||||
'first'=>0,//起始位置
|
||||
'last'=>0,//终点位置
|
||||
'back'=>0,
|
||||
'history'=>$history
|
||||
);
|
||||
}
|
||||
$this->history_num=$array['history_num'];
|
||||
$this->first=$array['first'];
|
||||
$this->last=$array['last'];
|
||||
$this->back=$array['back'];
|
||||
$this->history=$array['history'];
|
||||
}
|
||||
|
||||
function nextNum($i,$n=1){//环路下n一个值。和时钟环路类似。
|
||||
return ($i+$n)<$this->history_num ? ($i+$n):($i+$n-$this->history_num);
|
||||
}
|
||||
function prevNum($i,$n=1){//环路上一个值i。回退N个位置。
|
||||
return ($i-$n)>=0 ? ($i-$n) : ($i-$n+$this->history_num);
|
||||
}
|
||||
|
||||
function minus($i,$j){//顺时针两点只差,i-j
|
||||
return ($i > $j) ? ($i - $j):($i-$j+$this->history_num);
|
||||
}
|
||||
|
||||
|
||||
function getHistory(){//返回数组,用于保存或者序列化操作。
|
||||
return array(
|
||||
'history_num'=> $this->history_num,
|
||||
'first' => $this->first,
|
||||
'last' => $this->last,
|
||||
'back' => $this->back,
|
||||
'history' => $this->history
|
||||
);
|
||||
}
|
||||
|
||||
function add($path){
|
||||
if ($path==$this->history[$this->first]['path']) {//和最后相同,则不记录
|
||||
return 0;
|
||||
}
|
||||
if ($this->back!=0) {//有后退操作记录的情况下,进行插入。
|
||||
$this->goedit($path);
|
||||
return;
|
||||
}
|
||||
if ($this->history[0]['path']=='') {//刚构造,不用加一.首位不前移
|
||||
$this->history[$this->first]['path']=$path;
|
||||
return;
|
||||
}else{
|
||||
$this->first=$this->nextNum($this->first);//首位前移
|
||||
$this->history[$this->first]['path']=$path;
|
||||
}
|
||||
if ($this->first==$this->last) {//起始位置与终止位置相遇
|
||||
$this->last=$this->nextNum($this->last);//末尾位置前移。
|
||||
}
|
||||
}
|
||||
|
||||
function goback(){//返回从first后退N步的地址。
|
||||
$this->back+=1;
|
||||
//最大后退步数为起点到终点之差(顺时针之差)
|
||||
$mins=$this->minus($this->first,$this->last);
|
||||
if ($this->back >= $mins) {//退到最后点
|
||||
$this->back=$mins;
|
||||
}
|
||||
|
||||
$pos=$this->prevNum($this->first,$this->back);
|
||||
return $this->history[$pos]['path'];
|
||||
}
|
||||
|
||||
function gonext(){//从first后退N步的地方前进一步。
|
||||
$this->back-=1;
|
||||
if ($this->back<0) {//退到最后点
|
||||
$this->back=0;
|
||||
}
|
||||
return $this->history[$this->prevNum($this->first,$this->back)]['path'];
|
||||
}
|
||||
function goedit($path){//后退到某个点,没有前进而是修改。则firs值为最后的值。
|
||||
$pos=$this->minus($this->first,$this->back);
|
||||
$pos=$this->nextNum($pos);//下一个
|
||||
$this->history[$pos]['path']=$path;
|
||||
$this->first=$pos;
|
||||
$this->back=0;
|
||||
}
|
||||
|
||||
//是否可以后退
|
||||
function isback(){
|
||||
if ($this->back==0 && $this->first==0 && $this->last==0) {
|
||||
return 0;
|
||||
}
|
||||
if ($this->back < $this->minus($this->first,$this->last)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//是否可以前进
|
||||
function isnext(){
|
||||
if ($this->back>0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//取出最新纪录
|
||||
function getFirst(){
|
||||
return $this->history[$this->first]['path'];
|
||||
}
|
||||
}
|
||||
|
||||
//include 'common.function.php';
|
||||
//$hi=new history(array(),6);//传入空数组,则初始化数组构造。
|
||||
//for ($i=0; $i <8; $i++) {
|
||||
// $hi->add('s'.$i);
|
||||
//}
|
||||
//pr($hi->goback());
|
||||
//pr($hi->gonext());
|
||||
//$hi->add('asdfasdf2');
|
||||
//pr($hi->getHistory());
|
||||
|
||||
|
||||
//$ss=new history($hi->getHistory());//直接用数组构造。
|
||||
//$ss->add('asdfasdf');
|
||||
//$ss->goback();
|
||||
//pr($ss->getHistory());
|
|
@ -0,0 +1,167 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* 类名:CreatMiniature
|
||||
* 功能:生成多种类型的缩略图
|
||||
* 基本参数:$srcFile,$echoType
|
||||
* 方法用到的参数:
|
||||
* $toFile,生成的文件 * $toW,生成的宽 $toH,生成的高*
|
||||
* $bk1,背景颜色参数 以255为最高 * $bk2,背景颜色参数 * $bk3,背景颜色参数
|
||||
*
|
||||
* 例子:
|
||||
* include('thumb.php');
|
||||
* $cm=new CreatMiniature();
|
||||
* $cm->SetVar('1.jpg','file');
|
||||
* $cm->Distortion('dis_bei.jpg',150,200);
|
||||
|
||||
* $cm->Prorate('pro_bei.jpg',150,200);//附带切割
|
||||
* $cm->Cut('cut_bei.jpg',150,200);
|
||||
* $cm->BackFill('fill_bei.jpg',150,200);
|
||||
*/
|
||||
class CreatMiniature {
|
||||
// 公共变量
|
||||
var $srcFile = ''; //原图
|
||||
var $echoType; //输出图片类型,link--不保存为文件;file--保存为文件
|
||||
var $im = ''; //临时变量
|
||||
var $srcW = ''; //原图宽
|
||||
var $srcH = ''; //原图高
|
||||
// 设置变量及初始化
|
||||
function SetVar($srcFile, $echoType){
|
||||
$this->srcFile = $srcFile;
|
||||
$this->echoType = $echoType;
|
||||
|
||||
$info = '';
|
||||
$data = GetImageSize($this->srcFile, $info);
|
||||
switch ($data[2]) {
|
||||
case 1:
|
||||
if (!function_exists('imagecreatefromgif')) {
|
||||
exit();
|
||||
}
|
||||
$this->im = ImageCreateFromGIF($this->srcFile);
|
||||
break;
|
||||
case 2:
|
||||
if (!function_exists('imagecreatefromjpeg')) {
|
||||
exit();
|
||||
}
|
||||
$this->im = ImageCreateFromJpeg($this->srcFile);
|
||||
break;
|
||||
case 3:
|
||||
$this->im = ImageCreateFromPNG($this->srcFile);
|
||||
break;
|
||||
}
|
||||
$this->srcW = ImageSX($this->im);
|
||||
$this->srcH = ImageSY($this->im);
|
||||
}
|
||||
// 生成扭曲型缩图
|
||||
function Distortion($toFile, $toW, $toH){
|
||||
$cImg = $this->CreatImage($this->im, $toW, $toH, 0, 0, 0, 0, $this->srcW, $this->srcH);
|
||||
return $this->EchoImage($cImg, $toFile);
|
||||
ImageDestroy($cImg);
|
||||
}
|
||||
// 生成按比例缩放的缩图
|
||||
function Prorate($toFile, $toW, $toH){
|
||||
$toWH = $toW / $toH;
|
||||
$srcWH = $this->srcW / $this->srcH;
|
||||
if ($toWH<=$srcWH) {
|
||||
$ftoW = $toW;
|
||||
$ftoH = $ftoW * ($this->srcH / $this->srcW);
|
||||
} else {
|
||||
$ftoH = $toH;
|
||||
$ftoW = $ftoH * ($this->srcW / $this->srcH);
|
||||
}
|
||||
if ($this->srcW > $toW || $this->srcH > $toH) {
|
||||
$cImg = $this->CreatImage($this->im, $ftoW, $ftoH, 0, 0, 0, 0, $this->srcW, $this->srcH);
|
||||
return $this->EchoImage($cImg, $toFile);
|
||||
ImageDestroy($cImg);
|
||||
} else {
|
||||
$cImg = $this->CreatImage($this->im, $this->srcW, $this->srcH, 0, 0, 0, 0, $this->srcW, $this->srcH);
|
||||
return $this->EchoImage($cImg, $toFile);
|
||||
ImageDestroy($cImg);
|
||||
}
|
||||
}
|
||||
// 生成最小裁剪后的缩图
|
||||
function Cut($toFile, $toW, $toH){
|
||||
$toWH = $toW / $toH;
|
||||
$srcWH = $this->srcW / $this->srcH;
|
||||
if ($toWH<=$srcWH) {
|
||||
$ctoH = $toH;
|
||||
$ctoW = $ctoH * ($this->srcW / $this->srcH);
|
||||
} else {
|
||||
$ctoW = $toW;
|
||||
$ctoH = $ctoW * ($this->srcH / $this->srcW);
|
||||
}
|
||||
$allImg = $this->CreatImage($this->im, $ctoW, $ctoH, 0, 0, 0, 0, $this->srcW, $this->srcH);
|
||||
$cImg = $this->CreatImage($allImg, $toW, $toH, 0, 0, ($ctoW - $toW) / 2, ($ctoH - $toH) / 2, $toW, $toH);
|
||||
return $this->EchoImage($cImg, $toFile);
|
||||
ImageDestroy($cImg);
|
||||
ImageDestroy($allImg);
|
||||
}
|
||||
// 生成背景填充的缩图,默认用白色填充剩余空间,传入$isAlpha为真时用透明色填充
|
||||
function BackFill($toFile, $toW, $toH,$isAlpha=false,$red=255, $green=255, $blue=255){
|
||||
$toWH = $toW / $toH;
|
||||
$srcWH = $this->srcW / $this->srcH;
|
||||
if ($toWH<=$srcWH) {
|
||||
$ftoW = $toW;
|
||||
$ftoH = $ftoW * ($this->srcH / $this->srcW);
|
||||
} else {
|
||||
$ftoH = $toH;
|
||||
$ftoW = $ftoH * ($this->srcW / $this->srcH);
|
||||
}
|
||||
if (function_exists('imagecreatetruecolor')) {
|
||||
@$cImg = ImageCreateTrueColor($toW, $toH);
|
||||
if (!$cImg) {
|
||||
$cImg = ImageCreate($toW, $toH);
|
||||
}
|
||||
} else {
|
||||
$cImg = ImageCreate($toW, $toH);
|
||||
}
|
||||
|
||||
|
||||
$fromTop = ($toH - $ftoH)/2;//从正中间填充
|
||||
$backcolor = imagecolorallocate($cImg,$red,$green, $blue); //填充的背景颜色
|
||||
if ($isAlpha){//填充透明色
|
||||
$backcolor=ImageColorTransparent($cImg,$backcolor);
|
||||
$fromTop = $toH - $ftoH;//从底部填充
|
||||
}
|
||||
|
||||
ImageFilledRectangle($cImg, 0, 0, $toW, $toH, $backcolor);
|
||||
if ($this->srcW > $toW || $this->srcH > $toH) {
|
||||
$proImg = $this->CreatImage($this->im, $ftoW, $ftoH, 0, 0, 0, 0, $this->srcW, $this->srcH);
|
||||
if ($ftoW < $toW) {
|
||||
ImageCopy($cImg, $proImg, ($toW - $ftoW) / 2, 0, 0, 0, $ftoW, $ftoH);
|
||||
} else if ($ftoH < $toH) {
|
||||
ImageCopy($cImg, $proImg, 0, $fromTop, 0, 0, $ftoW, $ftoH);
|
||||
} else {
|
||||
ImageCopy($cImg, $proImg, 0, 0, 0, 0, $ftoW, $ftoH);
|
||||
}
|
||||
} else {
|
||||
ImageCopyMerge($cImg, $this->im, ($toW - $ftoW) / 2,$fromTop, 0, 0, $ftoW, $ftoH, 100);
|
||||
}
|
||||
return $this->EchoImage($cImg, $toFile);
|
||||
ImageDestroy($cImg);
|
||||
}
|
||||
|
||||
function CreatImage($img, $creatW, $creatH, $dstX, $dstY, $srcX, $srcY, $srcImgW, $srcImgH){
|
||||
if (function_exists('imagecreatetruecolor')) {
|
||||
@$creatImg = ImageCreateTrueColor($creatW, $creatH);
|
||||
if ($creatImg)
|
||||
ImageCopyResampled($creatImg, $img, $dstX, $dstY, $srcX, $srcY, $creatW, $creatH, $srcImgW, $srcImgH);
|
||||
else {
|
||||
$creatImg = ImageCreate($creatW, $creatH);
|
||||
ImageCopyResized($creatImg, $img, $dstX, $dstY, $srcX, $srcY, $creatW, $creatH, $srcImgW, $srcImgH);
|
||||
}
|
||||
} else {
|
||||
$creatImg = ImageCreate($creatW, $creatH);
|
||||
ImageCopyResized($creatImg, $img, $dstX, $dstY, $srcX, $srcY, $creatW, $creatH, $srcImgW, $srcImgH);
|
||||
}
|
||||
return $creatImg;
|
||||
}
|
||||
// 输出图片,link---只输出,不保存文件。file--保存为文件
|
||||
function EchoImage($img, $to_File){
|
||||
switch ($this->echoType) {
|
||||
case 'link':return ImagePNG($img);break;
|
||||
case 'file':return ImagePNG($img, $to_File);break;
|
||||
//return ImageJpeg($img, $to_File);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 程序路由处理类
|
||||
* 这里类判断外界参数调用内部方法
|
||||
*/
|
||||
class Application {
|
||||
public $default_controller = null; //默认的类名
|
||||
public $default_do = null; //默认的方法名
|
||||
public $sub_dir =''; //控制器子目录
|
||||
public $model = ''; //控制器对应模型 对象。
|
||||
|
||||
/**
|
||||
* 设置默认的类名
|
||||
* @param string $default_controller
|
||||
*/
|
||||
public function setDefaultController($default_controller){
|
||||
$this -> default_controller = $default_controller;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认的方法名
|
||||
* @param string $default_action
|
||||
*/
|
||||
public function setDefaultAction($default_action){
|
||||
$this -> default_action = $default_action;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置控制器子目录
|
||||
* @param string $dir
|
||||
*/
|
||||
public function setSubDir($dir){
|
||||
$this -> sub_dir = $dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行controller 的方法
|
||||
* @param $class , controller类名。
|
||||
* @param $function , 方法名
|
||||
*/
|
||||
public function appRun($class,$function){
|
||||
$sub_dir = $this -> sub_dir ? $this -> sub_dir . '/' : '';
|
||||
$class_file = CONTROLLER_DIR . $sub_dir.$class.'.class.php';
|
||||
if (!is_file($class_file)) {
|
||||
pr($class.' controller not exists!',1);
|
||||
}
|
||||
require_once $class_file;
|
||||
if (!class_exists($class)) {
|
||||
pr($class.' class not exists',1);
|
||||
}
|
||||
$instance = new $class();
|
||||
if (!method_exists($instance, $function)) {
|
||||
pr($function.' method not exists',1);
|
||||
}
|
||||
$instance -> $function();
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行自动加载的控制器
|
||||
*/
|
||||
private function autorun(){
|
||||
global $config;
|
||||
if (count($config['autorun']) > 0) {
|
||||
foreach ($config['autorun'] as $key => $var) {
|
||||
$this->appRun($var['controller'],$var['function']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用实际类和方式
|
||||
*/
|
||||
public function run(){
|
||||
$URI = $GLOBALS['in']['URLremote'];
|
||||
if (!isset($URI[0]) || $URI[0] == '') $URI[0] = $this->default_controller;
|
||||
if (!isset($URI[1]) || $URI[1] == '') $URI[1] = $this->default_action;
|
||||
define('ST',$URI[0]);
|
||||
define('ACT',$URI[1]);
|
||||
//自动加载运行类。
|
||||
$this->autorun();
|
||||
$this->appRun(ST,ACT);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 控制器抽象类
|
||||
*/
|
||||
abstract class Controller {
|
||||
public $in;
|
||||
public $db;
|
||||
public $config; // 全局配置
|
||||
public $tpl; // 模板目录
|
||||
public $values; // 模板变量
|
||||
public $L;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
function __construct(){
|
||||
global $in,$config,$db,$L;
|
||||
|
||||
$this -> db = $db;
|
||||
$this -> L = $L;
|
||||
$this -> config = &$config;
|
||||
$this -> in = &$in;
|
||||
$this -> values['config'] = &$config;
|
||||
$this -> values['in'] = &$in;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载模型
|
||||
* @param string $class
|
||||
*/
|
||||
public function loadModel($class){
|
||||
$args = func_get_args();
|
||||
$this -> $class = call_user_func_array('init_model', $args);
|
||||
return $this -> $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载类库文件
|
||||
* @param string $class
|
||||
*/
|
||||
public function loadClass($class){
|
||||
if (1 === func_num_args()) {
|
||||
$this -> $class = new $class;
|
||||
} else {
|
||||
$reflectionObj = new ReflectionClass($class);
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
$this -> $class = $reflectionObj -> newInstanceArgs($args);
|
||||
}
|
||||
return $this -> $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示模板
|
||||
*
|
||||
* TODO smarty
|
||||
* @param
|
||||
*/
|
||||
protected function assign($key,$value){
|
||||
$this->values[$key] = $value;
|
||||
}
|
||||
/**
|
||||
* 显示模板
|
||||
* @param
|
||||
*/
|
||||
protected function display($tpl_file){
|
||||
global $L,$LNG;
|
||||
extract($this->values);
|
||||
require($this->tpl.$tpl_file);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 模型抽象类
|
||||
* 一个关于各种模型的基本行为类,每个模型都必须继承这个类的方法
|
||||
*/
|
||||
|
||||
abstract class Model {
|
||||
var $db = null;
|
||||
var $in;
|
||||
var $config;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @return Null
|
||||
*/
|
||||
function __construct(){
|
||||
global $g_config, $in;
|
||||
$this -> in = $in;
|
||||
$this -> config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO db
|
||||
*/
|
||||
function db(){
|
||||
if ($this ->db != NULL) {
|
||||
return $this ->db;
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,697 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 加载类,从class目录;controller;model目录中寻找class
|
||||
*/
|
||||
function _autoload($className){
|
||||
if (file_exists(CLASS_DIR . strtolower($className) . '.class.php')) {
|
||||
require_once(CLASS_DIR . strtolower($className) . '.class.php');
|
||||
} else if (file_exists(CONTROLLER_DIR . strtolower($className) . '.class.php')) {
|
||||
require_once(CONTROLLER_DIR . strtolower($className) . '.class.php');
|
||||
} else if (file_exists(MODEl_DIR . strtolower($className) . '.class.php')) {
|
||||
require_once(MODEl_DIR . strtolower($className) . '.class.php');
|
||||
} else {
|
||||
// error code;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 生产model对象
|
||||
*/
|
||||
function init_model($model_name){
|
||||
if (!class_exists($model_name.'Model')) {
|
||||
$model_file = MODEL_DIR . strtolower($model_name) . 'Model.class.php';
|
||||
require_once ($model_file);
|
||||
|
||||
if(!is_file($model_file)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$reflectionObj = new ReflectionClass($model_name.'Model');
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
return $reflectionObj -> newInstanceArgs($args);
|
||||
}
|
||||
/**
|
||||
* 生产controller对象
|
||||
*/
|
||||
function init_controller($controller_name){
|
||||
if (!class_exists($controller_name)) {
|
||||
$model_file = CONTROLLER_DIR . strtolower($controller_name) . '.class.php';
|
||||
if(!is_file($model_file)){
|
||||
return false;
|
||||
}
|
||||
require_once ($model_file);
|
||||
}
|
||||
$reflectionObj = new ReflectionClass($controller_name);
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
return $reflectionObj -> newInstanceArgs($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载类
|
||||
*/
|
||||
function load_class($class){
|
||||
$filename = CLASS_DIR.$class.'.class.php';
|
||||
if (file_exists($filename)) {
|
||||
require($filename);
|
||||
}else{
|
||||
pr($filename.' is not exist',1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 加载函数库
|
||||
*/
|
||||
function load_function($function){
|
||||
$filename = FUNCTION_DIR.$function.'.function.php';
|
||||
if (file_exists($filename)) {
|
||||
require($filename);
|
||||
}else{
|
||||
pr($filename.' is not exist',1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 文本字符串转换
|
||||
*/
|
||||
function mystr($str){
|
||||
$from = array("\r\n", " ");
|
||||
$to = array("<br/>", " ");
|
||||
return str_replace($from, $to, $str);
|
||||
}
|
||||
|
||||
// 清除多余空格和回车字符
|
||||
function strip($str){
|
||||
return preg_replace('!\s+!', '', $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取精确时间
|
||||
*/
|
||||
function mtime(){
|
||||
$t= explode(' ',microtime());
|
||||
$time = $t[0]+$t[1];
|
||||
return $time;
|
||||
}
|
||||
/**
|
||||
* 过滤HTML
|
||||
*/
|
||||
function clear_html($HTML, $br = true){
|
||||
$HTML = htmlspecialchars(trim($HTML));
|
||||
$HTML = str_replace("\t", ' ', $HTML);
|
||||
if ($br) {
|
||||
return nl2br($HTML);
|
||||
} else {
|
||||
return str_replace("\n", '', $HTML);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将obj深度转化成array
|
||||
*
|
||||
* @param $obj 要转换的数据 可能是数组 也可能是个对象 还可能是一般数据类型
|
||||
* @return array || 一般数据类型
|
||||
*/
|
||||
function obj2array($obj){
|
||||
if (is_array($obj)) {
|
||||
foreach($obj as &$value) {
|
||||
$value = obj2array($value);
|
||||
}
|
||||
return $obj;
|
||||
} elseif (is_object($obj)) {
|
||||
$obj = get_object_vars($obj);
|
||||
return obj2array($obj);
|
||||
} else {
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算时间差
|
||||
*
|
||||
* @param char $pretime
|
||||
* @return char
|
||||
*/
|
||||
function spend_time(&$pretime){
|
||||
$now = microtime(1);
|
||||
$spend = round($now - $pretime, 5);
|
||||
$pretime = $now;
|
||||
return $spend;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回当前浮点式的时间,单位秒;主要用在调试程序程序时间时用
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
function microtime_float(){
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
return ((float)$usec + (float)$sec);
|
||||
}
|
||||
/**
|
||||
* 计算N次方根
|
||||
* @param $num
|
||||
* @param $root
|
||||
*/
|
||||
function croot($num, $root = 3){
|
||||
$root = intval($root);
|
||||
if (!$root) {
|
||||
return $num;
|
||||
}
|
||||
return exp(log($num) / $root);
|
||||
}
|
||||
|
||||
function add_magic_quotes($array){
|
||||
foreach ((array) $array as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$array[$k] = add_magic_quotes($v);
|
||||
} else {
|
||||
$array[$k] = addslashes($v);
|
||||
}
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
// 字符串加转义
|
||||
function add_slashes($string){
|
||||
if (!$GLOBALS['magic_quotes_gpc']) {
|
||||
if (is_array($string)) {
|
||||
foreach($string as $key => $val) {
|
||||
$string[$key] = add_slashes($val);
|
||||
}
|
||||
} else {
|
||||
$string = addslashes($string);
|
||||
}
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* hex to binary
|
||||
*/
|
||||
if (!function_exists('hex2bin')) {
|
||||
function hex2bin($hexdata) {
|
||||
return pack('H*', $hexdata);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维数组按照指定的键值进行排序,
|
||||
*
|
||||
* @param $keys 根据键值
|
||||
* @param $type 升序降序
|
||||
* @return array $array = array(
|
||||
* array('name'=>'手机','brand'=>'诺基亚','price'=>1050),
|
||||
* array('name'=>'手表','brand'=>'卡西欧','price'=>960)
|
||||
* );$out = array_sort($array,'price');
|
||||
*/
|
||||
function array_sort($arr, $keys, $type = 'asc'){
|
||||
$keysvalue = $new_array = array();
|
||||
foreach ($arr as $k => $v) {
|
||||
$keysvalue[$k] = $v[$keys];
|
||||
}
|
||||
if ($type == 'asc') {
|
||||
asort($keysvalue);
|
||||
} else {
|
||||
arsort($keysvalue);
|
||||
}
|
||||
reset($keysvalue);
|
||||
foreach ($keysvalue as $k => $v) {
|
||||
$new_array[$k] = $arr[$k];
|
||||
}
|
||||
return $new_array;
|
||||
}
|
||||
/**
|
||||
* 遍历数组,对每个元素调用 $callback,假如返回值不为假值,则直接返回该返回值;
|
||||
* 假如每次 $callback 都返回假值,最终返回 false
|
||||
*
|
||||
* @param $array
|
||||
* @param $callback
|
||||
* @return mixed
|
||||
*/
|
||||
function array_try($array, $callback){
|
||||
if (!$array || !$callback) {
|
||||
return false;
|
||||
}
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
array_shift($args);
|
||||
if (!$args) {
|
||||
$args = array();
|
||||
}
|
||||
foreach($array as $v) {
|
||||
$params = $args;
|
||||
array_unshift($params, $v);
|
||||
$x = call_user_func_array($callback, $params);
|
||||
if ($x) {
|
||||
return $x;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// 求多个数组的并集
|
||||
function array_union(){
|
||||
$argsCount = func_num_args();
|
||||
if ($argsCount < 2) {
|
||||
return false;
|
||||
} else if (2 === $argsCount) {
|
||||
list($arr1, $arr2) = func_get_args();
|
||||
|
||||
while ((list($k, $v) = each($arr2))) {
|
||||
if (!in_array($v, $arr1)) $arr1[] = $v;
|
||||
}
|
||||
return $arr1;
|
||||
} else { // 三个以上的数组合并
|
||||
$arg_list = func_get_args();
|
||||
$all = call_user_func_array('array_union', $arg_list);
|
||||
return array_union($arg_list[0], $all);
|
||||
}
|
||||
}
|
||||
// 取出数组中第n项
|
||||
function array_get($arr,$index){
|
||||
foreach($arr as $k=>$v){
|
||||
$index--;
|
||||
if($index<0) return array($k,$v);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打包返回AJAX请求的数据
|
||||
* @params {int} 返回状态码, 通常0表示正常
|
||||
* @params {array} 返回的数据集合
|
||||
*/
|
||||
function show_json($data,$code = true,$info=''){
|
||||
$use_time = mtime() - $GLOBALS['config']['app_startTime'];
|
||||
$result = array('code' => $code,'use_time'=>$use_time,'data' => $data);
|
||||
if ($info != '') {
|
||||
$result['info'] = $info;
|
||||
}
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode($result);
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 简单模版转换,用于根据配置获取列表:
|
||||
* 参数:cute1:第一次切割的字符串,cute2第二次切割的字符串,
|
||||
* arraylist为待处理的字符串,$this 为标记当前项,$this_str为当项标记的替换。
|
||||
* $tpl为处理后填充到静态模版({0}代表切割后左值,{1}代表切割后右值,{this}代表当前项填充值)
|
||||
* 例子:
|
||||
* $arr="default=淡蓝(默认)=5|mac=mac海洋=6|mac1=mac1海洋=7";
|
||||
* $tpl="<li class='list {this}' theme='{0}'>{1}_{2}</li>\n";
|
||||
* echo getTplList('|','=',$arr,$tpl,'mac'),'<br/>';
|
||||
*/
|
||||
function getTplList($cute1, $cute2, $arraylist, $tpl,$this,$this_str=''){
|
||||
$list = explode($cute1, $arraylist);
|
||||
if ($this_str == '') $this_str ="this";
|
||||
$html = '';
|
||||
foreach ($list as $value) {
|
||||
$info = explode($cute2, $value);
|
||||
$arr_replace = array();
|
||||
foreach ($info as $key => $value) {
|
||||
$arr_replace[$key]='{'.$key .'}';
|
||||
}
|
||||
if ($info[0] == $this) {
|
||||
$temp = str_replace($arr_replace, $info, $tpl);
|
||||
$temp = str_replace('{this}', $this_str, $temp);
|
||||
} else {
|
||||
$temp = str_replace($arr_replace, $info, $tpl);
|
||||
$temp = str_replace('{this}', '', $temp);
|
||||
}
|
||||
$html .= $temp;
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
//获取当前url地址
|
||||
function get_url() {
|
||||
$sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']
|
||||
== '443' ? 'https://' : 'http://';
|
||||
$php_self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||
$path_info = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
|
||||
$relate_url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] :
|
||||
$php_self.(isset($_SERVER['QUERY_STRING']) ? '?'.$_SERVER['QUERY_STRING'] : $path_info);
|
||||
return $sys_protocal.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '').$relate_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉HTML代码中的HTML标签,返回纯文本
|
||||
* @param string $document 待处理的字符串
|
||||
* @return string
|
||||
*/
|
||||
function html2txt($document){
|
||||
$search = array ("'<script[^>]*?>.*?</script>'si", // 去掉 javascript
|
||||
"'<[\/\!]*?[^<>]*?>'si", // 去掉 HTML 标记
|
||||
"'([\r\n])[\s]+'", // 去掉空白字符
|
||||
"'&(quot|#34);'i", // 替换 HTML 实体
|
||||
"'&(amp|#38);'i",
|
||||
"'&(lt|#60);'i",
|
||||
"'&(gt|#62);'i",
|
||||
"'&(nbsp|#160);'i",
|
||||
"'&(iexcl|#161);'i",
|
||||
"'&(cent|#162);'i",
|
||||
"'&(pound|#163);'i",
|
||||
"'&(copy|#169);'i",
|
||||
"'&#(\d+);'e"); // 作为 PHP 代码运行
|
||||
$replace = array ("",
|
||||
"",
|
||||
"",
|
||||
"\"",
|
||||
"&",
|
||||
"<",
|
||||
">",
|
||||
" ",
|
||||
chr(161),
|
||||
chr(162),
|
||||
chr(163),
|
||||
chr(169),
|
||||
"chr(\\1)");
|
||||
$text = preg_replace ($search, $replace, $document);
|
||||
return $text;
|
||||
}
|
||||
|
||||
// 获取内容第一条
|
||||
function match($content, $preg){
|
||||
$preg = "/" . $preg . "/isU";
|
||||
preg_match($preg, $content, $result);
|
||||
return $result[1];
|
||||
}
|
||||
// 获取内容,获取一个页面若干信息.结果在 1,2,3……中
|
||||
function match_all($content, $preg){
|
||||
$preg = "/" . $preg . "/isU";
|
||||
preg_match_all($preg, $content, $result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定长度的 utf8 字符串
|
||||
*
|
||||
* @param string $string
|
||||
* @param int $length
|
||||
* @param string $dot
|
||||
* @return string
|
||||
*/
|
||||
function get_utf8_str($string, $length, $dot = '...'){
|
||||
if (strlen($string) <= $length) return $string;
|
||||
|
||||
$strcut = '';
|
||||
$n = $tn = $noc = 0;
|
||||
|
||||
while ($n < strlen($string)) {
|
||||
$t = ord($string[$n]);
|
||||
if ($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) {
|
||||
$tn = 1;
|
||||
$n++;
|
||||
$noc++;
|
||||
} elseif (194 <= $t && $t <= 223) {
|
||||
$tn = 2;
|
||||
$n += 2;
|
||||
$noc += 2;
|
||||
} elseif (224 <= $t && $t <= 239) {
|
||||
$tn = 3;
|
||||
$n += 3;
|
||||
$noc += 2;
|
||||
} elseif (240 <= $t && $t <= 247) {
|
||||
$tn = 4;
|
||||
$n += 4;
|
||||
$noc += 2;
|
||||
} elseif (248 <= $t && $t <= 251) {
|
||||
$tn = 5;
|
||||
$n += 5;
|
||||
$noc += 2;
|
||||
} elseif ($t == 252 || $t == 253) {
|
||||
$tn = 6;
|
||||
$n += 6;
|
||||
$noc += 2;
|
||||
} else {
|
||||
$n++;
|
||||
}
|
||||
if ($noc >= $length) break;
|
||||
}
|
||||
if ($noc > $length) {
|
||||
$n -= $tn;
|
||||
}
|
||||
if ($n < strlen($string)) {
|
||||
$strcut = substr($string, 0, $n);
|
||||
return $strcut . $dot;
|
||||
} else {
|
||||
return $string ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符串截取,支持中文和其他编码
|
||||
*
|
||||
* @param string $str 需要转换的字符串
|
||||
* @param string $start 开始位置
|
||||
* @param string $length 截取长度
|
||||
* @param string $charset 编码格式
|
||||
* @param string $suffix 截断显示字符
|
||||
* @return string
|
||||
*/
|
||||
function msubstr($str, $start = 0, $length, $charset = "utf-8", $suffix = true){
|
||||
if (function_exists("mb_substr")) {
|
||||
$i_str_len = mb_strlen($str);
|
||||
$s_sub_str = mb_substr($str, $start, $length, $charset);
|
||||
if ($length >= $i_str_len) {
|
||||
return $s_sub_str;
|
||||
}
|
||||
return $s_sub_str . '...';
|
||||
} elseif (function_exists('iconv_substr')) {
|
||||
return iconv_substr($str, $start, $length, $charset);
|
||||
}
|
||||
$re['utf-8'] = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/";
|
||||
$re['gb2312'] = "/[\x01-\x7f]|[\xb0-\xf7][\xa0-\xfe]/";
|
||||
$re['gbk'] = "/[\x01-\x7f]|[\x81-\xfe][\x40-\xfe]/";
|
||||
$re['big5'] = "/[\x01-\x7f]|[\x81-\xfe]([\x40-\x7e]|\xa1-\xfe])/";
|
||||
preg_match_all($re[$charset], $str, $match);
|
||||
$slice = join("", array_slice($match[0], $start, $length));
|
||||
if ($suffix) return $slice . "…";
|
||||
return $slice;
|
||||
}
|
||||
|
||||
function web2wap(&$content){
|
||||
$search = array ("/<img[^>]+src=\"([^\">]+)\"[^>]+>/siU",
|
||||
"/<a[^>]+href=\"([^\">]+)\"[^>]*>(.*)<\/a>/siU",
|
||||
"'<br[^>]*>'si",
|
||||
"'<p>'si",
|
||||
"'</p>'si",
|
||||
"'<script[^>]*?>.*?</script>'si", // 去掉 javascript
|
||||
"'<[\/\!]*?[^<>]*?>'si", // 去掉 HTML 标记
|
||||
"'([\r\n])[\s]+'", // 去掉空白字符
|
||||
); // 作为 PHP 代码运行
|
||||
$replace = array ("#img#\\1#/img#",
|
||||
"#link#\\1#\\2#/link#",
|
||||
"[br]",
|
||||
"",
|
||||
"[br]",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
);
|
||||
$text = preg_replace ($search, $replace, $content);
|
||||
$text = str_replace("[br]", "<br/>", $text);
|
||||
$img_start = "<img src=\"" . $publish_url . "automini.php?src=";
|
||||
$img_end = "&pixel=100*80&cache=1&cacheTime=1000&miniType=png\" />";
|
||||
$text = preg_replace ("/#img#(.*)#\/img#/isUe", "'$img_start'.urlencode('\\1').'$img_end'", $text);
|
||||
$text = preg_replace ("/#link#(.*)#(.*)#\/link#/isU", "<a href=\"\\1\">\\2</a>", $text);
|
||||
while (preg_match("/<br\/><br\/>/siU", $text)) {
|
||||
$text = str_replace('<br/><br/>', '<br/>', $text);
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取变量的名字
|
||||
* eg hello="123" 获取ss字符串
|
||||
*/
|
||||
function get_var_name(&$aVar){
|
||||
foreach($GLOBALS as $key => $var) {
|
||||
if ($aVar == $GLOBALS[$key] && $key != "argc") {
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
// -----------------变量调试-------------------
|
||||
/**
|
||||
* 格式化输出变量,或者对象
|
||||
*
|
||||
* @param mixed $var
|
||||
* @param boolean $exit
|
||||
*/
|
||||
function pr($var, $exit = false){
|
||||
ob_start();
|
||||
$style = '<style>
|
||||
pre#debug{margin:10px;font-size:14px;color:#222;font-family:Consolas ;line-height:1.2em;background:#f6f6f6;border-left:5px solid #444;padding:5px;width:95%;word-break:break-all;}
|
||||
pre#debug b{font-weight:400;}
|
||||
#debug #debug_str{color:#E75B22;}
|
||||
#debug #debug_keywords{font-weight:800;color:00f;}
|
||||
#debug #debug_tag1{color:#22f;}
|
||||
#debug #debug_tag2{color:#f33;font-weight:800;}
|
||||
#debug #debug_var{color:#33f;}
|
||||
#debug #debug_var_str{color:#f00;}
|
||||
#debug #debug_set{color:#0C9CAE;}</style>';
|
||||
if (is_array($var)) {
|
||||
print_r($var);
|
||||
} else if (is_object($var)) {
|
||||
echo get_class($var) . " Object";
|
||||
} else if (is_resource($var)) {
|
||||
echo (string)$var;
|
||||
} else {
|
||||
echo var_dump($var);
|
||||
}
|
||||
$out = ob_get_clean(); //缓冲输出给$out 变量
|
||||
$out = preg_replace('/"(.*)"/', '<b id="debug_var_str">"' . '\\1' . '"</b>', $out); //高亮字符串变量
|
||||
$out = preg_replace('/=\>(.*)/', '=>' . '<b id="debug_str">' . '\\1' . '</b>', $out); //高亮=>后面的值
|
||||
$out = preg_replace('/\[(.*)\]/', '<b id="debug_tag1">[</b><b id="debug_var">' . '\\1' . '</b><b id="debug_tag1">]</b>', $out); //高亮变量
|
||||
$from = array(' ', '(', ')', '=>');
|
||||
$to = array(' ', '<b id="debug_tag2">(</i>', '<b id="debug_tag2">)</b>', '<b id="debug_set">=></b>');
|
||||
$out = str_replace($from, $to, $out);
|
||||
|
||||
$keywords = array('Array', 'int', 'string', 'class', 'object', 'null'); //关键字高亮
|
||||
$keywords_to = $keywords;
|
||||
foreach($keywords as $key => $val) {
|
||||
$keywords_to[$key] = '<b id="debug_keywords">' . $val . '</b>';
|
||||
}
|
||||
$out = str_replace($keywords, $keywords_to, $out);
|
||||
$out = str_replace("\n\n", "\n", $out);
|
||||
echo $style . '<pre id="debug"><b id="debug_keywords">' . get_var_name($var) . '</b> = ' . $out . '</pre>';
|
||||
if ($exit) exit; //为真则退出
|
||||
}
|
||||
|
||||
/**
|
||||
* 调试输出变量,对象的值。
|
||||
参数任意个(任意类型的变量)
|
||||
*
|
||||
* @return echo
|
||||
*/
|
||||
function debug_out(){
|
||||
$avg_num = func_num_args();
|
||||
$avg_list = func_get_args();
|
||||
ob_start();
|
||||
for($i = 0; $i < $avg_num; $i++) {
|
||||
pr($avg_list[$i]);
|
||||
}
|
||||
$out = ob_get_clean();
|
||||
echo $out;
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取$from~$to范围内的随机数
|
||||
*
|
||||
* @param $from 下限
|
||||
* @param $to 上限
|
||||
* @return unknown_type
|
||||
*/
|
||||
function rand_from_to($from, $to){
|
||||
$size = $from - $to; //数值区间
|
||||
$max = 30000; //最大
|
||||
if ($size < $max) {
|
||||
return $from + mt_rand(0, $size);
|
||||
} else {
|
||||
if ($size % $max) {
|
||||
return $from + random_from_to(0, $size / $max) * $max + mt_rand(0, $size % $max);
|
||||
} else {
|
||||
return $from + random_from_to(0, $size / $max) * $max + mt_rand(0, $max);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 产生随机字串,可用来自动生成密码 默认长度6位 字母和数字混合
|
||||
*
|
||||
* @param string $len 长度
|
||||
* @param string $type 字串类型:0 字母 1 数字 2 大写字母 3 小写字母 4 中文
|
||||
* 其他为数字字母混合(去掉了 容易混淆的字符oOLl和数字01,)
|
||||
* @param string $addChars 额外字符
|
||||
* @return string
|
||||
*/
|
||||
function rand_string($len = 4, $type = ''){
|
||||
$str = '';
|
||||
switch ($type) {
|
||||
case 0://大小写中英文
|
||||
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
break;
|
||||
case 1://数字
|
||||
$chars = str_repeat('0123456789', 3);
|
||||
break;
|
||||
case 2://大写字母
|
||||
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
break;
|
||||
case 3://小写字母
|
||||
$chars = 'abcdefghijklmnopqrstuvwxyz';
|
||||
break;
|
||||
default:
|
||||
// 默认去掉了容易混淆的字符oOLl和数字01,要添加请使用addChars参数
|
||||
$chars = 'ABCDEFGHIJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789';
|
||||
break;
|
||||
}
|
||||
if ($len > 10) { // 位数过长重复字符串一定次数
|
||||
$chars = $type == 1 ? str_repeat($chars, $len) : str_repeat($chars, 5);
|
||||
}
|
||||
if ($type != 4) {
|
||||
$chars = str_shuffle($chars);
|
||||
$str = substr($chars, 0, $len);
|
||||
} else {
|
||||
// 中文随机字
|
||||
for($i = 0; $i < $len; $i ++) {
|
||||
$str .= msubstr($chars, floor(mt_rand(0, mb_strlen($chars, 'utf-8') - 1)), 1);
|
||||
}
|
||||
}
|
||||
return $str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* php DES解密函数
|
||||
*
|
||||
* @param string $key 密钥
|
||||
* @param string $encrypted 加密字符串
|
||||
* @return string
|
||||
*/
|
||||
function des_decode($key, $encrypted){
|
||||
$encrypted = base64_decode($encrypted);
|
||||
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC, ''); //使用MCRYPT_DES算法,cbc模式
|
||||
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
|
||||
$ks = mcrypt_enc_get_key_size($td);
|
||||
|
||||
mcrypt_generic_init($td, $key, $key); //初始处理
|
||||
$decrypted = mdecrypt_generic($td, $encrypted); //解密
|
||||
|
||||
mcrypt_generic_deinit($td); //结束
|
||||
mcrypt_module_close($td);
|
||||
return pkcs5_unpad($decrypted);
|
||||
}
|
||||
/**
|
||||
* php DES加密函数
|
||||
*
|
||||
* @param string $key 密钥
|
||||
* @param string $text 字符串
|
||||
* @return string
|
||||
*/
|
||||
function des_encode($key, $text){
|
||||
$y = pkcs5_pad($text);
|
||||
$td = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC, ''); //使用MCRYPT_DES算法,cbc模式
|
||||
$ks = mcrypt_enc_get_key_size($td);
|
||||
|
||||
mcrypt_generic_init($td, $key, $key); //初始处理
|
||||
$encrypted = mcrypt_generic($td, $y); //解密
|
||||
mcrypt_generic_deinit($td); //结束
|
||||
mcrypt_module_close($td);
|
||||
return base64_encode($encrypted);
|
||||
}
|
||||
function pkcs5_unpad($text){
|
||||
$pad = ord($text{strlen($text)-1});
|
||||
if ($pad > strlen($text)) return $text;
|
||||
if (strspn($text, chr($pad), strlen($text) - $pad) != $pad) return $text;
|
||||
return substr($text, 0, -1 * $pad);
|
||||
}
|
||||
function pkcs5_pad($text, $block = 8){
|
||||
$pad = $block - (strlen($text) % $block);
|
||||
return $text . str_repeat(chr($pad), $pad);
|
||||
}
|
|
@ -0,0 +1,675 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
/**
|
||||
* 系统函数: filesize(),file_exists(),pathinfo(),rname(),unlink(),filemtime(),is_readable(),is_wrieteable();
|
||||
* 获取文件详细信息 file_info($file_name)
|
||||
* 获取文件夹详细信息 path_info($dir)
|
||||
* 递归获取文件夹信息 path_info_more($dir,&$file_num=0,&$path_num=0,&$size=0)
|
||||
* 获取文件夹下文件列表 path_list($dir)
|
||||
* 路径当前文件[夹]名 get_path_this($path)
|
||||
* 获取路径父目录 get_path_father($path)
|
||||
* 删除文件 del_file($file)
|
||||
* 递归删除文件夹 del_dir($dir)
|
||||
* 递归复制文件夹 copy_dir($source, $dest)
|
||||
* 创建目录 mk_dir($dir, $mode = 0777)
|
||||
* 文件大小格式化 size_format($bytes, $precision = 2)
|
||||
* 判断是否绝对路径 path_is_absolute( $path )
|
||||
* 扩展名的文件类型 ext_type($ext)
|
||||
* 文件下载 file_download($file)
|
||||
* 文件下载到服务器 file_download_this($from, $file_name)
|
||||
* 获取文件(夹)权限 get_mode($file) //rwx_rwx_rwx [文件名需要系统编码]
|
||||
* 上传文件(单个,多个) upload($fileInput, $path = './');//
|
||||
* 获取配置文件项 get_config($file, $ini, $type="string")
|
||||
* 修改配置文件项 update_config($file, $ini, $value,$type="string")
|
||||
* 写日志到LOG_PATH下 write_log('dd','default|.自建目录.','log|error|warning|debug|info|db')
|
||||
*/
|
||||
|
||||
// 传入参数为程序编码时,有传出,则用程序编码,
|
||||
// 传入参数没有和输出无关时,则传入时处理成系统编码。
|
||||
function iconv_app($str){
|
||||
global $config;
|
||||
return iconv($config['system_charset'], $config['app_charset'], $str);
|
||||
}
|
||||
function iconv_system($str){
|
||||
global $config;
|
||||
return iconv($config['app_charset'], $config['system_charset'], $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件详细信息
|
||||
* 文件名从程序编码转换成系统编码,传入utf8,系统函数需要为gbk
|
||||
*/
|
||||
function file_info($path,$date_formate=false){
|
||||
if (!$date_formate) $date_formate = $GLOBALS['L']['time_type'];
|
||||
$name = get_path_this($path);
|
||||
$size = abs(filesize($path));
|
||||
$info = array(
|
||||
'name' => iconv_app($name),
|
||||
'path' => iconv_app(get_path_father($path)),
|
||||
'ext' => get_path_ext($path),
|
||||
'type' => 'file',
|
||||
'mode' => get_mode($path),
|
||||
'atime' => date($date_formate, fileatime($path)), //访问时间
|
||||
'ctime' => date($date_formate, filectime($path)), //创建时间
|
||||
'mtime' => date($date_formate, filemtime($path)), //最后修改时间
|
||||
'is_readable' => intval(is_readable($path)),
|
||||
'is_writeable' => intval(is_writeable($path)),
|
||||
'size' => $size,
|
||||
'size_friendly' => size_format($size, 2)
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
/**
|
||||
* 获取文件夹细信息
|
||||
*/
|
||||
function folder_info($path,$date_formate=false){
|
||||
if (!$date_formate) $date_formate = $GLOBALS['L']['time_type'];
|
||||
$info = array(
|
||||
'name' => iconv_app(get_path_this($path)),
|
||||
'path' => iconv_app(get_path_father($path)),
|
||||
'type' => 'folder',
|
||||
'mode' => get_mode($path),
|
||||
'atime' => date($date_formate, fileatime($path)), //访问时间
|
||||
'ctime' => date($date_formate, filectime($path)), //创建时间
|
||||
'mtime' => date($date_formate, filemtime($path)), //最后修改时间
|
||||
'is_readable' => intval(is_readable($path)),
|
||||
'is_writeable' => intval(is_writeable($path))
|
||||
);
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取一个路径(文件夹&文件) 当前文件[夹]名
|
||||
* test/11/ ==>11 test/1.c ==>1.c
|
||||
*/
|
||||
function get_path_this($path){
|
||||
$path = str_replace('\\','/', rtrim(trim($path),'/'));
|
||||
return substr($path,strrpos($path,'/')+1);
|
||||
}
|
||||
/**
|
||||
* 获取一个路径(文件夹&文件) 父目录
|
||||
* /test/11/==>/test/ /test/1.c ==>/www/test/
|
||||
*/
|
||||
function get_path_father($path){
|
||||
$path = str_replace('\\','/', rtrim(trim($path),'/'));
|
||||
return substr($path, 0, strrpos($path,'/')+1);
|
||||
}
|
||||
|
||||
//自动获取不重复文件(夹)名
|
||||
function get_filename_auto($path){
|
||||
$i=1;$dot_index = strrpos($path,'.');
|
||||
$file_pre = substr($path,0,$dot_index);
|
||||
$file_ext = substr($path,$dot_index);
|
||||
while(file_exists($path)){
|
||||
$path = $file_pre.'('.$i.')'.$file_ext;
|
||||
$i++;
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展名
|
||||
*/
|
||||
function get_path_ext($path){
|
||||
return strtolower(end(explode('.',$path)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件夹详细信息,文件夹属性时调用,包含子文件夹数量,文件数量,总大小
|
||||
*/
|
||||
function path_info($path){
|
||||
//if (!is_dir($path)) return false;
|
||||
$pathinfo = _path_info_more($path);//子目录文件大小统计信息
|
||||
$folderinfo = folder_info($path);
|
||||
return array_merge($pathinfo,$folderinfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查名称是否合法
|
||||
*/
|
||||
function path_check($path){
|
||||
$check = array('/','\\',':','*','?','"','<','>','|');
|
||||
$path = rtrim($path,'/');
|
||||
$path = get_path_this($path);
|
||||
foreach ($check as $v) {
|
||||
if (strstr($path,$v)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归获取文件夹信息: 子文件夹数量,文件数量,总大小
|
||||
*/
|
||||
function _path_info_more($dir, &$file_num = 0, &$path_num = 0, &$size = 0){
|
||||
if (!$dh = opendir($dir)) return false;
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir . "/" . $file;
|
||||
if (!is_dir($fullpath)) {
|
||||
$file_num ++;
|
||||
$size += filesize($fullpath);
|
||||
} else {
|
||||
_path_info_more($fullpath, $file_num, $path_num, $size);
|
||||
$path_num ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
$pathinfo['file_num'] = $file_num;
|
||||
$pathinfo['folder_num'] = $path_num;
|
||||
$pathinfo['size'] = $size;
|
||||
$pathinfo['size_friendly'] = size_format($size);
|
||||
return $pathinfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取多选文件信息,包含子文件夹数量,文件数量,总大小,父目录权限
|
||||
*/
|
||||
function path_info_muti($list){
|
||||
$pathinfo = array(
|
||||
'file_num' => 0,
|
||||
'folder_num' => 0,
|
||||
'size' => 0,
|
||||
'size_friendly' => '',
|
||||
'father_name' => '',
|
||||
'mod' => ''
|
||||
);
|
||||
foreach ($list as $val) {
|
||||
if ($val['type'] == 'folder') {
|
||||
$pathinfo['folder_num'] ++;
|
||||
$temp = path_info($val['path']);
|
||||
$pathinfo['folder_num'] += $temp['folder_num'];
|
||||
$pathinfo['file_num'] += $temp['file_num'];
|
||||
$pathinfo['size'] += $temp['size'];
|
||||
}else{
|
||||
$pathinfo['file_num']++;
|
||||
$pathinfo['size'] += filesize($val['path']);
|
||||
}
|
||||
}
|
||||
$pathinfo['size_friendly'] = size_format($pathinfo['size']);
|
||||
$pathinfo['father_name'] = get_path_father($list[0]['path']);
|
||||
$pathinfo['mode'] = get_mode($pathinfo['father_name']);
|
||||
return $pathinfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件夹下列表信息
|
||||
* dir 包含结尾/ d:/wwwroot/test/
|
||||
* 传入需要读取的文件夹路径,为程序编码
|
||||
*/
|
||||
function path_list($dir,$list_file=true,$check_children=false){
|
||||
$dir = rtrim($dir,'/').'/';
|
||||
if (!is_dir($dir)) return array('folderlist'=>array(),'filelist'=>array());
|
||||
$dh = opendir($dir);
|
||||
$folderlist = array();$filelist = array();//文件夹与文件
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
if ($file != "." && $file != ".." && $file != ".svn" ) {
|
||||
$fullpath = $dir . $file;
|
||||
if (is_dir($fullpath)) {
|
||||
$info = folder_info($fullpath);
|
||||
if($check_children){
|
||||
$info['isParent'] = path_haschildren($fullpath,$list_file);
|
||||
}
|
||||
$folderlist[] = $info;
|
||||
} else if($list_file) {//是否列出文件
|
||||
$info = file_info($fullpath);
|
||||
if($check_children) $info['isParent'] = false;
|
||||
$filelist[] = $info;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return array('folderlist' => $folderlist,'filelist' => $filelist);
|
||||
}
|
||||
|
||||
// 判断文件夹是否含有子内容【区分为文件或者只筛选文件夹才算】
|
||||
function path_haschildren($dir,$check_file=false){
|
||||
$dir = rtrim($dir,'/').'/';
|
||||
if (!$dh = @opendir($dir)) return false;
|
||||
while (false !== ($file = readdir($dh))){
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir.$file;
|
||||
if ($check_file) {//有子目录或者文件都说明有子内容
|
||||
if(is_dir($fullpath.'/') || is_file($fullpath)) return true;
|
||||
}else{//只检查有没有文件
|
||||
if(is_dir($fullpath.'/')) return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件 传入参数编码为操作系统编码. win--gbk
|
||||
*/
|
||||
function del_file($fullpath){
|
||||
if (!@unlink($fullpath)) { // 删除不了,尝试修改文件权限
|
||||
@chmod($fullpath, 0777);
|
||||
if (!@unlink($fullpath)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件夹 传入参数编码为操作系统编码. win--gbk
|
||||
*/
|
||||
function del_dir($dir){
|
||||
if (!$dh = opendir($dir)) return false;
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir . '/' . $file;
|
||||
if (!is_dir($fullpath)) {
|
||||
if (!unlink($fullpath)) { // 删除不了,尝试修改文件权限
|
||||
chmod($fullpath, 0777);
|
||||
if (!unlink($fullpath)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!del_dir($fullpath)) {
|
||||
chmod($fullpath, 0777);
|
||||
if (!del_dir($fullpath)) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
if (rmdir($dir)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制文件夹
|
||||
* eg:将D:/wwwroot/下面wordpress复制到
|
||||
* D:/wwwroot/www/explorer/0000/del/1/
|
||||
* 末尾都不需要加斜杠,复制到地址如果不加源文件夹名,
|
||||
* 就会将wordpress下面文件复制到D:/wwwroot/www/explorer/0000/del/1/下面
|
||||
* $from = 'D:/wwwroot/wordpress';
|
||||
* $to = 'D:/wwwroot/www/explorer/0000/del/1/wordpress';
|
||||
*/
|
||||
|
||||
function copy_dir($source, $dest){
|
||||
$result = false;
|
||||
if (is_file($source)) {
|
||||
if ($dest[strlen($dest)-1] == '/') {
|
||||
$__dest = $dest . "/" . basename($source);
|
||||
} else {
|
||||
$__dest = $dest;
|
||||
}
|
||||
$result = copy($source, $__dest);
|
||||
chmod($__dest, 0755);
|
||||
} elseif (is_dir($source)) {
|
||||
if ($dest[strlen($dest)-1] == '/') {
|
||||
$dest = $dest . basename($source);
|
||||
mkdir($dest, 0755);
|
||||
} else {
|
||||
mkdir($dest, 0755);
|
||||
}
|
||||
$dirHandle = opendir($source);
|
||||
while (false !== ($file = readdir($dirHandle))) {
|
||||
if ($file != "." && $file != "..") {
|
||||
if (!is_dir($source . "/" . $file)) {
|
||||
$__dest = $dest . "/" . $file;
|
||||
} else {
|
||||
$__dest = $dest . "/" . $file;
|
||||
}
|
||||
$result = copy_dir($source . "/" . $file, $__dest);
|
||||
}
|
||||
}
|
||||
closedir($dirHandle);
|
||||
} else {
|
||||
$result = false;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建目录
|
||||
*
|
||||
* @param string $dir
|
||||
* @param int $mode
|
||||
* @return bool
|
||||
*/
|
||||
function mk_dir($dir, $mode = 0777){
|
||||
if (is_dir($dir) || mkdir($dir, $mode))
|
||||
return true;
|
||||
if (!mk_dir(dirname($dir), $mode))
|
||||
return false;
|
||||
return mkdir($dir, $mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取文件&文件夹列表(支持文件夹层级)
|
||||
* path : 文件夹 $dir ——返回的文件夹array files ——返回的文件array
|
||||
* $deepest 是否完整递归;$deep 递归层级
|
||||
*/
|
||||
function recursion_dir($path,&$dir,&$file,$deepest=-1,$deep=0){
|
||||
$path = rtrim($path,'/').'/';
|
||||
if (!is_array($file)) $file=array();
|
||||
if (!is_array($dir)) $dir=array();
|
||||
$handle=opendir($path);
|
||||
while(($val=readdir($handle)) !== false){
|
||||
if ($val=='.' || $val=='..') continue;
|
||||
$value = strval($path.$val);
|
||||
if (is_file($value)){
|
||||
$file[] = $value;
|
||||
}else if(is_dir($value)){
|
||||
$dir[]=$value;
|
||||
if ($deepest==-1 || $deep<$deepest){
|
||||
recursion_dir($value."/",$dir,$file,$deepest,$deep+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
* $search 为包含的字符串
|
||||
* is_content 表示是否搜索文件内容;默认不搜索
|
||||
* is_case 表示区分大小写,默认不区分
|
||||
*/
|
||||
function path_search($path,$search,$is_content=false,$file_ext='',$is_case=false){
|
||||
$ext_arr=explode("|",$file_ext);
|
||||
recursion_dir($path,$dirs,$files,-1,0);
|
||||
$strpos = 'stripos';//是否区分大小写
|
||||
if ($is_case) $strpos = 'strpos';
|
||||
|
||||
$filelist = array();
|
||||
$folderlist = array();
|
||||
foreach($files as $f){
|
||||
$ext = get_path_ext($f);
|
||||
$path_this = get_path_this($f);
|
||||
if ($file_ext !='' && !in_array($ext,$ext_arr)) continue;//文件类型不在用户限定内
|
||||
if ($strpos($path_this,$search) !== false){//搜索文件名;搜到就返回;搜不到继续
|
||||
$filelist[] = file_info($f);
|
||||
continue;
|
||||
}
|
||||
if ($is_content && is_file($f)){
|
||||
$fp = fopen($f, "r");
|
||||
$content = @fread($fp,filesize($f));
|
||||
fclose($fp);
|
||||
if ($strpos($content,$search) !== false){
|
||||
$filelist[] = file_info($f);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($file_ext == '') {//没限定扩展名则才搜索文件夹
|
||||
foreach($dirs as $f){
|
||||
$path_this = get_path_this($f);
|
||||
if ($strpos($path_this,$search)){
|
||||
$folderlist[]= array(
|
||||
'name' => iconv_app(get_path_this($f)),
|
||||
'path' => iconv_app(get_path_father($f))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return array('folderlist' => $folderlist,'filelist' => $filelist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件大小格式化
|
||||
*
|
||||
* @param $ :$bytes, int 文件大小
|
||||
* @param $ :$precision int 保留小数点
|
||||
* @return :string
|
||||
*/
|
||||
function size_format($bytes, $precision = 2){
|
||||
if ($bytes == 0) return "0 B";
|
||||
$unit = array('TB' => 1099511627776, // pow( 1024, 4)
|
||||
'GB' => 1073741824, // pow( 1024, 3)
|
||||
'MB' => 1048576, // pow( 1024, 2)
|
||||
'kB' => 1024, // pow( 1024, 1)
|
||||
'B ' => 1, // pow( 1024, 0)
|
||||
);
|
||||
foreach ($unit as $un => $mag) {
|
||||
if (doubleval($bytes) >= $mag)
|
||||
return round($bytes / $mag, $precision).' '.$un;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断路径是不是绝对路径
|
||||
* 返回true('/foo/bar','c:\windows').
|
||||
*
|
||||
* @return 返回true则为绝对路径,否则为相对路径
|
||||
*/
|
||||
function path_is_absolute($path){
|
||||
if (realpath($path) == $path)// *nux 的绝对路径 /home/my
|
||||
return true;
|
||||
if (strlen($path) == 0 || $path[0] == '.')
|
||||
return false;
|
||||
if (preg_match('#^[a-zA-Z]:\\\\#', $path))// windows 的绝对路径 c:\aaa\
|
||||
return true;
|
||||
return (bool)preg_match('#^[/\\\\]#', $path); //绝对路径 运行 / 和 \绝对路径,其他的则为相对路径
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展名的文件类型
|
||||
*
|
||||
* @param $ :$ext string 扩展名
|
||||
* @return :string;
|
||||
*/
|
||||
function ext_type($ext){
|
||||
$ext2type = array(
|
||||
'text' => array('txt','ini','log','asc','csv','tsv','vbs','bat','cmd','inc','conf','inf'),
|
||||
'code' => array('css','htm','html','php','js','c','cpp','h','java','cs','sql','xml'),
|
||||
'picture' => array('jpg','jpeg','png','gif','ico','bmp','tif','tiff','dib','rle'),
|
||||
'audio' => array('mp3','ogg','oga','mid','midi','ram','wav','wma','aac','ac3','aif','aiff','m3a','m4a','m4b','mka','mp1','mx3','mp2'),
|
||||
'flash' => array('swf'),
|
||||
'video' => array('rm','rmvb','flv','mkv','wmv','asf','avi','aiff','mp4','divx','dv','m4v','mov','mpeg','vob','mpg','mpv','ogm','ogv','qt'),
|
||||
'document' => array('doc','docx','docm','dotm','odt','pages','pdf','rtf','xls','xlsx','xlsb','xlsm','ppt','pptx','pptm','odp'),
|
||||
'rar_achieve' => array('rar','arj','tar','ace','gz','lzh','uue','bz2'),
|
||||
'zip_achieve' => array('zip','gzip','cab','tbz','tbz2'),
|
||||
'other_achieve' => array('dmg','sea','sit','sqx')
|
||||
);
|
||||
foreach ($ext2type as $type => $exts) {
|
||||
if (in_array($ext, $exts)) {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件下载
|
||||
*/
|
||||
function file_download($file){
|
||||
if (file_exists($file)) {
|
||||
header("Cache-Control: public");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment;filename=".get_path_this($file));
|
||||
header("Accept-Ranges: bytes");
|
||||
$size = filesize($file);
|
||||
//如果有$_SERVER['HTTP_RANGE']参数 断点续传
|
||||
if (isset ($_SERVER['HTTP_RANGE'])) {
|
||||
list ($a, $range) = explode("=", $_SERVER['HTTP_RANGE']);
|
||||
str_replace($range, "-", $range);
|
||||
$size2 = $size -1; //文件总字节数
|
||||
$new_length = $size2 - $range; //获取下次下载的长度
|
||||
header("HTTP/1.1 206 Partial Content");
|
||||
header("Content-Length: $new_length"); //输入总长
|
||||
header("Content-Range: bytes $range$size2/$size");
|
||||
}else{//第一次连接
|
||||
$size2 = $size -1;
|
||||
header("Content-Range: bytes 0-$size2/$size"); //Content-Range: bytes 0-4988927/4988928
|
||||
header("Content-Length: " . $size); //输出总长
|
||||
}
|
||||
$fp = fopen($file, "rb");
|
||||
fseek($fp, $range);
|
||||
while (!feof($fp)) {
|
||||
set_time_limit(0);
|
||||
print (fread($fp, 1024 * 8)); //输出文件
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
fclose($fp);
|
||||
exit ();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件代理输出
|
||||
*/
|
||||
function file_proxy_out($file){
|
||||
if (file_exists($file)) {
|
||||
$mime = get_file_mime(get_path_ext($file));
|
||||
header("Cache-Control:public");
|
||||
header("Content-Type:".$mime);
|
||||
$size = filesize($file);
|
||||
header("Content-Length: " . $size); //输出总长
|
||||
$fp = fopen($file, "rb");
|
||||
fseek($fp, $range);
|
||||
while (!feof($fp)) {
|
||||
set_time_limit(0);
|
||||
print (fread($fp, 1024 * 8)); //输出文件
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
fclose($fp);
|
||||
exit;
|
||||
}else{
|
||||
show_json('file not exists',false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文件下载到服务器
|
||||
*/
|
||||
function file_download_this($from, $file_name){
|
||||
$fp = @fopen ($from, "rb");
|
||||
if ($fp){
|
||||
$new_fp = @fopen ($file_name, "wb");
|
||||
if ($new_fp){
|
||||
while(!feof($fp)){
|
||||
fwrite($new_fp, fread($fp, 1024 * 8 ), 1024 * 8 );
|
||||
}
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
}else{
|
||||
return -2;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件(夹)权限 rwx_rwx_rwx
|
||||
*/
|
||||
function get_mode($file){
|
||||
$Mode = fileperms($file);
|
||||
$Owner = array();$Group=array();$World=array();
|
||||
if ($Mode &0x1000) $Type = 'p'; // FIFO pipe
|
||||
elseif ($Mode &0x2000) $Type = 'c'; // Character special
|
||||
elseif ($Mode &0x4000) $Type = 'd'; // Directory
|
||||
elseif ($Mode &0x6000) $Type = 'b'; // Block special
|
||||
elseif ($Mode &0x8000) $Type = '-'; // Regular
|
||||
elseif ($Mode &0xA000) $Type = 'l'; // Symbolic Link
|
||||
elseif ($Mode &0xC000) $Type = 's'; // Socket
|
||||
else $Type = 'u'; // UNKNOWN
|
||||
// Determine les permissions par Groupe
|
||||
$Owner['r'] = ($Mode &00400) ? 'r' : '-';
|
||||
$Owner['w'] = ($Mode &00200) ? 'w' : '-';
|
||||
$Owner['x'] = ($Mode &00100) ? 'x' : '-';
|
||||
$Group['r'] = ($Mode &00040) ? 'r' : '-';
|
||||
$Group['w'] = ($Mode &00020) ? 'w' : '-';
|
||||
$Group['e'] = ($Mode &00010) ? 'x' : '-';
|
||||
$World['r'] = ($Mode &00004) ? 'r' : '-';
|
||||
$World['w'] = ($Mode &00002) ? 'w' : '-';
|
||||
$World['e'] = ($Mode &00001) ? 'x' : '-';
|
||||
// Adjuste pour SUID, SGID et sticky bit
|
||||
if ($Mode &0x800) $Owner['e'] = ($Owner['e'] == 'x') ? 's' : 'S';
|
||||
if ($Mode &0x400) $Group['e'] = ($Group['e'] == 'x') ? 's' : 'S';
|
||||
if ($Mode &0x200) $World['e'] = ($World['e'] == 'x') ? 't' : 'T';
|
||||
$Mode = $Type.$Owner['r'].$Owner['w'].$Owner['x'].' '.
|
||||
$Group['r'].$Group['w'].$Group['e'].' '.
|
||||
$World['r'].$World['w'].$World['e'];
|
||||
return $Mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取可以上传的最大值
|
||||
* return * byte
|
||||
*/
|
||||
function get_post_max(){
|
||||
$upload = ini_get('upload_max_filesize');
|
||||
$upload = $upload==''?ini_get('upload_max_size'):$upload;
|
||||
$post = ini_get('post_max_size');
|
||||
$upload = intval($upload)*1024*1024;
|
||||
$post = intval($post)*1024*1024;
|
||||
return $upload<$post?$upload:$post;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传处理。单个文件上传,多个分多次请求
|
||||
* 调用demo
|
||||
* upload('file','D:/www/');
|
||||
*/
|
||||
function upload($fileInput, $path = './'){
|
||||
global $config,$L;
|
||||
if (!isset($_FILES[$fileInput])) show_json($L['upload_error_null'],false);
|
||||
|
||||
$file = $_FILES[$fileInput];
|
||||
$file_name = iconv_system($file['name']);
|
||||
$info = _upload($file['tmp_name'],$file['size'],$path.$file_name);
|
||||
show_json($info['data'],$info['code']);
|
||||
}
|
||||
function _upload($tmp_name,$size,$save_path){
|
||||
global $L;
|
||||
if(file_exists($save_path)){
|
||||
return array('code'=>false,'data'=>$L['upload_error_exists']);
|
||||
}
|
||||
if(move_uploaded_file($tmp_name,$save_path)){
|
||||
return array('code'=>true,'data'=>$L['upload_success'],'path'=>$save_path);
|
||||
}else {
|
||||
return array('code'=>fasle,'data'=>$L['move_error']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写日志
|
||||
* @param string $log 日志信息
|
||||
* @param string $type 日志类型 [system|app|...]
|
||||
* @param string $level 日志级别
|
||||
* @return boolean
|
||||
*/
|
||||
function write_log($log, $type = 'default', $level = 'log'){
|
||||
$now_time = date('[y-m-d H:i:s]');
|
||||
$now_day = date('Y_m_d');
|
||||
// 根据类型设置日志目标位置
|
||||
$target = LOG_PATH . strtolower($type) . '/';
|
||||
mk_dir($target, 0755);
|
||||
if (! is_writable($target)) exit('path can not write!');
|
||||
switch($level){// 分级写日志
|
||||
case 'error': $target .= 'Error_' . $now_day . '.log';break;
|
||||
case 'warning': $target .= 'Warning_' . $now_day . '.log';break;
|
||||
case 'debug': $target .= 'Debug_' . $now_day . '.log';break;
|
||||
case 'info': $target .= 'Info_' . $now_day . '.log';break;
|
||||
case 'db': $target .= 'Db_' . $now_day . '.log';break;
|
||||
default: $target .= 'Log_' . $now_day . '.log';break;
|
||||
}
|
||||
//检测日志文件大小, 超过配置大小则重命名
|
||||
if (file_exists($target) && filesize($target) <= 100000) {
|
||||
$file_name = substr(basename($target),0,strrpos(basename($target),'.log')).'.log';
|
||||
rename($target, dirname($target) .'/'. $file_name);
|
||||
}
|
||||
clearstatcache();
|
||||
return error_log("$now_time $log\n", 3, $target);
|
||||
}
|
|
@ -0,0 +1,517 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 获取客户端IP地址
|
||||
*
|
||||
* @param boolean $s_type ip类型[ip|long]
|
||||
* @return string $ip
|
||||
*/
|
||||
function get_client_ip($b_ip = true){
|
||||
$arr_ip_header = array(
|
||||
"HTTP_CLIENT_IP",
|
||||
"HTTP_X_FORWARDED_FOR",
|
||||
"REMOTE_ADDR",
|
||||
"HTTP_CDN_SRC_IP",
|
||||
"HTTP_PROXY_CLIENT_IP",
|
||||
"HTTP_WL_PROXY_CLIENT_IP"
|
||||
);
|
||||
$client_ip = 'unknown';
|
||||
foreach ($arr_ip_header as $key) {
|
||||
if (!empty($_SERVER[$key]) && strtolower($_SERVER[$key]) != "unknown") {
|
||||
$client_ip = $_SERVER[$key];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($pos = strpos($client_ip,',')){
|
||||
$client_ip = substr($client_ip,$pos+1);
|
||||
}
|
||||
return $client_ip;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// url检查
|
||||
function check_url($url){
|
||||
$array = get_headers($url, 1);
|
||||
if (preg_match('/404/', $array[0])) {
|
||||
return false;
|
||||
} elseif (preg_match('/403/', $array[0])) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取网络url文件内容,加入ua,以解决防采集的站
|
||||
*/
|
||||
function curl_get_contents($url){
|
||||
$ch = curl_init();
|
||||
$timeout = 5;
|
||||
$user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1)";
|
||||
curl_setopt ($ch, CURLOPT_URL, $url);
|
||||
curl_setopt ($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
|
||||
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
|
||||
$file_contents = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $file_contents;
|
||||
}
|
||||
|
||||
// 返回refer URL 地址
|
||||
function refer_url(){
|
||||
return isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : '';
|
||||
}
|
||||
// 返回当前页面的 URL 地址
|
||||
function this_url(){
|
||||
$s_url = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] ? 'https' : 'http';
|
||||
$s_url .= '://';
|
||||
return $s_url . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
|
||||
}
|
||||
|
||||
function select_var($array){
|
||||
if (!is_array($array)) return -1;
|
||||
ksort($array);
|
||||
$chosen = -1;
|
||||
foreach ($array as $k => $v) {
|
||||
if (isset($v)) {
|
||||
$chosen = $v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $chosen;
|
||||
}
|
||||
|
||||
|
||||
function stripslashes_deep($value){
|
||||
$value = is_array($value) ? array_map('stripslashes_deep', $value) : (isset($value) ? stripslashes($value) : null);
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET/POST数据统一入口
|
||||
* 将GET和POST的数据进行过滤,去掉非法字符以及hacker code,返回一个数组
|
||||
* 注意如果GET和POST有相同的Key,POST优先
|
||||
*
|
||||
* @return array $_GET和$_POST数据过滤处理后的值
|
||||
*/
|
||||
function parse_incoming(){
|
||||
global $_GET, $_POST,$_COOKIE;
|
||||
|
||||
$_COOKIE = stripslashes_deep($_COOKIE);
|
||||
$_GET = stripslashes_deep($_GET);
|
||||
$_POST = stripslashes_deep($_POST);
|
||||
$return = array();
|
||||
$return = array_merge($_GET,$_POST);
|
||||
$remote = array_get($return,0);
|
||||
$remote = explode('/',trim($remote[0],'/'));
|
||||
$return['URLremote'] = $remote;
|
||||
return $return;
|
||||
}
|
||||
|
||||
function url2absolute($index_url, $preg_url){
|
||||
if (preg_match('/[a-zA-Z]*\:\/\//', $preg_url)) return $preg_url;
|
||||
preg_match('/([a-zA-Z]*\:\/\/.*)\//', $index_url, $match);
|
||||
$index_url_temp = $match[1];
|
||||
|
||||
foreach(explode('/', $preg_url) as $key => $var) {
|
||||
if ($key == 0 && $var == '') {
|
||||
preg_match('/([a-zA-Z]*\:\/\/[^\/]*)\//', $index_url, $match);
|
||||
$index_url_temp = $match[1] . $preg_url;
|
||||
break;
|
||||
}
|
||||
if ($var == '..') {
|
||||
preg_match('/([a-zA-Z]*\:\/\/.*)\//', $index_url_temp, $match);
|
||||
$index_url_temp = $match[1];
|
||||
} elseif ($var != '.') $index_url_temp .= '/' . $var;
|
||||
}
|
||||
return $index_url_temp;
|
||||
}
|
||||
|
||||
// 将字符串转换成URL的编码,gbk的和utf8的 $to="gbk" 或"utf8"
|
||||
function urlcode($str, $to){
|
||||
if ($to == "gbk") {
|
||||
$result = RawUrlEncode($str); //gbk字符(主要是中文)转换为url %BA%EC形式
|
||||
} else {
|
||||
$key = mb_convert_encoding($str, "utf-8", "gbk"); //对于百度utf8中文url
|
||||
$result = urlencode($key);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
// 输出js
|
||||
function exec_js($js){
|
||||
echo "<script language='JavaScript'>\n" . $js . "</script>\n";
|
||||
}
|
||||
// 禁止缓存
|
||||
function no_cache(){
|
||||
header("Pragma:no-cache\r\n");
|
||||
header("Cache-Control:no-cache\r\n");
|
||||
header("Expires:0\r\n");
|
||||
}
|
||||
// 生成javascript转向
|
||||
function go_url($url, $msg = ''){
|
||||
header("Content-type: text/html; charset=utf-8\r\n");
|
||||
echo "<script type='text/javascript'>\n";
|
||||
echo "window.location.href='$direction';";
|
||||
echo "</script>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息框。eg
|
||||
* msg("falied","/",10);
|
||||
* msg("ok");
|
||||
*/
|
||||
function show_msg($message, $url = '#', $time = 3, $isgo = 1)
|
||||
{
|
||||
$goto = "content='$time;url=$url'";
|
||||
if ($isgo != "1") {
|
||||
$goto = "";
|
||||
} //是否自动跳转
|
||||
echo<<<END
|
||||
<html>
|
||||
<meta http-equiv='refresh' $goto charset="utf-8">
|
||||
<style>
|
||||
#msgbox{width:400px;border: 1px solid #ddd;font-family:微软雅黑;color:888;font-size:13px;margin:0 auto;margin-top:150px;}
|
||||
#msgbox #title{background:#3F9AC6;color:#fff;line-height:30px;height:30px;padding-left:20px;font-weight:800;}
|
||||
#msgbox #message{text-align:center;padding:20px;}
|
||||
#msgbox #info{text-align:center;padding:5px;border-top:1px solid #ddd;background:#f2f2f2;color:#888;}
|
||||
</style>
|
||||
<body>
|
||||
<div id="msgbox">
|
||||
<div id="title">提示信息</div>
|
||||
<div id="message">$message</div>
|
||||
<div id="info">$time 秒后自动跳转,如不想等待可 <a href='$url'>点击这里</a></div></center>
|
||||
</body>
|
||||
</html>
|
||||
END;
|
||||
exit;
|
||||
}
|
||||
|
||||
function send_http_status($i_status, $s_message = ''){
|
||||
$a_status = array(
|
||||
// Informational 1xx
|
||||
100 => 'Continue',
|
||||
101 => 'Switching Protocols',
|
||||
// Success 2xx
|
||||
200 => 'OK',
|
||||
201 => 'Created',
|
||||
202 => 'Accepted',
|
||||
203 => 'Non-Authoritative Information',
|
||||
204 => 'No Content',
|
||||
205 => 'Reset Content',
|
||||
206 => 'Partial Content',
|
||||
// Redirection 3xx
|
||||
300 => 'Multiple Choices',
|
||||
301 => 'Moved Permanently',
|
||||
302 => 'Found', // 1.1
|
||||
303 => 'See Other',
|
||||
304 => 'Not Modified',
|
||||
305 => 'Use Proxy', // 306 is deprecated but reserved
|
||||
307 => 'Temporary Redirect',
|
||||
// Client Error 4xx
|
||||
400 => 'Bad Request',
|
||||
401 => 'Unauthorized',
|
||||
402 => 'Payment Required',
|
||||
403 => 'Forbidden',
|
||||
404 => 'Not Found',
|
||||
405 => 'Method Not Allowed',
|
||||
406 => 'Not Acceptable',
|
||||
407 => 'Proxy Authentication Required',
|
||||
408 => 'Request Timeout',
|
||||
409 => 'Conflict',
|
||||
410 => 'Gone',
|
||||
411 => 'Length Required',
|
||||
412 => 'Precondition Failed',
|
||||
413 => 'Request Entity Too Large',
|
||||
414 => 'Request-URI Too Long',
|
||||
415 => 'Unsupported Media Type',
|
||||
416 => 'Requested Range Not Satisfiable',
|
||||
417 => 'Expectation Failed',
|
||||
// Server Error 5xx
|
||||
500 => 'Internal Server Error',
|
||||
501 => 'Not Implemented',
|
||||
502 => 'Bad Gateway',
|
||||
503 => 'Service Unavailable',
|
||||
504 => 'Gateway Timeout',
|
||||
505 => 'HTTP Version Not Supported',
|
||||
509 => 'Bandwidth Limit Exceeded'
|
||||
);
|
||||
|
||||
if (array_key_exists($i_status, $a_status)) {
|
||||
header('HTTP/1.1 ' . $i_status . ' ' . $a_status[$i_status]);
|
||||
}
|
||||
if ($s_message) {
|
||||
echo $s_message;
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取操作系统信息
|
||||
function get_os (){
|
||||
$agent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$os = false;
|
||||
if (eregi('win', $agent) && strpos($agent, '95')) {
|
||||
$os = 'Windows 95';
|
||||
} else if (eregi('win 9x', $agent) && strpos($agent, '4.90')) {
|
||||
$os = 'Windows ME';
|
||||
} else if (eregi('win', $agent) && ereg('98', $agent)) {
|
||||
$os = 'Windows 98';
|
||||
} else if (eregi('win', $agent) && eregi('nt 5.1', $agent)) {
|
||||
$os = 'Windows XP';
|
||||
} else if (eregi('win', $agent) && eregi('nt 5', $agent)) {
|
||||
$os = 'Windows 2000';
|
||||
} else if (eregi('win', $agent) && eregi('nt', $agent)) {
|
||||
$os = 'Windows NT';
|
||||
} else if (eregi('win', $agent) && ereg('32', $agent)) {
|
||||
$os = 'Windows 32';
|
||||
} else if (eregi('linux', $agent)) {
|
||||
$os = 'Linux';
|
||||
} else if (eregi('unix', $agent)) {
|
||||
$os = 'Unix';
|
||||
} else if (eregi('sun', $agent) && eregi('os', $agent)) {
|
||||
$os = 'SunOS';
|
||||
} else if (eregi('ibm', $agent) && eregi('os', $agent)) {
|
||||
$os = 'IBM OS/2';
|
||||
} else if (eregi('Mac', $agent) && eregi('PC', $agent)) {
|
||||
$os = 'Macintosh';
|
||||
} else if (eregi('PowerPC', $agent)) {
|
||||
$os = 'PowerPC';
|
||||
} else if (eregi('AIX', $agent)) {
|
||||
$os = 'AIX';
|
||||
} else if (eregi('HPUX', $agent)) {
|
||||
$os = 'HPUX';
|
||||
} else if (eregi('NetBSD', $agent)) {
|
||||
$os = 'NetBSD';
|
||||
} else if (eregi('BSD', $agent)) {
|
||||
$os = 'BSD';
|
||||
} else if (ereg('OSF1', $agent)) {
|
||||
$os = 'OSF1';
|
||||
} else if (ereg('IRIX', $agent)) {
|
||||
$os = 'IRIX';
|
||||
} else if (eregi('FreeBSD', $agent)) {
|
||||
$os = 'FreeBSD';
|
||||
} else if (eregi('teleport', $agent)) {
|
||||
$os = 'teleport';
|
||||
} else if (eregi('flashget', $agent)) {
|
||||
$os = 'flashget';
|
||||
} else if (eregi('webzip', $agent)) {
|
||||
$os = 'webzip';
|
||||
} else if (eregi('offline', $agent)) {
|
||||
$os = 'offline';
|
||||
} else {
|
||||
$os = 'Unknown';
|
||||
}
|
||||
return $os;
|
||||
}
|
||||
|
||||
//根据扩展名获取mime
|
||||
function get_file_mime($ext){
|
||||
$mimetypes = array(
|
||||
"323" => "text/h323",
|
||||
"acx" => "application/internet-property-stream",
|
||||
"ai" => "application/postscript",
|
||||
"aif" => "audio/x-aiff",
|
||||
"aifc" => "audio/x-aiff",
|
||||
"aiff" => "audio/x-aiff",
|
||||
"asf" => "video/x-ms-asf",
|
||||
"asr" => "video/x-ms-asf",
|
||||
"asx" => "video/x-ms-asf",
|
||||
"au" => "audio/basic",
|
||||
"avi" => "video/x-msvideo",
|
||||
"axs" => "application/olescript",
|
||||
"bas" => "text/plain",
|
||||
"bcpio" => "application/x-bcpio",
|
||||
"bin" => "application/octet-stream",
|
||||
"bmp" => "image/bmp",
|
||||
"c" => "text/plain",
|
||||
"cat" => "application/vnd.ms-pkiseccat",
|
||||
"cdf" => "application/x-cdf",
|
||||
"cer" => "application/x-x509-ca-cert",
|
||||
"class" => "application/octet-stream",
|
||||
"clp" => "application/x-msclip",
|
||||
"cmx" => "image/x-cmx",
|
||||
"cod" => "image/cis-cod",
|
||||
"cpio" => "application/x-cpio",
|
||||
"crd" => "application/x-mscardfile",
|
||||
"crl" => "application/pkix-crl",
|
||||
"crt" => "application/x-x509-ca-cert",
|
||||
"csh" => "application/x-csh",
|
||||
"css" => "text/css",
|
||||
"dcr" => "application/x-director",
|
||||
"der" => "application/x-x509-ca-cert",
|
||||
"dir" => "application/x-director",
|
||||
"dll" => "application/x-msdownload",
|
||||
"dms" => "application/octet-stream",
|
||||
"doc" => "application/msword",
|
||||
"dot" => "application/msword",
|
||||
"dvi" => "application/x-dvi",
|
||||
"dxr" => "application/x-director",
|
||||
"eps" => "application/postscript",
|
||||
"etx" => "text/x-setext",
|
||||
"evy" => "application/envoy",
|
||||
"exe" => "application/octet-stream",
|
||||
"fif" => "application/fractals",
|
||||
"flr" => "x-world/x-vrml",
|
||||
"gif" => "image/gif",
|
||||
"gtar" => "application/x-gtar",
|
||||
"gz" => "application/x-gzip",
|
||||
"h" => "text/plain",
|
||||
"hdf" => "application/x-hdf",
|
||||
"hlp" => "application/winhlp",
|
||||
"hqx" => "application/mac-binhex40",
|
||||
"hta" => "application/hta",
|
||||
"htc" => "text/x-component",
|
||||
"htm" => "text/html",
|
||||
"html" => "text/html",
|
||||
"htt" => "text/webviewhtml",
|
||||
"ico" => "image/x-icon",
|
||||
"ief" => "image/ief",
|
||||
"iii" => "application/x-iphone",
|
||||
"ins" => "application/x-internet-signup",
|
||||
"isp" => "application/x-internet-signup",
|
||||
"jfif" => "image/pipeg",
|
||||
"jpe" => "image/jpeg",
|
||||
"jpeg" => "image/jpeg",
|
||||
"jpg" => "image/jpeg",
|
||||
"js" => "application/x-javascript",
|
||||
"latex" => "application/x-latex",
|
||||
"lha" => "application/octet-stream",
|
||||
"lsf" => "video/x-la-asf",
|
||||
"lsx" => "video/x-la-asf",
|
||||
"lzh" => "application/octet-stream",
|
||||
"m13" => "application/x-msmediaview",
|
||||
"m14" => "application/x-msmediaview",
|
||||
"m3u" => "audio/x-mpegurl",
|
||||
"man" => "application/x-troff-man",
|
||||
"mdb" => "application/x-msaccess",
|
||||
"me" => "application/x-troff-me",
|
||||
"mht" => "message/rfc822",
|
||||
"mhtml" => "message/rfc822",
|
||||
"mid" => "audio/mid",
|
||||
"mny" => "application/x-msmoney",
|
||||
"mov" => "video/quicktime",
|
||||
"movie" => "video/x-sgi-movie",
|
||||
"mp2" => "video/mpeg",
|
||||
"mp3" => "audio/mpeg",
|
||||
"mp4" => "video/mpeg",
|
||||
"mpa" => "video/mpeg",
|
||||
"mpe" => "video/mpeg",
|
||||
"mpeg" => "video/mpeg",
|
||||
"mpg" => "video/mpeg",
|
||||
"mpp" => "application/vnd.ms-project",
|
||||
"mpv2" => "video/mpeg",
|
||||
"ms" => "application/x-troff-ms",
|
||||
"mvb" => "application/x-msmediaview",
|
||||
"nws" => "message/rfc822",
|
||||
"oda" => "application/oda",
|
||||
"p10" => "application/pkcs10",
|
||||
"p12" => "application/x-pkcs12",
|
||||
"p7b" => "application/x-pkcs7-certificates",
|
||||
"p7c" => "application/x-pkcs7-mime",
|
||||
"p7m" => "application/x-pkcs7-mime",
|
||||
"p7r" => "application/x-pkcs7-certreqresp",
|
||||
"p7s" => "application/x-pkcs7-signature",
|
||||
"pbm" => "image/x-portable-bitmap",
|
||||
"pdf" => "application/pdf",
|
||||
"pfx" => "application/x-pkcs12",
|
||||
"pgm" => "image/x-portable-graymap",
|
||||
"pko" => "application/ynd.ms-pkipko",
|
||||
"pma" => "application/x-perfmon",
|
||||
"pmc" => "application/x-perfmon",
|
||||
"pml" => "application/x-perfmon",
|
||||
"pmr" => "application/x-perfmon",
|
||||
"pmw" => "application/x-perfmon",
|
||||
"png" => "image/png",
|
||||
"pnm" => "image/x-portable-anymap",
|
||||
"pot," => "application/vnd.ms-powerpoint",
|
||||
"ppm" => "image/x-portable-pixmap",
|
||||
"pps" => "application/vnd.ms-powerpoint",
|
||||
"ppt" => "application/vnd.ms-powerpoint",
|
||||
"prf" => "application/pics-rules",
|
||||
"ps" => "application/postscript",
|
||||
"pub" => "application/x-mspublisher",
|
||||
"qt" => "video/quicktime",
|
||||
"ra" => "audio/x-pn-realaudio",
|
||||
"ram" => "audio/x-pn-realaudio",
|
||||
"ras" => "image/x-cmu-raster",
|
||||
"rgb" => "image/x-rgb",
|
||||
"rmi audio/mid" => "http://www.dreamdu.com",
|
||||
"roff" => "application/x-troff",
|
||||
"rtf" => "application/rtf",
|
||||
"rtx" => "text/richtext",
|
||||
"scd" => "application/x-msschedule",
|
||||
"sct" => "text/scriptlet",
|
||||
"setpay" => "application/set-payment-initiation",
|
||||
"setreg" => "application/set-registration-initiation",
|
||||
"sh" => "application/x-sh",
|
||||
"shar" => "application/x-shar",
|
||||
"sit" => "application/x-stuffit",
|
||||
"snd" => "audio/basic",
|
||||
"spc" => "application/x-pkcs7-certificates",
|
||||
"spl" => "application/futuresplash",
|
||||
"src" => "application/x-wais-source",
|
||||
"sst" => "application/vnd.ms-pkicertstore",
|
||||
"stl" => "application/vnd.ms-pkistl",
|
||||
"stm" => "text/html",
|
||||
"svg" => "image/svg+xml",
|
||||
"sv4cpio" => "application/x-sv4cpio",
|
||||
"sv4crc" => "application/x-sv4crc",
|
||||
"swf" => "application/x-shockwave-flash",
|
||||
"t" => "application/x-troff",
|
||||
"tar" => "application/x-tar",
|
||||
"tcl" => "application/x-tcl",
|
||||
"tex" => "application/x-tex",
|
||||
"texi" => "application/x-texinfo",
|
||||
"texinfo" => "application/x-texinfo",
|
||||
"tgz" => "application/x-compressed",
|
||||
"tif" => "image/tiff",
|
||||
"tiff" => "image/tiff",
|
||||
"tr" => "application/x-troff",
|
||||
"trm" => "application/x-msterminal",
|
||||
"tsv" => "text/tab-separated-values",
|
||||
"txt" => "text/plain",
|
||||
"uls" => "text/iuls",
|
||||
"ustar" => "application/x-ustar",
|
||||
"vcf" => "text/x-vcard",
|
||||
"vrml" => "x-world/x-vrml",
|
||||
"wav" => "audio/x-wav",
|
||||
"wcm" => "application/vnd.ms-works",
|
||||
"wdb" => "application/vnd.ms-works",
|
||||
"wks" => "application/vnd.ms-works",
|
||||
"wmf" => "application/x-msmetafile",
|
||||
"wps" => "application/vnd.ms-works",
|
||||
"wri" => "application/x-mswrite",
|
||||
"wrl" => "x-world/x-vrml",
|
||||
"wrz" => "x-world/x-vrml",
|
||||
"xaf" => "x-world/x-vrml",
|
||||
"xbm" => "image/x-xbitmap",
|
||||
"xla" => "application/vnd.ms-excel",
|
||||
"xlc" => "application/vnd.ms-excel",
|
||||
"xlm" => "application/vnd.ms-excel",
|
||||
"xls" => "application/vnd.ms-excel",
|
||||
"xlt" => "application/vnd.ms-excel",
|
||||
"xlw" => "application/vnd.ms-excel",
|
||||
"xof" => "x-world/x-vrml",
|
||||
"xpm" => "image/x-xpixmap",
|
||||
"xwd" => "image/x-xwindowdump",
|
||||
"z" => "application/x-compress",
|
||||
"zip" => "application/zip"
|
||||
);
|
||||
if (array_key_exists($ext,$mimetypes)){
|
||||
return $mimetypes[$ext];
|
||||
}else{
|
||||
return 'application/octet-stream';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
/* CSS by Brade - www.bradezone.com */
|
||||
*{margin:0;padding:0}
|
||||
/* 颜色微调【同样颜色灰度值调节】 */
|
||||
::-webkit-scrollbar-track-piece{background-color:#f5f5f5;border-left:1px solid #d2d2d2}
|
||||
::-webkit-scrollbar{width:10px;height:10px}
|
||||
::-webkit-scrollbar-thumb{background-color:#c2c2c2;background-clip:padding-box;border:1px solid #979797;min-height:28px}
|
||||
::-webkit-scrollbar-thumb:hover{border:1px solid #636363;background-color:#929292}
|
||||
|
||||
body,select,input,button{font:13px "微软雅黑",Microsoft Yahei,STXihei,arial,sans-serif;background:#fff;color:#333}
|
||||
code,pre,textarea{font: 14px Consolas, "Liberation Mono", Courier, monospace !important;}
|
||||
/* generic */
|
||||
a{-ms-transition: all 0.3s;
|
||||
-webkit-transition: all 0.3s;
|
||||
-moz-transition: all 0.3s;
|
||||
-o-transition: all 0.3s;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
a,a:visited{color:#06c;text-decoration:none;padding: 1px 4px;}
|
||||
a:hover{background:#C7D1DD;border-radius:10px;color:#555;text-decoration: none !important;}
|
||||
p{padding-bottom:4px;margin-bottom:4px}
|
||||
h1{font-size:18px;font-weight:bold;padding-bottom:0px;height:25px;padding:0 0 8px 0;color:#666;border:0;background:none;}
|
||||
|
||||
h2{font-size:24px;margin:0px;background:transparent;border:0;color:#366ec2;
|
||||
padding: 10px 0;;border-bottom: 3px solid #eee;margin-bottom: 10px;}
|
||||
h3{font-size:18px;font-weight:bold;padding:4px 0;margin:0}
|
||||
form#form{overflow:hidden}
|
||||
fieldset{float:left;min-height:48px;padding:0 4px 4px 4px;border:1px solid #ccc;margin-bottom:8px;margin-right:4px}
|
||||
fieldset div{margin-top:4px}
|
||||
input,select,textarea{color:#555;border:1px solid #ccc;padding: 2px 5px;}
|
||||
fieldset select{margin-right:4px}
|
||||
optgroup{font-size:11px}
|
||||
code{background:#ffc;padding:2px 4px;}
|
||||
code a:hover{background:transparent}
|
||||
table{margin:4px 0 8px;border:1px solid #ccc;font-size:inherit}
|
||||
tbody tr:hover td,tbody tr:hover th{background:#ffc}
|
||||
th,td{text-align:left;padding:2px 4px;vertical-align:top;font-weight:normal;border:1px dotted #ccc;border-width:0 0 0 1px;
|
||||
margin:0;background:inherit}
|
||||
|
||||
thead tr{text-align: center;font-weight: 800;color: #444;height:25px;line-height: 25px;}
|
||||
thead tr td{background: #F7F6F6;color: #222;font-weight: 800;border-bottom: 1px solid #CCC;white-space:nowrap;}
|
||||
th:first-child,td:first-child{border-color:transparent;white-space:nowrap}
|
||||
td[align=right]{text-align:right}
|
||||
table code{font-size:13px;line-height:18px}
|
||||
.hidden{display:none}
|
||||
.error,.message{padding:0;background:transparent;font-weight:bold}
|
||||
.error{color:#c00}
|
||||
.message{color:#090}
|
||||
/* specific */
|
||||
#content{margin:0 0 0 255px;height:100%;padding: 40px 10px 10px 0;}
|
||||
#content:after{content:".";clear:both;height:0;overflow:hidden;display:block}
|
||||
#lang{z-index: 10;background:#5579BA;color: #fff;position: fixed;
|
||||
top: 0;right: 0px;padding: 0 20px 0 10px;line-height:30px;height: 35px;box-shadow: 0 -5px 50px #666;}
|
||||
|
||||
#lang select{border-color: #fff;height: 22px;line-height: 22px;padding:0px;font-size:12px;}
|
||||
#content > p > a,.tabs a{border: 1px solid #ccc;display: inline-block;padding: 3px 1em;
|
||||
margin-bottom: 4px;background: #eee;color: #555;
|
||||
letter-spacing: 1px;border-radius: 15px;}
|
||||
#content > p > a:hover,.tabs a:hover{background:#6787c1;color:#eee;border-right:1px solid #5579BA;}
|
||||
#content > p > a.active,.tabs a.active{background:#5579BA;color:#fff;border-right:1px solid #5579BA;}
|
||||
|
||||
#menu{background:#E3E7EC;position:fixed;top: 30px;bottom:0px;overflow-x:hidden;
|
||||
overflow-y: auto;left:0px;width:201px;padding:10px 15px;color:#333;
|
||||
border-right:1px solid #ddf;margin:0;}
|
||||
#menu a{color:#333;display: inline-block;margin:1px;line-height:18px;}
|
||||
#menu a:hover{background:#333;color:#000;background: #C7D1DD;border:none;border-radius:10px;}
|
||||
#menu a.h1,#menu a.h1:hover{display:block;height:0;width:175px;padding:40px 0 0 0;overflow:hidden;float:left;border:0;margin:0;
|
||||
outline:0;background:url(http://www.bradezone.com/random/adminer_logo.gif) no-repeat;line-height:32px}
|
||||
#menu p{white-space:nowrap;border:0;padding:0 0 4px 0;margin:0 0 4px 0;overflow: hidden !important;}
|
||||
#menu p a.active{background: #8C9EB4;color: #fff;border-radius:10px;}
|
||||
#menu h1 a{display: none;}
|
||||
#menu h1:before{content: "Adminer ";line-height: 40px;}
|
||||
#menu h1{text-align: center;margin-bottom: 10px;}
|
||||
.logout a{border-bottom: 1px solid #ccc;}
|
||||
.links a {white-space: nowrap;margin-right: 0px;}
|
||||
.icon {background: #ccc;}
|
||||
|
||||
#content #breadcrumb{background: #5579BA;border-left: 1px solid #6787c1;height: 30px;color:#ddd;font-size: 16px;position:fixed;top:0;
|
||||
left: 231px;width:100%;line-height:30px;padding:2px 10px;z-index:11;margin:0;}
|
||||
#content #breadcrumb a{color:#fff;display:inline;padding:3px 6px;background:none;letter-spacing:0;text-decoration: underline;border:none;}
|
||||
#content #breadcrumb a:hover{background:transparent;color:#f90;}
|
||||
#schema .table{padding:4px 8px;background:#f3f3f3}
|
||||
/* IE hacks */
|
||||
*+html th:first-child,*+html td:first-child{border-color:inherit;white-space:inherit}
|
||||
* html #lang,* html #menu,* html #breadcrumb{position:absolute}
|
||||
* html #lang{padding-top:10px;height:30px;box-shadow: 0 -20px 50px #000;}
|
||||
* html form#form{height:100%}
|
||||
#logins a,#tables a{background: none}
|
||||
#logout{color:#333;text-decoration:none;padding:4px 1em;}
|
||||
#logout:hover{border-color:#333;background:#333;color:#fff}
|
||||
.js .column{background:#ddd}
|
||||
|
||||
input,object{
|
||||
border:1px solid #ccc;
|
||||
color: #226; font-weight: normal;
|
||||
background-color: #fcfdfe;
|
||||
font-style:14px;
|
||||
padding-top:4px 8px;
|
||||
border-right-color:#888\9;
|
||||
border-bottom-color:#888\9;
|
||||
}
|
||||
textarea{border: 1px solid #ccc;}
|
||||
input[type=text] {padding:4px;background: #fffffa;font-size:12px;}
|
||||
input[type=text]:focus{background: #ffffe6;border: 1px solid #5FA3EC;}
|
||||
input[type=checkbox]{display: inline-block;margin-right: 10px;margin-left: 5px;}
|
||||
input[type="button"],input[type="reset"],input[type="submit"]{
|
||||
height:25px;
|
||||
color: #6e6e6e;
|
||||
text-decoration: none;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
-webkit-transition: border-color .15s;
|
||||
-moz-transition: border .15s;
|
||||
-o-transition: border-color .15s;
|
||||
transition: border-color .15s;
|
||||
background: #f3f3f3;
|
||||
background-image: -moz-linear-gradient(top, #fafafa, #eeeeee); /* Firefox */
|
||||
background: -webkit-gradient(linear,0% 40%,0% 70%,from(#FaFaFa),to(#eeeeee));
|
||||
border: solid 1px #bbb;
|
||||
border-radius: 2px;
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
padding:2px 1.2em;
|
||||
cursor: pointer;
|
||||
margin-bottom:2px;
|
||||
}
|
||||
input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover{
|
||||
color: #333;
|
||||
border-color: #aaa;
|
||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
input.default {color: #000 !important;font-weight: 800;box-shadow: 0px 0px 5px #ccc;}
|
||||
input[type=button]:active,input[type=reset]:active,input[type=submit]:active{
|
||||
color: #448;
|
||||
background: -webkit-gradient(linear,0% 40%,0% 70%,from(#F1F1F1),to(#FaFaFa));
|
||||
background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(#F1F1F1),to(#FaFaFa));
|
||||
border-color: #888;
|
||||
}
|
||||
input[type="radio"]{border:none;display:inline-block;margin: 5px;}
|
||||
input:focus{border:1px solid #75A1F0;outline:none;box-shadow:0 0 8px #75A1F0;
|
||||
-webkit-transition:all 0.218s;-moz-transition: all .218s;-o-transition: all 0.218s;transition: all 0.218s;}
|
||||
|
||||
.js .checkable .checked td, .js .checkable .checked th {background: #ff9;}
|
||||
.nowrap td, .nowrap th, td.nowrap {white-space: pre;line-height: 24px;}
|
||||
code{background:none !important;}
|
||||
.jush-sql{background:#eee;}
|
||||
|
254
readme.txt
|
@ -1 +1,253 @@
|
|||
asdf
|
||||
#KODexplorer (http://kalcaddle.com/)
|
||||
###ver2.1(2014.4.2) power by warlee
|
||||
商业版授权请联系:QQ:kalcaddle@qq.com
|
||||
|
||||
是什么:
|
||||
Kodexplorer为千帆网络工作室开发的一款服务器文件管理程序。
|
||||
可用于服务器文件管理,支持图片、音乐、视频预览。在线解压缩。
|
||||
支持几乎所有编程语言的在线编辑(高亮,多光标编辑.堪比本地的sublime)
|
||||
中文编码全面兼容,文件编辑自动适配。
|
||||
及其便捷的快捷键支持,让你拥有本地化的体验
|
||||
全面采用Ajax+Json进行数据通信,毫秒级的响应速度;
|
||||
全平台兼容性:Win Linux Mac (Apache、Nginx、IIS)
|
||||
使用场景:
|
||||
你可以用它来管理你的服务器(备份,在线解压缩,版本发布....)
|
||||
你可以把他当做管理linux的一个操作系统界面
|
||||
可以用来作为私有云存储系统,存储你的文件...
|
||||
当然你也可以用来分享文件
|
||||
更多场景等你来挖掘!……
|
||||
|
||||
## 请尽量不要使用第三方修改版本,放置被植入恶意代码或后门
|
||||
## 觉得程序好用的话请尽量购买商业版
|
||||
|
||||
------------------【使用说明】------------------
|
||||
管理员: admin/admin
|
||||
普通用户:demo/demo
|
||||
游客用户:guest/guest
|
||||
|
||||
【如何使用】下载程序,上传到你的服务器路径下,解压。访问即可,体验超便捷的服务吧!
|
||||
【关于上传问题】 程序没有做任何限制,如果需要上传大文件,则修改php.ini:upload_max_filesize = 1000M post_max_size = 1000M
|
||||
【关于解压缩问题】 程序不做任何限制,如若失败请设置php内存限制。memory_limit 1000M
|
||||
【关于兼容性】建议使用chrome firefox ie9+ 体验更完整。ie8以下基本上不做兼容处理。chrome才支持文件夹拖拽上传。
|
||||
【文件打开】office文件在线预览功能,服务器必须在公网(外部能访问该服务器)
|
||||
--------------------------------------------
|
||||
|
||||
|
||||
ver2.1 `2014/4/2`
|
||||
=====================
|
||||
##update:
|
||||
文件夹拖拽上传,完美解决(保持原始目录结构)
|
||||
解压缩优化;解压中文问题。解压缩整体速度
|
||||
树目录增加快捷键支持(上下、左右展开树目录;复制、粘贴、剪切、删除、打开、搜索、新建文件(夹)、)
|
||||
pdf预览支持
|
||||
mac快捷键 ctrl 一一对应command
|
||||
音乐播放器和视频播放器相互独立
|
||||
图片懒加载、图片较多的情况下只加载首屏图片缩略图;
|
||||
编辑文件打开出错,自动关闭标签;文件打开20M限制(大于20M则不处理,浏览器会卡死)
|
||||
标签关闭提示:检测是否有未保存文件,文件修改实时修改是否修修改的按钮状态
|
||||
##fix bug:(bug解决和程序优化)
|
||||
文本文件编辑 文件名含有url编码则出错bug
|
||||
右键菜单在最下面时,右键位置重叠导致点击菜单问题
|
||||
编辑器打开文件时光标问题,处理:移动到行尾;编辑器enter建不显示自动提示
|
||||
iframe 打开url 优化。解决canvas问题
|
||||
文件编辑器,载入loading去掉
|
||||
删除错误时,或上传错误时也刷新目录。删除提示颜色错误
|
||||
对话框右键 点击右键菜单隐藏修复
|
||||
手机端 touch =双击
|
||||
文件列表 explorer 右键 不清除选才·
|
||||
树目录中文展开问题。
|
||||
ie 重命名状态textarea不可选则问题
|
||||
修复mac 下 ctrl连选出现右键菜单。
|
||||
ie 树目录右键兼容性
|
||||
|
||||
|
||||
ver2.0 `2014/3/2`
|
||||
=====================
|
||||
##fix bug:(bug解决和程序优化)
|
||||
body右键屏蔽(保留input、textarea)
|
||||
重命名&新建时 右键(编辑内容系统菜单)
|
||||
对话框 不显示边框(位移处理,opacity:0)
|
||||
esc 退出程序 屏蔽该功能。
|
||||
关闭播放器,还在播放bug
|
||||
增加资源管理器任务栏。任务栏加入右键功能。
|
||||
对话框增加右键功能
|
||||
guest [三类用户 root/default/guest] guest登陆处加链接。20min
|
||||
打包程序[update user_add,admin/demo; 删除webuploader.js thumb less]
|
||||
编辑添加应用权限只能是root用户才可以。
|
||||
保存文件不可写提示!
|
||||
解压缩结果提示。(对话框)
|
||||
upload dialog display
|
||||
root登陆 目录修改为服务器路径
|
||||
artdialog 已经打开的窗口 (设了id) 最小化时,再次打开则显示
|
||||
最小化窗口后,再次打开 dialog display (setting-display)
|
||||
上传进度加入大小
|
||||
上传窗口关闭,自动停止所有上传队列
|
||||
拖拽后,更新上传地址为当前地址。(之前上传队列也会这样。bug)
|
||||
root用户非服务器路径下文件预览(图片、mp3、视频、html、swf、……php代理输出文件内容,http方式)
|
||||
对话框最小化或关闭,重置最大index为焦点窗口
|
||||
图片缩略图生成:小于5k则不生成(直接输出)
|
||||
加载文件列表改为异步方式,数据返回采用回调函数方式。增强体验
|
||||
选中优化,文件&文件夹重命名、文件&文件夹新建 后自动选中。(f5增加回调。);
|
||||
选中保持,选中后如果调整排序等等,保持选中状态。
|
||||
上传文件选中当前。
|
||||
f5改为异步(加入mask loading) 优化文件夹打开体验
|
||||
键盘按键选中文件 增加字符搜索定位功能(单个字符,增加到多个字符选中。两次响应直接延迟250ms)
|
||||
幻灯片播放[优化成fancybox或者 重写动画部分、打开时关不掉问题]
|
||||
编辑器backspace、delete时不提示。
|
||||
编辑器,增加选中效果
|
||||
增加不自动提示功能,配置项作为全局配置。影响后续建立的文件。选中标记状态。
|
||||
更换桌面背景图片【load后替换】
|
||||
更换主题【css load 后载入】
|
||||
删除。不清除选中。提前准备数据
|
||||
构建打包,合并压缩。添加版本、版权
|
||||
自动升级(本地记录版本,服务器js调用 参数 url、version;忽略此版本。cookie。统计用户)
|
||||
|
||||
|
||||
ver2.0debug `2014/3/2`
|
||||
=====================
|
||||
##fix bug:(bug解决和程序优化)
|
||||
优化文件打开处理
|
||||
文件&文件夹:含有%、+号的处理(显示不出等问题,encoenURIComponent——rawurldecode)
|
||||
文件下载,支持大文件下载、断点续传。
|
||||
解决更改排序方式后 ——对应右键菜单不同步问题。
|
||||
优化右键更改列表状态,同步保存配置到服务端。
|
||||
文件浏览器打开(a点击新窗口跳转,a不支持click,用子元素冒泡来实现点击)
|
||||
优化配置文件存储方案。直接由前端操作后端key,value
|
||||
修复添加收藏夹问题(已打开设置窗口再添加失败问题)
|
||||
修复树目录中文文件名bug
|
||||
优化pic图片幻灯片播放
|
||||
优化新建文件&文件夹 清空选择状态
|
||||
对话框组件 ie8 优化;tips不显示任务栏;
|
||||
优化地址栏过长编辑状态问题
|
||||
优化新建、重命名文件(夹) 高度自适应问题
|
||||
firefox ctrl+s 系统对话框屏蔽
|
||||
树目录:收藏夹优化(右键绑定);右键操作优化,拖拽优化(文件管理&编辑器)
|
||||
收藏夹优化(右键 >编辑删除)
|
||||
##update:
|
||||
###新增功能
|
||||
多用户、权限控制:
|
||||
可以建立权限组,将功能分配给权限组
|
||||
添加用户,选择所属的权限组。
|
||||
权限按功能划分成颗粒,可以任意配置,例如普通使用者、游客等
|
||||
搜索:支持递归搜索,可选择是否搜索文件内容。
|
||||
增加桌面自定义壁纸。
|
||||
皮肤优化 ok 多色彩支持。
|
||||
应用商店,root用户可以管理应用。安装、修改、删除。普通用户可以安装应用。
|
||||
应用添加了图标。对应右键功能。
|
||||
office文档在线预览。
|
||||
###上传下载
|
||||
采用全新上传控件,跟安全,更好的体验。
|
||||
拖拽支持文件夹,多个文件。上传自动过滤不允许的文件类型
|
||||
拖拽上传 和上统一优化,修复webuploader的文件判断;火狐拖拽上传,ie9+拖拽上传。
|
||||
上传时自动过滤不合格的文件,上传失败错误返回。
|
||||
###文件编辑
|
||||
编辑器支持多光标
|
||||
支持几乎所有编程语言的代码高亮
|
||||
支持代码自动补全(基于文档、或自定义的代码快照)
|
||||
快速预览功能
|
||||
优化文件保存完美解决。编码自动识别转换。(字符串转义问题。1&#'[{'"+~%25\\\\ ////)
|
||||
文件编辑,添加收藏夹
|
||||
优化音乐播放器,添加音乐后自动播放新添加的第一首;解决之前添加列表后暂停问题。
|
||||
优化任务栏,多标签;最小化flash问题(left+10000 visiable)
|
||||
ctrl,shift 多选时拖拽优化(按住这两个键时,不能拖动;拖动加入延迟200ms)
|
||||
编辑器在没打开文件的情况下工具栏不可用问题。
|
||||
搜索、替换;vim模式
|
||||
……
|
||||
###登陆退出
|
||||
登陆优化 ok【页面&验证码&记住密码】
|
||||
三次错误需要输入验证码,保证系统的安全性
|
||||
优化自动登录安全性,客户端保存cookie自动登录信息。【tooken加入本地ip】
|
||||
|
||||
###系统优化
|
||||
解决较慢操作,阻塞其他操作问题。(同一个用户session会加锁,入口处做释放)
|
||||
前后端代码基本全部重构,前端采用模块化方法sea.js|require.js 模块化。
|
||||
凡是有模板调用的(display——页面部分php解析。并将配置注入到页面js变量,便于js使用)
|
||||
加入模板机制;通用模块采用懒加载模式;使用artTemplate 对模板绑定数据。
|
||||
kv结构存储
|
||||
路由权限控制
|
||||
后端统一json输出。
|
||||
|
||||
|
||||
ver1.21 `2013/11/6`
|
||||
=====================
|
||||
##fix bug:
|
||||
* 修复文件下载bug
|
||||
* 修复编辑器自动补全问题,<aa bb /> ——> <aa bb></a>
|
||||
* 兼容部分服务器问题。
|
||||
|
||||
ver1.2 `2013/10/16`
|
||||
=====================
|
||||
##fix bug:
|
||||
* 设置,外部通用调用方式
|
||||
* 打包中文乱码问题。
|
||||
* simple,default主题,navbar 下拉菜单右边位置问题。
|
||||
* 文件管理:有滚动条时,上下超过可视区域框选问题修复,统一和win操作一致。
|
||||
* 文件大小写不敏感设置,扩展名获取bug
|
||||
* 目录读取权限判断,解决“系统错误”相关问题。
|
||||
##update:
|
||||
* 地址栏宽度自适应优化,支持浏览器窗口调整
|
||||
* 增加远程下载功能;上传功能优化,
|
||||
* 整体样式风格优化,
|
||||
* 右键菜单优化(可持续粘贴,剪切后粘贴清空剪贴板)。
|
||||
* 新建文件、文件重命名高度自适应优化
|
||||
* 关闭调试状态错误信息
|
||||
* 图片播放幻灯片优化,支持浏览器窗口调整,解决事件绑定bug,添加图片倒影;添加关闭按钮,关闭动画等功能
|
||||
* 优化桌面,弹出层层级问题;任务栏为最上层
|
||||
* 优化多标签,没有标签时不显示标签容器,放至层级覆盖
|
||||
* 地址栏超出宽度,自动隐藏最左边内容
|
||||
* 右键菜单状态同步,排序方式初始化当前值,设置后标记当前值。
|
||||
* 优化编辑器:拖动内容&文件到编辑区,内容处理。
|
||||
* 拖拽上传,信息框自动隐出后关闭
|
||||
* setting,editor,player最小化时,再次调用则显示出弹出层
|
||||
* 优化影音播放器,皮肤及相关配置信息存储于js中,不用之前的服务器请求方式,修改皮肤后可以直接更新到界面上。
|
||||
|
||||
|
||||
ver1.01 `2013/9/10`
|
||||
=====================
|
||||
##fix bug:
|
||||
* 添加到收藏
|
||||
* simple,default主题,navbar 下拉菜单右边位置问题。
|
||||
##update:
|
||||
* 添加到收藏夹,修改收藏夹,更新文件管理收藏夹部分。
|
||||
* 修改主题,同时修改编辑器主题。【编辑区,文件管理,桌面】
|
||||
* 优化setting部分代码,整合为一个整体。
|
||||
* 优化debug,增加less编译,导出功能优化,先编译后复制再操作
|
||||
|
||||
|
||||
ver1.0 `2013.9.1`
|
||||
=====================
|
||||
##update:
|
||||
* 代码模块化优化,静态文件分离,可以分开部署
|
||||
* 编辑器单独逻辑提取,完整融合到文件管理,树目录融合文件管理,懒加载语法高亮
|
||||
* 多标签实现,弹层对话框多标签支持,桌面任务栏实现;编辑器多标签支持
|
||||
* 弹层功能优化,实现最大最小化,最小化关联多标签任务栏管理
|
||||
##fix bug:
|
||||
* linux 下浏览器打开文件和文件夹,中文问题
|
||||
* 重命名&新建&上传 刷新列表使用动画,当前选中失效问题,不使用动画加载方式。
|
||||
* html5拖拽上传优化
|
||||
|
||||
|
||||
ver0.8 `2013.6.15`
|
||||
=====================
|
||||
##update:
|
||||
* 整体优化,实现全部操作ajax本地化 ,进一步提升体验
|
||||
* 浏览器强刷新,保持之前最后所在路径
|
||||
* 重命名,新建,粘贴操作后添加选中状态
|
||||
* 代码主题列表优化,重新设计,提高可配置性
|
||||
* 优化代码,添加getTplList模版,简化关联配置获取
|
||||
* 增加设置功能,ajax刷新设置。缩略图片增加tips预览(被注释frame/setting.php)
|
||||
* 增加重命名只选择名称部分功能
|
||||
* 增加iframe js api互操作ie支持。四大浏览器内核皆支持。
|
||||
* 文件夹打开,采用ajax实现。包括头部地址栏,父级目录,左边树目录以及收藏夹
|
||||
* 历史记录完美实现,前进后退按钮实时变化状态。
|
||||
* 快捷键backspace实现后退(left header main 分别加入函数,屏蔽默认history(-1)操作)
|
||||
##fix bug:
|
||||
* 完善修改windows以及linux获取文件列表,中文路径属性获取失败问题。
|
||||
* 复制,剪切。剪贴板内容覆盖判空处理
|
||||
* 修复一些地方ajax线程同步问题,重命名后选中失效问题解决
|
||||
* 修复返回上层目录,根目录检测
|
||||
* 修复linux下 音视频播放,中文路径问题
|
||||
* 修复文件右键菜单位置出错问题
|
||||
* 修复ie下frame js相互通信问题
|
||||
* ajax更新文件列表下,各种bug修复。进一步提升操作友好性
|
||||
* 修复当前目录改变的情况下,播放器消失的问题。现在能使播放器始终保留
|
||||
|
|
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 263 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1023 B |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 643 B |
After Width: | Height: | Size: 752 B |