[更新]同步framework代码

This commit is contained in:
Anyon 2019-06-15 12:14:43 +08:00
parent 05b337d6bb
commit 266755253e
7 changed files with 29 additions and 31 deletions

View File

@ -1,6 +1,7 @@
{ {
"type": "project", "type": "project",
"name": "zoujingli/thinkadmin", "name": "zoujingli/thinkadmin",
"license": "MIT",
"authors": [ "authors": [
{ {
"name": "Anyon", "name": "Anyon",

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit8221d9d28aec2b292a3f5c4c16a2acdf class ComposerAutoloaderInitbe3e9ba0155bdb933f2ae90b5ee37778
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit8221d9d28aec2b292a3f5c4c16a2acdf
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit8221d9d28aec2b292a3f5c4c16a2acdf', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInitbe3e9ba0155bdb933f2ae90b5ee37778', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit8221d9d28aec2b292a3f5c4c16a2acdf', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitbe3e9ba0155bdb933f2ae90b5ee37778', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8221d9d28aec2b292a3f5c4c16a2acdf::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInitbe3e9ba0155bdb933f2ae90b5ee37778::getInitializer($loader));
} else { } else {
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInit8221d9d28aec2b292a3f5c4c16a2acdf
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit8221d9d28aec2b292a3f5c4c16a2acdf::$files; $includeFiles = Composer\Autoload\ComposerStaticInitbe3e9ba0155bdb933f2ae90b5ee37778::$files;
} else { } else {
$includeFiles = require __DIR__ . '/autoload_files.php'; $includeFiles = require __DIR__ . '/autoload_files.php';
} }
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire8221d9d28aec2b292a3f5c4c16a2acdf($fileIdentifier, $file); composerRequirebe3e9ba0155bdb933f2ae90b5ee37778($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequire8221d9d28aec2b292a3f5c4c16a2acdf($fileIdentifier, $file) function composerRequirebe3e9ba0155bdb933f2ae90b5ee37778($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file; require $file;

View File

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

View File

@ -499,12 +499,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "e0532657e7408ffb76806b421d34e9833e414ea1" "reference": "d4366fa9d4f48400391f9983c9771494c75aba95"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/e0532657e7408ffb76806b421d34e9833e414ea1", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/d4366fa9d4f48400391f9983c9771494c75aba95",
"reference": "e0532657e7408ffb76806b421d34e9833e414ea1", "reference": "d4366fa9d4f48400391f9983c9771494c75aba95",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -523,7 +523,7 @@
"qiniu/php-sdk": "^7.2", "qiniu/php-sdk": "^7.2",
"topthink/framework": "5.1.*" "topthink/framework": "5.1.*"
}, },
"time": "2019-06-13T02:34:10+00:00", "time": "2019-06-15T04:07:28+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {

View File

@ -1,7 +1,4 @@
[![Latest Stable Version](https://poser.pugx.org/zoujingli/think-library/v/stable)](https://packagist.org/packages/zoujingli/think-library) [![Latest Stable Version](https://poser.pugx.org/zoujingli/think-library/v/stable)](https://packagist.org/packages/zoujingli/think-library) [![Total Downloads](https://poser.pugx.org/zoujingli/think-library/downloads)](https://packagist.org/packages/zoujingli/think-library) [![Latest Unstable Version](https://poser.pugx.org/zoujingli/think-library/v/unstable)](https://packagist.org/packages/zoujingli/think-library) [![License](https://poser.pugx.org/zoujingli/think-library/license)](https://packagist.org/packages/zoujingli/think-library)
[![Latest Unstable Version](https://poser.pugx.org/zoujingli/think-library/v/unstable)](https://packagist.org/packages/zoujingli/think-library)
[![Total Downloads](https://poser.pugx.org/zoujingli/think-library/downloads)](https://packagist.org/packages/zoujingli/think-library)
[![License](https://poser.pugx.org/zoujingli/think-library/license)](https://packagist.org/packages/zoujingli/think-library)
# ThinkLibrary for ThinkPHP5.1 # ThinkLibrary for ThinkPHP5.1
ThinkLibrary 是针对 ThinkPHP5.1 版本封装的一套工具类库,方便快速构建 WEB 应用。 ThinkLibrary 是针对 ThinkPHP5.1 版本封装的一套工具类库,方便快速构建 WEB 应用。

View File

@ -154,22 +154,22 @@ class Data
/** /**
* 获取随机字符串编码 * 获取随机字符串编码
* @param integer $length * @param integer $length 字符串长度
* @param integer $type * @param integer $type 字符串类型(1纯数字,2纯字母,3数字字母)
* @return string * @return string
*/ */
public static function randomCode($length = 10, $type = 1) public static function randomCode($length = 10, $type = 1)
{ {
list($nchars, $schars) = [join('', range(0, 9)), join('', range('a', 'z'))]; $numbs = '0123456789';
if (intval($type) === 1) list($strs, $chars) = [range(1, 9), $nchars]; $chars = 'abcdefghijklmnopqrstuvwxyz';
if (intval($type) === 2) list($strs, $chars) = ['', $schars]; if (intval($type) === 1) $chars = $numbs;
if (intval($type) === 3) list($strs, $chars) = ['', $nchars . $schars]; if (intval($type) === 2) $chars = "a{$chars}";
if (isset($strs) && isset($chars)) { if (intval($type) === 3) $chars = "{$numbs}{$chars}";
while (strlen($strs) < $length) $strs .= $chars[rand(0, strlen($chars) - 1)]; $string = $chars[rand(1, strlen($chars) - 1)];
return $strs; if (isset($chars)) while (strlen($string) < $length) {
} else { $string .= $chars[rand(0, strlen($chars) - 1)];
return self::uniqidNumberCode();
} }
return $string;
} }
/** /**