master
skycaiji 2024-12-18 00:08:02 +08:00
parent bf3768e12a
commit b25ba8ebe6
236 changed files with 2802 additions and 102880 deletions

View File

@ -1,23 +1,12 @@
{
"name": "topthink/think",
"description": "the new thinkphp framework",
"name": "zorlan/skycaiji",
"description": "skycaiji",
"type": "project",
"keywords": [
"framework",
"thinkphp",
"ORM"
],
"homepage": "http://thinkphp.cn/",
"keywords": ["skycaiji", "crawler"],
"homepage": "http://skycaiji.com/",
"license": "Apache-2.0",
"authors": [
{
"name": "liu21st",
"email": "liu21st@gmail.com"
}
],
"require": {
"php": ">=5.4.0",
"topthink/framework": "5.0.*",
"topthink/think-image": "^1.0",
"topthink/think-captcha": "1.*",
"topthink/think-mongo": "1.*",
@ -27,18 +16,12 @@
"topthink/think-oracle": "1.*",
"phpmailer/phpmailer": "~5.2",
"matthiasmullie/minify": "^1.3",
"studio-42/elfinder": "^2.1",
"phpoffice/phpexcel": "^1.8"
},
"autoload": {
"psr-4": {
"app\\": "application"
}
},
"extra": {
"think-path": "thinkphp"
},
"config": {
"preferred-install": "dist"
"preferred-install": "dist",
"allow-plugins": {
"topthink/think-installer": false
}
}
}

201
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "fb8dcb2b8a78912f226ea44bf90cb32a",
"content-hash": "453df763b206ceea673eaf0fd562977e",
"packages": [
{
"name": "matthiasmullie/minify",
"version": "1.3.66",
"version": "1.3.73",
"source": {
"type": "git",
"url": "https://github.com/matthiasmullie/minify.git",
"reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6"
"reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/45fd3b0f1dfa2c965857c6d4a470bea52adc31a6",
"reference": "45fd3b0f1dfa2c965857c6d4a470bea52adc31a6",
"url": "https://api.github.com/repos/matthiasmullie/minify/zipball/cb7a9297b4ab070909cefade30ee95054d4ae87a",
"reference": "cb7a9297b4ab070909cefade30ee95054d4ae87a",
"shasum": "",
"mirrors": [
{
@ -32,9 +32,10 @@
"php": ">=5.3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.0",
"matthiasmullie/scrapbook": "dev-master",
"phpunit/phpunit": ">=4.8"
"friendsofphp/php-cs-fixer": ">=2.0",
"matthiasmullie/scrapbook": ">=1.3",
"phpunit/phpunit": ">=4.8",
"squizlabs/php_codesniffer": ">=3.0"
},
"suggest": {
"psr/cache-implementation": "Cache implementation to use with Minify::cache"
@ -57,12 +58,12 @@
{
"name": "Matthias Mullie",
"email": "minify@mullie.eu",
"homepage": "http://www.mullie.eu",
"homepage": "https://www.mullie.eu",
"role": "Developer"
}
],
"description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
"homepage": "http://www.minifier.org",
"homepage": "https://github.com/matthiasmullie/minify",
"keywords": [
"JS",
"css",
@ -70,21 +71,17 @@
"minifier",
"minify"
],
"support": {
"issues": "https://github.com/matthiasmullie/minify/issues",
"source": "https://github.com/matthiasmullie/minify/tree/1.3.73"
},
"funding": [
{
"url": "https://github.com/[user1",
"type": "github"
},
{
"url": "https://github.com/matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g.",
"type": "github"
},
{
"url": "https://github.com/user2",
"url": "https://github.com/matthiasmullie",
"type": "github"
}
],
"time": "2021-01-06T15:18:10+00:00"
"time": "2024-03-15T10:27:10+00:00"
},
{
"name": "matthiasmullie/path-converter",
@ -139,6 +136,10 @@
"paths",
"relative"
],
"support": {
"issues": "https://github.com/matthiasmullie/path-converter/issues",
"source": "https://github.com/matthiasmullie/path-converter/tree/1.1.3"
},
"time": "2019-02-05T23:41:09+00:00"
},
{
@ -222,6 +223,10 @@
}
],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v5.2.28"
},
"funding": [
{
"url": "https://marcus.bointon.com/donations/",
@ -304,85 +309,25 @@
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/PHPOffice/PHPExcel/issues",
"source": "https://github.com/PHPOffice/PHPExcel/tree/master"
},
"abandoned": "phpoffice/phpspreadsheet",
"time": "2018-11-22T23:07:24+00:00"
},
{
"name": "studio-42/elfinder",
"version": "2.1.59",
"source": {
"type": "git",
"url": "https://github.com/Studio-42/elFinder.git",
"reference": "06ada3132cefd057e1d89cb016f8c82473d420d4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Studio-42/elFinder/zipball/06ada3132cefd057e1d89cb016f8c82473d420d4",
"reference": "06ada3132cefd057e1d89cb016f8c82473d420d4",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.2"
},
"suggest": {
"barryvdh/elfinder-flysystem-driver": "VolumeDriver for elFinder to use Flysystem as a root.",
"google/apiclient": "VolumeDriver GoogleDrive require `google/apiclient:^2.0.",
"kunalvarma05/dropbox-php-sdk": "VolumeDriver `Dropbox`2 require `kunalvarma05/dropbox-php-sdk.",
"nao-pon/flysystem-google-drive": "require in GoogleDrive network volume mounting with Flysystem."
},
"type": "library",
"autoload": {
"classmap": [
"php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Dmitry Levashov",
"email": "dio@std42.ru",
"homepage": "http://std42.ru"
},
{
"name": "Troex Nevelin",
"email": "troex@fury.scancode.ru",
"homepage": "http://std42.ru"
},
{
"name": "Naoki Sawada",
"email": "hypweb+elfinder@gmail.com",
"homepage": "http://xoops.hypweb.net"
},
{
"name": "Community contributions",
"homepage": "https://github.com/Studio-42/elFinder/contributors"
}
],
"description": "File manager for web",
"homepage": "http://elfinder.org",
"time": "2021-06-13T15:04:24+00:00"
},
{
"name": "topthink/framework",
"version": "v5.0.24",
"version": "v5.0.25",
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be"
"reference": "643c58ed1bd22a2823ce5e95b3b68a5075f9087c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be",
"reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be",
"url": "https://api.github.com/repos/top-think/framework/zipball/643c58ed1bd22a2823ce5e95b3b68a5075f9087c",
"reference": "643c58ed1bd22a2823ce5e95b3b68a5075f9087c",
"shasum": "",
"mirrors": [
{
@ -426,7 +371,11 @@
"orm",
"thinkphp"
],
"time": "2019-01-11T08:04:58+00:00"
"support": {
"issues": "https://github.com/top-think/framework/issues",
"source": "https://github.com/top-think/framework/tree/v5.0.25"
},
"time": "2022-10-25T14:59:38+00:00"
},
{
"name": "topthink/think-captcha",
@ -454,12 +403,12 @@
},
"type": "library",
"autoload": {
"psr-4": {
"think\\captcha\\": "src/"
},
"files": [
"src/helper.php"
]
],
"psr-4": {
"think\\captcha\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -472,6 +421,10 @@
}
],
"description": "captcha package for thinkphp5",
"support": {
"issues": "https://github.com/top-think/think-captcha/issues",
"source": "https://github.com/top-think/think-captcha/tree/master"
},
"time": "2019-01-28T04:48:36+00:00"
},
{
@ -496,12 +449,12 @@
},
"type": "library",
"autoload": {
"psr-4": {
"think\\helper\\": "src"
},
"files": [
"src/helper.php"
]
],
"psr-4": {
"think\\helper\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -514,6 +467,10 @@
}
],
"description": "The ThinkPHP5 Helper Package",
"support": {
"issues": "https://github.com/top-think/think-helper/issues",
"source": "https://github.com/top-think/think-helper/tree/master"
},
"time": "2018-10-05T00:43:21+00:00"
},
{
@ -560,6 +517,10 @@
}
],
"description": "The ThinkPHP5 Image Package",
"support": {
"issues": "https://github.com/top-think/think-image/issues",
"source": "https://github.com/top-think/think-image/tree/master"
},
"time": "2016-09-29T06:05:43+00:00"
},
{
@ -607,6 +568,10 @@
"email": "448901948@qq.com"
}
],
"support": {
"issues": "https://github.com/top-think/think-installer/issues",
"source": "https://github.com/top-think/think-installer/tree/v1.0.14"
},
"time": "2021-03-25T08:34:02+00:00"
},
{
@ -634,13 +599,13 @@
},
"type": "library",
"autoload": {
"files": [
"src/config.php"
],
"psr-4": {
"Phinx\\": "phinx/src/Phinx",
"think\\migration\\": "src"
},
"files": [
"src/config.php"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -652,6 +617,10 @@
"email": "448901948@qq.com"
}
],
"support": {
"issues": "https://github.com/top-think/think-migration/issues",
"source": "https://github.com/top-think/think-migration/tree/master"
},
"time": "2017-03-31T06:33:23+00:00"
},
{
@ -676,10 +645,10 @@
},
"type": "library",
"autoload": {
"files": [],
"psr-4": {
"think\\mongo\\": "src"
},
"files": []
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -692,6 +661,10 @@
}
],
"description": "mongodb driver for thinkphp5",
"support": {
"issues": "https://github.com/top-think/think-mongo/issues",
"source": "https://github.com/top-think/think-mongo/tree/master"
},
"time": "2018-06-03T01:51:27+00:00"
},
{
@ -719,10 +692,10 @@
},
"type": "library",
"autoload": {
"files": [],
"psr-4": {
"think\\oracle\\": "src"
},
"files": []
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -735,6 +708,10 @@
}
],
"description": "Oracle driver for thinkphp5",
"support": {
"issues": "https://github.com/top-think/think-oracle/issues",
"source": "https://github.com/top-think/think-oracle/tree/master"
},
"abandoned": true,
"time": "2018-04-14T00:52:34+00:00"
},
@ -772,12 +749,12 @@
}
},
"autoload": {
"psr-4": {
"think\\": "src"
},
"files": [
"src/common.php"
]
],
"psr-4": {
"think\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -790,6 +767,10 @@
}
],
"description": "The ThinkPHP5 Queue Package",
"support": {
"issues": "https://github.com/top-think/think-queue/issues",
"source": "https://github.com/top-think/think-queue/tree/master"
},
"time": "2018-10-15T10:16:55+00:00"
}
],
@ -803,5 +784,5 @@
"php": ">=5.4.0"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
"plugin-api-version": "2.2.0"
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,175 +0,0 @@
/**
* elFinder client options and main script for RequireJS
*
* Rename "main.default.js" to "main.js" and edit it if you need configure elFInder options or any things. And use that in elfinder.html.
* e.g. `<script data-main="./main.js" src="./require.js"></script>`
**/
(function(){
"use strict";
var // jQuery and jQueryUI version
jqver = '3.6.0',
uiver = '1.12.1',
// Detect language (optional)
lang = (function() {
var locq = window.location.search,
map = {
'pt' : 'pt_BR',
'ug' : 'ug_CN',
'zh' : 'zh_CN'
},
full = {
'zh_tw' : 'zh_TW',
'zh_cn' : 'zh_CN',
'fr_ca' : 'fr_CA'
},
fullLang, locm, lang;
if (locq && (locm = locq.match(/lang=([a-zA-Z_-]+)/))) {
// detection by url query (?lang=xx)
fullLang = locm[1];
} else {
// detection by browser language
fullLang = (navigator.browserLanguage || navigator.language || navigator.userLanguage || '');
}
fullLang = fullLang.replace('-', '_').substr(0,5).toLowerCase();
if (full[fullLang]) {
lang = full[fullLang];
} else {
lang = (fullLang || 'en').substr(0,2);
if (map[lang]) {
lang = map[lang];
}
}
return lang;
})(),
// Start elFinder (REQUIRED)
start = function(elFinder, editors, config) {
// load jQueryUI CSS
elFinder.prototype.loadCss(window.elfinderPath+'jquery-ui.css');
$(function() {
var optEditors = {
commandsOptions: {
edit: {
editors: Array.isArray(editors)? editors : []
}
}
},
opts = {};
// Interpretation of "elFinderConfig"
if (config && config.managers) {
$.each(config.managers, function(id, mOpts) {
opts = Object.assign(opts, config.defaultOpts || {});
// editors marges to opts.commandOptions.edit
try {
mOpts.commandsOptions.edit.editors = mOpts.commandsOptions.edit.editors.concat(editors || []);
} catch(e) {
Object.assign(mOpts, optEditors);
}
// Make elFinder
$('#' + id).elfinder(
// 1st Arg - options
$.extend(true, { lang: lang }, opts, mOpts || {}),
// 2nd Arg - before boot up function
function(fm, extraObj) {
// `init` event callback function
fm.bind('init', function() {
// Optional for Japanese decoder "encoding-japanese"
if (fm.lang === 'ja') {
require(
[ 'encoding-japanese' ],
function(Encoding) {
if (Encoding && Encoding.convert) {
fm.registRawStringDecoder(function(s) {
return Encoding.convert(s, {to:'UNICODE',type:'string'});
});
}
}
);
}
});
}
);
});
} else {
alert('"elFinderConfig" object is wrong.');
}
});
},
// JavaScript loader (REQUIRED)
load = function() {
require(
[
'elfinder'
, 'extras/editors.default.min' // load text, image editors
, 'elFinderConfig'
// , 'extras/quicklook.googledocs.min' // optional preview for GoogleApps contents on the GoogleDrive volume
],
start,
function(error) {
alert(error.message);
}
);
},
// is IE8 or :? for determine the jQuery version to use (optional)
old = (typeof window.addEventListener === 'undefined' && typeof document.getElementsByClassName === 'undefined')
||
(!window.chrome && !document.unqueID && !window.opera && !window.sidebar && 'WebkitAppearance' in document.documentElement.style && document.body.style && typeof document.body.style.webkitFilter === 'undefined');
// config of RequireJS (REQUIRED)
require.config({
baseUrl : 'js',
paths : {
'jquery' : window.elfinderPath+(old? 'jquery_old.min' : 'jquery_new.min'),
'jquery-ui': window.elfinderPath+'jquery-ui.min',
'elfinder' : 'elfinder.min',
'encoding-japanese': window.elfinderPath+'encoding.min'
},
waitSeconds : 10 // optional
});
// check elFinderConfig and fallback
// This part don't used if you are using elfinder.html, see elfinder.html
if (! require.defined('elFinderConfig')) {
define('elFinderConfig', {
// elFinder options (REQUIRED)
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
defaultOpts : {
url : 'php/connector.minimal.php' // connector URL (REQUIRED)
,commandsOptions : {
edit : {
extraOptions : {
// set API key to enable Creative Cloud image editor
// see https://console.adobe.io/
creativeCloudApiKey : '',
// browsing manager URL for CKEditor, TinyMCE
// uses self location with the empty value
managerUrl : ''
}
}
,quicklook : {
// to enable CAD-Files and 3D-Models preview with sharecad.org
sharecadMimes : ['image/vnd.dwg', 'image/vnd.dxf', 'model/vnd.dwf', 'application/vnd.hp-hpgl', 'application/plt', 'application/step', 'model/iges', 'application/vnd.ms-pki.stl', 'application/sat', 'image/cgm', 'application/x-msmetafile'],
// to enable preview with Google Docs Viewer
googleDocsMimes : ['application/pdf', 'image/tiff', 'application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/postscript', 'application/rtf'],
// to enable preview with Microsoft Office Online Viewer
// these MIME types override "googleDocsMimes"
officeOnlineMimes : ['application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.presentation']
}
}
},
managers : {
'elfinder': {},
}
});
}
// load JavaScripts (REQUIRED)
load();
})();

File diff suppressed because one or more lines are too long

View File

