From 51ac97b5c6bf67037b8fecde86947063f6d3875d Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 10 Apr 2019 09:43:29 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]ComposerUpdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +++++----- vendor/composer/autoload_static.php | 8 +++--- vendor/composer/installed.json | 8 +++--- .../think-library/src/tools/Data.php | 15 ++++++++++- .../think-library/src/tools/Express.php | 12 ++++----- .../think-library/src/tools/Node.php | 26 ++++++++++++++++--- 7 files changed, 59 insertions(+), 26 deletions(-) diff --git a/vendor/autoload.php b/vendor/autoload.php index 3e0002637..bd6d08955 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf894ac9a65650ea774d251c7a7b441d3::getLoader(); +return ComposerAutoloaderInit465606aa1bf7d5d08b4f37af5e5eec56::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ab525a516..19f8e7b59 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -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; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 90480613d..8576bf4f2 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -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); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 5ea0be730..e30c25f3a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -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": { diff --git a/vendor/zoujingli/think-library/src/tools/Data.php b/vendor/zoujingli/think-library/src/tools/Data.php index f0bc1ee2d..c31462b1c 100644 --- a/vendor/zoujingli/think-library/src/tools/Data.php +++ b/vendor/zoujingli/think-library/src/tools/Data.php @@ -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]; + } } \ No newline at end of file diff --git a/vendor/zoujingli/think-library/src/tools/Express.php b/vendor/zoujingli/think-library/src/tools/Express.php index 21cf25402..d07bd9fcf 100644 --- a/vendor/zoujingli/think-library/src/tools/Express.php +++ b/vendor/zoujingli/think-library/src/tools/Express.php @@ -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); } diff --git a/vendor/zoujingli/think-library/src/tools/Node.php b/vendor/zoujingli/think-library/src/tools/Node.php index 668e88ecc..23c3f7c29 100644 --- a/vendor/zoujingli/think-library/src/tools/Node.php +++ b/vendor/zoujingli/think-library/src/tools/Node.php @@ -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; + } + } \ No newline at end of file