[更新]ComposerUpdate

This commit is contained in:
Anyon 2019-04-10 09:43:29 +08:00
parent 53c4565cda
commit 51ac97b5c6
7 changed files with 59 additions and 26 deletions

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3::getLoader();
return ComposerAutoloaderInit465606aa1bf7d5d08b4f37af5e5eec56::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3
class ComposerAutoloaderInit465606aa1bf7d5d08b4f37af5e5eec56
{
private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit465606aa1bf7d5d08b4f37af5e5eec56', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit465606aa1bf7d5d08b4f37af5e5eec56', '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';
call_user_func(\Composer\Autoload\ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit465606aa1bf7d5d08b4f37af5e5eec56::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit465606aa1bf7d5d08b4f37af5e5eec56::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiref894ac9a65650ea774d251c7a7b441d3($fileIdentifier, $file);
composerRequire465606aa1bf7d5d08b4f37af5e5eec56($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequiref894ac9a65650ea774d251c7a7b441d3($fileIdentifier, $file)
function composerRequire465606aa1bf7d5d08b4f37af5e5eec56($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3
class ComposerStaticInit465606aa1bf7d5d08b4f37af5e5eec56
{
public static $files = array (
'841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
@ -346,9 +346,9 @@ class ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitf894ac9a65650ea774d251c7a7b441d3::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit465606aa1bf7d5d08b4f37af5e5eec56::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit465606aa1bf7d5d08b4f37af5e5eec56::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit465606aa1bf7d5d08b4f37af5e5eec56::$classMap;
}, null, ClassLoader::class);
}

View File

@ -499,12 +499,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "4814e484ac22b33a86f4614cc9f1b34ba383546f"
"reference": "e7269e7e70e885390d659dccd43437c3acc02b02"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/4814e484ac22b33a86f4614cc9f1b34ba383546f",
"reference": "4814e484ac22b33a86f4614cc9f1b34ba383546f",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/e7269e7e70e885390d659dccd43437c3acc02b02",
"reference": "e7269e7e70e885390d659dccd43437c3acc02b02",
"shasum": "",
"mirrors": [
{
@ -523,7 +523,7 @@
"qiniu/php-sdk": "^7.2",
"topthink/framework": "5.1.*"
},
"time": "2019-04-04T04:53:18+00:00",
"time": "2019-04-09T11:46:35+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {

View File

@ -38,7 +38,7 @@ class Data
$db = is_string($dbQuery) ? Db::name($dbQuery) : $dbQuery;
list($table, $value) = [$db->getTable(), isset($data[$key]) ? $data[$key] : null];
$map = isset($where[$key]) ? [] : (is_string($value) ? [[$key, 'in', explode(',', $value)]] : [$key => $value]);
if (Db::table($table)->where($where)->where($map)->count() > 0) {
if (Db::table($table)->master()->where($where)->where($map)->count() > 0) {
return Db::table($table)->strict(false)->where($where)->where($map)->update($data) !== false;
}
return Db::table($table)->strict(false)->insert($data) !== false;
@ -138,4 +138,17 @@ class Data
while (strlen($string) < $length) $string .= rand(0, 9);
return $string;
}
/**
* 文件大小显示转换
* @param integer $size
* @param integer $dec
* @return string
*/
public static function toFileSize($size, $dec = 2)
{
list($pos, $map) = [0, ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']];
while ($size >= 1024 && $pos < 6) if (++$pos) $size /= 1024;
return round($size, $dec) . ' ' . $map[$pos];
}
}

View File

@ -40,15 +40,15 @@ class Express
/**
* 查询物流信息
* @param string $express_code 快递公司编辑
* @param string $express_no 快递物流编号
* @param string $expressCode 快递公司编辑
* @param string $expressNo 快递物流编号
* @return array
*/
public static function query($express_code, $express_no)
public static function query($expressCode, $expressNo)
{
list($microtime, $client_ip) = [microtime(true), request()->ip()];
$header = ['Host' => 'www.kuaidi100.com', 'CLIENT-IP' => $client_ip, 'X-FORWARDED-FOR' => $client_ip];
$location = "http://www.kuaidi100.com/query?type={$express_code}&postid={$express_no}&phone=&temp={$microtime}";
list($microtime, $clientIp) = [microtime(true), request()->ip()];
$header = ['Host' => 'www.kuaidi100.com', 'CLIENT-IP' => $clientIp, 'X-FORWARDED-FOR' => $clientIp];
$location = "http://www.kuaidi100.com/query?type={$expressCode}&postid={$expressNo}&phone=&temp={$microtime}";
return json_decode(Http::get($location, [], ['header' => $header, 'timeout' => 30]), true);
}

View File

@ -137,12 +137,32 @@ class Node
*/
public static function scanDir($dir, $data = [], $ext = 'php')
{
foreach (scandir($dir) as $_dir) if (strpos($_dir, '.') !== 0) {
$path = realpath($dir . DIRECTORY_SEPARATOR . $_dir);
foreach (scandir($dir) as $curr) if (strpos($curr, '.') !== 0) {
$path = realpath($dir . DIRECTORY_SEPARATOR . $curr);
if (is_dir($path)) $data = array_merge($data, self::scanDir($path));
elseif (pathinfo($path, 4) === $ext) $data[] = $path;
elseif (pathinfo($path, PATHINFO_EXTENSION) === $ext) $data[] = $path;
}
return $data;
}
/**
* 递归统计目录大小
* @param string $path 目录
* @return integer
*/
public static function totalDirSize($path)
{
list($total, $path) = [0, realpath($path)];
if (!file_exists($path)) return $total;
if (!is_dir($path)) return filesize($path);
if ($handle = opendir($path)) {
while ($file = readdir($handle)) if (!in_array($file, ['.', '..'])) {
$temp = $path . DIRECTORY_SEPARATOR . $file;
$total += (is_dir($temp) ? self::totalDirSize($temp) : filesize($temp));
}
if (is_resource($handle)) closedir($handle);
}
return $total;
}
}