@ -222,9 +222,9 @@ div.in-line-mg{display:inline;margin-right:5px;}
.datatable .sort input{height:auto;padding:0 5px;min-width:100%!important;}
.datatable .bg0{background:#fcfcfc}
.datatable .chk-inline{vertical-align:baseline;margin-right:5px;}
.datatable .sep{color:#999;text-indent:-9999px;display:inline-block;width:2px;line-height:12px;margin-left:1px;border-left:1px solid #aaa;}
.datatable .nav-packs{display:inline-block;max-width:500px;overflow:hidden;text-overflow:ellipsis;}
.datatable tr,.datatable td{white-space:nowrap;}
.datatable .sep{color:#999;text-indent:-9999px;display:inline-block;width:2px;line-height:12px;margin-left:1px;border-left:1px solid #aaa;}
.datatable .store-detail{position:relative;}
.datatable .store-detail .new-version{position:absolute;color:green;font-size:10px;top:-4px;right:-15px;}

View File

@ -32,7 +32,8 @@ $(box).sortable(sOpts)}},visualizeData:function(data){var cacheData=data;data=is
windowIframe(title,'',options)}(function(data){if(data){$('#myModal .modal-footer .close').addClass('btn btn-default').removeClass('close');$('#myModal .modal-footer').prepend('<button type="button" class="btn btn-info btn-back" data-dismiss="modal">返回</button>');$('#myModal .modal-footer .btn-back').bind('click',function(){globalOp.visualizeData(data)})}})(window.win_visualize_data);window.win_visualize_data=cacheData},showPanelCollapse:function(id){$(id).parent().find('a[data-toggle][href="'+id+'"]').attr('aria-expanded',!0).removeClass('collapsed');$(id).addClass('in').attr('aria-expanded',!0).attr('style','')},inputSelectCustom:function(sltObj,iptName,onOptions,customName,changeFunc){customName=customName?customName:'custom';var onChangeFunc=function(curObj,iptEle){var ipt=$(curObj).parents('.input-select-custom').eq(0).find(iptEle);if($(curObj).val()==customName){ipt.show()}else{ipt.hide()}
if(changeFunc&&typeof(changeFunc)=='function'){changeFunc()}};if(sltObj&&iptName){$(sltObj).bind('change',function(){onChangeFunc(this,'[name="'+iptName+'"]')})}else if(onOptions&&typeof(onOptions)=='object'){$(onOptions.box).on('change',onOptions.slt,function(){onChangeFunc(this,onOptions.ipt)})}},cpEasyBrowser:function(url,pageSource,inputUrls){pageSource=pageSource?pageSource:'';inputUrls=inputUrls?inputUrls:{};var data={type:'browser_url',page_source:pageSource,test_url:url,input_urls:inputUrls};data=JSON.stringify(data);window.top.postMessage(data,'*')},cpBrowserUrl:function(collId,pageSource,testUrl,inputedUrls){inputedUrls=inputedUrls?inputedUrls:{};var url='cpattern_test/browser?coll_id=_collid_&page_source=_source_&test_url=_url_';if(inputedUrls){for(var i in inputedUrls){url+='&'+i+'='+encodeURIComponent(inputedUrls[i])}}
url=ulink(url,{'_collid_':collId,'_source_':pageSource,'_url_':testUrl});return url},loadFormConfig:function(formObj,config,namePre){if(formObj&&isObject(config)){namePre=namePre?namePre:'';for(var i in config){var eleVal=config[i];var eleValIsArr=isObject(eleVal)?true:!1;var eleName=namePre?(namePre+'['+i+']'):i;var eleObj=$(formObj).find('[name="'+eleName+'"]');if(eleObj.length>0){var eleTag=eleObj.eq(0).prop('tagName').toLowerCase();if(eleTag=='input'){var eleType=eleObj.eq(0).attr('type').toLowerCase();if(eleType=='radio'||eleType=='checkbox'){eleObj.each(function(){if($(this).val()==eleVal){$(this).trigger('click')}})}else{eleObj.val(eleVal)}}else if(eleTag=='textarea'){eleObj.val(eleVal)}else if(eleTag=='select'){eleObj.val(eleVal).trigger('change')}}else{var isConfig=!0;eleObj=$(formObj).find('[name="'+eleName+'[]"]');if(eleObj.length>0){var eleTag=eleObj.eq(0).prop('tagName').toLowerCase();var eleType=eleObj.eq(0).attr('type').toLowerCase();if(eleTag=='input'&&eleType=='checkbox'){isConfig=!1;eleObj.each(function(){var curVal=$(this).val();if(eleValIsArr){if(eleVal.indexOf(curVal)>-1){$(this).prop('checked',!0)}}else{if(curVal==eleVal){$(this).prop('checked',!0)}}})}}
if(isConfig){globalOp.loadFormConfig(formObj,eleVal,eleName)}}}}},tipsCurlPost:function(){var tips='<p>表单数据模拟form表单输入的数据</p><p>表单上传模拟form表单输入并上传的数据</p>'+'<p>JSON数组以json格式发送数据可在“发送数据”的“值”中直接输入json字符串。在“名称”中填入json数组键名子节点名称使用.分隔例如a.b.c。根节点名称可使用###表示</p>';confirmRight({msg:tips,yes:'确定',width:500,textAlign:'left'})},editorCodeIfr:function(ifrEle,options){options=isObject(options)?options:{};if(options.set_value!=null&&typeof(options.set_value)!='undefined'){$(document).ready(function(){$(ifrEle).attr('src','');$(ifrEle).attr('src',ulink('develop/editor_code'));$(ifrEle).off('load').bind('load',function(){if(options.set_value&&$(ifrEle)[0].contentWindow.editor_code_op){$(ifrEle)[0].contentWindow.editor_code_op.set(options.set_value)}})})}else if(options.get_value){var ifrEle=$(ifrEle)[0];var val='';if(ifrEle&&ifrEle.contentWindow.editor_code_op){val=ifrEle.contentWindow.editor_code_op.get()}
if(isConfig){globalOp.loadFormConfig(formObj,eleVal,eleName)}}}}},tipsCurlPost:function(){var tips='<p>表单数据模拟form表单输入的数据</p><p>表单上传模拟form表单输入并上传的数据</p>'+'<p>JSON数组以json格式发送数据可在“发送数据”的“值”中直接输入json字符串。在“名称”中填入json数组键名子节点名称使用.分隔例如a.b.c。根节点名称可使用###表示</p>';confirmRight({msg:tips,yes:'确定',width:500,textAlign:'left'})},editorCodeIfr:function(ifrEle,options){options=isObject(options)?options:{};if(options.set_value!=null&&typeof(options.set_value)!='undefined'){$(document).ready(function(){$(ifrEle).attr('src','');$(ifrEle).attr('src',ulink('develop/editor_code'));$(ifrEle).off('load').bind('load',function(){var editorCodeOp=$(ifrEle)[0].contentWindow.editor_code_op;if(editorCodeOp){if(options.set_value){editorCodeOp.set(options.set_value)}
if(options.set_option){editorCodeOp.set_option(options.set_option)}}})})}else if(options.get_value){var ifrEle=$(ifrEle)[0];var val='';if(ifrEle&&ifrEle.contentWindow.editor_code_op){val=ifrEle.contentWindow.editor_code_op.get()}
return val}},collectorWindow:function(title,uri,uriVals,options){options=options?options:{};options.backdrop_static=1;title=isNull(title)?'':title;title+='<div class="loading-sm" style="margin-left:5px;"></div>';window.win_collector_window_params={title:title,uri:uri,uriVals:uriVals,options:options};windowModal(title,ulink('admin/collector/echo_msg?op=run'),{lg:options.lg})}};var pluginApiOp={load:function(params){params=params?params:{};var cacheParams=params;var boxObj=$(params.boxObj);var appObj=boxObj.find(params.appObj);var appApp=params.appApp?params.appApp:'';var appConfig=isObject(params.appConfig)?params.appConfig:{};var namePre=params.namePre?params.namePre:'config';var winCacheName='win_cache_plugin_api_'+params.module;boxObj.find('.plugin-api-refresh').off('click').bind('click',function(){window[winCacheName]=null;appObj.removeAttr('data-is-loaded');appObj.html('');cacheParams.show_refresh=1;pluginApiOp.load(cacheParams);return!1});if(!appObj.attr('data-change-ops')){appObj.attr('data-change-ops',1);appObj.bind('change',function(){var curVal=$(this).val();if(curVal){var sltOption=$(this).find('option:selected');var ops=sltOption.attr('data-ops');ops=decode_urlbase2json(ops);var html='';if(isObject(ops)){for(var i in ops){var op=ops[i];if(isObject(op)){var userOp=op.user;var nameKey=namePre+'['+op.name_key+']';var defaultVal=userOp['default'];html+='<div class="form-group plugin-api-op"><label>'+htmlspecialchars(op.name)+(userOp.required?'<span style="color:red;font-weight:bold;margin-left:5px;">*</span>':'')+'</label>';if(userOp.tag=='text'){html+='<textarea name="'+nameKey+'" rows="2" class="form-control"';if(defaultVal||defaultVal===0){html+=' placeholder="默认:'+htmlspecialchars(defaultVal)+'"'}
html+='"></textarea>'}else if(userOp.tag=='radio'){defaultVal=toInt(defaultVal);html+='<div class="input-group"><label class="radio-inline"><input type="radio" name="'+nameKey+'" value="1"'+(defaultVal>0?' checked="checked"':'')+'>是</label>'+'<label class="radio-inline"><input type="radio" name="'+nameKey+'" value="0"'+(defaultVal<=0?' checked="checked"':'')+'>否</label></div>'}else if(userOp.tag=='select'){html+='<select name="'+nameKey+'" class="form-control"><option value="">请选择</option>';if(isObject(userOp.tag_select)){for(var tsi in userOp.tag_select){html+='<option value="'+htmlspecialchars(tsi)+'"'+(defaultVal==tsi?' selected="selected"':'')+'>'+htmlspecialchars(userOp.tag_select[tsi])+'</option>'}}
html+='</select>'}

View File

@ -0,0 +1,13 @@
/*
|--------------------------------------------------------------------------
| SkyCaiji (蓝天采集器)
|--------------------------------------------------------------------------
| Copyright (c) 2018 https://www.skycaiji.com All rights reserved.
|--------------------------------------------------------------------------
| 使用协议 https://www.skycaiji.com/licenses
|--------------------------------------------------------------------------
*/
'use strict';function ToolFileManager(){}
ToolFileManager.prototype={constructor:ToolFileManager,file_load:function(){var $_o=this;var curFile=$('#ipt_file').val();$('#btn_back').bind('click',function(){if(curFile){window.location.href=ulink('tool/file?file=_file_',{'_file_':curFile.replace(/\/{0,1}[^\/\\]+$/,'')})}else{prompt_error('数据根目录,不能后退!')}});$('#btn_refresh').bind('click',function(){window.location.href=window.location.href});$('#fileList .open').bind('click',function(){var file=$_o.file_prop(this,'data-file');var isDir=$_o.file_prop(this,'data-is-dir');var fileUrl=ulink('tool/file?file=_file_',{'_file_':curFile+'/'+file});if(isDir){window.location.href=fileUrl}else{windowIframe(file,fileUrl,{lg:1})}});$('#btn_new_txt,#btn_new_folder').bind('click',function(){var isFolder=($(this).attr('id')=='btn_new_folder')?true:!1;windowModal('新建'+(isFolder?'文件夹':'空白文本'),ulink('tool/file'),{ajax:{data:{'file':curFile,'op':'new','new_type':(isFolder?'folder':'txt'),'new_name':$('#confirm_ipt_name').val()}}})});$('#fileList .move').bind('click',function(){var file=$_o.file_prop(this,'data-file');var fileUrl=ulink('tool/file?op=move&file=_file_',{'_file_':curFile+'/'+file});windowModal(file,fileUrl)});$('#fileList .rename').bind('click',function(){var file=$_o.file_prop(this,'data-file');var fileUrl=ulink('tool/file?op=rename&file=_file_',{'_file_':curFile+'/'+file});windowModal(file,fileUrl)});$('#fileList .delete').bind('click',function(){var tr=$(this).parents('tr').eq(0);var file=$_o.file_prop(this,'data-file');var fileUrl=ulink('tool/file?op=delete&file=_file_',{'_file_':curFile+'/'+file});confirmRight('确定删除?',function(){ajaxOpen({type:'post',url:fileUrl,success:function(data){ajaxDataMsg(data);if(data.code==1){tr.remove()}}})})});$('#fileList .download').bind('click',function(){var file=$_o.file_prop(this,'data-file');var fileUrl=ulink('tool/file?op=download&file=_file_',{'_file_':curFile+'/'+file});window.open(fileUrl,'_blank')});$('#chkall,#chkall1').bind('click',function(){var status=$(this).is(":checked")?true:!1;checkall(this);$('#chkall,#chkall1').prop('checked',status)});$('#btn_list_delete').bind('click',function(){var fileUrl=ulink('tool/files?op=delete');var files=$_o.checked_files();files=files.join(',');confirmRight('确定删除?',function(){ajaxOpen({type:'post',url:fileUrl,data:{cur:curFile,files:files},success:function(data){ajaxDataMsg(data)}})})});$('#btn_list_move').bind('click',function(){var files=$_o.checked_files();files=files.join(',');var fileUrl=ulink('tool/files?op=move');windowModal('移动',fileUrl,{ajax:{type:'post',data:{cur:curFile,files:files}}})})},file:function(fileData){$(document).ready(function(){var editorHeight=$(document.body).height()-$('#ifr_editor').offset().top;editorHeight=parseInt(editorHeight)-50;$('#ifr_editor').css('height',editorHeight+'px');globalOp.editorCodeIfr('#ifr_editor',{'set_value':fileData.data,'set_option':{indentUnit:0}});$('#btn_save').bind('click',function(){ajax_check_userpwd({type:'POST',dataType:'json',url:ulink('tool/file'),data:{'file':fileData.file,'op':'save','save_data':globalOp.editorCodeIfr('#ifr_editor',{'get_value':1})},beforeSend:function(){$('#btn_save').attr('disabled',!0)},success:function(data){if(data){data.url=''}
ajaxDataMsg(data)},complete:function(){$('#btn_save').removeAttr('disabled')}})})})},file_prop(obj,type){type=type?type:'data-file';var tr=$(obj).parents('tr').eq(0);var val=tr.attr(type);return val},checked_files:function(){var files=[];$('#fileList').find('[name="files[]"]').each(function(){if($(this).is(':checked')){files.push($(this).val())}});return files},file_other:function(){var $_o=this;$('#btn_down').bind('click',function(){var file=$('#ipt_file').val();var fileUrl=ulink('tool/file?op=download&file=_file_',{'_file_':file});window.open(fileUrl,'_blank')});$('#file_info').bind('mouseover',function(){$('#file_info').attr('data-mouse','over');$_o.file_other_embed()});$('#file_info').bind('mouseout',function(){$('#file_info').attr('data-mouse','out');$_o.file_other_embed()});$('#file_embed').bind('load',function(){$('#file_info').attr('data-loaded',1);$_o.file_other_embed()})},file_other_embed:function(){if($('#file_info').attr('data-loaded')==1){if($('#file_info').attr('data-mouse')=='over'){$('#file_info').stop(!0,!0);$('#file_info').show()}else{$('#file_info').fadeOut(1000,function(){if($('#file_info').attr('data-mouse')!='over'){$('#file_embed').removeClass('embed-hide').addClass('embed-show')}})}}}}
var toolFileManager=new ToolFileManager()

128
vendor/bin/minifycss vendored
View File

@ -1,14 +1,120 @@
#!/usr/bin/env sh
#!/usr/bin/env php
<?php
dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../matthiasmullie/minify/bin" && pwd)
/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../matthiasmullie/minify/bin/minifycss)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
namespace Composer;
"${dir}/minifycss" "$@"
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
if (!class_exists('Composer\BinProxyWrapper')) {
/**
* @internal
*/
final class BinProxyWrapper
{
private $handle;
private $position;
private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 17);
$this->realpath = realpath($opened_path) ?: $opened_path;
$opened_path = $this->realpath;
$this->handle = fopen($this->realpath, $mode);
$this->position = 0;
return (bool) $this->handle;
}
public function stream_read($count)
{
$data = fread($this->handle, $count);
if ($this->position === 0) {
$data = preg_replace('{^#!.*\r?\n}', '', $data);
}
$this->position += strlen($data);
return $data;
}
public function stream_cast($castAs)
{
return $this->handle;
}
public function stream_close()
{
fclose($this->handle);
}
public function stream_lock($operation)
{
return $operation ? flock($this->handle, $operation) : true;
}
public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}
return false;
}
public function stream_tell()
{
return $this->position;
}
public function stream_eof()
{
return feof($this->handle);
}
public function stream_stat()
{
return array();
}
public function stream_set_option($option, $arg1, $arg2)
{
return true;
}
public function url_stat($path, $flags)
{
$path = substr($path, 17);
if (file_exists($path)) {
return stat($path);
}
return false;
}
}
}
if (
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss');
exit(0);
}
}
include __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifycss';

View File

@ -1,4 +1,5 @@
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../matthiasmullie/minify/bin/minifycss
SET BIN_TARGET=%~dp0/minifycss
SET COMPOSER_RUNTIME_BIN_DIR=%~dp0
php "%BIN_TARGET%" %*

128
vendor/bin/minifyjs vendored
View File

@ -1,14 +1,120 @@
#!/usr/bin/env sh
#!/usr/bin/env php
<?php
dir=$(cd "${0%[/\\]*}" > /dev/null; cd "../matthiasmullie/minify/bin" && pwd)
/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../matthiasmullie/minify/bin/minifyjs)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/
if [ -d /proc/cygdrive ]; then
case $(which php) in
$(readlink -n /proc/cygdrive)/*)
# We are in Cygwin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
;;
esac
fi
namespace Composer;
"${dir}/minifyjs" "$@"
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
if (!class_exists('Composer\BinProxyWrapper')) {
/**
* @internal
*/
final class BinProxyWrapper
{
private $handle;
private $position;
private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 17);
$this->realpath = realpath($opened_path) ?: $opened_path;
$opened_path = $this->realpath;
$this->handle = fopen($this->realpath, $mode);
$this->position = 0;
return (bool) $this->handle;
}
public function stream_read($count)
{
$data = fread($this->handle, $count);
if ($this->position === 0) {
$data = preg_replace('{^#!.*\r?\n}', '', $data);
}
$this->position += strlen($data);
return $data;
}
public function stream_cast($castAs)
{
return $this->handle;
}
public function stream_close()
{
fclose($this->handle);
}
public function stream_lock($operation)
{
return $operation ? flock($this->handle, $operation) : true;
}
public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}
return false;
}
public function stream_tell()
{
return $this->position;
}
public function stream_eof()
{
return feof($this->handle);
}
public function stream_stat()
{
return array();
}
public function stream_set_option($option, $arg1, $arg2)
{
return true;
}
public function url_stat($path, $flags)
{
$path = substr($path, 17);
if (file_exists($path)) {
return stat($path);
}
return false;
}
}
}
if (
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs');
exit(0);
}
}
include __DIR__ . '/..'.'/matthiasmullie/minify/bin/minifyjs';

View File

@ -1,4 +1,5 @@
@ECHO OFF
setlocal DISABLEDELAYEDEXPANSION
SET BIN_TARGET=%~dp0/../matthiasmullie/minify/bin/minifyjs
SET BIN_TARGET=%~dp0/minifyjs
SET COMPOSER_RUNTIME_BIN_DIR=%~dp0
php "%BIN_TARGET%" %*

View File

