@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 文件管理逻辑类 | |||
* | |||
@@ -13,8 +13,7 @@ class FileManagement | |||
{ | |||
var $baseDir = ""; | |||
var $activeDir = ""; | |||
//是否允许文件管理器删除目录; | |||
//默认为不允许 0 ,如果希望可能管理整个目录,请把值设为 1 ; | |||
//是否允许文件管理器删除目录,默认为不允许0,如果希望可能管理整个目录,请把值设为1 | |||
var $allowDeleteDir = 0; | |||
//初始化系统 | |||
function Init() | |||
@@ -145,7 +145,7 @@ else if ($dopost == 'edituser') { | |||
$uname = isset($uname)? HtmlReplace($uname,1) : ''; | |||
$spacesta = isset($spacesta)? HtmlReplace($spacesta,1) : ''; | |||
$exptime = isset($exptime)? HtmlReplace($exptime,1) : ''; | |||
if (!isset($_POST['id'])) exit('dedebiz'); | |||
if (!isset($_POST['id'])) exit ('dedebiz'); | |||
$pwdsql = empty($pwd) ? '' : ",pwd='".md5($pwd)."'"; | |||
if (function_exists('password_hash')) { | |||
$pwdsql = empty($pwd) ? '' : ",pwd_new='".password_hash($pwd, PASSWORD_BCRYPT)."'"; | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
/** | |||
* 用于地址跳转 | |||
* 地址跳转 | |||
* | |||
* @version $id:jump.php$ | |||
* @package DedeBIZ.Site | |||
@@ -68,7 +68,7 @@ function LoadTestDiv() { | |||
newobj.style.top = posTop; | |||
newobj.style.left = posLeft; | |||
document.body.appendChild(newobj); | |||
} else{ | |||
} else { | |||
newobj.style.display = "block"; | |||
} | |||
const formData = new FormData() | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 文档类 | |||
* 文档 | |||
* | |||
* @version $id:archives.class.php 4 15:13 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 自由列表类 | |||
* 自由列表 | |||
* | |||
* @version $id:freelist.class.php 3 15:15 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 文档列表类 | |||
* 文档列表 | |||
* | |||
* @version $id:listview.class.php 2 15:15 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 视图类 | |||
* 视图 | |||
* | |||
* @version $id:partview.class.php 14:17 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 搜索视图类 | |||
* 搜索视图 | |||
* | |||
* @version $id:searchview.class.php 15:26 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 自定义模型列表类 | |||
* 自定义模型列表 | |||
* | |||
* @version $id:sglistview.class.php 15:48 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 自定义模型视图类 | |||
* 自定义模型视图 | |||
* | |||
* @version $id:sgpage.class.php 15:48 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 专题视图类 | |||
* 专题视图 | |||
* | |||
* @version $id:specview.class.php 18:17 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 标签列表类 | |||
* 标签列表 | |||
* | |||
* @version $id:taglist.class.php 18:17 2010年7月7日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* @version $id:autoload.inc.php 17:44 2020-09-22 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -27,7 +27,7 @@ function __autoload($classname) | |||
echo '</pre>'; | |||
exit (); | |||
} else { | |||
header ( "location:/404.html" ); | |||
header ("location:/404.html"); | |||
die (); | |||
} | |||
} | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* @version $id:autoload7.inc.php 17:44 2020-09-22 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -27,7 +27,7 @@ function dede_autoloader($classname) | |||
echo '</pre>'; | |||
exit (); | |||
} else { | |||
header ( "location:/404.html" ); | |||
header ("location:/404.html"); | |||
die (); | |||
} | |||
} | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 栏目模型 | |||
* | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 栏目小助手 | |||
* 栏目助手 | |||
* | |||
* @version $id:channelunit.func.php 2 16:46 2010年7月6日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 字符编码转换 | |||
* | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 系统核心函数存放文件 | |||
* 系统核心函数存放 | |||
* | |||
* @version $id:common.func.php 4 16:39 2010年7月6日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -230,7 +230,7 @@ if (!function_exists('CheckSql')) { | |||
} | |||
} | |||
/** | |||
* 载入小助手,系统默认载入小助手示例 | |||
* 载入助手,系统默认载入助手示例 | |||
* <code> | |||
* if (!function_exists('HelloDede')) | |||
* { | |||
@@ -240,10 +240,10 @@ if (!function_exists('CheckSql')) { | |||
* } | |||
* } | |||
* </code> | |||
* 开发中使用这个小助手的时候直接使用函数helper('test');初始化它,然后在文件中就可以直接使用:HelloDede();调用 | |||
* 开发中使用这个助手的时候直接使用函数helper('test');初始化它,然后在文件中就可以直接使用:HelloDede();调用 | |||
* | |||
* @access public | |||
* @param mix $helpers 小助手名称,可以是数组,可以是单个字符串 | |||
* @param mix $helpers 助手名称,可以是数组,可以是单个字符串 | |||
* @return void | |||
*/ | |||
$_helpers = array(); | |||
@@ -263,7 +263,7 @@ function helper($helpers) | |||
include_once(DEDEINC.'/helpers/'.$helpers.'.helper.php'); | |||
$_helpers[$helpers] = TRUE; | |||
} | |||
//无法载入小助手 | |||
//无法载入助手 | |||
if (!isset($_helpers[$helpers])) { | |||
exit('Unable to load the requested file: helpers/'.$helpers.'.helper.php'); | |||
} | |||
@@ -276,7 +276,7 @@ function dede_htmlspecialchars($str) | |||
else return htmlspecialchars($str); | |||
} | |||
/** | |||
* 载入小助手,这里会员可能载入用helps载入多个小助手 | |||
* 载入助手,这里会员可能载入用helps载入多个助手 | |||
* | |||
* @access public | |||
* @param string | |||
@@ -263,23 +263,23 @@ if ($GLOBALS['cfg_dbtype'] == 'mysql' || $GLOBALS['cfg_dbtype'] == 'mysqli') { | |||
} else { | |||
require_once(DEDEINC.'/database/dedesqlite.class.php'); | |||
} | |||
//载入小助手配置,并对其进行默认初始化 | |||
//载入助手配置,并对其进行默认初始化 | |||
$cfg_helper_autoload = array( | |||
'charset', /* 编码小助手 */ | |||
'channelunit',/* 模型单元小助手 */ | |||
'string', /* 字符串小助手 */ | |||
'time', /* 日期小助手 */ | |||
'file', /* 文件小助手 */ | |||
'util', /* 单元小助手 */ | |||
'validate', /* 数据验证小助手 */ | |||
'filter', /* 过滤器小助手 */ | |||
'cookie', /* cookies小助手 */ | |||
'debug', /* 调试小助手 */ | |||
'archive', /* 文档小助手 */ | |||
'upload', /* 上传小助手 */ | |||
'extend', /* 扩展小助手 */ | |||
'code', /* 代码小助手 */ | |||
'charset', /* 编码助手 */ | |||
'channelunit',/* 模型单元助手 */ | |||
'string', /* 字符串助手 */ | |||
'time', /* 日期助手 */ | |||
'file', /* 文件助手 */ | |||
'util', /* 单元助手 */ | |||
'validate', /* 数据验证助手 */ | |||
'filter', /* 过滤器助手 */ | |||
'cookie', /* cookies助手 */ | |||
'debug', /* 调试助手 */ | |||
'archive', /* 文档助手 */ | |||
'upload', /* 上传助手 */ | |||
'extend', /* 扩展助手 */ | |||
'code', /* 代码助手 */ | |||
); | |||
//初始化小助手 | |||
//初始化助手 | |||
helper($cfg_helper_autoload); | |||
?> |
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 系统核心函数 | |||
* @version $id:customfields.func.php 2 20:50 2010年7月7日 tianya $ | |||
@@ -1,8 +1,8 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 系统底层数据库核心类 | |||
* 调用这个类前,请先设定这些外部变量 | |||
* 系统底层数据库核心,调用这个类前,请先设定这些外部变量 | |||
* | |||
* $GLOBALS['cfg_dbhost']; | |||
* $GLOBALS['cfg_dbuser']; | |||
* $GLOBALS['cfg_dbpwd']; | |||
@@ -1,8 +1,8 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 系统底层数据库核心类 | |||
* 调用这个类前,请先设定这些外部变量 | |||
* 系统底层数据库核心,调用这个类前,请先设定这些外部变量 | |||
* | |||
* $GLOBALS['cfg_dbhost']; | |||
* $GLOBALS['cfg_dbuser']; | |||
* $GLOBALS['cfg_dbpwd']; | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 动态分页 | |||
* | |||
@@ -99,7 +99,7 @@ class DedeAttParse | |||
} | |||
} | |||
/** | |||
* 解析属性(私有成员,仅给SetSource调用) | |||
* 解析属性,私有成员,仅给SetSource调用 | |||
* | |||
* @access private | |||
* @return void | |||
@@ -113,9 +113,7 @@ class DedeAttParse | |||
$ddtag = ""; | |||
$notAttribute = TRUE; | |||
$strLen = strlen($this->SourceString); | |||
//这里是获得Tag的名称,可视情况是否需要 | |||
//如果不在这个里解析,则在解析整个Tag时解析 | |||
//属性中不应该存在tagname这个名称 | |||
//这里是获得Tag的名称,可视情况是否需要,如果不在这个里解析,则在解析整个Tag时解析,属性中不应该存在tagname这个名称 | |||
for ($i = 0; $i < $strLen; $i++) { | |||
$d = substr($this->SourceString, $i, 1); | |||
if ($d == ' ') { | |||
@@ -155,7 +153,6 @@ class DedeAttParse | |||
} else if ($startdd == 0) { | |||
switch ($d) { | |||
case ' ': | |||
//continue; | |||
break; | |||
case '\'': | |||
$ddtag = '\''; | |||
@@ -174,7 +171,7 @@ class DedeAttParse | |||
} else if ($startdd == 1) { | |||
if ($d == $ddtag) { | |||
$this->CAtt->Count++; | |||
$this->CAtt->Items[$tmpatt] = trim($tmpvalue); //strtolower(trim($tmpvalue)); | |||
$this->CAtt->Items[$tmpatt] = trim($tmpvalue); | |||
$tmpatt = ""; | |||
$tmpvalue = ""; | |||
$startdd = -1; | |||
@@ -185,10 +182,9 @@ class DedeAttParse | |||
} | |||
if ($tmpatt != "") { | |||
$this->CAtt->Count++; | |||
$this->CAtt->Items[$tmpatt] = trim($tmpvalue); //strtolower(trim($tmpvalue)); | |||
} //完成属性解析 | |||
} //for | |||
} //has Attribute | |||
}//End DedeAttParse | |||
$this->CAtt->Items[$tmpatt] = trim($tmpvalue); | |||
} | |||
} | |||
} | |||
} | |||
?> |
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 采集小助手 | |||
* 采集助手 | |||
* | |||
* @version $id:charset.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 模块插件 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 模板主题 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 模板主题引擎 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 投票 | |||
* | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 自定义表单解析 | |||
* 自定义表单 | |||
* | |||
* @version $id:diyform.class.php 10:31 2010年7月6日 tianya $ | |||
* @package DedeBIZ.Libraries | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 防采集混淆字符串 | |||
* | |||
@@ -9,6 +9,6 @@ if (!defined('DEDEINC')) exit('dedebiz'); | |||
* @license https://www.dedebiz.com/license | |||
* @link https://www.dedebiz.com | |||
*/ | |||
//仅作一个映射,开发直接采用helper('downmix');进行调用 | |||
//仅作一个映射,开发直接采用helper('downmix');调用 | |||
helper('downmix'); | |||
?> |
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 联动菜单 | |||
* | |||
@@ -1,4 +1,4 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
//这里扩展自己的函数 | |||
?> |
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 过滤核心处理 | |||
* | |||
@@ -35,7 +35,7 @@ function _FilterAll($fk, &$svar) | |||
} | |||
return $svar; | |||
} | |||
/* 对_GET,_POST,_COOKIE进行过滤 */ | |||
//对_GET,_POST,_COOKIE进行过滤 | |||
foreach (array('_GET', '_POST', '_COOKIE') as $_request) { | |||
foreach ($$_request as $_k => $_v) { | |||
${$_k} = _FilterAll($_k, $_v); | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 文档小助手 | |||
* 文档助手 | |||
* | |||
* @version $id:archive.helper.php 2 23:00 2010年7月5日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 缓存小助手,支持文件和dedebiz cache | |||
* 缓存助手,支持文件和dedebiz cache | |||
* | |||
* @version $id:cache.helper.php 10:46 2011-3-2 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 文档小助手 | |||
* 文档助手 | |||
* | |||
* @version $id:channelunit.helper.php 16:49 2010年7月6日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -29,10 +29,7 @@ if (!function_exists('GetRankStar')) { | |||
} | |||
} | |||
/** | |||
* 获得文档网址 | |||
* 如果要获得文件的路径,直接用 | |||
* GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$typedir,$money) | |||
* 即是不指定站点参数则返回相当对根目录的真实路径 | |||
* 获得文档网址,如果要获得文件的路径,直接用GetFileUrl($aid,$typeid,$timetag,$title,$ismake,$rank,$namerule,$typedir,$money)即是不指定站点参数则返回相当对根目录的真实路径 | |||
* | |||
* @param int $aid 文档id | |||
* @param int $typeid 栏目id | |||
@@ -83,7 +80,7 @@ if (!function_exists('GetFileUrl')) { | |||
} | |||
} | |||
/** | |||
* 获得新文件名(本函数会自动创建目录) | |||
* 获得新文件名,本函数会自动创建目录 | |||
* | |||
* @param int $aid 文档id | |||
* @param int $typeid 栏目id | |||
@@ -122,7 +119,7 @@ if (!function_exists('GetFileNewName')) { | |||
} | |||
} | |||
/** | |||
* 获得文件相对于主站点根目录的物理文件名(动态网址返回url) | |||
* 获得文件相对于主站点根目录的物理文件名,动态网址返回url | |||
* | |||
* @param int $aid 文档id | |||
* @param int $typeid 栏目id | |||
@@ -184,8 +181,7 @@ if (!function_exists('GetFileName')) { | |||
} | |||
} | |||
/** | |||
* 获得指定栏目链接 | |||
* 对于使用封面文件和单独页面的情况,强制使用默认页名称 | |||
* 获得指定栏目链接,对于使用封面文件和单独页面的情况,强制使用默认页名称 | |||
* | |||
* @param int $typeid 栏目id | |||
* @param string $typedir 栏目目录 | |||
@@ -208,7 +204,7 @@ if (!function_exists('GetTypeUrl')) { | |||
if ($isdefault==-1) { | |||
//动态 | |||
if ($cfg_rewrite == 'Y') { | |||
//网页版return $GLOBALS['cfg_cmspath']."/list-".$typeid.".html"; | |||
//网页版,栏目形式:域名/list-1.html、域名/list-2.html,分页形式:域名/list-1-1.html、域名/list-1-2.htmlreturn $GLOBALS['cfg_cmspath']."/list-".$typeid.".html"; | |||
//目录版默认,栏目形式:域名/list-1、域名/list-2,分页形式:域名/list-1-1、域名/list-1-2 | |||
return $GLOBALS['cfg_cmspath']."/list-".$typeid.""; | |||
} else { | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* DedeBIZ中用到的字符编码转换的小助手函数 | |||
* DedeBIZ中字符编码转换助手 | |||
* | |||
* @version $id:charset.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -12,7 +12,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); | |||
$UC2GBTABLE = $CODETABLE = $BIG5_DATA = $GB_DATA = ''; | |||
$GbkUniDic = null; | |||
/** | |||
* UTF-8 转GB编码 | |||
* UTF-8转GB编码 | |||
* | |||
* @access public | |||
* @param string $utfstr 需要转换的字符串 | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
//允许的函数 | |||
$GLOBALS['allowedCalls'] = array( | |||
//系统 | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* Cookie处理小助手 | |||
* Cookie处理助手 | |||
* | |||
* @version $id:file.helper.php 13:58 2010年7月5日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 验证小助手 | |||
* 验证助手 | |||
* | |||
* @version $id:validate.helper.php 2 13:56 2010年7月5日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -10,7 +10,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); | |||
* @link https://www.dedebiz.com | |||
*/ | |||
/** | |||
* 浏览器友好的变量输出,便于调试时候使用 | |||
* 浏览器友好的变量输出,便于调试时候使用 | |||
* | |||
* @param mixed $var 要输出查看的文档 | |||
* @param bool $echo 是否直接输出 | |||
@@ -1,4 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 防采集混淆字符串 | |||
* | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 扩展小助手 | |||
* 扩展助手 | |||
* | |||
* @version $id:extend.helper.php 13:58 2010年7月5日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 文件处理小助手 | |||
* 文件处理助手 | |||
* | |||
* @version $id:file.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 过滤小助手 | |||
* 过滤助手 | |||
* | |||
* @version $id:filter.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,6 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
require_once DEDEINC."/libraries/imageresize.class.php"; | |||
/** | |||
* 图像处理相关函数 | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 字符串小助手 | |||
* 字符串助手 | |||
* | |||
* @version $id:string.helper.php 5 14:24 2010年7月5日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -12,8 +12,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); | |||
//拼音的缓冲数组 | |||
$pinyins = array(); | |||
/** | |||
* 中文截取2,单字节截取模式 | |||
* 如果是request的文档,必须使用这个函数 | |||
* 中文截取2,单字节截取模式,如果是request的文档,必须使用这个函数 | |||
* | |||
* @access public | |||
* @param string $str 需要截取的字符串 | |||
@@ -1,8 +1,6 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 仅用于测试 | |||
* | |||
* @version $id:test.helper.php 5 15:01 2010年7月5日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
* @copyright Copyright (c) 2022 DedeBIZ.COM | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 时间戳小助手 | |||
* 时间戳助手 | |||
* | |||
* @version $id:time.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 上传处理小助手 | |||
* 上传处理助手 | |||
* | |||
* @version $id:upload.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 核心小助手 | |||
* 核心助手 | |||
* | |||
* @version $id:util.helper.php 4 19:20 2010年7月6日 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,7 +1,7 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 验证小助手 | |||
* 验证助手 | |||
* | |||
* @version $id:validate.helper.php 2010-07-05 11:43:09 tianya $ | |||
* @package DedeBIZ.Helpers | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 图像处理 | |||
* | |||
@@ -12,7 +12,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); | |||
class image | |||
{ | |||
var $attachinfo; | |||
var $targetfile; //图片路径 | |||
var $targetfile; //图片路径 | |||
var $imagecreatefromfunc; | |||
var $imagefunc; | |||
var $attach; | |||
@@ -21,7 +21,7 @@ class image | |||
var $watermarktext; | |||
var $thumbstatus; | |||
var $watermarkstatus; | |||
//析构函数,兼容PHP4 | |||
//析构函数,兼容PHP4 | |||
function image($targetfile, $cfg_thumb, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $cfg_watermarktype, $photo_marktrans, $trueMarkimg, $attach = array()) | |||
{ | |||
$this->__construct($targetfile, $cfg_thumb, $cfg_watermarktext, $photo_waterpos, $photo_diaphaneity, $photo_wheight, $photo_wwidth, $cfg_watermarktype, $photo_marktrans, $trueMarkimg, $attach); | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 图像处理相关函数 | |||
* | |||
@@ -52,6 +52,6 @@ if (function_exists("imagecreatefromwebp") && function_exists("imagewebp")) { | |||
$cfg_photo_typenames[] = "image/webp"; | |||
$cfg_photo_support .= "WEBP "; | |||
} | |||
//引入图像处理小助手 | |||
//引入图像处理助手 | |||
helper('image'); | |||
?> |
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 管理员后台基本函数 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
function SpHtml2Text($str) | |||
{ | |||
$str = preg_replace("/<sty(.*)\\/style>|<scr(.*)\\/script>|<!--(.*)-->/isU","",$str); | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
require_once(DEDEINC."/libraries/crawlerdetect.class.php"); | |||
require_once(DEDEINC."/libraries/mobiledetect.class.php"); | |||
//copyright https://github.com/jenssegers/agent | |||
@@ -1,17 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
//Copyright 2020 The DedeBiz Authors. All rights reserved. | |||
//license that can be found in the LICENSE file. | |||
//@copyright Copyright (c) 2022 DedeBIZ.COM | |||
//@license https://www.dedebiz.com/license | |||
//@link https://www.dedebiz.com | |||
/* | |||
The MIT License (MIT) | |||
Copyright (c) 2014-2019 British Columbia Institute of Technology | |||
Copyright (c) 2019-2020 CodeIgniter Foundation | |||
*/ | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
function is_cli() | |||
{ | |||
return (PHP_SAPI === 'cli' || defined('STDIN')); | |||
@@ -54,8 +42,7 @@ class DedeCli | |||
]; | |||
public static function init() | |||
{ | |||
if (is_cli()) | |||
{ | |||
if (is_cli()) { | |||
static::$readline_support = extension_loaded('readline'); | |||
static::parseCommandLine(); | |||
static::$initialized = true; | |||
@@ -66,22 +53,18 @@ class DedeCli | |||
private static function parseCommandLine() | |||
{ | |||
$optionsFound = false; | |||
for ($i=1; $i < $_SERVER['argc']; $i++) | |||
{ | |||
if (! $optionsFound && strpos($_SERVER['argv'][$i], '-') === false) | |||
{ | |||
for ($i=1; $i < $_SERVER['argc']; $i++) { | |||
if (! $optionsFound && strpos($_SERVER['argv'][$i], '-') === false) { | |||
static::$segments[] = $_SERVER['argv'][$i]; | |||
continue; | |||
} | |||
$optionsFound = true; | |||
if (substr($_SERVER['argv'][$i], 0, 1) != '-') | |||
{ | |||
if (substr($_SERVER['argv'][$i], 0, 1) != '-') { | |||
continue; | |||
} | |||
$arg = str_replace('-', '', $_SERVER['argv'][$i]); | |||
$value = null; | |||
if (isset($_SERVER['argv'][$i+1]) && substr($_SERVER['argv'][$i+1], 0, 1) != '-') | |||
{ | |||
if (isset($_SERVER['argv'][$i+1]) && substr($_SERVER['argv'][$i+1], 0, 1) != '-') { | |||
$value = $_SERVER['argv'][$i+1]; | |||
$i++; | |||
} | |||
@@ -92,8 +75,7 @@ class DedeCli | |||
} | |||
public static function getOption(string $name) | |||
{ | |||
if (! array_key_exists($name, static::$options)) | |||
{ | |||
if (! array_key_exists($name, static::$options)) { | |||
return null; | |||
} | |||
$val = static::$options[$name] === null | |||
@@ -107,15 +89,13 @@ class DedeCli | |||
} | |||
public static function getOptionString(): string | |||
{ | |||
if (! count(static::$options)) | |||
{ | |||
if (! count(static::$options)) { | |||
return ''; | |||
} | |||
$out = ''; | |||
foreach (static::$options as $name => $value) | |||
{ | |||
if (mb_strpos($value, ' ') !== false) | |||
{ | |||
if (mb_strpos($value, ' ') !== false) { | |||
$value = '"'.$value.'"'; | |||
} | |||
$out .= "-{$name} $value "; | |||
@@ -124,8 +104,7 @@ class DedeCli | |||
} | |||
public static function newLine(int $num = 1) | |||
{ | |||
for ($i = 0; $i < $num; $i++) | |||
{ | |||
for ($i = 0; $i < $num; $i++) { | |||
static::write(''); | |||
} | |||
} | |||
@@ -135,25 +114,20 @@ class DedeCli | |||
} | |||
public static function color(string $text, string $foreground, string $background = null, string $format = null) | |||
{ | |||
if (static::isWindows() && ! isset($_SERVER['ANSICON'])) | |||
{ | |||
if (static::isWindows() && ! isset($_SERVER['ANSICON'])) { | |||
return $text; | |||
} | |||
if ( ! array_key_exists($foreground, static::$foreground_colors)) | |||
{ | |||
if ( ! array_key_exists($foreground, static::$foreground_colors)) { | |||
throw new \RuntimeException('Invalid CLI foreground color: '.$foreground); | |||
} | |||
if ($background !== null && ! array_key_exists($background, static::$background_colors)) | |||
{ | |||
if ($background !== null && ! array_key_exists($background, static::$background_colors)) { | |||
throw new \RuntimeException('Invalid CLI background color: '.$background); | |||
} | |||
$string = "\033[".static::$foreground_colors[$foreground]."m"; | |||
if ($background !== null) | |||
{ | |||
if ($background !== null) { | |||
$string .= "\033[".static::$background_colors[$background]."m"; | |||
} | |||
if ($format === 'underline') | |||
{ | |||
if ($format === 'underline') { | |||
$string .= "\033[4m"; | |||
} | |||
$string .= $text."\033[0m"; | |||
@@ -161,16 +135,14 @@ class DedeCli | |||
} | |||
public static function getWidth(int $default = 80): int | |||
{ | |||
if (static::isWindows()) | |||
{ | |||
if (static::isWindows()) { | |||
return $default; | |||
} | |||
return (int)shell_exec('tput cols'); | |||
} | |||
public static function getHeight(int $default = 32): int | |||
{ | |||
if (static::isWindows()) | |||
{ | |||
if (static::isWindows()) { | |||
return $default; | |||
} | |||
return (int)shell_exec('tput lines'); | |||
@@ -178,13 +150,11 @@ class DedeCli | |||
public static function showProgress($thisStep = 1, int $totalSteps = 10, int $pos = 0,int $total = 0) | |||
{ | |||
static $inProgress = false; | |||
if ($inProgress !== false && $inProgress <= $thisStep) | |||
{ | |||
if ($inProgress !== false && $inProgress <= $thisStep) { | |||
fwrite(STDOUT, "\033[1A"); | |||
} | |||
$inProgress = $thisStep; | |||
if ($thisStep !== false) | |||
{ | |||
if ($thisStep !== false) { | |||
$thisStep = abs($thisStep); | |||
$totalSteps = $totalSteps < 1 ? 1 : $totalSteps; | |||
$percent = intval(($thisStep / $totalSteps) * 100); | |||
@@ -201,28 +171,23 @@ class DedeCli | |||
} | |||
public static function wrap(string $string = null, int $max = 0, int $pad_left = 0): string | |||
{ | |||
if (empty($string)) | |||
{ | |||
if (empty($string)) { | |||
return ''; | |||
} | |||
if ($max == 0) | |||
{ | |||
if ($max == 0) { | |||
$max = DedeCli::getWidth(); | |||
} | |||
if (DedeCli::getWidth() < $max) | |||
{ | |||
if (DedeCli::getWidth() < $max) { | |||
$max = DedeCli::getWidth(); | |||
} | |||
$max = $max - $pad_left; | |||
$lines = wordwrap($string, $max); | |||
if ($pad_left > 0) | |||
{ | |||
if ($pad_left > 0) { | |||
$lines = explode(PHP_EOL, $lines); | |||
$first = true; | |||
array_walk($lines, function (&$line, $index) use ($max, $pad_left, &$first) | |||
{ | |||
if ( ! $first) | |||
{ | |||
if ( ! $first) { | |||
$line = str_repeat(" ", $pad_left).$line; | |||
} else { | |||
$first = false; | |||
@@ -240,25 +205,19 @@ class DedeCli | |||
} | |||
public static function input(string $prefix = null): string | |||
{ | |||
if (static::$readline_support) | |||
{ | |||
if (static::$readline_support) { | |||
return readline($prefix); | |||
} | |||
echo $prefix; | |||
return fgets(STDIN); | |||
} | |||
/** | |||
* 询问会员输入.这个可以1个或2个参数. | |||
* | |||
* 使用: | |||
* | |||
* 询问会员输入,可以1个或2个参数 | |||
* | |||
* //等待任何输入 | |||
* DedeCli::prompt(); | |||
* | |||
* $color = DedeCli::prompt('What is your favorite color?'); | |||
* | |||
* $color = DedeCli::prompt('What is your favourite color?', 'white'); | |||
* | |||
* $ready = DedeCli::prompt('Are you ready?', array('y','n')); | |||
* | |||
* @return string the user input | |||
@@ -298,29 +257,21 @@ class DedeCli | |||
$output = $args[0]; | |||
} | |||
break; | |||
} | |||
if ($output !== '') | |||
{ | |||
} if ($output !== '') { | |||
$extra_output = ''; | |||
if ($default !== null) | |||
{ | |||
if ($default !== null) { | |||
$extra_output = ' [ Default: "'.$default.'" ]'; | |||
} | |||
elseif ($options !== []) | |||
{ | |||
} elseif ($options !== []) { | |||
$extra_output = ' [ '.implode(', ', $options).' ]'; | |||
} | |||
fwrite(STDOUT, $output.$extra_output.': '); | |||
} | |||
$input = trim(static::input()) ? : $default; | |||
if (empty($input) && $required === true) | |||
{ | |||
if (empty($input) && $required === true) { | |||
static::write('This is required.'); | |||
static::newLine(); | |||
$input = forward_static_call_array([__CLASS__, 'prompt'], $args); | |||
} | |||
if ( ! empty($options) && ! in_array($input, $options)) | |||
{ | |||
} if (! empty($options) && ! in_array($input, $options)) { | |||
static::write('This is not a valid option. Please try again.'); | |||
static::newLine(); | |||
$input = forward_static_call_array([__CLASS__, 'prompt'], $args); | |||
@@ -329,8 +280,7 @@ class DedeCli | |||
} | |||
public static function wait(int $seconds, bool $countdown = false) | |||
{ | |||
if ($countdown === true) | |||
{ | |||
if ($countdown === true) { | |||
$time = $seconds; | |||
while ($time > 0) | |||
{ | |||
@@ -340,8 +290,7 @@ class DedeCli | |||
} | |||
static::write(); | |||
} else { | |||
if ($seconds > 0) | |||
{ | |||
if ($seconds > 0) { | |||
sleep($seconds); | |||
} else { | |||
static::write(static::$wait_msg); | |||
@@ -351,16 +300,14 @@ class DedeCli | |||
} | |||
public static function error(string $text, string $foreground = 'light_red', string $background = null) | |||
{ | |||
if ($foreground || $background) | |||
{ | |||
if ($foreground || $background) { | |||
$text = static::color($text, $foreground, $background); | |||
} | |||
fwrite(STDERR, $text.PHP_EOL); | |||
} | |||
public static function write(string $text = '', string $foreground = null, string $background = null) | |||
{ | |||
if ($foreground || $background) | |||
{ | |||
if ($foreground || $background) { | |||
$text = static::color($text, $foreground, $background); | |||
} | |||
fwrite(STDOUT, $text.PHP_EOL); | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/* | |||
* This file is part of Crawler Detect - the web crawler detection library. | |||
* | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
//用于DedeBIZ商业组件通信 | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
//DedeBIZ商业组件通信 | |||
define("DEDEBIZ", true); | |||
class DedeBizClient | |||
{ | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* HTTP下载类 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/* | |||
* This file is part of Crawler Detect - the web crawler detection library. | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/* | |||
* This file is part of Crawler Detect - the web crawler detection library. | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/* | |||
* This file is part of Crawler Detect - the web crawler detection library. | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/* | |||
* This file is part of Crawler Detect - the web crawler detection library. | |||
* | |||
@@ -1,4 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 图片缩放尺寸 | |||
* | |||
@@ -12,7 +13,6 @@ | |||
class ImageResizeException extends \Exception | |||
{ | |||
} | |||
/** | |||
* PHP class to resize and scale images | |||
*/ | |||
@@ -28,38 +28,26 @@ class ImageResize | |||
const IMG_FLIP_HORIZONTAL = 0; | |||
const IMG_FLIP_VERTICAL = 1; | |||
const IMG_FLIP_BOTH = 2; | |||
public $quality_jpg = 85; | |||
public $quality_webp = 85; | |||
public $quality_png = 6; | |||
public $quality_truecolor = true; | |||
public $gamma_correct = false; | |||
public $interlace = 1; | |||
public $source_type; | |||
protected $source_image; | |||
protected $original_w; | |||
protected $original_h; | |||
protected $dest_x = 0; | |||
protected $dest_y = 0; | |||
protected $source_x; | |||
protected $source_y; | |||
protected $dest_w; | |||
protected $dest_h; | |||
protected $source_w; | |||
protected $source_h; | |||
protected $source_info; | |||
protected $filters = []; | |||
/** | |||
* Create instance from a strng | |||
* | |||
@@ -75,8 +63,6 @@ class ImageResize | |||
$resize = new self('data://application/octet-stream;base64,'.base64_encode($image_data)); | |||
return $resize; | |||
} | |||
/** | |||
* Add filter function for use right before save image to file. | |||
* | |||
@@ -88,7 +74,6 @@ class ImageResize | |||
$this->filters[] = $filter; | |||
return $this; | |||
} | |||
/** | |||
* Apply filters. | |||
* | |||
@@ -101,7 +86,6 @@ class ImageResize | |||
$function($image, $filterType); | |||
} | |||
} | |||
/** | |||
* Loads image source and its properties to the instanciated object | |||
* | |||
@@ -114,15 +98,12 @@ class ImageResize | |||
if (!defined('IMAGETYPE_WEBP')) { | |||
define('IMAGETYPE_WEBP', 18); | |||
} | |||
if (!defined('IMAGETYPE_BMP')) { | |||
define('IMAGETYPE_BMP', 6); | |||
} | |||
if ($filename === null || empty($filename) || (substr($filename, 0, 5) !== 'data:' && !is_file($filename))) { | |||
throw new ImageResizeException('File does not exist'); | |||
} | |||
$finfo = finfo_open(FILEINFO_MIME_TYPE); | |||
$checkWebp = false; | |||
if (strstr(finfo_file($finfo, $filename), 'image') === false) { | |||
@@ -136,91 +117,68 @@ class ImageResize | |||
$checkWebp = true; | |||
$this->source_type = IMAGETYPE_WEBP; | |||
} | |||
if (!$image_info = getimagesize($filename, $this->source_info)) { | |||
$image_info = getimagesize($filename); | |||
} | |||
if (!$checkWebp) { | |||
if (!$image_info) { | |||
if (strstr(finfo_file($finfo, $filename), 'image') !== false) { | |||
throw new ImageResizeException('Unsupported image type'); | |||
} | |||
throw new ImageResizeException('Could not read file'); | |||
} | |||
$this->original_w = $image_info[0]; | |||
$this->original_h = $image_info[1]; | |||
$this->source_type = $image_info[2]; | |||
} | |||
switch ($this->source_type) { | |||
case IMAGETYPE_GIF: | |||
$this->source_image = imagecreatefromgif($filename); | |||
break; | |||
case IMAGETYPE_JPEG: | |||
$this->source_image = $this->imageCreateJpegfromExif($filename); | |||
// set new width and height for image, maybe it has changed | |||
$this->original_w = imagesx($this->source_image); | |||
$this->original_h = imagesy($this->source_image); | |||
break; | |||
case IMAGETYPE_PNG: | |||
$this->source_image = imagecreatefrompng($filename); | |||
break; | |||
case IMAGETYPE_WEBP: | |||
$this->source_image = imagecreatefromwebp($filename); | |||
$this->original_w = imagesx($this->source_image); | |||
$this->original_h = imagesy($this->source_image); | |||
break; | |||
case IMAGETYPE_BMP: | |||
if (version_compare(PHP_VERSION, '7.2.0', '<')) { | |||
throw new ImageResizeException('For bmp support PHP >= 7.2.0 is required'); | |||
} | |||
$this->source_image = imagecreatefrombmp($filename); | |||
break; | |||
default: | |||
throw new ImageResizeException('Unsupported image type'); | |||
} | |||
if (!$this->source_image) { | |||
throw new ImageResizeException('Could not load image'); | |||
} | |||
finfo_close($finfo); | |||
return $this->resize($this->getSourceWidth(), $this->getSourceHeight()); | |||
} | |||
// http://stackoverflow.com/a/28819866 | |||
//http://stackoverflow.com/a/28819866 | |||
public function imageCreateJpegfromExif($filename) | |||
{ | |||
$img = imagecreatefromjpeg($filename); | |||
if (!function_exists('exif_read_data') || !isset($this->source_info['APP1']) || strpos($this->source_info['APP1'], 'Exif') !== 0) { | |||
return $img; | |||
} | |||
try { | |||
} try { | |||
$exif = @exif_read_data($filename); | |||
} catch (Exception $e) { | |||
$exif = null; | |||
} | |||
if (!$exif || !isset($exif['Orientation'])) { | |||
return $img; | |||
} | |||
$orientation = $exif['Orientation']; | |||
if ($orientation === 6 || $orientation === 5) { | |||
$img = imagerotate($img, 270, 0); | |||
} elseif ($orientation === 3 || $orientation === 4) { | |||
@@ -228,14 +186,11 @@ class ImageResize | |||
} elseif ($orientation === 8 || $orientation === 7) { | |||
$img = imagerotate($img, 90, 0); | |||
} | |||
if ($orientation === 5 || $orientation === 4 || $orientation === 7) { | |||
imageflip($img, IMG_FLIP_HORIZONTAL); | |||
} | |||
return $img; | |||
} | |||
/** | |||
* Saves new image | |||
* | |||
@@ -250,70 +205,61 @@ class ImageResize | |||
{ | |||
$image_type = $image_type ?: $this->source_type; | |||
$quality = is_numeric($quality) ? (int) abs($quality) : null; | |||
switch ($image_type) { | |||
case IMAGETYPE_GIF: | |||
if( !empty($exact_size) && is_array($exact_size) ){ | |||
if (!empty($exact_size) && is_array($exact_size)) { | |||
$dest_image = imagecreatetruecolor($exact_size[0], $exact_size[1]); | |||
} else{ | |||
} else { | |||
$dest_image = imagecreatetruecolor($this->getDestWidth(), $this->getDestHeight()); | |||
} | |||
$background = imagecolorallocatealpha($dest_image, 255, 255, 255, 1); | |||
imagecolortransparent($dest_image, $background); | |||
imagefill($dest_image, 0, 0, $background); | |||
imagesavealpha($dest_image, true); | |||
break; | |||
case IMAGETYPE_JPEG: | |||
if( !empty($exact_size) && is_array($exact_size) ){ | |||
if (!empty($exact_size) && is_array($exact_size)) { | |||
$dest_image = imagecreatetruecolor($exact_size[0], $exact_size[1]); | |||
$background = imagecolorallocate($dest_image, 255, 255, 255); | |||
imagefilledrectangle($dest_image, 0, 0, $exact_size[0], $exact_size[1], $background); | |||
} else{ | |||
} else { | |||
$dest_image = imagecreatetruecolor($this->getDestWidth(), $this->getDestHeight()); | |||
$background = imagecolorallocate($dest_image, 255, 255, 255); | |||
imagefilledrectangle($dest_image, 0, 0, $this->getDestWidth(), $this->getDestHeight(), $background); | |||
} | |||
break; | |||
case IMAGETYPE_WEBP: | |||
if (version_compare(PHP_VERSION, '5.5.0', '<')) { | |||
throw new ImageResizeException('For WebP support PHP >= 5.5.0 is required'); | |||
} | |||
if( !empty($exact_size) && is_array($exact_size) ){ | |||
if (!empty($exact_size) && is_array($exact_size)) { | |||
$dest_image = imagecreatetruecolor($exact_size[0], $exact_size[1]); | |||
$background = imagecolorallocate($dest_image, 255, 255, 255); | |||
imagefilledrectangle($dest_image, 0, 0, $exact_size[0], $exact_size[1], $background); | |||
} else{ | |||
} else { | |||
$dest_image = imagecreatetruecolor($this->getDestWidth(), $this->getDestHeight()); | |||
$background = imagecolorallocate($dest_image, 255, 255, 255); | |||
imagefilledrectangle($dest_image, 0, 0, $this->getDestWidth(), $this->getDestHeight(), $background); | |||
} | |||
imagealphablending($dest_image, false); | |||
imagesavealpha($dest_image, true); | |||
break; | |||
case IMAGETYPE_PNG: | |||
if (!$this->quality_truecolor || !imageistruecolor($this->source_image)) { | |||
if( !empty($exact_size) && is_array($exact_size) ){ | |||
if (!empty($exact_size) && is_array($exact_size)) { | |||
$dest_image = imagecreate($exact_size[0], $exact_size[1]); | |||
} else{ | |||
} else { | |||
$dest_image = imagecreate($this->getDestWidth(), $this->getDestHeight()); | |||
} | |||
} else { | |||
if( !empty($exact_size) && is_array($exact_size) ){ | |||
if(!empty($exact_size) && is_array($exact_size)) { | |||
$dest_image = imagecreatetruecolor($exact_size[0], $exact_size[1]); | |||
} else{ | |||
} else { | |||
$dest_image = imagecreatetruecolor($this->getDestWidth(), $this->getDestHeight()); | |||
} | |||
} | |||
imagealphablending($dest_image, false); | |||
imagesavealpha($dest_image, true); | |||
$background = imagecolorallocatealpha($dest_image, 255, 255, 255, 127); | |||
imagecolortransparent($dest_image, $background); | |||
imagefill($dest_image, 0, 0, $background); | |||
@@ -323,8 +269,7 @@ class ImageResize | |||
if (version_compare(PHP_VERSION, '7.2.0', '<')) { | |||
throw new ImageResizeException('For WebP support PHP >= 7.2.0 is required'); | |||
} | |||
if(!empty($exact_size) && is_array($exact_size)) { | |||
if (!empty($exact_size) && is_array($exact_size)) { | |||
$dest_image = imagecreatetruecolor($exact_size[0], $exact_size[1]); | |||
$background = imagecolorallocate($dest_image, 255, 255, 255); | |||
imagefilledrectangle($dest_image, 0, 0, $exact_size[0], $exact_size[1], $background); | |||
@@ -335,14 +280,11 @@ class ImageResize | |||
} | |||
break; | |||
} | |||
imageinterlace($dest_image, $this->interlace); | |||
if ($this->gamma_correct) { | |||
imagegammacorrect($this->source_image, 2.2, 1.0); | |||
} | |||
if( !empty($exact_size) && is_array($exact_size) ) { | |||
if (!empty($exact_size) && is_array($exact_size)) { | |||
if ($this->getSourceHeight() < $this->getSourceWidth()) { | |||
$this->dest_x = 0; | |||
$this->dest_y = ($exact_size[1] - $this->getDestHeight()) / 2; | |||
@@ -352,7 +294,6 @@ class ImageResize | |||
$this->dest_y = 0; | |||
} | |||
} | |||
imagecopyresampled( | |||
$dest_image, | |||
$this->source_image, | |||
@@ -365,27 +306,20 @@ class ImageResize | |||
$this->source_w, | |||
$this->source_h | |||
); | |||
if ($this->gamma_correct) { | |||
imagegammacorrect($dest_image, 1.0, 2.2); | |||
} | |||
$this->applyFilter($dest_image); | |||
switch ($image_type) { | |||
case IMAGETYPE_GIF: | |||
imagegif($dest_image, $filename); | |||
break; | |||
case IMAGETYPE_JPEG: | |||
if ($quality === null || $quality > 100) { | |||
$quality = $this->quality_jpg; | |||
} | |||
imagejpeg($dest_image, $filename, $quality); | |||
break; | |||
case IMAGETYPE_WEBP: | |||
if (version_compare(PHP_VERSION, '5.5.0', '<')) { | |||
throw new ImageResizeException('For WebP support PHP >= 5.5.0 is required'); | |||
@@ -393,32 +327,24 @@ class ImageResize | |||
if ($quality === null) { | |||
$quality = $this->quality_webp; | |||
} | |||
imagewebp($dest_image, $filename, $quality); | |||
break; | |||
case IMAGETYPE_PNG: | |||
if ($quality === null || $quality > 9) { | |||
$quality = $this->quality_png; | |||
} | |||
imagepng($dest_image, $filename, $quality); | |||
break; | |||
case IMAGETYPE_BMP: | |||
imagebmp($dest_image, $filename, $quality); | |||
break; | |||
} | |||
if ($permissions) { | |||
chmod($filename, $permissions); | |||
} | |||
imagedestroy($dest_image); | |||
return $this; | |||
} | |||
/** | |||
* Convert the image to string | |||
* | |||
@@ -429,16 +355,11 @@ class ImageResize | |||
public function getImageAsString($image_type = null, $quality = null) | |||
{ | |||
$string_temp = tempnam(sys_get_temp_dir(), ''); | |||
$this->save($string_temp, $image_type, $quality); | |||
$string = file_get_contents($string_temp); | |||
unlink($string_temp); | |||
return $string; | |||
} | |||
/** | |||
* Convert the image to string with the current settings | |||
* | |||
@@ -448,7 +369,6 @@ class ImageResize | |||
{ | |||
return $this->getImageAsString(); | |||
} | |||
/** | |||
* Outputs image to browser | |||
* @param string $image_type | |||
@@ -457,12 +377,9 @@ class ImageResize | |||
public function output($image_type = null, $quality = null) | |||
{ | |||
$image_type = $image_type ?: $this->source_type; | |||
header('Content-Type: '.image_type_to_mime_type($image_type)); | |||
$this->save(null, $image_type, $quality); | |||
} | |||
/** | |||
* Resizes image according to the given short side (short side proportional) | |||
* | |||
@@ -475,18 +392,14 @@ class ImageResize | |||
if ($this->getSourceHeight() < $this->getSourceWidth()) { | |||
$ratio = $max_short / $this->getSourceHeight(); | |||
$long = (int) ($this->getSourceWidth() * $ratio); | |||
$this->resize($long, $max_short, $allow_enlarge); | |||
} else { | |||
$ratio = $max_short / $this->getSourceWidth(); | |||
$long = (int) ($this->getSourceHeight() * $ratio); | |||
$this->resize($max_short, $long, $allow_enlarge); | |||
} | |||
return $this; | |||
} | |||
/** | |||
* Resizes image according to the given long side (short side proportional) | |||
* | |||
@@ -499,18 +412,14 @@ class ImageResize | |||
if ($this->getSourceHeight() > $this->getSourceWidth()) { | |||
$ratio = $max_long / $this->getSourceHeight(); | |||
$short = (int) ($this->getSourceWidth() * $ratio); | |||
$this->resize($short, $max_long, $allow_enlarge); | |||
} else { | |||
$ratio = $max_long / $this->getSourceWidth(); | |||
$short = (int) ($this->getSourceHeight() * $ratio); | |||
$this->resize($max_long, $short, $allow_enlarge); | |||
} | |||
return $this; | |||
} | |||
/** | |||
* Resizes image according to the given height (width proportional) | |||
* | |||
@@ -522,12 +431,9 @@ class ImageResize | |||
{ | |||
$ratio = $height / $this->getSourceHeight(); | |||
$width = (int) ($this->getSourceWidth() * $ratio); | |||
$this->resize($width, $height, $allow_enlarge); | |||
return $this; | |||
} | |||
/** | |||
* Resizes image according to the given width (height proportional) | |||
* | |||
@@ -539,12 +445,9 @@ class ImageResize | |||
{ | |||
$ratio = $width / $this->getSourceWidth(); | |||
$height = (int) ($this->getSourceHeight() * $ratio); | |||
$this->resize($width, $height, $allow_enlarge); | |||
return $this; | |||
} | |||
/** | |||
* Resizes image to best fit inside the given dimensions | |||
* | |||
@@ -558,19 +461,15 @@ class ImageResize | |||
if ($this->getSourceWidth() <= $max_width && $this->getSourceHeight() <= $max_height && $allow_enlarge === false) { | |||
return $this; | |||
} | |||
$ratio = $this->getSourceHeight() / $this->getSourceWidth(); | |||
$width = $max_width; | |||
$height = (int) ($width * $ratio); | |||
if ($height > $max_height) { | |||
$height = $max_height; | |||
$width = (int) ($height / $ratio); | |||
} | |||
return $this->resize($width, $height, $allow_enlarge); | |||
} | |||
/** | |||
* Resizes image according to given scale (proportionally) | |||
* | |||
@@ -581,12 +480,9 @@ class ImageResize | |||
{ | |||
$width = (int) ($this->getSourceWidth() * $scale / 100); | |||
$height = (int) ($this->getSourceHeight() * $scale / 100); | |||
$this->resize($width, $height, true); | |||
return $this; | |||
} | |||
/** | |||
* Resizes image according to the given width and height | |||
* | |||
@@ -601,25 +497,19 @@ class ImageResize | |||
// if the user hasn't explicitly allowed enlarging, | |||
// but either of the dimensions are larger then the original, | |||
// then just use original dimensions - this logic may need rethinking | |||
if ($width > $this->getSourceWidth() || $height > $this->getSourceHeight()) { | |||
$width = $this->getSourceWidth(); | |||
$height = $this->getSourceHeight(); | |||
} | |||
} | |||
$this->source_x = 0; | |||
$this->source_y = 0; | |||
$this->dest_w = $width; | |||
$this->dest_h = $height; | |||
$this->source_w = $this->getSourceWidth(); | |||
$this->source_h = $this->getSourceHeight(); | |||
return $this; | |||
} | |||
/** | |||
* Crops image according to the given width, height and crop position | |||
* | |||
@@ -635,42 +525,30 @@ class ImageResize | |||
// this logic is slightly different to resize(), | |||
// it will only reset dimensions to the original | |||
// if that particular dimenstion is larger | |||
if ($width > $this->getSourceWidth()) { | |||
$width = $this->getSourceWidth(); | |||
} | |||
if ($height > $this->getSourceHeight()) { | |||
$height = $this->getSourceHeight(); | |||
} | |||
} | |||
$ratio_source = $this->getSourceWidth() / $this->getSourceHeight(); | |||
$ratio_dest = $width / $height; | |||
if ($ratio_dest < $ratio_source) { | |||
$this->resizeToHeight($height, $allow_enlarge); | |||
$excess_width = (int) (($this->getDestWidth() - $width) * $this->getSourceWidth() / $this->getDestWidth()); | |||
$this->source_w = $this->getSourceWidth() - $excess_width; | |||
$this->source_x = $this->getCropPosition($excess_width, $position); | |||
$this->dest_w = $width; | |||
} else { | |||
$this->resizeToWidth($width, $allow_enlarge); | |||
$excess_height = (int) (($this->getDestHeight() - $height) * $this->getSourceHeight() / $this->getDestHeight()); | |||
$this->source_h = $this->getSourceHeight() - $excess_height; | |||
$this->source_y = $this->getCropPosition($excess_height, $position); | |||
$this->dest_h = $height; | |||
} | |||
return $this; | |||
} | |||
/** | |||
* Crops image according to the given width, height, x and y | |||
* | |||
@@ -692,19 +570,15 @@ class ImageResize | |||
} else { | |||
$this->source_w = $width; | |||
} | |||
if ($height > $this->getSourceHeight() - $y) { | |||
$this->source_h = $this->getSourceHeight() - $y; | |||
} else { | |||
$this->source_h = $height; | |||
} | |||
$this->dest_w = $width; | |||
$this->dest_h = $height; | |||
return $this; | |||
} | |||
/** | |||
* Gets source width | |||
* | |||
@@ -714,7 +588,6 @@ class ImageResize | |||
{ | |||
return $this->original_w; | |||
} | |||
/** | |||
* Gets source height | |||
* | |||
@@ -724,7 +597,6 @@ class ImageResize | |||
{ | |||
return $this->original_h; | |||
} | |||
/** | |||
* Gets width of the destination image | |||
* | |||
@@ -734,7 +606,6 @@ class ImageResize | |||
{ | |||
return $this->dest_w; | |||
} | |||
/** | |||
* Gets height of the destination image | |||
* @return integer | |||
@@ -743,7 +614,6 @@ class ImageResize | |||
{ | |||
return $this->dest_h; | |||
} | |||
/** | |||
* Gets crop position (X or Y) according to the given position | |||
* | |||
@@ -769,7 +639,6 @@ class ImageResize | |||
} | |||
return (int) $size; | |||
} | |||
/** | |||
* Enable or not the gamma color correction on the image, enabled by default | |||
* | |||
@@ -779,7 +648,6 @@ class ImageResize | |||
public function gamma($enable = false) | |||
{ | |||
$this->gamma_correct = $enable; | |||
return $this; | |||
} | |||
} |
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
class Condition | |||
{ | |||
/** | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
class ConditionNotAllowedException extends \Exception | |||
{ | |||
public function __construct($message = "Condition not allowed exception", $code = 0, \Throwable $previous = null) | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
class FileNotFoundException extends \Exception | |||
{ | |||
public function __construct($message = "File not found exception", $code = 0, \Throwable $previous = null) | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
class InvalidJsonException extends \Exception | |||
{ | |||
public function __construct($message = "Invalid JSON format", $code = 0, \Throwable $previous = null) | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
class InvalidNodeException extends \Exception | |||
{ | |||
public function __construct($message = "Invalid JSON node exception", $code = 0, \Throwable $previous = null) | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
class NullValueException extends \Exception | |||
{ | |||
public function __construct($message = "Null value exception", $code = 0, \Throwable $previous = null) | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
require_once(dirname(__FILE__)."/Exceptions/ConditionNotAllowedException.php"); | |||
require_once(dirname(__FILE__)."/Exceptions/FileNotFoundException.php"); | |||
require_once(dirname(__FILE__)."/Exceptions/InvalidJsonException.php"); | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
require_once(dirname(__FILE__)."/Exceptions/ConditionNotAllowedException.php"); | |||
require_once(dirname(__FILE__)."/Exceptions/FileNotFoundException.php"); | |||
require_once(dirname(__FILE__)."/Exceptions/InvalidJsonException.php"); | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* This class represents a query result where a given | |||
* value was queried but did not exist. | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* SMTP邮件操作类 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* Mobile Detect Library | |||
* Motto: "Every business should have a mobile detection script to detect mobile readers" | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 提示窗口对话框类 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* Unicode编码词典的php分词器 | |||
* | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
require_once(DEDEINC."/libraries/agent.class.php"); | |||
/** | |||
* 轻量级流量统计 | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 会员登录 | |||
* | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 支付宝App支付网关 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 支付宝电子面单下载 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 支付宝刷卡支付 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 支付宝扫码支付 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 支付宝标准接口 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
use WeChat\Exceptions\InvalidArgumentException; | |||
/** | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 手机WAP网站支付支持 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace AliPay; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicAliPay; | |||
/** | |||
* 支付宝网站支付 | |||
@@ -1,5 +1,5 @@ | |||
<?php | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\DataArray; | |||
use WeChat\Exceptions\InvalidInstanceException; | |||
/** | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Contracts\BasicWeChat; | |||
/** | |||
* 卡券管理 | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Exceptions\InvalidArgumentException; | |||
use WeChat\Exceptions\InvalidResponseException; | |||
/** | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Exceptions\InvalidArgumentException; | |||
use WeChat\Exceptions\InvalidDecryptException; | |||
use WeChat\Exceptions\InvalidResponseException; | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Exceptions\InvalidArgumentException; | |||
use WeChat\Exceptions\InvalidResponseException; | |||
/** | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use WeChat\Exceptions\InvalidArgumentException; | |||
use WeChat\Exceptions\InvalidResponseException; | |||
/** | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 企业微信基础类 | |||
* Class BasicWeWork | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
use ArrayAccess; | |||
/** | |||
* Class DataArray | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 错误消息处理 | |||
* Class DataError | |||
@@ -1,6 +1,6 @@ | |||
<?php | |||
namespace WeChat\Contracts; | |||
if (!defined('DEDEINC')) exit('dedebiz'); | |||
if (!defined('DEDEINC')) exit ('dedebiz'); | |||
/** | |||
* 自定义CURL文件类 | |||
* Class MyCurlFile | |||