@ -37,26 +37,80 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var ?string */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array<string, bool>
*/
private $missingClasses = array();
/** @var ?string */
private $apcuPrefix;
/**
* @var self[]
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}
/**
* @return string[]
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
@ -66,28 +120,47 @@ class ClassLoader
return array();
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
*
* @return void
*/
public function addClassMap(array $classMap)
{
@ -102,9 +175,11 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
@ -147,11 +222,13 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
@ -195,8 +272,10 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
@ -211,10 +290,12 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
@ -234,6 +315,8 @@ class ClassLoader
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
@ -256,6 +339,8 @@ class ClassLoader
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@ -276,6 +361,8 @@ class ClassLoader
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
@ -296,25 +383,44 @@ class ClassLoader
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
@ -323,6 +429,8 @@ class ClassLoader
return true;
}
return null;
}
/**
@ -367,6 +475,21 @@ class ClassLoader
return $file;
}
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@ -438,6 +561,10 @@ class ClassLoader
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{

350
vendor/composer/InstalledVersions.php vendored Normal file
View File

@ -0,0 +1,350 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = require __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
$installed[] = self::$installed;
return $installed;
}
}

View File

@ -6,45 +6,13 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'EasyPeasyICS' => $vendorDir . '/phpmailer/phpmailer/extras/EasyPeasyICS.php',
'PHPMailer' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',
'PHPMailerOAuth' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauth.php',
'PHPMailerOAuthGoogle' => $vendorDir . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php',
'POP3' => $vendorDir . '/phpmailer/phpmailer/class.pop3.php',
'RecursiveCallbackFilterIterator' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeLocalFileSystem.class.php',
'SMTP' => $vendorDir . '/phpmailer/phpmailer/class.smtp.php',
'elFinder' => $vendorDir . '/studio-42/elfinder/php/elFinder.class.php',
'elFinderAbortException' => $vendorDir . '/studio-42/elfinder/php/elFinder.class.php',
'elFinderConnector' => $vendorDir . '/studio-42/elfinder/php/elFinderConnector.class.php',
'elFinderEditor' => $vendorDir . '/studio-42/elfinder/php/editors/editor.php',
'elFinderEditorOnlineConvert' => $vendorDir . '/studio-42/elfinder/php/editors/OnlineConvert/editor.php',
'elFinderEditorZipArchive' => $vendorDir . '/studio-42/elfinder/php/editors/ZipArchive/editor.php',
'elFinderEditorZohoOffice' => $vendorDir . '/studio-42/elfinder/php/editors/ZohoOffice/editor.php',
'elFinderLibGdBmp' => $vendorDir . '/studio-42/elfinder/php/libs/GdBmp.php',
'elFinderPlugin' => $vendorDir . '/studio-42/elfinder/php/elFinderPlugin.php',
'elFinderPluginAutoResize' => $vendorDir . '/studio-42/elfinder/php/plugins/AutoResize/plugin.php',
'elFinderPluginAutoRotate' => $vendorDir . '/studio-42/elfinder/php/plugins/AutoRotate/plugin.php',
'elFinderPluginNormalizer' => $vendorDir . '/studio-42/elfinder/php/plugins/Normalizer/plugin.php',
'elFinderPluginSanitizer' => $vendorDir . '/studio-42/elfinder/php/plugins/Sanitizer/plugin.php',
'elFinderPluginWatermark' => $vendorDir . '/studio-42/elfinder/php/plugins/Watermark/plugin.php',
'elFinderSession' => $vendorDir . '/studio-42/elfinder/php/elFinderSession.php',
'elFinderSessionInterface' => $vendorDir . '/studio-42/elfinder/php/elFinderSessionInterface.php',
'elFinderTriggerException' => $vendorDir . '/studio-42/elfinder/php/elFinder.class.php',
'elFinderVolumeBox' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeBox.class.php',
'elFinderVolumeDriver' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeDriver.class.php',
'elFinderVolumeDropbox' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeDropbox.class.php',
'elFinderVolumeDropbox2' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeDropbox2.class.php',
'elFinderVolumeFTP' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeFTP.class.php',
'elFinderVolumeFlysystemGoogleDriveCache' => $vendorDir . '/studio-42/elfinder/php/elFinderFlysystemGoogleDriveNetmount.php',
'elFinderVolumeFlysystemGoogleDriveNetmount' => $vendorDir . '/studio-42/elfinder/php/elFinderFlysystemGoogleDriveNetmount.php',
'elFinderVolumeGoogleDrive' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeGoogleDrive.class.php',
'elFinderVolumeGroup' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeGroup.class.php',
'elFinderVolumeLocalFileSystem' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeLocalFileSystem.class.php',
'elFinderVolumeMySQL' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeMySQL.class.php',
'elFinderVolumeOneDrive' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeOneDrive.class.php',
'elFinderVolumeSFTPphpseclib' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeSFTPphpseclib.class.php',
'elFinderVolumeTrash' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeTrash.class.php',
'elFinderVolumeTrashMySQL' => $vendorDir . '/studio-42/elfinder/php/elFinderVolumeTrashMySQL.class.php',
'ntlm_sasl_client_class' => $vendorDir . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php',
'phpmailerException' => $vendorDir . '/phpmailer/phpmailer/class.phpmailer.php',
);

View File

@ -12,8 +12,7 @@ return array(
'think\\helper\\' => array($vendorDir . '/topthink/think-helper/src'),
'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
'think\\' => array($baseDir . '/thinkphp/library/think', $vendorDir . '/topthink/think-image/src', $vendorDir . '/topthink/think-queue/src'),
'app\\' => array($baseDir . '/application'),
'think\\' => array($vendorDir . '/topthink/think-image/src', $vendorDir . '/topthink/think-queue/src', $vendorDir . '/topthink/framework/library/think'),
'Phinx\\' => array($vendorDir . '/topthink/think-migration/phinx/src/Phinx'),
'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
'MatthiasMullie\\Minify\\' => array($vendorDir . '/matthiasmullie/minify/src'),

View File

@ -22,13 +22,15 @@ class ComposerAutoloaderInit34a41e2841af1a67f3ddef099fc7b348
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit34a41e2841af1a67f3ddef099fc7b348', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit34a41e2841af1a67f3ddef099fc7b348', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit34a41e2841af1a67f3ddef099fc7b348::getInitializer($loader));
} else {
@ -63,11 +65,16 @@ class ComposerAutoloaderInit34a41e2841af1a67f3ddef099fc7b348
}
}
/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire34a41e2841af1a67f3ddef099fc7b348($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}

View File

@ -24,10 +24,6 @@ class ComposerStaticInit34a41e2841af1a67f3ddef099fc7b348
'think\\captcha\\' => 14,
'think\\' => 6,
),
'a' =>
array (
'app\\' => 4,
),
'P' =>
array (
'Phinx\\' => 6,
@ -66,13 +62,9 @@ class ComposerStaticInit34a41e2841af1a67f3ddef099fc7b348
),
'think\\' =>
array (
0 => __DIR__ . '/../..' . '/thinkphp/library/think',
1 => __DIR__ . '/..' . '/topthink/think-image/src',
2 => __DIR__ . '/..' . '/topthink/think-queue/src',
),
'app\\' =>
array (
0 => __DIR__ . '/../..' . '/application',
0 => __DIR__ . '/..' . '/topthink/think-image/src',
1 => __DIR__ . '/..' . '/topthink/think-queue/src',
2 => __DIR__ . '/..' . '/topthink/framework/library/think',
),
'Phinx\\' =>
array (
@ -99,45 +91,13 @@ class ComposerStaticInit34a41e2841af1a67f3ddef099fc7b348
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'EasyPeasyICS' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/EasyPeasyICS.php',
'PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php',
'PHPMailerOAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauth.php',
'PHPMailerOAuthGoogle' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmaileroauthgoogle.php',
'POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.pop3.php',
'RecursiveCallbackFilterIterator' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeLocalFileSystem.class.php',
'SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.smtp.php',
'elFinder' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinder.class.php',
'elFinderAbortException' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinder.class.php',
'elFinderConnector' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderConnector.class.php',
'elFinderEditor' => __DIR__ . '/..' . '/studio-42/elfinder/php/editors/editor.php',
'elFinderEditorOnlineConvert' => __DIR__ . '/..' . '/studio-42/elfinder/php/editors/OnlineConvert/editor.php',
'elFinderEditorZipArchive' => __DIR__ . '/..' . '/studio-42/elfinder/php/editors/ZipArchive/editor.php',
'elFinderEditorZohoOffice' => __DIR__ . '/..' . '/studio-42/elfinder/php/editors/ZohoOffice/editor.php',
'elFinderLibGdBmp' => __DIR__ . '/..' . '/studio-42/elfinder/php/libs/GdBmp.php',
'elFinderPlugin' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderPlugin.php',
'elFinderPluginAutoResize' => __DIR__ . '/..' . '/studio-42/elfinder/php/plugins/AutoResize/plugin.php',
'elFinderPluginAutoRotate' => __DIR__ . '/..' . '/studio-42/elfinder/php/plugins/AutoRotate/plugin.php',
'elFinderPluginNormalizer' => __DIR__ . '/..' . '/studio-42/elfinder/php/plugins/Normalizer/plugin.php',
'elFinderPluginSanitizer' => __DIR__ . '/..' . '/studio-42/elfinder/php/plugins/Sanitizer/plugin.php',
'elFinderPluginWatermark' => __DIR__ . '/..' . '/studio-42/elfinder/php/plugins/Watermark/plugin.php',
'elFinderSession' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderSession.php',
'elFinderSessionInterface' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderSessionInterface.php',
'elFinderTriggerException' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinder.class.php',
'elFinderVolumeBox' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeBox.class.php',
'elFinderVolumeDriver' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeDriver.class.php',
'elFinderVolumeDropbox' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeDropbox.class.php',
'elFinderVolumeDropbox2' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeDropbox2.class.php',
'elFinderVolumeFTP' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeFTP.class.php',
'elFinderVolumeFlysystemGoogleDriveCache' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderFlysystemGoogleDriveNetmount.php',
'elFinderVolumeFlysystemGoogleDriveNetmount' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderFlysystemGoogleDriveNetmount.php',
'elFinderVolumeGoogleDrive' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeGoogleDrive.class.php',
'elFinderVolumeGroup' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeGroup.class.php',
'elFinderVolumeLocalFileSystem' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeLocalFileSystem.class.php',
'elFinderVolumeMySQL' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeMySQL.class.php',
'elFinderVolumeOneDrive' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeOneDrive.class.php',
'elFinderVolumeSFTPphpseclib' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeSFTPphpseclib.class.php',
'elFinderVolumeTrash' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeTrash.class.php',
'elFinderVolumeTrashMySQL' => __DIR__ . '/..' . '/studio-42/elfinder/php/elFinderVolumeTrashMySQL.class.php',
'ntlm_sasl_client_class' => __DIR__ . '/..' . '/phpmailer/phpmailer/extras/ntlm_sasl_client.php',
'phpmailerException' => __DIR__ . '/..' . '/phpmailer/phpmailer/class.phpmailer.php',
);

File diff suppressed because it is too large Load Diff

140
vendor/composer/installed.php vendored Normal file
View File

@ -0,0 +1,140 @@
<?php return array(
'root' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'name' => 'zorlan/skycaiji',
'dev' => true,
),
'versions' => array(
'matthiasmullie/minify' => array(
'pretty_version' => '1.3.73',
'version' => '1.3.73.0',
'type' => 'library',
'install_path' => __DIR__ . '/../matthiasmullie/minify',
'aliases' => array(),
'reference' => 'cb7a9297b4ab070909cefade30ee95054d4ae87a',
'dev_requirement' => false,
),
'matthiasmullie/path-converter' => array(
'pretty_version' => '1.1.3',
'version' => '1.1.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../matthiasmullie/path-converter',
'aliases' => array(),
'reference' => 'e7d13b2c7e2f2268e1424aaed02085518afa02d9',
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v5.2.28',
'version' => '5.2.28.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),
'reference' => 'acba50393dd03da69a50226c139722af8b153b11',
'dev_requirement' => false,
),
'phpoffice/phpexcel' => array(
'pretty_version' => '1.8.2',
'version' => '1.8.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoffice/phpexcel',
'aliases' => array(),
'reference' => '1441011fb7ecdd8cc689878f54f8b58a6805f870',
'dev_requirement' => false,
),
'topthink/framework' => array(
'pretty_version' => 'v5.0.25',
'version' => '5.0.25.0',
'type' => 'think-framework',
'install_path' => __DIR__ . '/../topthink/framework',
'aliases' => array(),
'reference' => '643c58ed1bd22a2823ce5e95b3b68a5075f9087c',
'dev_requirement' => false,
),
'topthink/think-captcha' => array(
'pretty_version' => 'v1.0.8',
'version' => '1.0.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-captcha',
'aliases' => array(),
'reference' => '1d64363c814c92f6086c4fa5e3223fe7e23db09d',
'dev_requirement' => false,
),
'topthink/think-helper' => array(
'pretty_version' => 'v1.0.7',
'version' => '1.0.7.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-helper',
'aliases' => array(),
'reference' => '5f92178606c8ce131d36b37a57c58eb71e55f019',
'dev_requirement' => false,
),
'topthink/think-image' => array(
'pretty_version' => 'v1.0.7',
'version' => '1.0.7.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-image',
'aliases' => array(),
'reference' => '8586cf47f117481c6d415b20f7dedf62e79d5512',
'dev_requirement' => false,
),
'topthink/think-installer' => array(
'pretty_version' => 'v1.0.14',
'version' => '1.0.14.0',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/../topthink/think-installer',
'aliases' => array(),
'reference' => 'eae1740ac264a55c06134b6685dfb9f837d004d1',
'dev_requirement' => false,
),
'topthink/think-migration' => array(
'pretty_version' => 'v1.1.1',
'version' => '1.1.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-migration',
'aliases' => array(),
'reference' => '8e489f8d38a39876690c0e00fcf9a54ae92c4d3d',
'dev_requirement' => false,
),
'topthink/think-mongo' => array(
'pretty_version' => 'v1.8.5',
'version' => '1.8.5.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-mongo',
'aliases' => array(),
'reference' => '657cc79bd5f090a58b0cc83776073dd69c83a3d1',
'dev_requirement' => false,
),
'topthink/think-oracle' => array(
'pretty_version' => 'v1.3',
'version' => '1.3.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../topthink/think-oracle',
'aliases' => array(),
'reference' => '89a049e876167030b489322f691aed00799fd68f',
'dev_requirement' => false,
),
'topthink/think-queue' => array(
'pretty_version' => 'v1.1.6',
'version' => '1.1.6.0',
'type' => 'think-extend',
'install_path' => __DIR__ . '/../topthink/think-queue',
'aliases' => array(),
'reference' => '250650eb0e8ea5af4cfdc7ae46f3f4e0a24ac245',
'dev_requirement' => false,
),
'zorlan/skycaiji' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'dev_requirement' => false,
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View File

@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 50400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.4.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View File

@ -1,12 +0,0 @@
# These are supported funding model platforms
github: [matthiasmullie] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -1,59 +0,0 @@
# How to contribute
## Issues
When [filing bugs](https://github.com/matthiasmullie/minify/issues/new),
try to be as thorough as possible:
* What version did you use?
* What did you try to do? ***Please post the relevant parts of your code.***
* What went wrong? ***Please include error messages, if any.***
* What was the expected result?
## Pull requests
Bug fixes and general improvements to the existing codebase are always welcome.
New features are also welcome, but will be judged on an individual basis. If
you'd rather not risk wasting your time implementing a new feature only to see
it turned down, please start the discussion by
[opening an issue](https://github.com/matthiasmullie/minify/issues/new).
Don't forget to add your changes to the [changelog](CHANGELOG.md).
### Testing
Please include tests for every change or addition to the code.
To run the complete test suite:
```sh
vendor/bin/phpunit
```
When submitting a new pull request, please make sure that that the test suite
passes (Travis CI will run it & report back on your pull request.)
To run the tests on Windows, run `tests/convert_symlinks_to_windows_style.sh`
from the command line in order to convert Linux-style test symlinks to
Windows-style.
### Coding standards
All code must follow [PSR-2](http://www.php-fig.org/psr/psr-2/). Just make sure
to run php-cs-fixer before submitting the code, it'll take care of the
formatting for you:
```sh
vendor/bin/php-cs-fixer fix src
vendor/bin/php-cs-fixer fix tests
```
Document the code thoroughly!
## License
Note that minify is MIT-licensed, which basically allows anyone to do
anything they like with it, without restriction.

View File

@ -1,13 +0,0 @@
ARG version=cli
FROM php:$version
COPY . /var/www
WORKDIR /var/www
RUN apt-get update
RUN apt-get install -y zip unzip libzip-dev git
RUN docker-php-ext-install zip
RUN docker-php-ext-install pcntl
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN composer install

View File

@ -3,12 +3,12 @@
"type": "library",
"description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.",
"keywords": ["minify", "minifier", "css", "js", "javascript"],
"homepage": "http://www.minifier.org",
"homepage": "https://github.com/matthiasmullie/minify",
"license": "MIT",
"authors": [
{
"name": "Matthias Mullie",
"homepage": "http://www.mullie.eu",
"homepage": "https://www.mullie.eu",
"email": "minify@mullie.eu",
"role": "Developer"
}
@ -19,9 +19,10 @@
"matthiasmullie/path-converter": "~1.1"
},
"require-dev": {
"matthiasmullie/scrapbook": "dev-master",
"friendsofphp/php-cs-fixer": ">=2.0",
"matthiasmullie/scrapbook": ">=1.3",
"phpunit/phpunit": ">=4.8",
"friendsofphp/php-cs-fixer": "~2.0"
"squizlabs/php_codesniffer": ">=3.0"
},
"suggest": {
"psr/cache-implementation": "Cache implementation to use with Minify::cache"
@ -31,6 +32,11 @@
"MatthiasMullie\\Minify\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MatthiasMullie\\Minify\\Tests\\": "tests/"
}
},
"bin": [
"bin/minifycss",
"bin/minifyjs"

View File

@ -1,46 +0,0 @@
version: '2.1'
services:
php:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./src:/var/www/src
- ./data:/var/www/data
- ./tests:/var/www/tests
- ./phpunit.xml.dist:/var/www/phpunit.xml.dist
'8.0':
extends: php
build:
args:
version: 8.0-cli
'7.4':
extends: php
build:
args:
version: 7.4-cli
'7.3':
extends: php
build:
args:
version: 7.3-cli
'7.2':
extends: php
build:
args:
version: 7.2-cli
'7.1':
extends: php
build:
args:
version: 7.1-cli
'7.0':
extends: php
build:
args:
version: 7.0-cli
'5.6':
extends: php
build:
args:
version: 5.6-cli

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="PSR12" />
<file>./src</file>
<file>./tests</file>
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
</ruleset>

View File

@ -1,6 +1,7 @@
<?php
/**
* CSS Minifier
* CSS Minifier.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
@ -12,15 +13,14 @@
namespace MatthiasMullie\Minify;
use MatthiasMullie\Minify\Exceptions\FileImportException;
use MatthiasMullie\PathConverter\ConverterInterface;
use MatthiasMullie\PathConverter\Converter;
use MatthiasMullie\PathConverter\ConverterInterface;
/**
* CSS minifier
* CSS minifier.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
* @author Tijs Verkoyen <minify@verkoyen.eu>
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
@ -44,6 +44,10 @@ class CSS extends Minify
'jpeg' => 'data:image/jpeg',
'svg' => 'data:image/svg+xml',
'woff' => 'data:application/x-font-woff',
'woff2' => 'data:application/x-font-woff2',
'avif' => 'data:image/avif',
'apng' => 'data:image/apng',
'webp' => 'data:image/webp',
'tif' => 'image/tiff',
'tiff' => 'image/tiff',
'xbm' => 'image/x-xbitmap',
@ -93,7 +97,7 @@ class CSS extends Minify
}
// add to top
$content = implode(';', $matches[2]).';'.trim($content, ';');
$content = implode(';', $matches[2]) . ';' . trim($content, ';');
}
return $content;
@ -102,7 +106,7 @@ class CSS extends Minify
/**
* Combine CSS from import statements.
*
* @import's will be loaded and their content merged into the original file,
* \@import's will be loaded and their content merged into the original file,
* to save HTTP requests.
*
* @param string $source The file to combine imports for
@ -200,7 +204,7 @@ class CSS extends Minify
// loop the matches
foreach ($matches as $match) {
// get the path for the file that will be imported
$importPath = dirname($source).'/'.$match['path'];
$importPath = dirname($source) . '/' . $match['path'];
// only replace the import with the content if we can grab the
// content of the file
@ -211,7 +215,7 @@ class CSS extends Minify
// check if current file was not imported previously in the same
// import chain.
if (in_array($importPath, $parents)) {
throw new FileImportException('Failed to import file "'.$importPath.'": circular reference detected.');
throw new FileImportException('Failed to import file "' . $importPath . '": circular reference detected.');
}
// grab referenced file & minify it (which may include importing
@ -223,7 +227,7 @@ class CSS extends Minify
// check if this is only valid for certain media
if (!empty($match['media'])) {
$importContent = '@media '.$match['media'].'{'.$importContent.'}';
$importContent = '@media ' . $match['media'] . '{' . $importContent . '}';
}
// add to replacement array
@ -262,7 +266,7 @@ class CSS extends Minify
// get the path for the file that will be imported
$path = $match[2];
$path = dirname($source).'/'.$path;
$path = dirname($source) . '/' . $path;
// only replace the import with the content if we're able to get
// the content of the file, and it's relatively small
@ -273,7 +277,7 @@ class CSS extends Minify
// build replacement
$search[] = $match[0];
$replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')';
$replace[] = 'url(' . $this->importExtensions[$extension] . ';base64,' . $importContent . ')';
}
}
@ -289,7 +293,7 @@ class CSS extends Minify
* Perform CSS optimizations.
*
* @param string[optional] $path Path to write the data to
* @param string[] $parents Parent paths, for circular reference checks
* @param string[] $parents Parent paths, for circular reference checks
*
* @return string The minified data
*/
@ -312,7 +316,9 @@ class CSS extends Minify
$css = $this->replace($css);
$css = $this->stripWhitespace($css);
$css = $this->shortenColors($css);
$css = $this->convertLegacyColors($css);
$css = $this->cleanupModernColors($css);
$css = $this->shortenHEXColors($css);
$css = $this->shortenZeroes($css);
$css = $this->shortenFontWeights($css);
$css = $this->stripEmptyTags($css);
@ -465,9 +471,9 @@ class CSS extends Minify
// build replacement
$search[] = $match[0];
if ($type === 'url') {
$replace[] = 'url('.$url.')';
$replace[] = 'url(' . $url . ')';
} elseif ($type === 'import') {
$replace[] = '@import "'.$url.'"';
$replace[] = '@import "' . $url . '"';
}
}
@ -476,64 +482,153 @@ class CSS extends Minify
}
/**
* Shorthand hex color codes.
* #FF0000 -> #F00.
* Shorthand HEX color codes.
* #FF0000FF -> #f00 -> red
* #FF00FF00 -> transparent.
*
* @param string $content The CSS content to shorten the hex color codes for
* @param string $content The CSS content to shorten the HEX color codes for
*
* @return string
*/
protected function shortenColors($content)
protected function shortenHexColors($content)
{
$content = preg_replace('/(?<=[: ])#([0-9a-z])\\1([0-9a-z])\\2([0-9a-z])\\3(?:([0-9a-z])\\4)?(?=[; }])/i', '#$1$2$3$4', $content);
// shorten repeating patterns within HEX ..
$content = preg_replace('/(?<=[: ])#([0-9a-f])\\1([0-9a-f])\\2([0-9a-f])\\3(?:([0-9a-f])\\4)?(?=[; }])/i', '#$1$2$3$4', $content);
// remove alpha channel if it's pointless...
$content = preg_replace('/(?<=[: ])#([0-9a-z]{6})ff?(?=[; }])/i', '#$1', $content);
$content = preg_replace('/(?<=[: ])#([0-9a-z]{3})f?(?=[; }])/i', '#$1', $content);
// remove alpha channel if it's pointless ..
$content = preg_replace('/(?<=[: ])#([0-9a-f]{6})ff(?=[; }])/i', '#$1', $content);
$content = preg_replace('/(?<=[: ])#([0-9a-f]{3})f(?=[; }])/i', '#$1', $content);
// replace `transparent` with shortcut ..
$content = preg_replace('/(?<=[: ])#[0-9a-f]{6}00(?=[; }])/i', '#fff0', $content);
$colors = array(
// make these more readable
'#00f' => 'blue',
'#dc143c' => 'crimson',
'#0ff' => 'cyan',
'#8b0000' => 'darkred',
'#696969' => 'dimgray',
'#ff69b4' => 'hotpink',
'#0f0' => 'lime',
'#fdf5e6' => 'oldlace',
'#87ceeb' => 'skyblue',
'#d8bfd8' => 'thistle',
// we can shorten some even more by replacing them with their color name
'#F0FFFF' => 'azure',
'#F5F5DC' => 'beige',
'#A52A2A' => 'brown',
'#FF7F50' => 'coral',
'#FFD700' => 'gold',
'#f0ffff' => 'azure',
'#f5f5dc' => 'beige',
'#ffe4c4' => 'bisque',
'#a52a2a' => 'brown',
'#ff7f50' => 'coral',
'#ffd700' => 'gold',
'#808080' => 'gray',
'#008000' => 'green',
'#4B0082' => 'indigo',
'#FFFFF0' => 'ivory',
'#F0E68C' => 'khaki',
'#FAF0E6' => 'linen',
'#4b0082' => 'indigo',
'#fffff0' => 'ivory',
'#f0e68c' => 'khaki',
'#faf0e6' => 'linen',
'#800000' => 'maroon',
'#000080' => 'navy',
'#808000' => 'olive',
'#CD853F' => 'peru',
'#FFC0CB' => 'pink',
'#DDA0DD' => 'plum',
'#ffa500' => 'orange',
'#da70d6' => 'orchid',
'#cd853f' => 'peru',
'#ffc0cb' => 'pink',
'#dda0dd' => 'plum',
'#800080' => 'purple',
'#F00' => 'red',
'#FA8072' => 'salmon',
'#A0522D' => 'sienna',
'#C0C0C0' => 'silver',
'#FFFAFA' => 'snow',
'#D2B48C' => 'tan',
'#FF6347' => 'tomato',
'#EE82EE' => 'violet',
'#F5DEB3' => 'wheat',
'#f00' => 'red',
'#fa8072' => 'salmon',
'#a0522d' => 'sienna',
'#c0c0c0' => 'silver',
'#fffafa' => 'snow',
'#d2b48c' => 'tan',
'#008080' => 'teal',
'#ff6347' => 'tomato',
'#ee82ee' => 'violet',
'#f5deb3' => 'wheat',
// or the other way around
'WHITE' => '#fff',
'BLACK' => '#000',
'black' => '#000',
'fuchsia' => '#f0f',
'magenta' => '#f0f',
'white' => '#fff',
'yellow' => '#ff0',
// and also `transparent`
'transparent' => '#fff0',
);
return preg_replace_callback(
'/(?<=[: ])('.implode('|', array_keys($colors)).')(?=[; }])/i',
'/(?<=[: ])(' . implode('|', array_keys($colors)) . ')(?=[; }])/i',
function ($match) use ($colors) {
return $colors[strtoupper($match[0])];
return $colors[strtolower($match[0])];
},
$content
);
}
/**
* Convert RGB|HSL color codes.
* rgb(255,0,0,.5) -> rgb(255 0 0 / .5).
* rgb(255,0,0) -> #f00.
*
* @param string $content The CSS content to shorten the RGB color codes for
*
* @return string
*/
protected function convertLegacyColors($content)
{
/*
https://drafts.csswg.org/css-color/#color-syntax-legacy
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hsl
*/
// convert legacy color syntax
$content = preg_replace('/(rgb)a?\(\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*,\s*([0,1]?(?:\.[0-9]*)?)\s*\)/i', '$1($2 $3 $4 / $5)', $content);
$content = preg_replace('/(rgb)a?\(\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*,\s*([0-9]{1,3}%?)\s*\)/i', '$1($2 $3 $4)', $content);
$content = preg_replace('/(hsl)a?\(\s*([0-9]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9]{1,3}%)\s*,\s*([0-9]{1,3}%)\s*,\s*([0,1]?(?:\.[0-9]*)?)\s*\)/i', '$1($2 $3 $4 / $5)', $content);
$content = preg_replace('/(hsl)a?\(\s*([0-9]+(?:deg|grad|rad|turn)?)\s*,\s*([0-9]{1,3}%)\s*,\s*([0-9]{1,3}%)\s*\)/i', '$1($2 $3 $4)', $content);
// convert `rgb` to `hex`
$dec = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])';
return preg_replace_callback(
"/rgb\($dec $dec $dec\)/i",
function ($match) {
return sprintf('#%02x%02x%02x', $match[1], $match[2], $match[3]);
},
$content
);
}
/**
* Cleanup RGB|HSL|HWB|LCH|LAB
* rgb(255 0 0 / 1) -> rgb(255 0 0).
* rgb(255 0 0 / 0) -> transparent.
*
* @param string $content The CSS content to cleanup HSL|HWB|LCH|LAB
*
* @return string
*/
protected function cleanupModernColors($content)
{
/*
https://drafts.csswg.org/css-color/#color-syntax-modern
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/hwb
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lch
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/lab
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklch
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/oklab
*/
$tag = '(rgb|hsl|hwb|(?:(?:ok)?(?:lch|lab)))';
// remove alpha channel if it's pointless ..
$content = preg_replace('/' . $tag . '\(\s*([^\s]+)\s+([^\s]+)\s+([^\s]+)\s+\/\s+1(?:(?:\.\d?)*|00%)?\s*\)/i', '$1($2 $3 $4)', $content);
// replace `transparent` with shortcut ..
$content = preg_replace('/' . $tag . '\(\s*[^\s]+\s+[^\s]+\s+[^\s]+\s+\/\s+0(?:[\.0%]*)?\s*\)/i', '#fff0', $content);
return $content;
}
/**
* Shorten CSS font weights.
*
@ -549,10 +644,10 @@ class CSS extends Minify
);
$callback = function ($match) use ($weights) {
return $match[1].$weights[$match[2]];
return $match[1] . $weights[$match[2]];
};
return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content);
return preg_replace_callback('/(font-weight\s*:\s*)(' . implode('|', array_keys($weights)) . ')(?=[;}])/', $callback, $content);
}
/**
@ -584,19 +679,19 @@ class CSS extends Minify
// practice, Webkit (especially Safari) seems to stumble over at least
// 0%, potentially other units as well. Only stripping 'px' for now.
// @see https://github.com/matthiasmullie/minify/issues/60
$content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content);
$content = preg_replace('/' . $before . '(-?0*(\.0+)?)(?<=0)px' . $after . '/', '\\1', $content);
// strip 0-digits (.0 -> 0)
$content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content);
$content = preg_replace('/' . $before . '\.0+' . $units . '?' . $after . '/', '0\\1', $content);
// strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px
$content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content);
$content = preg_replace('/' . $before . '(-?[0-9]+\.[0-9]+)0+' . $units . '?' . $after . '/', '\\1\\2', $content);
// strip trailing 0: 50.00 -> 50, 50.00px -> 50px
$content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content);
$content = preg_replace('/' . $before . '(-?[0-9]+)\.0+' . $units . '?' . $after . '/', '\\1\\2', $content);
// strip leading 0: 0.1 -> .1, 01.1 -> 1.1
$content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content);
$content = preg_replace('/' . $before . '(-?)0+([0-9]*\.[0-9]+)' . $units . '?' . $after . '/', '\\1\\2\\3', $content);
// strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0)
$content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content);
$content = preg_replace('/' . $before . '-?0+' . $units . '?' . $after . '/', '0\\1', $content);
// IE doesn't seem to understand a unitless flex-basis value (correct -
// it goes against the spec), so let's add it in again (make it `%`,
@ -628,18 +723,7 @@ class CSS extends Minify
*/
protected function stripComments()
{
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$callback = function ($match) use ($minifier) {
$count = count($minifier->extracted);
$placeholder = '/*'.$count.'*/';
$minifier->extracted[$placeholder] = $match[0];
return $placeholder;
};
$this->registerPattern('/\n?\/\*(!|.*?@license|.*?@preserve).*?\*\/\n?/s', $callback);
$this->registerPattern('/\/\*.*?\*\//s', '');
$this->stripMultilineComments();
}
/**
@ -670,7 +754,7 @@ class CSS extends Minify
// not in things like `calc(3px + 2px)`, shorthands like `3px -2px`, or
// selectors like `div.weird- p`
$pseudos = array('nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type');
$content = preg_replace('/:('.implode('|', $pseudos).')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
$content = preg_replace('/:(' . implode('|', $pseudos) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content);
// remove semicolon/whitespace followed by closing bracket
$content = str_replace(';}', '}', $content);
@ -680,12 +764,12 @@ class CSS extends Minify
/**
* Replace all occurrences of functions that may contain math, where
* whitespace around operators needs to be preserved (e.g. calc, clamp)
* whitespace around operators needs to be preserved (e.g. calc, clamp).
*/
protected function extractMath()
{
$functions = array('calc', 'clamp', 'min', 'max');
$pattern = '/\b('. implode('|', $functions) .')(\(.+?)(?=$|;|})/m';
$pattern = '/\b(' . implode('|', $functions) . ')(\(.+?)(?=$|;|})/m';
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
@ -700,11 +784,11 @@ class CSS extends Minify
// instead, it'll match a larger portion of code to where it's certain that
// the calc() musts have ended, and we'll figure out which is the correct
// closing parenthesis here, by counting how many have opened
for ($i = 0; $i < $length; $i++) {
for ($i = 0; $i < $length; ++$i) {
$char = $match[2][$i];
$expr .= $char;
if ($char === '(') {
$opened++;
++$opened;
} elseif ($char === ')' && --$opened === 0) {
break;
}
@ -712,16 +796,16 @@ class CSS extends Minify
// now that we've figured out where the calc() starts and ends, extract it
$count = count($minifier->extracted);
$placeholder = 'math('.$count.')';
$minifier->extracted[$placeholder] = $function.'('.trim(substr($expr, 1, -1)).')';
$placeholder = 'math(' . $count . ')';
$minifier->extracted[$placeholder] = $function . '(' . trim(substr($expr, 1, -1)) . ')';
// and since we've captured more code than required, we may have some leftover
// calc() in here too - go recursive on the remaining but of code to go figure
// that out and extract what is needed
$rest = str_replace($function.$expr, '', $match[0]);
$rest = $minifier->str_replace_first($function . $expr, '', $match[0]);
$rest = preg_replace_callback($pattern, $callback, $rest);
return $placeholder.$rest;
return $placeholder . $rest;
};
$this->registerPattern($pattern, $callback);
@ -729,19 +813,19 @@ class CSS extends Minify
/**
* Replace custom properties, whose values may be used in scenarios where
* we wouldn't want them to be minified (e.g. inside calc)
* we wouldn't want them to be minified (e.g. inside calc).
*/
protected function extractCustomProperties()
{
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$this->registerPattern(
'/(?<=^|[;}])(--[^:;{}"\'\s]+)\s*:([^;{}]+)/m',
'/(?<=^|[;}{])\s*(--[^:;{}"\'\s]+)\s*:([^;{}]+)/m',
function ($match) use ($minifier) {
$placeholder = '--custom-'. count($minifier->extracted) . ':0';
$minifier->extracted[$placeholder] = $match[1] .':'. trim($match[2]);
return $placeholder;
$placeholder = '--custom-' . count($minifier->extracted) . ':0';
$minifier->extracted[$placeholder] = $match[1] . ':' . trim($match[2]);
return $placeholder;
}
);
}

View File

@ -1,18 +1,20 @@
<?php
/**
* Base Exception
* Base Exception.
*
* @deprecated Use Exceptions\BasicException instead
*
* @author Matthias Mullie <minify@mullie.eu>
*/
namespace MatthiasMullie\Minify;
/**
* Base Exception Class
* Base Exception Class.
*
* @deprecated Use Exceptions\BasicException instead
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
*/
abstract class Exception extends \Exception

View File

@ -1,6 +1,7 @@
<?php
/**
* Basic exception
* Basic exception.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
@ -8,14 +9,14 @@
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
namespace MatthiasMullie\Minify\Exceptions;
use MatthiasMullie\Minify\Exception;
/**
* Basic Exception Class
* Basic Exception Class.
*
* @package Minify\Exception
* @author Matthias Mullie <minify@mullie.eu>
*/
abstract class BasicException extends Exception

View File

@ -1,6 +1,7 @@
<?php
/**
* File Import Exception
* File Import Exception.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
@ -8,12 +9,12 @@
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
namespace MatthiasMullie\Minify\Exceptions;
/**
* File Import Exception Class
* File Import Exception Class.
*
* @package Minify\Exception
* @author Matthias Mullie <minify@mullie.eu>
*/
class FileImportException extends BasicException

View File

@ -1,6 +1,7 @@
<?php
/**
* IO Exception
* IO Exception.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
@ -8,12 +9,12 @@
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
namespace MatthiasMullie\Minify\Exceptions;
/**
* IO Exception Class
* IO Exception Class.
*
* @package Minify\Exception
* @author Matthias Mullie <minify@mullie.eu>
*/
class IOException extends BasicException

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
<?php
/**
* Abstract minifier class
* Abstract minifier class.
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
@ -8,6 +9,7 @@
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
*/
namespace MatthiasMullie\Minify;
use MatthiasMullie\Minify\Exceptions\IOException;
@ -18,7 +20,6 @@ use Psr\Cache\CacheItemInterface;
*
* Please report bugs on https://github.com/matthiasmullie/minify/issues
*
* @package Minify
* @author Matthias Mullie <minify@mullie.eu>
* @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved
* @license MIT License
@ -44,6 +45,8 @@ abstract class Minify
* been extracted from the JS source code, so we can reliably match "code",
* without having to worry about potential "code-like" characters inside.
*
* @internal
*
* @var string[]
*/
public $extracted = array();
@ -128,7 +131,7 @@ abstract class Minify
// check if we can read the file
if (!$this->canImportFile($path)) {
throw new IOException('The file "'.$path.'" could not be opened for reading. Check if PHP has enough permissions.');
throw new IOException('The file "' . $path . '" could not be opened for reading. Check if PHP has enough permissions.');
}
$this->add($path);
@ -243,6 +246,9 @@ abstract class Minify
/**
* Register a pattern to execute against the source content.
*
* If $replacement is a string, it must be plain text. Placeholders like $1 or \2 don't work.
* If you need that functionality, use a callback instead.
*
* @param string $pattern PCRE pattern
* @param string|callable $replacement Replacement value for matched pattern
*/
@ -254,6 +260,49 @@ abstract class Minify
$this->patterns[] = array($pattern, $replacement);
}
/**
* Both JS and CSS use the same form of multi-line comment, so putting the common code here.
*/
protected function stripMultilineComments()
{
// First extract comments we want to keep, so they can be restored later
// PHP only supports $this inside anonymous functions since 5.4
$minifier = $this;
$callback = function ($match) use ($minifier) {
$count = count($minifier->extracted);
$placeholder = '/*' . $count . '*/';
$minifier->extracted[$placeholder] = $match[0];
return $placeholder;
};
$this->registerPattern('/
# optional newline
\n?
# start comment
\/\*
# comment content
(?:
# either starts with an !
!
|
# or, after some number of characters which do not end the comment
(?:(?!\*\/).)*?
# there is either a @license or @preserve tag
@(?:license|preserve)
)
# then match to the end of the comment
.*?\*\/\n?
/ixs', $callback);
// Then strip all other comments
$this->registerPattern('/\/\*.*?\*\//s', '');
}
/**
* We can't "just" run some regular expressions against JavaScript: it's a
* complex language. E.g. having an occurrence of // xyz would be a comment,
@ -268,11 +317,13 @@ abstract class Minify
*/
protected function replace($content)
{
$processed = '';
$contentLength = strlen($content);
$output = '';
$processedOffset = 0;
$positions = array_fill(0, count($this->patterns), -1);
$matches = array();
while ($content) {
while ($processedOffset < $contentLength) {
// find first match for all patterns
foreach ($this->patterns as $i => $pattern) {
list($pattern, $replacement) = $pattern;
@ -285,12 +336,12 @@ abstract class Minify
// no need to re-run matches that are still in the part of the
// content that hasn't been processed
if ($positions[$i] >= 0) {
if ($positions[$i] >= $processedOffset) {
continue;
}
$match = null;
if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE)) {
if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE, $processedOffset)) {
$matches[$i] = $match;
// we'll store the match position as well; that way, we
@ -307,61 +358,53 @@ abstract class Minify
// no more matches to find: everything's been processed, break out
if (!$matches) {
$processed .= $content;
// output the remaining content
$output .= substr($content, $processedOffset);
break;
}
// see which of the patterns actually found the first thing (we'll
// only want to execute that one, since we're unsure if what the
// other found was not inside what the first found)
$discardLength = min($positions);
$firstPattern = array_search($discardLength, $positions);
$match = $matches[$firstPattern][0][0];
$matchOffset = min($positions);
$firstPattern = array_search($matchOffset, $positions);
$match = $matches[$firstPattern];
// execute the pattern that matches earliest in the content string
list($pattern, $replacement) = $this->patterns[$firstPattern];
$replacement = $this->replacePattern($pattern, $replacement, $content);
list(, $replacement) = $this->patterns[$firstPattern];
// figure out which part of the string was unmatched; that's the
// part we'll execute the patterns on again next
$content = (string) substr($content, $discardLength);
$unmatched = (string) substr($content, strpos($content, $match) + strlen($match));
// move the replaced part to $processed and prepare $content to
// again match batch of patterns against
$processed .= substr($replacement, 0, strlen($replacement) - strlen($unmatched));
$content = $unmatched;
// first match has been replaced & that content is to be left alone,
// the next matches will start after this replacement, so we should
// fix their offsets
foreach ($positions as $i => $position) {
$positions[$i] -= $discardLength + strlen($match);
}
// add the part of the input between $processedOffset and the first match;
// that content wasn't matched by anything
$output .= substr($content, $processedOffset, $matchOffset - $processedOffset);
// add the replacement for the match
$output .= $this->executeReplacement($replacement, $match);
// advance $processedOffset past the match
$processedOffset = $matchOffset + strlen($match[0][0]);
}
return $processed;
return $output;
}
/**
* This is where a pattern is matched against $content and the matches
* are replaced by their respective value.
* This function will be called plenty of times, where $content will always
* move up 1 character.
* If $replacement is a callback, execute it, passing in the match data.
* If it's a string, just pass it through.
*
* @param string $pattern Pattern to match
* @param string|callable $replacement Replacement value
* @param string $content Content to match pattern against
* @param array $match Match data, in PREG_OFFSET_CAPTURE form
*
* @return string
*/
protected function replacePattern($pattern, $replacement, $content)
protected function executeReplacement($replacement, $match)
{
if (is_callable($replacement)) {
return preg_replace_callback($pattern, $replacement, $content, 1, $count);
} else {
return preg_replace($pattern, $replacement, $content, 1, $count);
if (!is_callable($replacement)) {
return $replacement;
}
// convert $match from the PREG_OFFSET_CAPTURE form to the form the callback expects
foreach ($match as &$matchItem) {
$matchItem = $matchItem[0];
}
return $replacement($match);
}
/**
@ -395,8 +438,8 @@ abstract class Minify
}
$count = count($minifier->extracted);
$placeholder = $match[1].$placeholderPrefix.$count.$match[1];
$minifier->extracted[$placeholder] = $match[1].$match[2].$match[1];
$placeholder = $match[1] . $placeholderPrefix . $count . $match[1];
$minifier->extracted[$placeholder] = $match[1] . $match[2] . $match[1];
return $placeholder;
};
@ -413,7 +456,7 @@ abstract class Minify
* considered as escape-char (times 2) and to get it in the regex,
* escaped (times 2)
*/
$this->registerPattern('/(['.$chars.'])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
$this->registerPattern('/([' . $chars . '])(.*?(?<!\\\\)(\\\\\\\\)*+)\\1/s', $callback);
}
/**
@ -451,14 +494,20 @@ abstract class Minify
$parsed = parse_url($path);
if (
// file is elsewhere
isset($parsed['host']) ||
isset($parsed['host'])
// file responds to queries (may change, or need to bypass cache)
isset($parsed['query'])
|| isset($parsed['query'])
) {
return false;
}
return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
try {
return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path);
}
// catch openbasedir exceptions which are not caught by @ on is_file()
catch (\Exception $e) {
return false;
}
}
/**
@ -473,7 +522,7 @@ abstract class Minify
protected function openFileForWriting($path)
{
if ($path === '' || ($handler = @fopen($path, 'w')) === false) {
throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.');
throw new IOException('The file "' . $path . '" could not be opened for writing. Check if PHP has enough permissions.');
}
return $handler;
@ -491,11 +540,21 @@ abstract class Minify
protected function writeToFile($handler, $content, $path = '')
{
if (
!is_resource($handler) ||
($result = @fwrite($handler, $content)) === false ||
($result < strlen($content))
!is_resource($handler)
|| ($result = @fwrite($handler, $content)) === false
|| ($result < strlen($content))
) {
throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.');
throw new IOException('The file "' . $path . '" could not be written to. Check your disk space and file permissions.');
}
}
protected static function str_replace_first($search, $replace, $subject)
{
$pos = strpos($subject, $search);
if ($pos !== false) {
return substr_replace($subject, $replace, $pos, strlen($search));
}
return $subject;
}
}

View File

@ -259,7 +259,9 @@ class Api extends CollectController{
$listRelease=is_array($listRelease)?$listRelease:array();
$listFunc=model('FuncApp')->where($cond)->column('uptime','app');
$listFunc=is_array($listFunc)?$listFunc:array();
$updateResult['data']['plugin']=array_merge($listRelease,$listFunc);
$listApi=model('ApiApp')->where($cond)->column('uptime','app');
$listApi=is_array($listApi)?$listApi:array();
$updateResult['data']['plugin']=array_merge($listRelease,$listFunc,$listApi);
}
if(!empty($storeAddons['app'])&&is_array($storeAddons['app'])){

View File

@ -12,73 +12,402 @@
namespace skycaiji\admin\controller;
use skycaiji\admin\model\DbCommon;
class Tool extends BaseController {
/*文件管理*/
public function fileManagerAction(){
$this->set_html_tags(
'文件管理',
'文件管理',
breadcrumb(array(array('url'=>url('tool/fileManager'),'title'=>'文件管理')))
);
return $this->fetch('fileManager');
}
/*elfinder文件管理器*/
public function elfinderAction(){
$this->check_usertoken();
$op=input('op');
if(empty($op)){
$this->ajax_check_userpwd();
$this->success('','tool/elfinder?op=show&pwd='.g_sc('user','password').'&'.url_usertoken());
}elseif('show'==$op){
if(input('pwd')==g_sc('user','password')){
$elfinderUrl=config('root_website').'/vendor/studio-42/elfinder';
$this->assign('elfinderUrl',$elfinderUrl);
return $this->fetch();
}else{
$this->error('密码验证错误');
}
}elseif('connect'==$op){
\elFinder::$netDrivers['ftp'] = 'FTP';
$opts = array(
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => config('root_path').'/data',
'URL' => config('root_website').'/data',
'uploadDeny' => array('all'),
'uploadAllow' => array('image/x-ms-bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/x-icon', 'text/plain'),
'uploadOrder' => array('deny', 'allow'),
'attributes' => array (
array (
'pattern' => '/\.(php|htaccess|html|lock)$/i',
'read' => false,
'write' => false,
'hidden' => true,
'locked' => false
),
array (
'pattern' => '/^\/{0,1}$/i',
'read' => true,
'write' => false,
'hidden' => false,
'locked' => false
)
)
)
)
);
$connector = new \elFinderConnector(new \elFinder($opts));
$connector->run();
}
}
/*文件管理*/
public function fileManagerAction(){
if($this->request->isPost()){
$this->ajax_check_userpwd();
session('file_manager_date',date('Y-m-d'));
$this->success('','tool/file');
}else{
$this->set_html_tags(
'文件管理',
'文件管理',
breadcrumb(array(array('url'=>url('tool/fileManager'),'title'=>'文件管理')))
);
return $this->fetch('fileManager');
}
}
private function _file_manager_date(){
if(date('Y-m-d')!=session('file_manager_date')){
$this->error('访问过期','tool/fileManager',array('window_top'=>1));
}
}
private function _protected_paths($path){
static $paths=array('app','files','images','program','program/upgrade','program/backup');
static $pathList=null;
if(!isset($pathList)){
foreach ($paths as $v){
$v=config('root_path').DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.$v;
$v=realpath($v);
if($v){
$pathList[]=$v;
}
}
}
$path=realpath($path);
if($path&&in_array($path,$pathList)){
return true;
}else{
return false;
}
}
public function fileAction(){
$this->_file_manager_date();
$op=input('op');
$file=input('file','');
$file=str_replace('/', DIRECTORY_SEPARATOR, $file);
$file=trim($file,'\/\\');
$rootPath=config('root_path').DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR;
$filePath=$rootPath.$file;
$filePath=realpath($filePath);
$fileName='';
if($file){
if(stripos($filePath, $rootPath)!==0){
$this->error('禁止访问根目录外的文件');
}
$fileName='';
if(preg_match('/([^\/\\\]+)$/',$filePath,$fileName)){
$fileName=$fileName[1];
}else{
$fileName='';
}
}
$files=array();
if(empty($op)){
if(is_dir($filePath)){
$fileList=scandir($filePath);
foreach ($fileList as $v){
if($v=='.'||$v=='..'||$v=='index.html'||$v=='install.lock'||preg_match('/\.php$/i', $v)){
continue;
}
$fileInfo=array('dir'=>'','date'=>'');
$curFile=$filePath.DIRECTORY_SEPARATOR.$v;
if(is_dir($curFile)){
$fileInfo['dir']='1';
}
$fileInfo['date']=date("Y-m-d H:i:s",filemtime($curFile));
$files[$v]=$fileInfo;
}
$this->assign('file',$file);
$this->assign('filePath',$filePath);
$this->assign('files',$files);
return $this->fetch('file');
}else{
$filePath=realpath($filePath);
if(empty($filePath)){
$this->error('文件不存在');
}
$fileData=file_get_contents($filePath);
$fileEncode=mb_detect_encoding($fileData,array('UTF-8','GB2312','GBK','BIG5','ASCII'));
if($fileEncode&&strtoupper($fileEncode)=='UTF-8'){
$fileData=json_encode(array('file'=>$file,'data'=>$fileData));
$this->assign('fileData',$fileData);
return $this->fetch('file_file');
}else{
$fileType='';
$fileInfo=array();
if(getimagesize($filePath)){
$fileType='img';
}else{
$fileType=pathinfo($filePath,PATHINFO_EXTENSION);
$fileInfo['size']=filesize($filePath);
$fileInfo['name']=basename($filePath);
$fileInfo['file']=$filePath;
if($fileInfo['size']>1024*1024){
$fileInfo['size']=round($fileInfo['size']/(1024*1024),2).' MB';
}else{
$fileInfo['size']=round($fileInfo['size']/1024,2).' KB';
}
$fileInfo['ctime']=date('Y-m-d H:i:s',filectime($filePath));
$fileInfo['mtime']=date('Y-m-d H:i:s',filemtime($filePath));
}
$this->assign('file',$file);
$this->assign('fileType',$fileType);
$this->assign('fileInfo',$fileInfo);
$this->assign('fileUrl',config('root_url').'/data/'.$file);
return $this->fetch('file_other');
}
}
}elseif($op=='new'){
if(is_dir($filePath)){
$newType=input('new_type');
if($this->request->isPost()){
$newName=input('new_name','');
if(!preg_match('/^[\w\-]+$/', $newName)){
$this->error('名称只能由字母、数字和下划线组成');
}
$newFile=$filePath.DIRECTORY_SEPARATOR.$newName;
if($newType=='folder'){
if(!is_dir($newFile)){
mkdir($newFile,0777,true);
}
$indexFile=$newFile.DIRECTORY_SEPARATOR.'index.html';
if(!file_exists($indexFile)){
write_dir_file($indexFile, '');
}
}elseif($newType=='txt'){
write_dir_file($newFile.'.txt', '');
}
$this->success('创建成功','tool/file?file='.rawurlencode($file));
}else{
$this->assign('file',$file);
$this->assign('newType',$newType);
return $this->fetch('file_add');
}
}
}elseif($op=='save'){
if($this->request->isPost()){
$saveData=input('save_data','',null);
file_put_contents($filePath, $saveData);
$this->success('已修改','');
}
}elseif($op=='move'){
if($this->request->isPost()){
if($this->_protected_paths($filePath)){
$this->error('禁止移动系统文件夹:'.$filePath);
}
$moveTo=input('move_to','','trim');
if(!preg_match('/^[\w\-\/\\\]+$/', $moveTo)||preg_match('/^[\/\\\]+$/', $moveTo)){
$this->error('目录只能由字母、数字和下划线组成');
}
$moveTo=str_replace('\\', '/', $moveTo);
$movePath=$rootPath.$moveTo;
if(!is_dir($movePath)){
mkdir($movePath,0777,true);
}
$movePath=realpath($movePath).DIRECTORY_SEPARATOR;
$tips=is_dir($filePath)?'目录':'文件';
if(file_exists($movePath.$fileName)){
$this->error('移动失败,已存在'.$tips);
}
if(rename($filePath, $movePath.$fileName)){
$this->success($tips.'已成功移动到:'.$movePath,'tool/file?file='.rawurlencode($moveTo));
}else{
$this->error($tips.'移动失败');
}
}else{
$this->assign('file',$file);
$this->assign('cur',preg_replace('/[\/\\\]*[^\/\\\]+$/', '', $file));
$this->assign('rootPath',$rootPath);
return $this->fetch('file_move');
}
}elseif($op=='rename'){
if($this->request->isPost()){
if($this->_protected_paths($filePath)){
$this->error('禁止重命名系统文件夹:'.$filePath);
}
$rename=input('rename','','trim');
if(!preg_match('/^[\w\-]+$/', $rename)){
$this->error('名称只能由字母、数字和下划线组成');
}
$newName=preg_replace_callback('/([^\/\\\]+)$/',function($match)use($rename){
$match=$match[0];
$match=explode('.',$match);
$match[0]=$rename;
return implode('.', $match);
},$filePath);
if(file_exists($newName)){
$this->error('文件名称已存在');
}
if(rename($filePath,$newName)){
$this->success('重命名成功','tool/file?file='.rawurlencode(preg_replace('/[^\/\\\]+$/', '', $file)));
}else{
$this->error('重命名失败');
}
}else{
$this->assign('file',$file);
return $this->fetch('file_rename');
}
}elseif($op=='delete'){
if($this->request->isPost()){
if($this->_protected_paths($filePath)){
$this->error('禁止删除系统文件夹:'.$filePath);
}
if(is_dir($filePath)){
\util\Funcs::clear_dir($filePath);
rmdir($filePath);
}else{
unlink($filePath);
}
$this->success('已删除','');
}
}elseif($op=='download'){
$fileName=explode('.', $fileName);
if(is_dir($filePath)){
$zipFileName=dirname($filePath).DIRECTORY_SEPARATOR.'_____'.$fileName[0].'.zip';
$error='';
try{
$zip=new \ZipArchive();
if($zip->open($zipFileName, \ZipArchive::CREATE | \ZipArchive::OVERWRITE) === TRUE) {
$this->_addFileToZip($filePath, $fileName[0], $zip);
$zip->close();
}else{
$error='文件不存在';
}
}catch (\Exception $ex){
$error=$ex->getMessage();
}
$filecont=null;
$filesize=0;
if(file_exists($zipFileName)){
$filecont=file_get_contents($zipFileName);
$filesize=filesize($zipFileName);
unlink($zipFileName);
}
if($error){
$this->error($error,'');
}
\util\Tools::browser_export_scj($fileName[0],$filecont,'zip',$filesize);
}else{
\util\Tools::browser_export_scj($fileName[0],file_get_contents($filePath),$fileName[1],filesize($filePath));
}
}
}
private function _addFileToZip($path, $current, $zip) {
static $isWin=null;
if(!isset($isWin)){
$isWin=stripos($this->request->header('user-agent'),'windows')!==false?true:false;
}
$handler = opendir($path);
while(($filename = readdir($handler)) !== false) {
if ($filename != '.' && $filename != '..') {
$curFile=$path.DIRECTORY_SEPARATOR.$filename;
$curName=$current?($current.'/'.$filename):$current;
$nameEncode=$curName;
if($isWin){
$nameEncode=iconv('UTF-8', 'GBK//IGNORE', $nameEncode);
}
if (is_dir($curFile)){
$zip->addEmptyDir($nameEncode);
$this->_addFileToZip($curFile,$curName,$zip);
}else{
$zip->addFile($curFile,$nameEncode);
}
}
}
@closedir($handler);
}
public function filesAction(){
$this->_file_manager_date();
$cur=input('cur','','trim');
$cur=str_replace('/', DIRECTORY_SEPARATOR, $cur);
$cur=trim($cur,'\/\\');
$rootPath=config('root_path').DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR;
$curPath=$rootPath.$cur;
$curPath=realpath($curPath);
if($cur){
if(!is_dir($curPath)){
$this->error('当前目录错误');
}
if(stripos($curPath, $rootPath)!==0){
$this->error('当前目录错误');
}
}
$files=input('files','','trim');
$files=$files?explode(',', $files):array();
init_array($files);
$fileList=array();
foreach ($files as $file){
$fileName=$curPath.DIRECTORY_SEPARATOR.$file;
$fileName=realpath($fileName);
if(stripos($fileName, $rootPath)===0){
if(!$this->_protected_paths($fileName)){
$fileList[]=$fileName;
}
}
}
if(empty($fileList)){
$this->error('请选择文件');
}
$op=input('op');
if($op=='move'){
$this->assign('cur',$cur);
$this->assign('files',implode(',', $files));
$this->assign('rootPath',$rootPath);
return $this->fetch('files_move');
}elseif($op=='move_post'){
if($this->request->isPost()){
$moveTo=input('move_to','','trim');
if(!preg_match('/^[\w\-\/\\\]+$/', $moveTo)||preg_match('/^[\/\\\]+$/', $moveTo)){
$this->error('目录只能由字母、数字和下划线组成');
}
$moveTo=str_replace('\\', '/', $moveTo);
$movePath=$rootPath.$moveTo;
if(!is_dir($movePath)){
mkdir($movePath,0777,true);
}
$movePath=realpath($movePath).DIRECTORY_SEPARATOR;
foreach ($fileList as $file){
$fileName='';
if(preg_match('/([^\/\\\]+)$/',$file,$fileName)){
$fileName=$fileName[1];
}else{
$fileName='';
}
if(file_exists($movePath.$fileName)){
continue;
}
rename($file, $movePath.$fileName);
}
$this->success($tips.'已成功移动到:'.$movePath,'tool/file?file='.rawurlencode($moveTo));
}else{
$this->error('无效操作');
}
}elseif($op=='delete'){
if($this->request->isPost()){
foreach ($fileList as $file){
if(is_dir($file)){
\util\Funcs::clear_dir($file);
rmdir($file);
}else{
unlink($file);
}
}
$this->success('已删除','tool/file?file='.rawurlencode($cur));
}else{
$this->error('无效操作');
}
}
}
/*日志列表*/
public function logsAction(){

View File

@ -36,5 +36,5 @@
</div>
{else /}
没有规则,请进入<a href="{:url('mystore/store')}">云平台</a>下载
没有规则,请进入<a href="{:url('mystore/store')}" target="_blank">云平台</a>下载
{/if}

View File

@ -5,5 +5,14 @@ $_WP['title']=$msg;
{block name="cssjs"}
{/block}
{block name="content"}
<script type="text/javascript">
(function(){
if(window.top!=window.self){
$('.main-header').hide();
$('.main-sidebar').hide();
$('.content-wrapper').css('margin-left','0px').find('.content-header>.breadcrumb').hide();
}
})();
</script>
{include file="common@common:message" _success="" /}
{/block}

View File

@ -5,5 +5,14 @@ $_WP['title']=$msg;
{block name="cssjs"}
{/block}
{block name="content"}
<script type="text/javascript">
(function(){
if(window.top!=window.self){
$('.main-header').hide();
$('.main-sidebar').hide();
$('.content-wrapper').css('margin-left','0px').find('.content-header>.breadcrumb').hide();
}
})();
</script>
{include file="common@common:message" _success="1" /}
{/block}

View File

@ -71,6 +71,13 @@ var editor_code_op={
return false;
}
});
},
set_option:function(opts){
if(isObject(opts)){
for(var k in opts){
window.codeEditor.setOption(k,opts[k]);
}
}
}
};
</script>

View File

@ -1,92 +0,0 @@
{extend name="common:main" /}
{block name="cssjs"}
<script src="__PUBLIC__/static/js/admin/mystore.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
{php}$orderClass=array($orderKey=>'_'.$sortBy);$orderSort=array($orderKey=>($sortBy=='asc'?'升序':'降序'));{/php}
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li><a href="{:url('mystore/rule')}">采集规则</a></li>
<li><a href="{:url('mystore/releaseApp')}">发布插件</a></li>
<li class="active"><a href="{:url('mystore/funcApp')}">函数插件</a></li>
<li class="nav-tab-right">
<div class="nav-check-update">
<a href="javascript:;" id="check_update">检测更新</a>
<input type="checkbox" id="auto_check" {:is_empty(g_sc_c('store_auto_check_plugin'))?'':'checked="checked"'} value="1" title="刷新页面时自动检测" />
</div>
<span class="nav-sep">|</span>
<div class="nav-upload"><a href="{:url('mystore/upload')}" onclick="windowModal('导入插件',$(this).attr('href'));return false;">导入插件</a></div>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active">
<div class="table-responsive" style="border:0;">
<form id="form_list" method="post" ajax-submit="true" action="{:url('mystore/funcAppOp')}">
{:html_usertoken()}
<table id="list_table" class="table table-hover datatable">
<thead>
<tr>
<th class="sorting{$orderClass['id']}" data-order="id" title="ID{$orderSort['id']}" style="width:65px;min-width:65px;">{$Think.lang.select}</th>
<th class="sorting{$orderClass['name']}" data-order="name" title="{$orderSort['name']}">名称</th>
<th class="sorting{$orderClass['app']}" data-order="app" title="{$orderSort['app']}">类和方法</th>
<th class="sorting{$orderClass['module']}" data-order="module" title="{$orderSort['module']}">模块</th>
<th class="sorting{$orderClass['addtime']}" data-order="addtime" title="{$orderSort['addtime']}">本地添加</th>
<th class="sorting{$orderClass['uptime']}" data-order="uptime" title="{$orderSort['uptime']}">平台更新</th>
<th>平台</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{foreach name="appList" item="app"}
<tr data-app-id="{$app['id']}">
<td class="chk"><input type="checkbox" name="ids[]" value="{$app['id']}" /></td>
<td><div class="name">{$app['name']}</div></td>
<td class="dropdown methods">
<a href="javascript:;" class="dropdown-toggle" id="dm_{$app['app']}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">{$app['app']} <span class="caret"></span></a>
<ul class="dropdown-menu" aria-labelledby="dm_{$app['app']}">
</ul>
</td>
<td title="使用:{$modules[$app['module']]['loc']}">{$modules[$app['module']]['name']}</td>
<td>{:date('Y-m-d H:i',$app['addtime'])}</td>
<td>{:date('Y-m-d H:i',$app['uptime'])}</td>
<td>
<a href="javascript:;" data-url="{$app['_store_url']}" class="store-detail">{$app['_is_provider']?'第三方':'官方'}</a>
</td>
<td>
<div class="in-line-mg"><a href="javascript:;" class="enable" style="color:{$app['enable']?'green':'red'}" data-val="{$app['enable']?1:0}">{$app['enable']?'已启用':'已禁用'}</a></div>
<div class="in-line-mg"><a href="{:url('develop/func?app='.$app['app'])}">开发</a></div>
<div class="in-line-mg"><a href="javascript:;" class="delete">删除</a></div>
</td>
</tr>
{/foreach}
</tbody>
<tfoot>
<tr>
<td class="chk"><label class="chk-all"><input type="checkbox" id="chkall" onclick="checkall(this,'ids[]')" /><span>全部</span></label></td>
<td colspan="2">
<button type="button" class="btn btn btn-danger" id="deleteall">{$Think.lang.delete}</button>
&nbsp;<a href="{:url('develop/func')}" class="btn btn-primary">开发一个</a>
</td>
<td colspan="5" style="text-align:right;font-size:12px;">
{if !empty($appList)}
<p class="help-block">鼠标悬停在“模块”上可显示提示</p>
{/if}
</td>
</tr>
{if condition="!empty($pagenav)"}
<tr>
<td colspan="8">{$pagenav}</td>
</tr>
{/if}
</tfoot>
</table>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript">
myStoreClass.init_funcapp();
</script>
{/block}

View File

@ -25,5 +25,5 @@
</div>
{else /}
您没有规则,请进入<a href="{:url('mystore/store')}">云平台</a>下载
您没有规则,请进入<a href="{:url('mystore/store')}" target="_blank">云平台</a>下载
{/if}

View File

@ -28,8 +28,8 @@
<tbody>
{if empty($taskList)}
<tr>
<td colspan="7" style="text-align:center;">
<p class="help-block">没有任务,创建<a href="{:url('task/set')}">新任务</a>或进入<a href="{:url('mystore/store')}">云平台</a>下载规则</p>
<td colspan="8" style="text-align:center;">
<p class="help-block">没有任务,创建<a href="{:url('task/set')}">新任务</a>或进入<a href="{:url('mystore/store')}" target="_blank">云平台</a>下载规则</p>
</td>
</tr>
{else/}

View File

@ -1,75 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<title>文件管理</title>
<base href="{$elfinderUrl}/" />
<!-- Require JS (REQUIRED) -->
<!-- Rename "main.default.js" to "main.js" and edit it if you need configure elFInder options or any things -->
</head>
<body>
<script type="text/javascript">var elfinderPath="__PUBLIC__/elfinder/";</script>
<script data-main="__PUBLIC__/elfinder/main.default.js" src="__PUBLIC__/elfinder/require.min.js"></script>
<script>
define('elFinderConfig', {
// elFinder options (REQUIRED)
// Documentation for client options:
defaultOpts : {
url : "{:url('tool/elfinder?op=connect&'.url_usertoken())}" // connector URL (REQUIRED)
,commandsOptions : {
edit : {
extraOptions : {
// set API key to enable Creative Cloud image editor
// see https://console.adobe.io/
creativeCloudApiKey : '',
// browsing manager URL for CKEditor, TinyMCE
// uses self location with the empty value
managerUrl : ''
}
}
,quicklook : {
// to enable CAD-Files and 3D-Models preview with sharecad.org
sharecadMimes : ['image/vnd.dwg', 'image/vnd.dxf', 'model/vnd.dwf', 'application/vnd.hp-hpgl', 'application/plt', 'application/step', 'model/iges', 'application/vnd.ms-pki.stl', 'application/sat', 'image/cgm', 'application/x-msmetafile'],
// to enable preview with Google Docs Viewer
googleDocsMimes : ['application/pdf', 'image/tiff', 'application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/postscript', 'application/rtf'],
// to enable preview with Microsoft Office Online Viewer
// these MIME types override "googleDocsMimes"
officeOnlineMimes : ['application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.presentation']
}
}
// bootCalback calls at before elFinder boot up
,bootCallback : function(fm, extraObj) {
/* any bind functions etc. */
fm.bind('init', function() {
// any your code
});
// for example set document.title dynamically.
var title = document.title;
fm.bind('open', function() {
var path = '',
cwd = fm.cwd();
if (cwd) {
path = fm.path(cwd.hash) || null;
}
document.title = path? path + ':' + title : title;
}).bind('destroy', function() {
document.title = title;
});
},
//全屏显示
height : '100%',
lang:'zh_CN'
},
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {}
}
});
</script>
<!-- Element where elFinder will be created (REQUIRED) -->
<div id="elfinder"></div>
</body>
</html>

View File

@ -0,0 +1,85 @@
{extend name="common:main_clean" /}
{block name="cssjs"}
<style type="text/css">
.container-fluid{padding:10px!important;}
#fileList span.open{cursor:pointer;margin-left:3px;}
#fileList .chk{padding-right:0;min-width:33px;width:33px;text-align:center;}
.chk{text-align:center;}
</style>
<script src="__PUBLIC__/static/js/admin/tool_file_manager.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
<input type="hidden" id="ipt_file" value="{$file}" />
<div class="input-group">
<a href="javascript:;" class="input-group-addon" id="btn_back" title="后退"><span class="glyphicon glyphicon-arrow-left"></span></a>
<input class="form-control" value="{$filePath}" readonly="readonly" />
<a href="javascript:;" class="input-group-addon" id="btn_refresh" title="刷新"><span class="glyphicon glyphicon-refresh"></span></a>
</div>
<div class="table-responsive">
<table class="table table-hover datatable" id="fileList">
<thead>
<tr>
<th class="chk"><label class="checkbox-inline"><input type="checkbox" id="chkall" onclick="checkall(this,'files[]')">&nbsp;</label></th>
<th>
文件名
<div class="dropdown" style="display:inline;font-size:12px;">
<a href="javascript:;" class="glyphicon glyphicon-plus" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></a>
<ul class="dropdown-menu">
<li><a href="javascript:;" id="btn_new_txt">新建空白文本</a></li>
<li><a href="javascript:;" id="btn_new_folder">新建文件夹</a></li>
</ul>
</div>
</th>
<th>修改时间</th>
<th style="width:170px">操作</th>
</tr>
</thead>
<tbody>
{if $files}
{foreach $files as $k=>$v}
<tr data-file="{$k}" data-is-dir="{$v['dir']}">
<td class="chk"><label class="checkbox-inline"><input type="checkbox" name="files[]" value="{$k}">&nbsp;</label></td>
{if $v['dir']}
<td><span class="glyphicon glyphicon-folder-close" style="color:#FADA77"></span> <span class="open">{$k}</span></td>
{else/}
<td><span class="glyphicon glyphicon-file" style="color:#999"></span> <span class="open">{$k}</span></td>
{/if}
<td>{$v['date']}</td>
<td>
<ul class="in-line">
<li><a href="javascript:;" class="open">打开</a></li>
<li class="sep">|</li>
<li><a href="javascript:;" class="download">下载</a></li>
<li class="sep">|</li>
<li><a href="javascript:;" class="delete">删除</a></li>
<li class="sep">|</li>
<li>
<div class="dropdown">
<a href="javascript:;" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">更多</a>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="javascript:;" class="rename">重命名</a></li>
<li><a href="javascript:;" class="move">移动</a></li>
</ul>
</div>
</li>
</ul>
</td>
</tr>
{/foreach}
<tr>
<td class="chk"><label class="checkbox-inline"><input type="checkbox" id="chkall1" onclick="checkall(this,'files[]')">&nbsp;</label></td>
<td colspan="3">
<button type="button" class="btn btn-sm btn-danger" id="btn_list_delete">删除</button>
<button type="button" class="btn btn-sm btn-primary" id="btn_list_move">移动</button>
</td>
</tr>
{else/}
<tr><td colspan="4">没有文件</td></tr>
{/if}
</tbody>
</table>
</div>
<script type="text/javascript">
toolFileManager.file_load();
</script>
{/block}

View File

@ -2,7 +2,7 @@
{block name="cssjs"}
<style type="text/css">
.content-header{display:none;}
.content{padding:0;}
section.content{padding:0;}
</style>
{/block}
{block name="content"}
@ -10,19 +10,24 @@
<iframe style="width:100%;height:100%;padding:0;margin:0;border:0;"></iframe>
</div>
<script type="text/javascript">
var ifrHeight=$(document.body).height()-$('#ifrManager').offset().top;
$('#ifrManager').height(ifrHeight+'px');
ajax_check_userpwd({
type:'post',
dataType:'json',
url:ulink('tool/elfinder'),
success: function (data) {
if(data.code==1){
$('#ifrManager iframe').attr('src',data.url);
}else{
toastr.error(data.msg);
}
(function(){
if(window.top!=window.self){
//不要嵌套
$('.wrapper').hide();
window.top.location.href=window.self.location.href;
}
});
ajax_check_userpwd({
type:'post',
dataType:'json',
url:ulink('tool/fileManager'),
success:function(data){
if(data.code==1){
var ifrHeight=$(document.body).height()-$('#ifrManager').offset().top;
$('#ifrManager').css('height',ifrHeight+'px');
$('#ifrManager iframe').attr('src',data.url);
}
}
});
})();
</script>
{/block}

View File

@ -0,0 +1,11 @@
<form method="post" ajax-submit="true" role="form" action="{:url('tool/file')}">
{:html_usertoken()}
<input type="hidden" name="file" value="{$file}" />
<input type="hidden" name="op" value="new" />
<input type="hidden" name="new_type" value="{$newType}" />
<div class="form-group">
<label>名称</label>
<input class="form-control" name="new_name" placeholder="输入{$newType=='txt'?'文本':'文件夹'}名称" />
</div>
<button type="submit" class="btn btn-primary btn-block">创建</button>
</form>

View File

@ -0,0 +1,15 @@
{extend name="common:main_clean" /}
{block name="cssjs"}
<style type="text/css">
html,body{height:100%!important;}
.container-fluid{padding:0!important;height:100%!important;}
</style>
<script src="__PUBLIC__/static/js/admin/tool_file_manager.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
<iframe id="ifr_editor" style="width:100%;border:0;"></iframe>
<div style="padding:0 10px;"><button class="btn btn-primary btn-block" id="btn_save">修改文件</button></div>
<script type="text/javascript">
toolFileManager.file({$fileData});
</script>
{/block}

View File

@ -0,0 +1,14 @@
<form method="post" ajax-submit="true" role="form" action="{:url('tool/file')}">
{:html_usertoken()}
<input type="hidden" name="file" value="{$file}" />
<input type="hidden" name="op" value="move" />
<div class="form-group">
<label>移动到目录</label>
<div class="input-group">
<div class="input-group-addon">{$rootPath}</div>
<input class="form-control" name="move_to" value="{$cur}" />
</div>
<p class="help-block">移动到文件夹名称,子目录用斜杠分隔</p>
</div>
<button type="submit" class="btn btn-primary btn-block">确定</button>
</form>

View File

@ -0,0 +1,33 @@
{extend name="common:main_clean" /}
{block name="cssjs"}
<style type="text/css">
html,body{height:100%!important;}
.container-fluid{padding:0!important;height:100%!important;}
.embed-hide{width:1px;height:1px;}
.embed-show{width:100%;height:100%;border:0;padding:0;margin:0;}
</style>
<script src="__PUBLIC__/static/js/admin/tool_file_manager.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
{if $fileType=='img'}
<img src="{$fileUrl}" style="max-width:100%;" />
{else/}
{if $fileType}
<div style="width:100%;height:100%;overflow:hidden;">
<div id="file_info" class="jumbotron" style="margin:20px;">
<p>文件名称:{$fileInfo['name']}</p>
<p>文件大小:{$fileInfo['size']}</p>
<p>文件路径:{$fileInfo['file']}</p>
<p>创建时间:{$fileInfo['ctime']}</p>
<p>修改时间:{$fileInfo['mtime']}</p>
<p>下载文件:<a href="javascript:;" id="btn_down">下载文件</a></p>
<input type="hidden" id="ipt_file" value="{$file}" />
</div>
<embed id="file_embed" src="{$fileUrl}" class="embed-hide" autostart="false"></embed>
</div>
{/if}
<script type="text/javascript">
toolFileManager.file_other();
</script>
{/if}
{/block}

View File

@ -0,0 +1,10 @@
<form method="post" ajax-submit="true" role="form" action="{:url('tool/file')}">
{:html_usertoken()}
<input type="hidden" name="file" value="{$file}" />
<input type="hidden" name="op" value="rename" />
<div class="form-group">
<label>重命名</label>
<input class="form-control" name="rename" placeholder="输入新名称" />
</div>
<button type="submit" class="btn btn-primary btn-block">确定</button>
</form>

View File

@ -0,0 +1,15 @@
<form method="post" ajax-submit="true" role="form" action="{:url('tool/files')}">
{:html_usertoken()}
<input type="hidden" name="cur" value="{$cur}" />
<input type="hidden" name="files" value="{$files}" />
<input type="hidden" name="op" value="move_post" />
<div class="form-group">
<label>移动到目录</label>
<div class="input-group">
<div class="input-group-addon">{$rootPath}</div>
<input class="form-control" name="move_to" value="{$cur}" />
</div>
<p class="help-block">移动到文件夹名称,子目录用斜杠分隔</p>
</div>
<button type="submit" class="btn btn-primary btn-block">确定</button>
</form>

View File

@ -10,7 +10,7 @@
*/
define('SKYCAIJI_VERSION', '2.8');
define('SKYCAIJI_VERSION', '2.8.1');
\think\Loader::addNamespace('plugin',SKYCAIJI_PATH.'plugin');
\think\Loader::addNamespace('util',APP_PATH.'extend/util');

View File

@ -47,7 +47,7 @@ function msgGoHome(){
msgWaitTm--;
setTimeout("msgGoHome()",1000);
}else{
window.location.href="{$url}";
window{$data['window_top']?'.top':''}.location.href="{$url}";
}
}
}

View File

@ -38,40 +38,36 @@ class Tools{
}
public static function load_data_config(){
static $loaded=false;
if(!$loaded){
if(file_exists(config('root_path').'/data/config.php')){
if(file_exists(config('root_path').'/data/config.php')){
$dataConfig=include config('root_path').'/data/config.php';
if($dataConfig&&is_array($dataConfig)){
$dataConfig=include config('root_path').'/data/config.php';
if($dataConfig&&is_array($dataConfig)){
$dbConfig=array();
foreach ($dataConfig as $k=>$v){
if(strpos($k, 'DB_')!==false){
$dbConfig[$k]=$v;
unset($dataConfig[$k]);
}
}
$dbConfig=array(
'type'=>$dbConfig['DB_TYPE'],
'hostname'=>$dbConfig['DB_HOST'],
'hostport'=>$dbConfig['DB_PORT'],
'database'=>$dbConfig['DB_NAME'],
'password'=>$dbConfig['DB_PWD'],
'username'=>$dbConfig['DB_USER'],
'prefix'=>$dbConfig['DB_PREFIX'],
);
if(!empty($dbConfig)&&is_array($dbConfig)){
$dbConfig=array_merge(config('database'),$dbConfig);
config('database',$dbConfig);
config($dataConfig);
$loaded=true;
$dbConfig=array();
foreach ($dataConfig as $k=>$v){
if(strpos($k, 'DB_')!==false){
$dbConfig[$k]=$v;
unset($dataConfig[$k]);
}
}
$dbConfig=array(
'type'=>$dbConfig['DB_TYPE'],
'hostname'=>$dbConfig['DB_HOST'],
'hostport'=>$dbConfig['DB_PORT'],
'database'=>$dbConfig['DB_NAME'],
'password'=>$dbConfig['DB_PWD'],
'username'=>$dbConfig['DB_USER'],
'prefix'=>$dbConfig['DB_PREFIX'],
);
if(!empty($dbConfig)&&is_array($dbConfig)){
$dbConfig=array_merge(config('database'),$dbConfig);
config('database',$dbConfig);
config($dataConfig);
}
}
}
}
@ -815,8 +811,10 @@ class Tools{
return $urls;
}
public static function browser_export_scj($name,$txt){
public static function browser_export_scj($name,$cont,$suffix='txt',$size=null){
set_time_limit(600);
$suffix=$suffix?('.'.$suffix):'';
$size=$size?$size:mb_strlen($cont);
ob_start();
header("Expires: 0" );
header("Pragma:public" );
@ -825,13 +823,13 @@ class Tools{
header("Content-Type:application/octet-stream" );
header("Content-transfer-encoding: binary");
header("Content-Length: " .mb_strlen($txt));
header("Content-Length: " .$size);
if (preg_match("/MSIE/i", $_SERVER["HTTP_USER_AGENT"])) {
header('Content-Disposition: attachment; filename="'.urlencode($name).'.txt"');
header('Content-Disposition: attachment; filename="'.urlencode($name).$suffix.'"');
}else{
header('Content-Disposition: attachment; filename="'.$name.'.txt"');
header('Content-Disposition: attachment; filename="'.$name.$suffix.'"');
}
echo $txt;
echo $cont;
ob_end_flush();
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +0,0 @@
elFinder is issued under a 3-clauses BSD license.
Copyright (c) 2009-2020, Studio 42
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the Studio 42 Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL "STUDIO 42" OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,215 +0,0 @@
elFinder
========
**WARNING: IF YOU HAVE OLDER (IN PARTICULAR 2.1.58 OR EARLIER) VERSIONS OF ELFINDER ON PUBLIC SERVERS, IT MAY CAUSE SERIOUS DAMAGE TO YOUR SERVER AND VISITED USER. YOU SHOULD UPDATE TO THE LATEST VERSION OR REMOVE IT FROM THE SERVER.**
[![elFinder file manager for the Web](https://studio-42.github.io/elFinder/images/elFinderScr.png "elFinder file manager for the Web")](https://studio-42.github.io/elFinder/)
elFinder is an open-source file manager for web, written in JavaScript using
jQuery UI. Creation is inspired by simplicity and convenience of Finder program
used in Mac OS X operating system.
[![Download now!](https://studio-42.github.io/elFinder/images/download-icon.png)](https://github.com/Studio-42/elFinder/releases/latest)
[![Packagist License](https://poser.pugx.org/studio-42/elfinder/license.png)](https://choosealicense.com/licenses/bsd-3-clause/)
[![Latest Stable Version](https://poser.pugx.org/studio-42/elfinder/version.png)](https://packagist.org/packages/studio-42/elfinder)
[![Total Downloads](https://poser.pugx.org/studio-42/elfinder/d/total.png)](https://packagist.org/packages/studio-42/elfinder)
[![CDNJS version](https://img.shields.io/cdnjs/v/elfinder.svg)](https://cdnjs.com/libraries/elfinder)
[![Donate Paypal(nao-pon)](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FF5FKRSMKYDVA)
[![Donate Bitcoin(nao-pon)](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](https://studio-42.github.io/elFinder/tools/donate-bitcoin/)
Contents
--------
* [Branches](#branches)
* [Features](#features)
* [Requirements](#requirements)
* [Installation](#installation)
* [Downloads](#downloads)
* [Demo Sites](#demo-sites)
* [FAQs](#faqs)
* [3rd Party Connectors](#3rd-party-connectors)
* [3rd Party Volume Drivers](#3rd-party-volume-drivers)
* [3rd Party Themes](#3rd-party-themes)
* [Support](#support)
* [Authors](#authors)
* [License](#license)
Branches
--------
- [master](https://github.com/Studio-42/elFinder/tree/master) - Main development branch
- [2.1-src](https://github.com/Studio-42/elFinder/tree/2.1-src) - 2.1 development branch, auto build to 2.1 on commit
- [2.1](https://github.com/Studio-42/elFinder/tree/2.1) - 2.1 nightly build branch
Features
--------
* Usability like the MacOS Finder or Windows Explorer
* Mobile friendly view for touch devices
* All operations with files and folders on a remote server (copy, move,
upload, create folder/file, rename, etc.)
* High performance server backend and light client UI
* Multi-root support
* Local file system, MySQL, FTP, SFTP, Box, Dropbox, GoogleDrive and OneDrive volume storage drivers
* Support AWS S3, Azure, Digital Ocean Spaces and more with [League\Flysystem](https://github.com/barryvdh/elfinder-flysystem-driver) Flysystem driver
* Cloud storage (Box, Dropbox, GoogleDrive and OneDrive) drivers
* Background file/folder upload with Drag & Drop HTML5 support
* Chunked file upload for large file
* Upload directly to the folder
* Upload form URL (or list)
* List and Icons view
* Keyboard shortcuts
* Standard methods of file/group selection using mouse or keyboard
* Move/Copy files with Drag & Drop
* Drag & Drop to outside by starting drag with alt/option key press
* Archives create/extract (zip, rar, 7z, tar, gzip, bzip2)
* Rich context menu and toolbar
* Quicklook, preview for common file types
* Edit text files and images
* "Places" for your favorites
* Calculate directory sizes
* Thumbnails for image, movie files
* Easy to integrate with web editors (elRTE, CKEditor, TinyMCE)
* Flexible configuration of access rights, upload file types, user interface
and other
* Extensibility by event handling of backend and client side
* Simple client-server API based on JSON
* Supports custom information in info dialog
* Configuable columns of list view
* Supports custom CSS class function for the custom folder icon
* Connector plugin
* [AutoRotate](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/AutoRotate/plugin.php) : Auto rotation on file upload of JPEG file by EXIF Orientation.
* [AutoResize](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/AutoResize/plugin.php) : Auto resize on file upload.
* [Normalizer](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/Normalizer/plugin.php) : UTF-8 Normalizer of file-name and file-path etc.
* [Sanitizer](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/Sanitizer/plugin.php) : Sanitizer of file-name and file-path etc.
* [Watermark](https://github.com/Studio-42/elFinder/blob/2.1-src/php/plugins/Watermark/plugin.php) : Print watermark on file upload.
* For more details, see the [Changelog](https://github.com/Studio-42/elFinder/blob/master/Changelog)
Requirements
------------
### jQuery / jQuery UI
* jQuery 1.8.0+
* jQuery UI 1.9.0+
* Required: draggable, droppable, resizable, selectable, button and slider
* Recommend: sorter (To make sortable the List column and the Places)
**However, we recommend newest version.**
### Client
* Modern browsers both of desktop or mobile. elFinder was tested in newest Chrome, Edge, Firefox, IE and Opera
- **Caution**: Web App mode ("apple-mobile-web-app-capable" meta tag) on iOS is not work perfectly in elFinder
### Server
* Any web server
* PHP 5.2+ (Recommend PHP 5.4 or higher) And for thumbnails - GD / Imagick module / convert(imagemagick) require
* Recommend PHP 7.1 or higher to supports non-ASCII character of file path/name on the Windows server
Installation
------------
### Builds (compressed)
1. Download and unzip one of the [builds](#downloads) below to your PHP server
2. Rename `/php/connector.minimal.php-dist` to `/php/connector.minimal.php`
3. Load `/elfinder.html` in your browser to run elFinder
### Source (uncompressed)
1. Clone this repository to your PHP server
```
$ git clone https://github.com/Studio-42/elFinder.git
```
2. Rename `/php/connector.minimal.php-dist` to `/php/connector.minimal.php`
3. Load `/elfinder.src.html` in your browser to run elFinder
### Installer
- [Setup elFinder 2.1.x nightly with Composer](https://github.com/Studio-42/elFinder/tree/gh-pages/tools/installer/setup_with_composer)
Downloads
------------
**Stable releases** ([Changelog](https://github.com/Studio-42/elFinder/blob/master/Changelog))
+ [elFinder 2.1.59](https://github.com/Studio-42/elFinder/archive/2.1.59.zip)
+ [elFinder 2.0.9](https://github.com/Studio-42/elFinder/archive/2.0.9.zip) (deprecated)
**Nightly builds**
+ [elFinder 2.1.x (Nightly)](https://github.com/Studio-42/elFinder/archive/2.1.zip)
Demo sites
------------
**2.1.x Nightly**
+ https://studio-42.github.io/elFinder/ (with CORS)
FAQs
------------
### Should I use elFinder builds (compressed) or source (uncompressed)?
For debugging and development, use the [source](#source-uncompressed). For production, use [builds](#builds-compressed).
### How do I integrate elFinder with CKEditor/TinyMCE/elRTE/etc...?
Check out the [wiki](https://github.com/studio-42/elFinder/wiki#howtos) for individual instructions.
### The procedure of language files created or modified?
You can create or modify the language file to use translation tool. Please refer to the pull request the results to the respective branch.
* [2.1 branch translation tool](http://studio-42.github.io/elFinder/tools/langman/#2.1)
3rd party connectors
--------------------
* [ASP.NET](https://github.com/leniel/elFinder.Net) / [ASP.NET Core](https://github.com/gordon-matt/elFinder.NetCore) / [.NET Standard](https://github.com/mguinness/elFinder.AspNet)
* [Java Servlet](https://github.com/trustsystems/elfinder-java-connector)
* [JavaScript/Efw](https://github.com/efwGrp/efw3.X/blob/master/help/tag.elfinder.md)
* [Nodejs](https://github.com/dekyfin/elfinder-node)
* [Python](https://github.com/Studio-42/elfinder-python)
* [Ruby/Rails](https://github.com/phallstrom/el_finder)
3rd party Volume Drivers
--------------------
* [League\Flysystem (PHP)](https://github.com/barryvdh/elfinder-flysystem-driver) (for elFinder 2.1+) driver for the [Flysystem](https://github.com/thephpleague/flysystem)
3rd party Themes
--------------------
Hint: [How to load CSS with RequireJS?](https://github.com/Studio-42/elFinder/wiki/How-to-load-CSS-with-RequireJS%3F)
* [lokothodida/elfinder-theme-moono](https://github.com/lokothodida/elfinder-theme-moono)
* [lokothodida/elfinder-theme-windows-10](https://github.com/lokothodida/elfinder-theme-windows-10)
* [RobiNN1/elFinder-Material-Theme](https://github.com/RobiNN1/elFinder-Material-Theme)
* [StudioJunkyard/elfinder-boostrap-theme](https://github.com/StudioJunkyard/LibreICONS/tree/master/themes/elFinder)
3rd party Integrations
--------------------
* [Django](https://github.com/mikery/django-elfinder)
* [Drupal](https://gitlab.com/667bdrm/elfinder)
* [Laravel](https://github.com/barryvdh/laravel-elfinder)
* [Roundcube](https://github.com/Offerel/roundcube_elfinder)
* [Symfony](https://github.com/helios-ag/FMElfinderBundle)
* [Tiki Wiki](https://doc.tiki.org/elFinder)
* [WordPress](https://wordpress.org/plugins/file-manager/)
* [XOOPS](https://github.com/nao-pon/xelfinder)
* [Yii](http://www.yiiframework.com/extension/elfinder/)
* [Zenphoto](http://www.zenphoto.org/news/elfinder/)
Support
-------
* [Homepage](http://elfinder.org)
* [Wiki](https://github.com/Studio-42/elFinder/wiki)
* [Issues](https://github.com/Studio-42/elFinder/issues)
* <dev@std42.ru>
Authors
-------
* Current main developer: Naoki Sawada <hypweb+elfinder@gmail.com>
* Chief developer: Dmitry "dio" Levashov <dio@std42.ru>
* Maintainer: Troex Nevelin <troex@fury.scancode.ru>
* Developers: Alexey Sukhotin, Naoki Sawada <hypweb+elfinder@gmail.com>
* Icons: PixelMixer, [Yusuke Kamiyamane](http://p.yusukekamiyamane.com), [Icons8](https://icons8.com)
We hope our tools will be helpful for you.
License
-------
elFinder is issued under a 3-clauses BSD license.
* [License terms](https://github.com/Studio-42/elFinder/blob/master/LICENSE.md)

View File

@ -1,28 +0,0 @@
{
"name": "elfinder",
"authors": [
"Dmitry \"dio\" Levashov <dio@std42.ru>",
"Troex Nevelin <troex@fury.scancode.ru>",
"Alexey Sukhotin <strogg@yandex.ru>",
"Naoki Sawada <hypweb@gmail.com>"
],
"description": "Open-source file manager for web, written in JavaScript using jQuery and jQuery UI.",
"dependencies": {
"jquery": "1.8.0 - 3",
"jquery-ui": "^1.9.x"
},
"keywords": [
"filemanager",
"jquery",
"jquery-ui",
"javascript",
"php"
],
"license": "BSD-3-Clause",
"homepage": "https://github.com/Studio-42/elFinder",
"ignore": [
"**/.*",
"jquery",
"php"
]
}

View File

@ -1,39 +0,0 @@
{
"name": "studio-42/elfinder",
"description": "File manager for web",
"license": "BSD-3-Clause",
"homepage": "http://elfinder.org",
"authors": [
{
"name": "Dmitry Levashov",
"homepage": "http://std42.ru",
"email": "dio@std42.ru"
},
{
"name": "Troex Nevelin",
"homepage": "http://std42.ru",
"email": "troex@fury.scancode.ru"
},
{
"name": "Naoki Sawada",
"homepage": "http://xoops.hypweb.net",
"email": "hypweb+elfinder@gmail.com"
},
{
"name": "Community contributions",
"homepage": "https://github.com/Studio-42/elFinder/contributors"
}
],
"require": {
"php": ">=5.2"
},
"suggest": {
"kunalvarma05/dropbox-php-sdk": "VolumeDriver `Dropbox`2 require `kunalvarma05/dropbox-php-sdk.",
"google/apiclient": "VolumeDriver GoogleDrive require `google/apiclient:^2.0.",
"barryvdh/elfinder-flysystem-driver": "VolumeDriver for elFinder to use Flysystem as a root.",
"nao-pon/flysystem-google-drive": "require in GoogleDrive network volume mounting with Flysystem."
},
"autoload": {
"classmap": ["php"]
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,430 +0,0 @@
/**
* MacOS X like theme for elFinder.
* Required jquery ui "smoothness" theme.
*
* @author Dmitry (dio) Levashov
**/
/* scrollbar for Chrome and Safari */
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-track {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 50, 0.08);
border-radius: 10px;
box-shadow:0 0 0 1px rgba(255, 255, 255, .3);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 50, 0.16);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-thumb:active {
background-color: rgba(0, 0, 50, 0.24);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-corner {
background-color: transparent;
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button {
background-color: transparent;
width: 10px;
height: 10px;
border: 5px solid transparent;
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button:hover {
border: 5px solid rgba(0, 0, 50, 0.08);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button:active {
border: 5px solid rgba(0, 0, 50, 0.5);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button:single-button:vertical:decrement {
border-bottom: 8px solid rgba(0, 0, 50, 0.3);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button:single-button:vertical:increment {
border-top: 8px solid rgba(0, 0, 50, 0.3);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button:single-button:horizontal:decrement {
border-right: 8px solid rgba(0, 0, 50, 0.3);
}
.elfinder:not(.elfinder-mobile) *::-webkit-scrollbar-button:single-button:horizontal:increment {
border-left: 8px solid rgba(0, 0, 50, 0.3);
}
/* input textarea */
.elfinder input,
.elfinder textarea {
color: #000;
background-color: #FFF;
border-color: #ccc;
}
/* dialogs */
.std42-dialog, .std42-dialog .ui-widget-content {
background-color: #ededed;
background-image: none;
background-clip: content-box;
}
.std42-dialog.elfinder-bg-translucent {
background-color: #fff;
background-color: rgba(255, 255, 255, 0.9);
}
.std42-dialog.elfinder-bg-translucent .ui-widget-content {
background-color: transparent;
}
.elfinder-quicklook-title {
color: #fff;
}
.elfinder-quicklook-titlebar-icon {
background-color: transparent;
background-image: none;
}
.elfinder-quicklook-titlebar-icon .ui-icon {
background-color: #d4d4d4;
border-color: #8a8a8a;
}
.elfinder-quicklook-info-progress {
background-color: gray;
}
.std42-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close:hover .ui-icon,
.elfinder-mobile .std42-dialog .ui-dialog-titlebar .ui-dialog-titlebar-close .ui-icon,
.elfinder-quicklook-titlebar-icon .ui-icon.elfinder-icon-close:hover,
.elfinder-mobile .elfinder-quicklook-titlebar-icon .ui-icon.elfinder-icon-close {
background-color: #ff6252;
border-color: #e5695d;
background-image: url("../img/ui-icons_ffffff_256x240.png");
}
.std42-dialog .ui-dialog-titlebar .elfinder-titlebar-minimize:hover .ui-icon,
.elfinder-mobile .std42-dialog .ui-dialog-titlebar .elfinder-titlebar-minimize .ui-icon,
.elfinder-quicklook-titlebar-icon .ui-icon.elfinder-icon-minimize:hover,
.elfinder-mobile .elfinder-quicklook-titlebar-icon .ui-icon.elfinder-icon-minimize {
background-color: #ffbc00;
border-color: #e3a40b;
background-image: url("../img/ui-icons_ffffff_256x240.png");
}
.std42-dialog .ui-dialog-titlebar .elfinder-titlebar-full:hover .ui-icon,
.elfinder-mobile .std42-dialog .ui-dialog-titlebar .elfinder-titlebar-full .ui-icon,
.elfinder-quicklook-titlebar-icon .ui-icon.elfinder-icon-full:hover,
.elfinder-mobile .elfinder-quicklook-titlebar-icon .ui-icon.elfinder-icon-full {
background-color: #26c82f;
border-color: #13ae10;
background-image: url("../img/ui-icons_ffffff_256x240.png");
}
.std42-dialog .elfinder-help,
.std42-dialog .elfinder-help .ui-widget-content {
background: #fff;
}
/* navbar */
.elfinder .elfinder-navbar {
background: #dde4eb;
}
.elfinder-navbar .ui-state-hover {
color: #000;
background-color: #edf1f4;
border-color: #bdcbd8;
}
.elfinder-navbar .ui-droppable-hover {
background: transparent;
}
.elfinder-navbar .ui-state-active {
background: #3875d7;
border-color: #3875d7;
color: #fff;
}
.elfinder-navbar .elfinder-droppable-active {
background: #A7C6E5;
}
/* disabled elfinder */
.elfinder-disabled .elfinder-navbar .ui-state-active {
background: #dadada;
border-color: #aaa;
color: #777;
}
/* workzone */
.elfinder-workzone {
background: #fff;
}
/* current directory */
/* Is in trash */
.elfinder-cwd-wrapper.elfinder-cwd-wrapper-trash {
background-color: #f0f0f0;
}
/* selected file in "icons" view */
.elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-hover,
.elfinder-cwd-view-icons .elfinder-cwd-file .ui-state-active {
background: #ccc;
}
/* type badge in "icons" view */
/* default */
.elfinder-cwd-icon:before {
color: white;
background-color: #798da7;
}
/* type */
.elfinder-cwd-icon-text:before {
background-color: #6f99e6
}
.elfinder-cwd-icon-image:before {
background-color: #2ea26c
}
.elfinder-cwd-icon-audio:before {
background-color: #7bad2a
}
.elfinder-cwd-icon-video:before {
background-color: #322aad
}
/* subtype */
.elfinder-cwd-icon-x-empty:before,
.elfinder-cwd-icon-plain:before {
background-color: #719be6
}
.elfinder-cwd-icon-rtf:before,
.elfinder-cwd-icon-rtfd:before {
background-color: #83aae7
}
.elfinder-cwd-icon-pdf:before {
background-color: #db7424
}
.elfinder-cwd-icon-html:before {
background-color: #82bc12
}
.elfinder-cwd-icon-xml:before,
.elfinder-cwd-icon-css:before {
background-color: #7c7c7c
}
.elfinder-cwd-icon-x-shockwave-flash:before {
background-color: #f43a36
}
.elfinder-cwd-icon-zip:before,
.elfinder-cwd-icon-x-zip:before,
.elfinder-cwd-icon-x-xz:before,
.elfinder-cwd-icon-x-7z-compressed:before,
.elfinder-cwd-icon-x-gzip:before,
.elfinder-cwd-icon-x-tar:before,
.elfinder-cwd-icon-x-bzip:before,
.elfinder-cwd-icon-x-bzip2:before,
.elfinder-cwd-icon-x-rar:before,
.elfinder-cwd-icon-x-rar-compressed:before {
background-color: #97638e
}
.elfinder-cwd-icon-javascript:before,
.elfinder-cwd-icon-x-javascript:before,
.elfinder-cwd-icon-x-perl:before,
.elfinder-cwd-icon-x-python:before,
.elfinder-cwd-icon-x-ruby:before,
.elfinder-cwd-icon-x-sh:before,
.elfinder-cwd-icon-x-shellscript:before,
.elfinder-cwd-icon-x-c:before,
.elfinder-cwd-icon-x-csrc:before,
.elfinder-cwd-icon-x-chdr:before,
.elfinder-cwd-icon-x-c--:before,
.elfinder-cwd-icon-x-c--src:before,
.elfinder-cwd-icon-x-c--hdr:before,
.elfinder-cwd-icon-x-java:before,
.elfinder-cwd-icon-x-java-source:before,
.elfinder-cwd-icon-x-php:before {
background-color: #7c607c
}
.elfinder-cwd-icon-msword:before,
.elfinder-cwd-icon-vnd-ms-office:before,
.elfinder-cwd-icon-vnd-ms-word:before,
.elfinder-cwd-icon-vnd-ms-word-document-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-word-template-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-wordprocessingml-document:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-wordprocessingml-template:before {
background-color: #2b569a
}
.elfinder-cwd-icon-ms-excel:before,
.elfinder-cwd-icon-vnd-ms-excel:before,
.elfinder-cwd-icon-vnd-ms-excel-addin-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-excel-sheet-binary-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-excel-sheet-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-excel-template-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-spreadsheetml-sheet:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-spreadsheetml-template:before {
background-color: #107b10
}
.elfinder-cwd-icon-vnd-ms-powerpoint:before,
.elfinder-cwd-icon-vnd-ms-powerpoint-addin-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-powerpoint-presentation-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-powerpoint-slide-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-powerpoint-slideshow-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-ms-powerpoint-template-macroEnabled-12:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-presentation:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-slide:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-slideshow:before,
.elfinder-cwd-icon-vnd-openxmlformats-officedocument-presentationml-template:before {
background-color: #d24625
}
.elfinder-cwd-icon-vnd-oasis-opendocument-chart:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-database:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-formula:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-graphics:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-graphics-template:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-image:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-presentation:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-presentation-template:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-spreadsheet:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-spreadsheet-template:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-text:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-text-master:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-text-template:before,
.elfinder-cwd-icon-vnd-oasis-opendocument-text-web:before,
.elfinder-cwd-icon-vnd-openofficeorg-extension:before {
background-color: #00a500
}
.elfinder-cwd-icon-postscript:before {
background-color: #ff5722
}
/* list view*/
.elfinder-cwd table thead td.ui-state-hover {
background: #ddd;
}
.elfinder-cwd table tr:nth-child(odd) {
background-color: #edf3fe;
}
.elfinder-cwd table tr {
border: 1px solid transparent;
border-top: 1px solid #fff;
}
.elfinder-cwd .elfinder-droppable-active td {
background: #A7C6E5;
}
.elfinder-cwd.elfinder-table-header-sticky table {
border-top-color: #fff;
}
.elfinder-droppable-active .elfinder-cwd.elfinder-table-header-sticky table {
border-top-color: #A7C6E5;
}
/* common selected background/color */
.elfinder-cwd-view-icons .elfinder-cwd-file .elfinder-cwd-filename.ui-state-hover,
.elfinder-cwd table td.ui-state-hover,
.elfinder-button-menu .ui-state-hover {
background: #3875d7;
color: #fff;
}
/* disabled elfinder */
.elfinder-disabled .elfinder-cwd-view-icons .elfinder-cwd-file .elfinder-cwd-filename.ui-state-hover,
.elfinder-disabled .elfinder-cwd table td.ui-state-hover {
background: #dadada;
}
/* statusbar */
.elfinder .elfinder-statusbar {
color: #555;
}
.elfinder .elfinder-statusbar a {
text-decoration: none;
color: #555;
}
/* contextmenu */
.elfinder-contextmenu .ui-state-active {
background: #6293df;
color: #fff;
}
.elfinder-contextmenu .ui-state-hover {
background: #3875d7;
color: #fff;
}
.elfinder-contextmenu .ui-state-hover .elfinder-contextmenu-arrow {
background-image: url('../img/arrows-active.png');
}
/* dialog */
.elfinder .ui-dialog input:text.ui-state-hover,
.elfinder .ui-dialog textarea.ui-state-hover {
background-image: none;
background-color: inherit;
}
.elfinder-notify-cancel .elfinder-notify-button {
background-color: #707070;
background-image: url("../img/ui-icons_ffffff_256x240.png");
}
.elfinder-notify-cancel .elfinder-notify-button.ui-state-hover {
background-color: #aaa;
}
/* edit dialog */
.elfinder-dialog-edit select.elfinder-edit-changed {
border-bottom: 2px solid #13ae10;
}
/* tooltip */
.ui-widget-content.elfinder-ui-tooltip {
background-color: #fff;
}
.elfinder-ui-tooltip.ui-widget-shadow,
.elfinder .elfinder-ui-tooltip.ui-widget-shadow {
box-shadow: 2px 6px 4px -4px #cecdcd;
}
/* progressbar */
.elfinder-ui-progressbar {
background-color: #419bf3;
}

View File

@ -1,73 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<title>elFinder 2.1.x source version with PHP connector</title>
<!-- Require JS (REQUIRED) -->
<!-- Rename "main.default.js" to "main.js" and edit it if you need configure elFInder options or any things -->
<script data-main="./main.default.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script>
define('elFinderConfig', {
// elFinder options (REQUIRED)
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
defaultOpts : {
url : 'php/connector.minimal.php', // or connector.maximal.php : connector URL (REQUIRED)
commandsOptions : {
edit : {
extraOptions : {
// set API key to enable Creative Cloud image editor
// see https://console.adobe.io/
creativeCloudApiKey : '',
// browsing manager URL for CKEditor, TinyMCE
// uses self location with the empty value
managerUrl : ''
}
},
quicklook : {
// to enable CAD-Files and 3D-Models preview with sharecad.org
sharecadMimes : ['image/vnd.dwg', 'image/vnd.dxf', 'model/vnd.dwf', 'application/vnd.hp-hpgl', 'application/plt', 'application/step', 'model/iges', 'application/vnd.ms-pki.stl', 'application/sat', 'image/cgm', 'application/x-msmetafile'],
// to enable preview with Google Docs Viewer
googleDocsMimes : ['application/pdf', 'image/tiff', 'application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/postscript', 'application/rtf'],
// to enable preview with Microsoft Office Online Viewer
// these MIME types override "googleDocsMimes"
officeOnlineMimes : ['application/vnd.ms-office', 'application/msword', 'application/vnd.ms-word', 'application/vnd.ms-excel', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.presentation']
}
},
// bootCalback calls at before elFinder boot up
bootCallback : function(fm, extraObj) {
/* any bind functions etc. */
fm.bind('init', function() {
// any your code
});
// for example set document.title dynamically.
var title = document.title;
fm.bind('open', function() {
var path = '',
cwd = fm.cwd();
if (cwd) {
path = fm.path(cwd.hash) || null;
}
document.title = path? path + ':' + title : title;
}).bind('destroy', function() {
document.title = title;
});
}
},
managers : {
// 'DOM Element ID': { /* elFinder options of this DOM Element */ }
'elfinder': {}
}
});
</script>
</head>
<body>
<!-- Element where elFinder will be created (REQUIRED) -->
<div id="elfinder"></div>
</body>
</html>

View File

@ -1,91 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<title>elFinder 2.1.x source version with PHP connector</title>
<!-- Section CSS -->
<!-- jQuery UI (REQUIRED) -->
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<!-- elFinder CSS (REQUIRED) -->
<link rel="stylesheet" type="text/css" href="css/elfinder.min.css">
<link rel="stylesheet" type="text/css" href="css/theme.css">
<!-- Section JavaScript -->
<!-- jQuery and jQuery UI (REQUIRED) -->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!--<![endif]-->
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<!-- elFinder JS (REQUIRED) -->
<script src="js/elfinder.min.js"></script>
<!-- Extra contents editors (OPTIONAL) -->
<script src="js/extras/editors.default.min.js"></script>
<!-- GoogleDocs Quicklook plugin for GoogleDrive Volume (OPTIONAL) -->
<!--<script src="js/extras/quicklook.googledocs.js"></script>-->
<!-- elFinder initialization (REQUIRED) -->
<script type="text/javascript" charset="utf-8">
// Documentation for client options:
// https://github.com/Studio-42/elFinder/wiki/Client-configuration-options
$(document).ready(function() {
$('#elfinder').elfinder(
// 1st Arg - options
{
cssAutoLoad : false, // Disable CSS auto loading
baseUrl : './', // Base URL to css/*, js/*
url : 'php/connector.minimal.php' // connector URL (REQUIRED)
// , lang: 'ru' // language (OPTIONAL)
},
// 2nd Arg - before boot up function
function(fm, extraObj) {
// `init` event callback function
fm.bind('init', function() {
// Optional for Japanese decoder "encoding-japanese.js"
if (fm.lang === 'ja') {
fm.loadScript(
[ '//cdn.rawgit.com/polygonplanet/encoding.js/1.0.26/encoding.min.js' ],
function() {
if (window.Encoding && Encoding.convert) {
fm.registRawStringDecoder(function(s) {
return Encoding.convert(s, {to:'UNICODE',type:'string'});
});
}
},
{ loadType: 'tag' }
);
}
});
// Optional for set document.title dynamically.
var title = document.title;
fm.bind('open', function() {
var path = '',
cwd = fm.cwd();
if (cwd) {
path = fm.path(cwd.hash) || null;
}
document.title = path? path + ':' + title : title;
}).bind('destroy', function() {
document.title = title;
});
}
);
});
</script>
</head>
<body>
<!-- Element where elFinder will be created (REQUIRED) -->
<div id="elfinder"></div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 934 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

Some files were not shown because too many files have changed in this diff Show More