diff --git a/build.cmd b/build.cmd deleted file mode 100644 index 6cb030a27..000000000 --- a/build.cmd +++ /dev/null @@ -1,13 +0,0 @@ -:: Composer 安装更新脚本 -@echo off -title Composer Plugs Install And Optimize -echo. -echo ========= 1. 清理已安装插件 ========= -rmdir /s/q vendor thinkphp runtime -echo. -echo ========= 2. 下载并安装插件 ========= -composer update --profile --prefer-dist --optimize-autoloader -echo. -echo ========= 3. 压缩并发布插件 ========= -composer dump-autoload --optimize -exit \ No newline at end of file diff --git a/composer.json b/composer.json index 6204f57f5..77b5ef4b7 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "topthink/think-captcha": "^1.0", "topthink/think-mongo": "^1.1", "topthink/think-queue": "^1.0", - "endroid/qrcode": "^1.9", + "endroid/qr-code": "^1.9", "aliyuncs/oss-sdk-php": "^2.2" }, "extra": { diff --git a/thinkphp/README.md b/thinkphp/README.md index 68e5e69dd..f01fd2b96 100644 --- a/thinkphp/README.md +++ b/thinkphp/README.md @@ -92,7 +92,7 @@ www WEB閮ㄧ讲鐩綍锛堟垨鑰呭瓙鐩綍锛 ## 鍛藉悕瑙勮寖 -ThinkPHP5鐨勫懡鍚嶈鑼冮伒寰狿SR-2瑙勮寖浠ュ強PSR-4鑷姩鍔犺浇瑙勮寖銆 +ThinkPHP5鐨勫懡鍚嶈鑼冮伒寰猔PSR-2`瑙勮寖浠ュ強`PSR-4`鑷姩鍔犺浇瑙勮寖銆 ## 鍙備笌寮鍙 娉ㄥ唽骞剁櫥褰 Github 甯愬彿锛 fork 鏈」鐩苟杩涜鏀瑰姩銆 diff --git a/thinkphp/base.php b/thinkphp/base.php index f88935d09..92c4fa557 100644 --- a/thinkphp/base.php +++ b/thinkphp/base.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -define('THINK_VERSION', '5.0.15'); +define('THINK_VERSION', '5.0.24'); define('THINK_START_TIME', microtime(true)); define('THINK_START_MEM', memory_get_usage()); define('EXT', '.php'); diff --git a/thinkphp/convention.php b/thinkphp/convention.php index 4ca03c06e..31a0a0c11 100644 --- a/thinkphp/convention.php +++ b/thinkphp/convention.php @@ -116,6 +116,8 @@ return [ // +---------------------------------------------------------------------- 'template' => [ + // 榛樿妯℃澘娓叉煋瑙勫垯 1 瑙f瀽涓哄皬鍐+涓嬪垝绾 2 鍏ㄩ儴杞崲灏忓啓 + 'auto_rule' => 1, // 妯℃澘寮曟搸绫诲瀷 鏀寔 php think 鏀寔鎵╁睍 'type' => 'Think', // 瑙嗗浘鍩虹鐩綍锛岄厤缃洰褰曚负鎵鏈夋ā鍧楃殑瑙嗗浘璧峰鐩綍 @@ -286,4 +288,11 @@ return [ 'list_rows' => 15, ], + //鎺у埗鍙伴厤缃 + 'console' => [ + 'name' => 'Think Console', + 'version' => '0.1', + 'user' => null, + ], + ]; diff --git a/thinkphp/lang/zh-cn.php b/thinkphp/lang/zh-cn.php index 0c2732f59..eb7a9142a 100644 --- a/thinkphp/lang/zh-cn.php +++ b/thinkphp/lang/zh-cn.php @@ -48,6 +48,7 @@ return [ 'KVDB init error' => '娌℃湁鍒濆鍖朘VDB锛岃鍦⊿AE绠$悊骞冲彴鍒濆鍖朘VDB鏈嶅姟', 'fields not exists' => '鏁版嵁琛ㄥ瓧娈典笉瀛樺湪', 'where express error' => '鏌ヨ琛ㄨ揪寮忛敊璇', + 'not support data' => '涓嶆敮鎸佺殑鏁版嵁琛ㄨ揪寮', 'no data to update' => '娌℃湁浠讳綍鏁版嵁闇瑕佹洿鏂', 'miss data to insert' => '缂哄皯闇瑕佸啓鍏ョ殑鏁版嵁', 'miss complex primary data' => '缂哄皯澶嶅悎涓婚敭鏁版嵁', @@ -66,6 +67,7 @@ return [ 'relation data not exists' => '鍏宠仈鏁版嵁涓嶅瓨鍦', 'relation not support' => '鍏宠仈涓嶆敮鎸', 'chunk not support order' => 'Chunk涓嶆敮鎸佽皟鐢╫rder鏂规硶', + 'closure not support cache(true)' => '浣跨敤闂寘鏌ヨ涓嶆敮鎸乧ache(true)锛岃鎸囧畾缂撳瓨Key', // 涓婁紶閿欒淇℃伅 'unknown upload error' => '鏈煡涓婁紶閿欒锛', diff --git a/thinkphp/library/think/App.php b/thinkphp/library/think/App.php index d34c04cb4..f572b907c 100644 --- a/thinkphp/library/think/App.php +++ b/thinkphp/library/think/App.php @@ -551,11 +551,20 @@ class App // 鑾峰彇鎺у埗鍣ㄥ悕 $controller = strip_tags($result[1] ?: $config['default_controller']); + + if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) { + throw new HttpException(404, 'controller not exists:' . $controller); + } + $controller = $convert ? strtolower($controller) : $controller; // 鑾峰彇鎿嶄綔鍚 $actionName = strip_tags($result[2] ?: $config['default_action']); - $actionName = $convert ? strtolower($actionName) : $actionName; + if (!empty($config['action_convert'])) { + $actionName = Loader::parseName($actionName, 1); + } else { + $actionName = $convert ? strtolower($actionName) : $actionName; + } // 璁剧疆褰撳墠璇锋眰鐨勬帶鍒跺櫒銆佹搷浣 $request->controller(Loader::parseName($controller, 1))->action($actionName); @@ -581,6 +590,13 @@ class App if (is_callable([$instance, $action])) { // 鎵ц鎿嶄綔鏂规硶 $call = [$instance, $action]; + // 涓ユ牸鑾峰彇褰撳墠鎿嶄綔鏂规硶鍚 + $reflect = new \ReflectionMethod($instance, $action); + $methodName = $reflect->getName(); + $suffix = $config['action_suffix']; + $actionName = $suffix ? substr($methodName, 0, -strlen($suffix)) : $methodName; + $request->action($actionName); + } elseif (is_callable([$instance, '_empty'])) { // 绌烘搷浣 $call = [$instance, '_empty']; diff --git a/thinkphp/library/think/Collection.php b/thinkphp/library/think/Collection.php index 8e132b1bf..f872476f9 100644 --- a/thinkphp/library/think/Collection.php +++ b/thinkphp/library/think/Collection.php @@ -99,6 +99,16 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria return new static(array_keys($this->items)); } + /** + * 杩斿洖鏁扮粍涓墍鏈夌殑鍊肩粍鎴愮殑鏂 Collection 瀹炰緥 + * @access public + * @return static + */ + public function values() + { + return new static(array_values($this->items)); + } + /** * 鍚堝苟鏁扮粍骞惰繑鍥炰竴涓柊鐨 Collection 瀹炰緥 * @access public @@ -273,7 +283,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria $result = []; foreach ($this->items as $row) { - $key = $value = null; + $key = $value = null; $keySet = $valueSet = false; if (null !== $indexKey && array_key_exists($indexKey, $row)) { @@ -309,7 +319,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria */ public function sort(callable $callback = null) { - $items = $this->items; + $items = $this->items; $callback = $callback ?: function ($a, $b) { return $a == $b ? 0 : (($a < $b) ? -1 : 1); }; diff --git a/thinkphp/library/think/Console.php b/thinkphp/library/think/Console.php index 2ccde8838..32b257259 100644 --- a/thinkphp/library/think/Console.php +++ b/thinkphp/library/think/Console.php @@ -79,14 +79,19 @@ class Console /** * Console constructor. * @access public - * @param string $name 鍚嶇О - * @param string $version 鐗堟湰 + * @param string $name 鍚嶇О + * @param string $version 鐗堟湰 + * @param null|string $user 鎵ц鐢ㄦ埛 */ - public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') + public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN', $user = null) { $this->name = $name; $this->version = $version; + if ($user) { + $this->setUser($user); + } + $this->defaultCommand = 'list'; $this->definition = $this->getDefaultInputDefinition(); @@ -95,6 +100,19 @@ class Console } } + /** + * 璁剧疆鎵ц鐢ㄦ埛 + * @param $user + */ + public function setUser($user) + { + $user = posix_getpwnam($user); + if ($user) { + posix_setuid($user['uid']); + posix_setgid($user['gid']); + } + } + /** * 鍒濆鍖 Console * @access public @@ -106,8 +124,9 @@ class Console static $console; if (!$console) { + $config = Config::get('console'); // 瀹炰緥鍖 console - $console = new self('Think Console', '0.1'); + $console = new self($config['name'], $config['version'], $config['user']); // 璇诲彇鎸囦护闆 if (is_file(CONF_PATH . 'command' . EXT)) { @@ -479,7 +498,7 @@ class Console }, $namespace); $allNamespaces = $this->getNamespaces(); - $namespaces = preg_grep('{^' . $expr . '}', $allNamespaces); + $namespaces = preg_grep('{^' . $expr . '}', $allNamespaces); if (empty($namespaces)) { $message = sprintf( @@ -527,7 +546,7 @@ class Console }, $name); $allCommands = array_keys($this->commands); - $commands = preg_grep('{^' . $expr . '}', $allCommands); + $commands = preg_grep('{^' . $expr . '}', $allCommands); if (empty($commands) || count(preg_grep('{^' . $expr . '$}', $commands)) < 1) { if (false !== ($pos = strrpos($name, ':'))) { @@ -550,7 +569,7 @@ class Console if (count($commands) > 1) { $commandList = $this->commands; - $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) { + $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) { $commandName = $commandList[$nameOrAlias]->getName(); return $commandName === $nameOrAlias || !in_array($commandName, $commands); @@ -601,7 +620,7 @@ class Console $abbrevs = []; foreach ($names as $name) { for ($len = strlen($name); $len > 0; --$len) { - $abbrev = substr($name, 0, $len); + $abbrev = substr($name, 0, $len); $abbrevs[$abbrev][] = $name; } } @@ -754,8 +773,8 @@ class Console */ private function findAlternatives($name, $collection) { - $threshold = 1e3; - $alternatives = []; + $threshold = 1e3; + $alternatives = []; $collectionParts = []; foreach ($collection as $item) { diff --git a/thinkphp/library/think/Controller.php b/thinkphp/library/think/Controller.php index e446e58df..77225b735 100644 --- a/thinkphp/library/think/Controller.php +++ b/thinkphp/library/think/Controller.php @@ -52,7 +52,7 @@ class Controller */ public function __construct(Request $request = null) { - $this->view = View::instance(Config::get('template'), Config::get('view_replace_str')); + $this->view = View::instance(Config::get('template'), Config::get('view_replace_str')); $this->request = is_null($request) ? Request::instance() : $request; // 鎺у埗鍣ㄥ垵濮嬪寲 @@ -202,9 +202,15 @@ class Controller } // 鎵归噺楠岃瘉 - if ($batch || $this->batchValidate) $v->batch(true); + if ($batch || $this->batchValidate) { + $v->batch(true); + } + // 璁剧疆閿欒淇℃伅 - if (is_array($message)) $v->message($message); + if (is_array($message)) { + $v->message($message); + } + // 浣跨敤鍥炶皟楠岃瘉 if ($callback && is_callable($callback)) { call_user_func_array($callback, [$v, &$data]); diff --git a/thinkphp/library/think/Loader.php b/thinkphp/library/think/Loader.php index e4130bdbf..d813a5d7b 100644 --- a/thinkphp/library/think/Loader.php +++ b/thinkphp/library/think/Loader.php @@ -23,7 +23,7 @@ class Loader /** * @var array 绫诲悕鏄犲皠 */ - protected static $map = []; + protected static $classMap = []; /** * @var array 鍛藉悕绌洪棿鍒悕 @@ -56,9 +56,9 @@ class Loader private static $fallbackDirsPsr0 = []; /** - * @var array 鑷姩鍔犺浇鐨勬枃浠 + * @var array 闇瑕佸姞杞界殑鏂囦欢 */ - private static $autoloadFiles = []; + private static $files = []; /** * 鑷姩鍔犺浇 @@ -99,8 +99,8 @@ class Loader private static function findFile($class) { // 绫诲簱鏄犲皠 - if (!empty(self::$map[$class])) { - return self::$map[$class]; + if (!empty(self::$classMap[$class])) { + return self::$classMap[$class]; } // 鏌ユ壘 PSR-4 @@ -156,7 +156,7 @@ class Loader } // 鎵句笉鍒板垯璁剧疆鏄犲皠涓 false 骞惰繑鍥 - return self::$map[$class] = false; + return self::$classMap[$class] = false; } /** @@ -169,9 +169,9 @@ class Loader public static function addClassMap($class, $map = '') { if (is_array($class)) { - self::$map = array_merge(self::$map, $class); + self::$classMap = array_merge(self::$classMap, $class); } else { - self::$map[$class] = $map; + self::$classMap[$class] = $map; } } @@ -284,6 +284,24 @@ class Loader // 娉ㄥ唽绯荤粺鑷姩鍔犺浇 spl_autoload_register($autoload ?: 'think\\Loader::autoload', true, true); + // Composer 鑷姩鍔犺浇鏀寔 + if (is_dir(VENDOR_PATH . 'composer')) { + if (PHP_VERSION_ID >= 50600 && is_file(VENDOR_PATH . 'composer' . DS . 'autoload_static.php')) { + require VENDOR_PATH . 'composer' . DS . 'autoload_static.php'; + + $declaredClass = get_declared_classes(); + $composerClass = array_pop($declaredClass); + + foreach (['prefixLengthsPsr4', 'prefixDirsPsr4', 'fallbackDirsPsr4', 'prefixesPsr0', 'fallbackDirsPsr0', 'classMap', 'files'] as $attr) { + if (property_exists($composerClass, $attr)) { + self::${$attr} = $composerClass::${$attr}; + } + } + } else { + self::registerComposerLoader(); + } + } + // 娉ㄥ唽鍛藉悕绌洪棿瀹氫箟 self::addNamespace([ 'think' => LIB_PATH . 'think' . DS, @@ -296,10 +314,7 @@ class Loader self::addClassMap(__include_file(RUNTIME_PATH . 'classmap' . EXT)); } - // Composer 鑷姩鍔犺浇鏀寔 - if (is_dir(VENDOR_PATH . 'composer')) { - self::registerComposerLoader(); - } + self::loadComposerAutoloadFiles(); // 鑷姩鍔犺浇 extend 鐩綍 self::$fallbackDirsPsr4[] = rtrim(EXTEND_PATH, DS); @@ -331,16 +346,21 @@ class Loader if ($classMap) { self::addClassMap($classMap); } - } if (is_file(VENDOR_PATH . 'composer/autoload_files.php')) { - $includeFiles = require VENDOR_PATH . 'composer/autoload_files.php'; - foreach ($includeFiles as $fileIdentifier => $file) { - if (empty(self::$autoloadFiles[$fileIdentifier])) { - __require_file($file); - self::$autoloadFiles[$fileIdentifier] = true; - } + self::$files = require VENDOR_PATH . 'composer/autoload_files.php'; + } + } + + // 鍔犺浇composer autofile鏂囦欢 + public static function loadComposerAutoloadFiles() + { + foreach (self::$files as $fileIdentifier => $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + __require_file($file); + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; } } } diff --git a/thinkphp/library/think/Log.php b/thinkphp/library/think/Log.php index bf6c04f3a..c064306c0 100644 --- a/thinkphp/library/think/Log.php +++ b/thinkphp/library/think/Log.php @@ -176,7 +176,7 @@ class Log } } - if ($result = self::$driver->save($log)) { + if ($result = self::$driver->save($log, true)) { self::$log = []; } @@ -211,7 +211,7 @@ class Log is_null(self::$driver) && self::init(Config::get('log')); // 鍐欏叆鏃ュ織 - if ($result = self::$driver->save($log)) { + if ($result = self::$driver->save($log, false)) { self::$log = []; } diff --git a/thinkphp/library/think/Model.php b/thinkphp/library/think/Model.php index a42eafaf2..2dc27b48a 100644 --- a/thinkphp/library/think/Model.php +++ b/thinkphp/library/think/Model.php @@ -94,6 +94,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess protected $type = []; // 鏄惁涓烘洿鏂版暟鎹 protected $isUpdate = false; + // 鏄惁浣跨敤Replace + protected $replace = false; // 鏄惁寮哄埗鏇存柊鎵鏈夋暟鎹 protected $force = false; // 鏇存柊鏉′欢 @@ -116,6 +118,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess */ protected static $initialized = []; + /** + * 鏄惁浠庝富搴撹鍙栵紙涓讳粠鍒嗗竷寮忔湁鏁堬級 + * @var array + */ + protected static $readMaster; + /** * 鏋勯犳柟娉 * @access public @@ -171,6 +179,20 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $this->initialize(); } + /** + * 鏄惁浠庝富搴撹鍙栨暟鎹紙涓讳粠鍒嗗竷鏈夋晥锛 + * @access public + * @param bool $all 鏄惁鎵鏈夋ā鍨嬬敓鏁 + * @return $this + */ + public function readMaster($all = false) + { + $model = $all ? '*' : $this->class; + + static::$readMaster[$model] = true; + return $this; + } + /** * 鍒涘缓妯″瀷鐨勬煡璇㈠璞 * @access protected @@ -194,6 +216,10 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $queryClass = $this->query ?: $con->getConfig('query'); $query = new $queryClass($con, $this); + if (isset(static::$readMaster['*']) || isset(static::$readMaster[$this->class])) { + $query->master(true); + } + // 璁剧疆褰撳墠鏁版嵁琛ㄥ拰妯″瀷鍚 if (!empty($this->table)) { $query->setTable($this->table); @@ -679,7 +705,11 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $value = empty($value) ? new \stdClass() : json_decode($value); break; case 'serialize': - $value = unserialize($value); + try { + $value = unserialize($value); + } catch (\Exception $e) { + $value = null; + } break; default: if (false !== strpos($type, '\\')) { @@ -985,6 +1015,18 @@ abstract class Model implements \JsonSerializable, \ArrayAccess return false; } + /** + * 鏂板鏁版嵁鏄惁浣跨敤Replace + * @access public + * @param bool $replace + * @return $this + */ + public function replace($replace = true) + { + $this->replace = $replace; + return $this; + } + /** * 淇濆瓨褰撳墠鏁版嵁瀵硅薄 * @access public @@ -1000,19 +1042,21 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $data = []; } + // 鏁版嵁鑷姩楠岃瘉 if (!empty($data)) { - // 鏁版嵁鑷姩楠岃瘉 if (!$this->validateData($data)) { return false; } + // 鏁版嵁瀵硅薄璧嬪 foreach ($data as $key => $value) { $this->setAttr($key, $value, $data); } - if (!empty($where)) { - $this->isUpdate = true; - $this->updateWhere = $where; - } + } + + if (!empty($where)) { + $this->isUpdate = true; + $this->updateWhere = $where; } // 鑷姩鍏宠仈鍐欏叆 @@ -1135,9 +1179,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess // 妫娴嬪瓧娈 $allowFields = $this->checkAllowField(array_merge($this->auto, $this->insert)); if (!empty($allowFields)) { - $result = $this->getQuery()->strict(false)->field($allowFields)->insert($this->data, false, false, $sequence); + $result = $this->getQuery()->strict(false)->field($allowFields)->insert($this->data, $this->replace, false, $sequence); } else { - $result = $this->getQuery()->insert($this->data, false, false, $sequence); + $result = $this->getQuery()->insert($this->data, $this->replace, false, $sequence); } // 鑾峰彇鑷姩澧為暱涓婚敭 diff --git a/thinkphp/library/think/Paginator.php b/thinkphp/library/think/Paginator.php index 0b42de03b..365556784 100644 --- a/thinkphp/library/think/Paginator.php +++ b/thinkphp/library/think/Paginator.php @@ -128,7 +128,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J } $url = $path; if (!empty($parameters)) { - $url .= '?' . urldecode(http_build_query($parameters, null, '&')); + $url .= '?' . http_build_query($parameters, null, '&'); } return $url . $this->buildFragment(); } @@ -395,7 +395,15 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J public function __call($name, $arguments) { - return call_user_func_array([$this->getCollection(), $name], $arguments); + $collection = $this->getCollection(); + + $result = call_user_func_array([$collection, $name], $arguments); + + if ($result === $collection) { + return $this; + } + + return $result; } } diff --git a/thinkphp/library/think/Request.php b/thinkphp/library/think/Request.php index 4a40d22c2..5997a763a 100644 --- a/thinkphp/library/think/Request.php +++ b/thinkphp/library/think/Request.php @@ -121,6 +121,11 @@ class Request protected $cache; // 缂撳瓨鏄惁妫鏌 protected $isCheckCache; + /** + * 鏄惁鍚堝苟Param + * @var bool + */ + protected $mergeParam = false; /** * 鏋勯犲嚱鏁 @@ -155,8 +160,8 @@ class Request /** * Hook 鏂规硶娉ㄥ叆 * @access public - * @param string|array $method 鏂规硶鍚 - * @param mixed $callback callable + * @param string|array $method 鏂规硶鍚 + * @param mixed $callback callable * @return void */ public static function hook($method, $callback = null) @@ -182,16 +187,28 @@ class Request return self::$instance; } + /** + * 閿姣佸綋鍓嶈姹傚璞 + * @access public + * @return void + */ + public static function destroy() + { + if (!is_null(self::$instance)) { + self::$instance = null; + } + } + /** * 鍒涘缓涓涓猆RL璇锋眰 * @access public - * @param string $uri URL鍦板潃 - * @param string $method 璇锋眰绫诲瀷 - * @param array $params 璇锋眰鍙傛暟 - * @param array $cookie - * @param array $files - * @param array $server - * @param string $content + * @param string $uri URL鍦板潃 + * @param string $method 璇锋眰绫诲瀷 + * @param array $params 璇锋眰鍙傛暟 + * @param array $cookie + * @param array $files + * @param array $server + * @param string $content * @return \think\Request */ public static function create($uri, $method = 'GET', $params = [], $cookie = [], $files = [], $server = [], $content = null) @@ -232,7 +249,7 @@ class Request parse_str(html_entity_decode($info['query']), $query); if (!empty($params)) { $params = array_replace($query, $params); - $queryString = http_build_query($query, '', '&'); + $queryString = http_build_query($params, '', '&'); } else { $params = $query; $queryString = $info['query']; @@ -479,8 +496,8 @@ class Request /** * 璁剧疆璧勬簮绫诲瀷 * @access public - * @param string|array $type 璧勬簮绫诲瀷鍚 - * @param string $val 璧勬簮绫诲瀷 + * @param string|array $type 璧勬簮绫诲瀷鍚 + * @param string $val 璧勬簮绫诲瀷 * @return void */ public function mimeType($type, $val = '') @@ -495,22 +512,28 @@ class Request /** * 褰撳墠鐨勮姹傜被鍨 * @access public - * @param bool $method true 鑾峰彇鍘熷璇锋眰绫诲瀷 + * @param bool $method true 鑾峰彇鍘熷璇锋眰绫诲瀷 * @return string */ public function method($method = false) { if (true === $method) { // 鑾峰彇鍘熷璇锋眰绫诲瀷 - return IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']); + return $this->server('REQUEST_METHOD') ?: 'GET'; } elseif (!$this->method) { if (isset($_POST[Config::get('var_method')])) { - $this->method = strtoupper($_POST[Config::get('var_method')]); - $this->{$this->method}($_POST); + $method = strtoupper($_POST[Config::get('var_method')]); + if (in_array($method, ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'])) { + $this->method = $method; + $this->{$this->method}($_POST); + } else { + $this->method = 'POST'; + } + unset($_POST[Config::get('var_method')]); } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { $this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); } else { - $this->method = IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']); + $this->method = $this->server('REQUEST_METHOD') ?: 'GET'; } } return $this->method; @@ -609,14 +632,14 @@ class Request /** * 鑾峰彇褰撳墠璇锋眰鐨勫弬鏁 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function param($name = '', $default = null, $filter = '') { - if (empty($this->param)) { + if (empty($this->mergeParam)) { $method = $this->method(true); // 鑷姩鑾峰彇璇锋眰鍙橀噺 switch ($method) { @@ -632,7 +655,8 @@ class Request $vars = []; } // 褰撳墠璇锋眰鍙傛暟鍜孶RL鍦板潃涓殑鍙傛暟鍚堝苟 - $this->param = array_merge($this->get(false), $vars, $this->route(false)); + $this->param = array_merge($this->param, $this->get(false), $vars, $this->route(false)); + $this->mergeParam = true; } if (true === $name) { // 鑾峰彇鍖呭惈鏂囦欢涓婁紶淇℃伅鐨勬暟缁 @@ -646,15 +670,16 @@ class Request /** * 璁剧疆鑾峰彇璺敱鍙傛暟 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function route($name = '', $default = null, $filter = '') { if (is_array($name)) { $this->param = []; + $this->mergeParam = false; return $this->route = array_merge($this->route, $name); } return $this->input($this->route, $name, $default, $filter); @@ -663,9 +688,9 @@ class Request /** * 璁剧疆鑾峰彇GET鍙傛暟 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function get($name = '', $default = null, $filter = '') @@ -675,6 +700,7 @@ class Request } if (is_array($name)) { $this->param = []; + $this->mergeParam = false; return $this->get = array_merge($this->get, $name); } return $this->input($this->get, $name, $default, $filter); @@ -683,9 +709,9 @@ class Request /** * 璁剧疆鑾峰彇POST鍙傛暟 * @access public - * @param string $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function post($name = '', $default = null, $filter = '') @@ -700,6 +726,7 @@ class Request } if (is_array($name)) { $this->param = []; + $this->mergeParam = false; return $this->post = array_merge($this->post, $name); } return $this->input($this->post, $name, $default, $filter); @@ -708,9 +735,9 @@ class Request /** * 璁剧疆鑾峰彇PUT鍙傛暟 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function put($name = '', $default = null, $filter = '') @@ -725,6 +752,7 @@ class Request } if (is_array($name)) { $this->param = []; + $this->mergeParam = false; return $this->put = is_null($this->put) ? $name : array_merge($this->put, $name); } @@ -734,9 +762,9 @@ class Request /** * 璁剧疆鑾峰彇DELETE鍙傛暟 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function delete($name = '', $default = null, $filter = '') @@ -747,9 +775,9 @@ class Request /** * 璁剧疆鑾峰彇PATCH鍙傛暟 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鍙橀噺鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function patch($name = '', $default = null, $filter = '') @@ -759,9 +787,9 @@ class Request /** * 鑾峰彇request鍙橀噺 - * @param string $name 鏁版嵁鍚嶇О - * @param string $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string $name 鏁版嵁鍚嶇О + * @param string $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function request($name = '', $default = null, $filter = '') @@ -771,6 +799,7 @@ class Request } if (is_array($name)) { $this->param = []; + $this->mergeParam = false; return $this->request = array_merge($this->request, $name); } return $this->input($this->request, $name, $default, $filter); @@ -779,9 +808,9 @@ class Request /** * 鑾峰彇session鏁版嵁 * @access public - * @param string|array $name 鏁版嵁鍚嶇О - * @param string $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鏁版嵁鍚嶇О + * @param string $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function session($name = '', $default = null, $filter = '') @@ -798,9 +827,9 @@ class Request /** * 鑾峰彇cookie鍙傛暟 * @access public - * @param string|array $name 鏁版嵁鍚嶇О - * @param string $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鏁版嵁鍚嶇О + * @param string $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function cookie($name = '', $default = null, $filter = '') @@ -831,9 +860,9 @@ class Request /** * 鑾峰彇server鍙傛暟 * @access public - * @param string|array $name 鏁版嵁鍚嶇О - * @param string $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鏁版嵁鍚嶇О + * @param string $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function server($name = '', $default = null, $filter = '') @@ -909,9 +938,9 @@ class Request /** * 鑾峰彇鐜鍙橀噺 - * @param string|array $name 鏁版嵁鍚嶇О - * @param string $default 榛樿鍊 - * @param string|array $filter 杩囨护鏂规硶 + * @param string|array $name 鏁版嵁鍚嶇О + * @param string $default 榛樿鍊 + * @param string|array $filter 杩囨护鏂规硶 * @return mixed */ public function env($name = '', $default = null, $filter = '') @@ -928,8 +957,8 @@ class Request /** * 璁剧疆鎴栬呰幏鍙栧綋鍓嶇殑Header * @access public - * @param string|array $name header鍚嶇О - * @param string $default 榛樿鍊 + * @param string|array $name header鍚嶇О + * @param string $default 榛樿鍊 * @return string */ public function header($name = '', $default = null) @@ -967,10 +996,10 @@ class Request /** * 鑾峰彇鍙橀噺 鏀寔杩囨护鍜岄粯璁ゅ - * @param array $data 鏁版嵁婧 - * @param string|false $name 瀛楁鍚 - * @param mixed $default 榛樿鍊 - * @param string|array $filter 杩囨护鍑芥暟 + * @param array $data 鏁版嵁婧 + * @param string|false $name 瀛楁鍚 + * @param mixed $default 榛樿鍊 + * @param string|array $filter 杩囨护鍑芥暟 * @return mixed */ public function input($data = [], $name = '', $default = null, $filter = '') @@ -1051,9 +1080,9 @@ class Request /** * 閫掑綊杩囨护缁欏畾鐨勫 - * @param mixed $value 閿 - * @param mixed $key 閿悕 - * @param array $filters 杩囨护鏂规硶+榛樿鍊 + * @param mixed $value 閿 + * @param mixed $key 閿悕 + * @param array $filters 杩囨护鏂规硶+榛樿鍊 * @return mixed */ private function filterValue(&$value, $key, $filters) @@ -1093,7 +1122,7 @@ class Request public function filterExp(&$value) { // 杩囨护鏌ヨ鐗规畩瀛楃 - if (is_string($value) && preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT LIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i', $value)) { + if (is_string($value) && preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT LIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOT EXISTS|NOTEXISTS|EXISTS|NOT NULL|NOTNULL|NULL|BETWEEN TIME|NOT BETWEEN TIME|NOTBETWEEN TIME|NOTIN|NOT IN|IN)$/i', $value)) { $value .= ' '; } // TODO 鍏朵粬瀹夊叏杩囨护 @@ -1138,9 +1167,9 @@ class Request /** * 鏄惁瀛樺湪鏌愪釜璇锋眰鍙傛暟 * @access public - * @param string $name 鍙橀噺鍚 - * @param string $type 鍙橀噺绫诲瀷 - * @param bool $checkEmpty 鏄惁妫娴嬬┖鍊 + * @param string $name 鍙橀噺鍚 + * @param string $type 鍙橀噺绫诲瀷 + * @param bool $checkEmpty 鏄惁妫娴嬬┖鍊 * @return mixed */ public function has($name, $type = 'param', $checkEmpty = false) @@ -1164,8 +1193,8 @@ class Request /** * 鑾峰彇鎸囧畾鐨勫弬鏁 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param string $type 鍙橀噺绫诲瀷 + * @param string|array $name 鍙橀噺鍚 + * @param string $type 鍙橀噺绫诲瀷 * @return mixed */ public function only($name, $type = 'param') @@ -1186,8 +1215,8 @@ class Request /** * 鎺掗櫎鎸囧畾鍙傛暟鑾峰彇 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param string $type 鍙橀噺绫诲瀷 + * @param string|array $name 鍙橀噺鍚 + * @param string $type 鍙橀噺绫诲瀷 * @return mixed */ public function except($name, $type = 'param') @@ -1229,7 +1258,7 @@ class Request /** * 褰撳墠鏄惁Ajax璇锋眰 * @access public - * @param bool $ajax true 鑾峰彇鍘熷ajax璇锋眰 + * @param bool $ajax true 鑾峰彇鍘熷ajax璇锋眰 * @return bool */ public function isAjax($ajax = false) @@ -1239,14 +1268,16 @@ class Request if (true === $ajax) { return $result; } else { - return $this->param(Config::get('var_ajax')) ? true : $result; + $result = $this->param(Config::get('var_ajax')) ? true : $result; + $this->mergeParam = false; + return $result; } } /** * 褰撳墠鏄惁Pjax璇锋眰 * @access public - * @param bool $pjax true 鑾峰彇鍘熷pjax璇锋眰 + * @param bool $pjax true 鑾峰彇鍘熷pjax璇锋眰 * @return bool */ public function isPjax($pjax = false) @@ -1255,14 +1286,16 @@ class Request if (true === $pjax) { return $result; } else { - return $this->param(Config::get('var_pjax')) ? true : $result; + $result = $this->param(Config::get('var_pjax')) ? true : $result; + $this->mergeParam = false; + return $result; } } /** * 鑾峰彇瀹㈡埛绔疘P鍦板潃 - * @param integer $type 杩斿洖绫诲瀷 0 杩斿洖IP鍦板潃 1 杩斿洖IPV4鍦板潃鏁板瓧 - * @param boolean $adv 鏄惁杩涜楂樼骇妯″紡鑾峰彇锛堟湁鍙兘琚吉瑁咃級 + * @param integer $type 杩斿洖绫诲瀷 0 杩斿洖IP鍦板潃 1 杩斿洖IPV4鍦板潃鏁板瓧 + * @param boolean $adv 鏄惁杩涜楂樼骇妯″紡鑾峰彇锛堟湁鍙兘琚吉瑁咃級 * @return mixed */ public function ip($type = 0, $adv = true) @@ -1273,7 +1306,11 @@ class Request return $ip[$type]; } - if ($adv) { + $httpAgentIp = Config::get('http_agent_ip'); + + if ($httpAgentIp && isset($_SERVER[$httpAgentIp])) { + $ip = $_SERVER[$httpAgentIp]; + } elseif ($adv) { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $pos = array_search('unknown', $arr); @@ -1338,14 +1375,18 @@ class Request /** * 褰撳墠璇锋眰鐨刪ost * @access public + * @param bool $strict true 浠呬粎鑾峰彇HOST * @return string */ - public function host() + public function host($strict = false) { if (isset($_SERVER['HTTP_X_REAL_HOST'])) { - return $_SERVER['HTTP_X_REAL_HOST']; + $host = $_SERVER['HTTP_X_REAL_HOST']; + } else { + $host = $this->server('HTTP_HOST'); } - return $this->server('HTTP_HOST'); + + return true === $strict && strpos($host, ':') ? strstr($host, ':', true) : $host; } /** @@ -1415,7 +1456,7 @@ class Request /** * 璁剧疆鎴栬呰幏鍙栧綋鍓嶈姹傜殑璋冨害淇℃伅 * @access public - * @param array $dispatch 璋冨害淇℃伅 + * @param array $dispatch 璋冨害淇℃伅 * @return array */ public function dispatch($dispatch = null) @@ -1466,11 +1507,12 @@ class Request */ public function action($action = null) { - if (!is_null($action)) { + if (!is_null($action) && !is_bool($action)) { $this->action = $action; return $this; } else { - return $this->action ?: ''; + $name = $this->action ?: ''; + return true === $action ? $name : strtolower($name); } } @@ -1534,7 +1576,7 @@ class Request /** * 璁剧疆褰撳墠鍦板潃鐨勮姹傜紦瀛 * @access public - * @param string $key 缂撳瓨鏍囪瘑锛屾敮鎸佸彉閲忚鍒 锛屼緥濡 item/:name/:id + * @param string $key 缂撳瓨鏍囪瘑锛屾敮鎸佸彉閲忚鍒 锛屼緥濡 item/:name/:id * @param mixed $expire 缂撳瓨鏈夋晥鏈 * @param array $except 缂撳瓨鎺掗櫎 * @param string $tag 缂撳瓨鏍囩 @@ -1619,7 +1661,7 @@ class Request * 璁剧疆褰撳墠璇锋眰缁戝畾鐨勫璞″疄渚 * @access public * @param string|array $name 缁戝畾鐨勫璞℃爣璇 - * @param mixed $obj 缁戝畾鐨勫璞″疄渚 + * @param mixed $obj 缁戝畾鐨勫璞″疄渚 * @return mixed */ public function bind($name, $obj = null) diff --git a/thinkphp/library/think/Response.php b/thinkphp/library/think/Response.php index f14bbcfde..c5c152093 100644 --- a/thinkphp/library/think/Response.php +++ b/thinkphp/library/think/Response.php @@ -69,9 +69,7 @@ class Response */ public static function create($data = '', $type = '', $code = 200, array $header = [], $options = []) { - $type = empty($type) ? 'null' : strtolower($type); - - $class = false !== strpos($type, '\\') ? $type : '\\think\\response\\' . ucfirst($type); + $class = false !== strpos($type, '\\') ? $type : '\\think\\response\\' . ucfirst(strtolower($type)); if (class_exists($class)) { $response = new $class($data, $code, $header, $options); } else { diff --git a/thinkphp/library/think/Route.php b/thinkphp/library/think/Route.php index 2dbd61dd4..ab53aa200 100644 --- a/thinkphp/library/think/Route.php +++ b/thinkphp/library/think/Route.php @@ -68,8 +68,8 @@ class Route /** * 娉ㄥ唽鍙橀噺瑙勫垯 * @access public - * @param string|array $name 鍙橀噺鍚 - * @param string $rule 鍙橀噺瑙勫垯 + * @param string|array $name 鍙橀噺鍚 + * @param string $rule 鍙橀噺瑙勫垯 * @return void */ public static function pattern($name = null, $rule = '') @@ -84,10 +84,10 @@ class Route /** * 娉ㄥ唽瀛愬煙鍚嶉儴缃茶鍒 * @access public - * @param string|array $domain 瀛愬煙鍚 - * @param mixed $rule 璺敱瑙勫垯 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $domain 瀛愬煙鍚 + * @param mixed $rule 璺敱瑙勫垯 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function domain($domain, $rule = '', $option = [], $pattern = []) @@ -121,8 +121,8 @@ class Route /** * 璁剧疆璺敱缁戝畾 * @access public - * @param mixed $bind 缁戝畾淇℃伅 - * @param string $type 缁戝畾绫诲瀷 榛樿涓簃odule 鏀寔 namespace class controller + * @param mixed $bind 缁戝畾淇℃伅 + * @param string $type 缁戝畾绫诲瀷 榛樿涓簃odule 鏀寔 namespace class controller * @return mixed */ public static function bind($bind, $type = 'module') @@ -133,8 +133,8 @@ class Route /** * 璁剧疆鎴栬呰幏鍙栬矾鐢辨爣璇 * @access public - * @param string|array $name 璺敱鍛藉悕鏍囪瘑 鏁扮粍琛ㄧず鎵归噺璁剧疆 - * @param array $value 璺敱鍦板潃鍙婂彉閲忎俊鎭 + * @param string|array $name 璺敱鍛藉悕鏍囪瘑 鏁扮粍琛ㄧず鎵归噺璁剧疆 + * @param array $value 璺敱鍦板潃鍙婂彉閲忎俊鎭 * @return array */ public static function name($name = '', $value = null) @@ -154,7 +154,7 @@ class Route /** * 璇诲彇璺敱缁戝畾 * @access public - * @param string $type 缁戝畾绫诲瀷 + * @param string $type 缁戝畾绫诲瀷 * @return mixed */ public static function getBind($type) @@ -165,8 +165,8 @@ class Route /** * 瀵煎叆閰嶇疆鏂囦欢鐨勮矾鐢辫鍒 * @access public - * @param array $rule 璺敱瑙勫垯 - * @param string $type 璇锋眰绫诲瀷 + * @param array $rule 璺敱瑙勫垯 + * @param string $type 璇锋眰绫诲瀷 * @return void */ public static function import(array $rule, $type = '*') @@ -222,11 +222,11 @@ class Route /** * 娉ㄥ唽璺敱瑙勫垯 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param string $type 璇锋眰绫诲瀷 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param string $type 璇锋眰绫诲瀷 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function rule($rule, $route = '', $type = '*', $option = [], $pattern = []) @@ -270,12 +270,12 @@ class Route /** * 璁剧疆璺敱瑙勫垯 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param string $type 璇锋眰绫诲瀷 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 - * @param string $group 鎵灞炲垎缁 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param string $type 璇锋眰绫诲瀷 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 + * @param string $group 鎵灞炲垎缁 * @return void */ protected static function setRule($rule, $route, $type = '*', $option = [], $pattern = [], $group = '') @@ -348,7 +348,7 @@ class Route /** * 璁剧疆褰撳墠鎵ц鐨勫弬鏁颁俊鎭 * @access public - * @param array $options 鍙傛暟淇℃伅 + * @param array $options 鍙傛暟淇℃伅 * @return mixed */ protected static function setOption($options = []) @@ -369,7 +369,7 @@ class Route /** * 鑾峰彇褰撳墠鐨勫垎缁勪俊鎭 * @access public - * @param string $type 鍒嗙粍淇℃伅鍚嶇О name option pattern + * @param string $type 鍒嗙粍淇℃伅鍚嶇О name option pattern * @return mixed */ public static function getGroup($type) @@ -384,9 +384,9 @@ class Route /** * 璁剧疆褰撳墠鐨勮矾鐢卞垎缁 * @access public - * @param string $name 鍒嗙粍鍚嶇О - * @param array $option 鍒嗙粍璺敱鍙傛暟 - * @param array $pattern 鍒嗙粍鍙橀噺瑙勫垯 + * @param string $name 鍒嗙粍鍚嶇О + * @param array $option 鍒嗙粍璺敱鍙傛暟 + * @param array $pattern 鍒嗙粍鍙橀噺瑙勫垯 * @return void */ public static function setGroup($name, $option = [], $pattern = []) @@ -399,10 +399,10 @@ class Route /** * 娉ㄥ唽璺敱鍒嗙粍 * @access public - * @param string|array $name 鍒嗙粍鍚嶇О鎴栬呭弬鏁 - * @param array|\Closure $routes 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $name 鍒嗙粍鍚嶇О鎴栬呭弬鏁 + * @param array|\Closure $routes 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function group($name, $routes, $option = [], $pattern = []) @@ -487,10 +487,10 @@ class Route /** * 娉ㄥ唽璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function any($rule, $route = '', $option = [], $pattern = []) @@ -501,10 +501,10 @@ class Route /** * 娉ㄥ唽GET璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function get($rule, $route = '', $option = [], $pattern = []) @@ -515,10 +515,10 @@ class Route /** * 娉ㄥ唽POST璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function post($rule, $route = '', $option = [], $pattern = []) @@ -529,10 +529,10 @@ class Route /** * 娉ㄥ唽PUT璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function put($rule, $route = '', $option = [], $pattern = []) @@ -543,10 +543,10 @@ class Route /** * 娉ㄥ唽DELETE璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function delete($rule, $route = '', $option = [], $pattern = []) @@ -557,10 +557,10 @@ class Route /** * 娉ㄥ唽PATCH璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function patch($rule, $route = '', $option = [], $pattern = []) @@ -571,10 +571,10 @@ class Route /** * 娉ㄥ唽璧勬簮璺敱 * @access public - * @param string|array $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string|array $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function resource($rule, $route = '', $option = [], $pattern = []) @@ -618,10 +618,10 @@ class Route /** * 娉ㄥ唽鎺у埗鍣ㄨ矾鐢 鎿嶄綔鏂规硶瀵瑰簲涓嶅悓鐨勮姹傚悗缂 * @access public - * @param string $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $pattern 鍙橀噺瑙勫垯 * @return void */ public static function controller($rule, $route = '', $option = [], $pattern = []) @@ -634,9 +634,9 @@ class Route /** * 娉ㄥ唽鍒悕璺敱 * @access public - * @param string|array $rule 璺敱鍒悕 - * @param string $route 璺敱鍦板潃 - * @param array $option 璺敱鍙傛暟 + * @param string|array $rule 璺敱鍒悕 + * @param string $route 璺敱鍦板潃 + * @param array $option 璺敱鍙傛暟 * @return void */ public static function alias($rule = null, $route = '', $option = []) @@ -651,8 +651,8 @@ class Route /** * 璁剧疆涓嶅悓璇锋眰绫诲瀷涓嬮潰鐨勬柟娉曞墠缂 * @access public - * @param string $method 璇锋眰绫诲瀷 - * @param string $prefix 绫诲瀷鍓嶇紑 + * @param string $method 璇锋眰绫诲瀷 + * @param string $prefix 绫诲瀷鍓嶇紑 * @return void */ public static function setMethodPrefix($method, $prefix = '') @@ -667,8 +667,8 @@ class Route /** * rest鏂规硶瀹氫箟鍜屼慨鏀 * @access public - * @param string|array $name 鏂规硶鍚嶇О - * @param array|bool $resource 璧勬簮 + * @param string|array $name 鏂规硶鍚嶇О + * @param array|bool $resource 璧勬簮 * @return void */ public static function rest($name, $resource = []) @@ -683,9 +683,9 @@ class Route /** * 娉ㄥ唽鏈尮閰嶈矾鐢辫鍒欏悗鐨勫鐞 * @access public - * @param string $route 璺敱鍦板潃 - * @param string $method 璇锋眰绫诲瀷 - * @param array $option 璺敱鍙傛暟 + * @param string $route 璺敱鍦板潃 + * @param string $method 璇锋眰绫诲瀷 + * @param array $option 璺敱鍙傛暟 * @return void */ public static function miss($route, $method = '*', $option = []) @@ -696,7 +696,7 @@ class Route /** * 娉ㄥ唽涓涓嚜鍔ㄨВ鏋愮殑URL璺敱 * @access public - * @param string $route 璺敱鍦板潃 + * @param string $route 璺敱鍦板潃 * @return void */ public static function auto($route) @@ -726,9 +726,9 @@ class Route /** * 妫娴嬪瓙鍩熷悕閮ㄧ讲 * @access public - * @param Request $request Request璇锋眰瀵硅薄 - * @param array $currentRules 褰撳墠璺敱瑙勫垯 - * @param string $method 璇锋眰绫诲瀷 + * @param Request $request Request璇锋眰瀵硅薄 + * @param array $currentRules 褰撳墠璺敱瑙勫垯 + * @param string $method 璇锋眰绫诲瀷 * @return void */ public static function checkDomain($request, &$currentRules, $method = 'get') @@ -737,7 +737,7 @@ class Route $rules = self::$rules['domain']; // 寮鍚瓙鍩熷悕閮ㄧ讲 鏀寔浜岀骇鍜屼笁绾у煙鍚 if (!empty($rules)) { - $host = $request->host(); + $host = $request->host(true); if (isset($rules[$host])) { // 瀹屾暣鍩熷悕鎴栬匢P閰嶇疆 $item = $rules[$host]; @@ -827,14 +827,23 @@ class Route /** * 妫娴婾RL璺敱 * @access public - * @param Request $request Request璇锋眰瀵硅薄 - * @param string $url URL鍦板潃 - * @param string $depr URL鍒嗛殧绗 - * @param bool $checkDomain 鏄惁妫娴嬪煙鍚嶈鍒 + * @param Request $request Request璇锋眰瀵硅薄 + * @param string $url URL鍦板潃 + * @param string $depr URL鍒嗛殧绗 + * @param bool $checkDomain 鏄惁妫娴嬪煙鍚嶈鍒 * @return false|array */ public static function check($request, $url, $depr = '/', $checkDomain = false) { + //妫鏌ヨВ鏋愮紦瀛 + if (!App::$debug && Config::get('route_check_cache')) { + $key = self::getCheckCacheKey($request); + if (Cache::has($key)) { + list($rule, $route, $pathinfo, $option, $matches) = Cache::get($key); + return self::parseRule($rule, $route, $pathinfo, $option, $matches, true); + } + } + // 鍒嗛殧绗︽浛鎹 纭繚璺敱瀹氫箟浣跨敤缁熶竴鐨勫垎闅旂 $url = str_replace($depr, '|', $url); @@ -888,12 +897,12 @@ class Route /** * 妫娴嬭矾鐢辫鍒 * @access private - * @param Request $request - * @param array $rules 璺敱瑙勫垯 - * @param string $url URL鍦板潃 - * @param string $depr URL鍒嗗壊绗 - * @param string $group 璺敱鍒嗙粍鍚 - * @param array $options 璺敱鍙傛暟锛堝垎缁勶級 + * @param Request $request + * @param array $rules 璺敱瑙勫垯 + * @param string $url URL鍦板潃 + * @param string $depr URL鍒嗗壊绗 + * @param string $group 璺敱鍒嗙粍鍚 + * @param array $options 璺敱鍙傛暟锛堝垎缁勶級 * @return mixed */ private static function checkRoute($request, $rules, $url, $depr = '/', $group = '', $options = []) @@ -971,9 +980,9 @@ class Route /** * 妫娴嬭矾鐢卞埆鍚 * @access private - * @param Request $request - * @param string $url URL鍦板潃 - * @param string $depr URL鍒嗛殧绗 + * @param Request $request + * @param string $url URL鍦板潃 + * @param string $depr URL鍒嗛殧绗 * @return mixed */ private static function checkRouteAlias($request, $url, $depr) @@ -1018,9 +1027,9 @@ class Route /** * 妫娴婾RL缁戝畾 * @access private - * @param string $url URL鍦板潃 - * @param array $rules 璺敱瑙勫垯 - * @param string $depr URL鍒嗛殧绗 + * @param string $url URL鍦板潃 + * @param array $rules 璺敱瑙勫垯 + * @param string $depr URL鍒嗛殧绗 * @return mixed */ private static function checkUrlBind(&$url, &$rules, $depr = '/') @@ -1049,9 +1058,9 @@ class Route /** * 缁戝畾鍒扮被 * @access public - * @param string $url URL鍦板潃 - * @param string $class 绫诲悕锛堝甫鍛藉悕绌洪棿锛 - * @param string $depr URL鍒嗛殧绗 + * @param string $url URL鍦板潃 + * @param string $class 绫诲悕锛堝甫鍛藉悕绌洪棿锛 + * @param string $depr URL鍒嗛殧绗 * @return array */ public static function bindToClass($url, $class, $depr = '/') @@ -1068,9 +1077,9 @@ class Route /** * 缁戝畾鍒板懡鍚嶇┖闂 * @access public - * @param string $url URL鍦板潃 - * @param string $namespace 鍛藉悕绌洪棿 - * @param string $depr URL鍒嗛殧绗 + * @param string $url URL鍦板潃 + * @param string $namespace 鍛藉悕绌洪棿 + * @param string $depr URL鍒嗛殧绗 * @return array */ public static function bindToNamespace($url, $namespace, $depr = '/') @@ -1088,9 +1097,9 @@ class Route /** * 缁戝畾鍒版帶鍒跺櫒绫 * @access public - * @param string $url URL鍦板潃 - * @param string $controller 鎺у埗鍣ㄥ悕 锛堟敮鎸佸甫妯″潡鍚 index/user 锛 - * @param string $depr URL鍒嗛殧绗 + * @param string $url URL鍦板潃 + * @param string $controller 鎺у埗鍣ㄥ悕 锛堟敮鎸佸甫妯″潡鍚 index/user 锛 + * @param string $depr URL鍒嗛殧绗 * @return array */ public static function bindToController($url, $controller, $depr = '/') @@ -1107,9 +1116,9 @@ class Route /** * 缁戝畾鍒版ā鍧/鎺у埗鍣 * @access public - * @param string $url URL鍦板潃 - * @param string $controller 鎺у埗鍣ㄧ被鍚嶏紙甯﹀懡鍚嶇┖闂达級 - * @param string $depr URL鍒嗛殧绗 + * @param string $url URL鍦板潃 + * @param string $controller 鎺у埗鍣ㄧ被鍚嶏紙甯﹀懡鍚嶇┖闂达級 + * @param string $depr URL鍒嗛殧绗 * @return array */ public static function bindToModule($url, $controller, $depr = '/') @@ -1126,8 +1135,8 @@ class Route /** * 璺敱鍙傛暟鏈夋晥鎬ф鏌 * @access private - * @param array $option 璺敱鍙傛暟 - * @param Request $request Request瀵硅薄 + * @param array $option 璺敱鍙傛暟 + * @param Request $request Request瀵硅薄 * @return bool */ private static function checkOption($option, $request) @@ -1153,12 +1162,12 @@ class Route /** * 妫娴嬭矾鐢辫鍒 * @access private - * @param string $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param string $url URL鍦板潃 - * @param array $pattern 鍙橀噺瑙勫垯 - * @param array $option 璺敱鍙傛暟 - * @param string $depr URL鍒嗛殧绗︼紙鍏ㄥ眬锛 + * @param string $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param string $url URL鍦板潃 + * @param array $pattern 鍙橀噺瑙勫垯 + * @param array $option 璺敱鍙傛暟 + * @param string $depr URL鍒嗛殧绗︼紙鍏ㄥ眬锛 * @return array|false */ private static function checkRule($rule, $route, $url, $pattern, $option, $depr) @@ -1200,9 +1209,9 @@ class Route /** * 瑙f瀽妯″潡鐨刄RL鍦板潃 [妯″潡/鎺у埗鍣/鎿嶄綔?]鍙傛暟1=鍊1&鍙傛暟2=鍊2... * @access public - * @param string $url URL鍦板潃 - * @param string $depr URL鍒嗛殧绗 - * @param bool $autoSearch 鏄惁鑷姩娣卞害鎼滅储鎺у埗鍣 + * @param string $url URL鍦板潃 + * @param string $depr URL鍒嗛殧绗 + * @param bool $autoSearch 鏄惁鑷姩娣卞害鎼滅储鎺у埗鍣 * @return array */ public static function parseUrl($url, $depr = '/', $autoSearch = false) @@ -1269,7 +1278,7 @@ class Route /** * 瑙f瀽URL鐨刾athinfo鍙傛暟鍜屽彉閲 * @access private - * @param string $url URL鍦板潃 + * @param string $url URL鍦板潃 * @return array */ private static function parseUrlPath($url) @@ -1295,9 +1304,9 @@ class Route /** * 妫娴婾RL鍜岃鍒欒矾鐢辨槸鍚﹀尮閰 * @access private - * @param string $url URL鍦板潃 - * @param string $rule 璺敱瑙勫垯 - * @param array $pattern 鍙橀噺瑙勫垯 + * @param string $url URL鍦板潃 + * @param string $rule 璺敱瑙勫垯 + * @param array $pattern 鍙橀噺瑙勫垯 * @return array|false */ private static function match($url, $rule, $pattern) @@ -1370,16 +1379,28 @@ class Route /** * 瑙f瀽瑙勫垯璺敱 * @access private - * @param string $rule 璺敱瑙勫垯 - * @param string $route 璺敱鍦板潃 - * @param string $pathinfo URL鍦板潃 - * @param array $option 璺敱鍙傛暟 - * @param array $matches 鍖归厤鐨勫彉閲 + * @param string $rule 璺敱瑙勫垯 + * @param string $route 璺敱鍦板潃 + * @param string $pathinfo URL鍦板潃 + * @param array $option 璺敱鍙傛暟 + * @param array $matches 鍖归厤鐨勫彉閲 + * @param bool $fromCache 閫氳繃缂撳瓨瑙f瀽 * @return array */ - private static function parseRule($rule, $route, $pathinfo, $option = [], $matches = []) + private static function parseRule($rule, $route, $pathinfo, $option = [], $matches = [], $fromCache = false) { $request = Request::instance(); + + //淇濆瓨瑙f瀽缂撳瓨 + if (Config::get('route_check_cache') && !$fromCache) { + try { + $key = self::getCheckCacheKey($request); + Cache::tag('route_check')->set($key, [$rule, $route, $pathinfo, $option, $matches]); + } catch (\Exception $e) { + + } + } + // 瑙f瀽璺敱瑙勫垯 if ($rule) { $rule = explode('/', $rule); @@ -1506,7 +1527,7 @@ class Route App::$modulePath = APP_PATH . (Config::get('app_multi_module') ? $request->module() . DS : ''); } else { // 璺敱鍒版ā鍧/鎺у埗鍣/鎿嶄綔 - $result = self::parseModule($route); + $result = self::parseModule($route, isset($option['convert']) ? $option['convert'] : false); } // 寮鍚姹傜紦瀛 if ($request->isGet() && isset($option['cache'])) { @@ -1526,10 +1547,11 @@ class Route /** * 瑙f瀽URL鍦板潃涓 妯″潡/鎺у埗鍣/鎿嶄綔 * @access private - * @param string $url URL鍦板潃 + * @param string $url URL鍦板潃 + * @param bool $convert 鏄惁鑷姩杞崲URL鍦板潃 * @return array */ - private static function parseModule($url) + private static function parseModule($url, $convert = false) { list($path, $var) = self::parseUrlPath($url); $action = array_pop($path); @@ -1543,14 +1565,14 @@ class Route // 璁剧疆褰撳墠璇锋眰鐨勮矾鐢卞彉閲 Request::instance()->route($var); // 璺敱鍒版ā鍧/鎺у埗鍣/鎿嶄綔 - return ['type' => 'module', 'module' => [$module, $controller, $action], 'convert' => false]; + return ['type' => 'module', 'module' => [$module, $controller, $action], 'convert' => $convert]; } /** * 瑙f瀽URL鍦板潃涓殑鍙傛暟Request瀵硅薄 * @access private - * @param string $url 璺敱瑙勫垯 - * @param array $var 鍙橀噺 + * @param string $url 璺敱瑙勫垯 + * @param array $var 鍙橀噺 * @return void */ private static function parseUrlParams($url, &$var = []) @@ -1600,4 +1622,24 @@ class Route } return $var; } + + /** + * 鑾峰彇璺敱瑙f瀽缂撳瓨鐨刱ey + * @param Request $request + * @return string + */ + private static function getCheckCacheKey(Request $request) + { + static $key; + + if (empty($key)) { + if ($callback = Config::get('route_check_cache_key')) { + $key = call_user_func($callback, $request); + } else { + $key = "{$request->host(true)}|{$request->method()}|{$request->path()}"; + } + } + + return $key; + } } diff --git a/thinkphp/library/think/Template.php b/thinkphp/library/think/Template.php index 02cd504b8..9ba0ff35b 100644 --- a/thinkphp/library/think/Template.php +++ b/thinkphp/library/think/Template.php @@ -64,14 +64,16 @@ class Template */ public function __construct(array $config = []) { - $this->config['cache_path'] = TEMP_PATH; - $this->config = array_merge($this->config, $config); + $this->config['cache_path'] = TEMP_PATH; + $this->config = array_merge($this->config, $config); + $this->config['taglib_begin_origin'] = $this->config['taglib_begin']; $this->config['taglib_end_origin'] = $this->config['taglib_end']; - $this->config['taglib_begin'] = $this->stripPreg($this->config['taglib_begin']); - $this->config['taglib_end'] = $this->stripPreg($this->config['taglib_end']); - $this->config['tpl_begin'] = $this->stripPreg($this->config['tpl_begin']); - $this->config['tpl_end'] = $this->stripPreg($this->config['tpl_end']); + + $this->config['taglib_begin'] = preg_quote($this->config['taglib_begin'], '/'); + $this->config['taglib_end'] = preg_quote($this->config['taglib_end'], '/'); + $this->config['tpl_begin'] = preg_quote($this->config['tpl_begin'], '/'); + $this->config['tpl_end'] = preg_quote($this->config['tpl_end'], '/'); // 鍒濆鍖栨ā鏉跨紪璇戝瓨鍌ㄥ櫒 $type = $this->config['compile_type'] ? $this->config['compile_type'] : 'File'; @@ -79,20 +81,6 @@ class Template $this->storage = new $class(); } - /** - * 瀛楃涓叉浛鎹 閬垮厤姝e垯娣锋穯 - * @access private - * @param string $str - * @return string - */ - private function stripPreg($str) - { - return str_replace( - ['{', '}', '(', ')', '|', '[', ']', '-', '+', '*', '.', '^', '?'], - ['\{', '\}', '\(', '\)', '\|', '\[', '\]', '\-', '\+', '\*', '\.', '\^', '\?'], - $str); - } - /** * 妯℃澘鍙橀噺璧嬪 * @access public diff --git a/thinkphp/library/think/Url.php b/thinkphp/library/think/Url.php index 2b5fd7f78..53a545f92 100644 --- a/thinkphp/library/think/Url.php +++ b/thinkphp/library/think/Url.php @@ -302,7 +302,7 @@ class Url foreach ($rule as $item) { list($url, $pattern, $domain, $suffix) = $item; if (empty($pattern)) { - return [$url, $domain, $suffix]; + return [rtrim($url, '$'), $domain, $suffix]; } $type = Config::get('url_common_param'); foreach ($pattern as $key => $val) { diff --git a/thinkphp/library/think/Validate.php b/thinkphp/library/think/Validate.php index 353561be0..608e1e4a5 100644 --- a/thinkphp/library/think/Validate.php +++ b/thinkphp/library/think/Validate.php @@ -42,7 +42,6 @@ class Validate 'float' => ':attribute must be float', 'boolean' => ':attribute must be bool', 'email' => ':attribute not a valid email address', - 'mobile' => ':attribute not a valid mobile', 'array' => ':attribute must be a array', 'accepted' => ':attribute must be yes,on or 1', 'date' => ':attribute not a valid datetime', @@ -68,6 +67,8 @@ class Validate 'min' => 'min size of :attribute must be :rule', 'after' => ':attribute cannot be less than :rule', 'before' => ':attribute cannot exceed :rule', + 'afterWith' => ':attribute cannot be less than :rule', + 'beforeWith' => ':attribute cannot exceed :rule', 'expire' => ':attribute not within :rule', 'allowIp' => 'access IP is not allowed', 'denyIp' => 'access IP denied', @@ -879,12 +880,16 @@ class Validate // 鏀寔澶氫釜瀛楁楠岃瘉 $fields = explode('^', $key); foreach ($fields as $key) { - $map[$key] = $data[$key]; + if (isset($data[$key])) { + $map[$key] = $data[$key]; + } } } elseif (strpos($key, '=')) { parse_str($key, $map); - } else { + } elseif (isset($data[$field])) { $map[$key] = $data[$field]; + } else { + $map = []; } $pk = isset($rule[3]) ? $rule[3] : $db->getPk(); @@ -1114,9 +1119,10 @@ class Validate * @access protected * @param mixed $value 瀛楁鍊 * @param mixed $rule 楠岃瘉瑙勫垯 + * @param array $data 鏁版嵁 * @return bool */ - protected function after($value, $rule) + protected function after($value, $rule, $data) { return strtotime($value) >= strtotime($rule); } @@ -1126,13 +1132,42 @@ class Validate * @access protected * @param mixed $value 瀛楁鍊 * @param mixed $rule 楠岃瘉瑙勫垯 + * @param array $data 鏁版嵁 * @return bool */ - protected function before($value, $rule) + protected function before($value, $rule, $data) { return strtotime($value) <= strtotime($rule); } + /** + * 楠岃瘉鏃ユ湡瀛楁 + * @access protected + * @param mixed $value 瀛楁鍊 + * @param mixed $rule 楠岃瘉瑙勫垯 + * @param array $data 鏁版嵁 + * @return bool + */ + protected function afterWith($value, $rule, $data) + { + $rule = $this->getDataValue($data, $rule); + return !is_null($rule) && strtotime($value) >= strtotime($rule); + } + + /** + * 楠岃瘉鏃ユ湡瀛楁 + * @access protected + * @param mixed $value 瀛楁鍊 + * @param mixed $rule 楠岃瘉瑙勫垯 + * @param array $data 鏁版嵁 + * @return bool + */ + protected function beforeWith($value, $rule, $data) + { + $rule = $this->getDataValue($data, $rule); + return !is_null($rule) && strtotime($value) <= strtotime($rule); + } + /** * 楠岃瘉鏈夋晥鏈 * @access protected @@ -1196,7 +1231,7 @@ class Validate // 涓嶆槸姝e垯琛ㄨ揪寮忓垯涓ょ琛ヤ笂/ $rule = '/^' . $rule . '$/'; } - return 1 === preg_match($rule, (string) $value); + return is_scalar($value) && 1 === preg_match($rule, (string) $value); } /** diff --git a/thinkphp/library/think/cache/driver/File.php b/thinkphp/library/think/cache/driver/File.php index 6b1abd195..fee64894a 100644 --- a/thinkphp/library/think/cache/driver/File.php +++ b/thinkphp/library/think/cache/driver/File.php @@ -215,7 +215,10 @@ class File extends Driver public function rm($name) { $filename = $this->getCacheKey($name); - return $this->unlink($filename); + try { + return $this->unlink($filename); + } catch (\Exception $e) { + } } /** diff --git a/thinkphp/library/think/cache/driver/Memcache.php b/thinkphp/library/think/cache/driver/Memcache.php index 815f60b7f..58703ea34 100644 --- a/thinkphp/library/think/cache/driver/Memcache.php +++ b/thinkphp/library/think/cache/driver/Memcache.php @@ -63,7 +63,7 @@ class Memcache extends Driver public function has($name) { $key = $this->getCacheKey($name); - return $this->handler->get($key) ? true : false; + return false !== $this->handler->get($key); } /** diff --git a/thinkphp/library/think/cache/driver/Redis.php b/thinkphp/library/think/cache/driver/Redis.php index bb8713a66..027b3ea26 100644 --- a/thinkphp/library/think/cache/driver/Redis.php +++ b/thinkphp/library/think/cache/driver/Redis.php @@ -70,7 +70,7 @@ class Redis extends Driver */ public function has($name) { - return $this->handler->get($this->getCacheKey($name)) ? true : false; + return $this->handler->exists($this->getCacheKey($name)); } /** diff --git a/thinkphp/library/think/console/command/Clear.php b/thinkphp/library/think/console/command/Clear.php index 41019ceaf..1b5102ec2 100644 --- a/thinkphp/library/think/console/command/Clear.php +++ b/thinkphp/library/think/console/command/Clear.php @@ -10,8 +10,10 @@ // +---------------------------------------------------------------------- namespace think\console\command; +use think\Cache; use think\console\Command; use think\console\Input; +use think\console\input\Argument; use think\console\input\Option; use think\console\Output; @@ -22,6 +24,7 @@ class Clear extends Command // 鎸囦护閰嶇疆 $this ->setName('clear') + ->addArgument('type', Argument::OPTIONAL, 'type to clear', null) ->addOption('path', 'd', Option::VALUE_OPTIONAL, 'path to clear', null) ->setDescription('Clear runtime file'); } @@ -30,8 +33,14 @@ class Clear extends Command { $path = $input->getOption('path') ?: RUNTIME_PATH; - if (is_dir($path)) { - $this->clearPath($path); + $type = $input->getArgument('type'); + + if ($type == 'route') { + Cache::clear('route_check'); + } else { + if (is_dir($path)) { + $this->clearPath($path); + } } $output->writeln("Clear Successed"); diff --git a/thinkphp/library/think/db/Builder.php b/thinkphp/library/think/db/Builder.php index bbc20374e..58b45aa88 100644 --- a/thinkphp/library/think/db/Builder.php +++ b/thinkphp/library/think/db/Builder.php @@ -11,7 +11,6 @@ namespace think\db; -use BadMethodCallException; use PDO; use think\Exception; @@ -99,8 +98,15 @@ abstract class Builder $result = []; foreach ($data as $key => $val) { - $item = $this->parseKey($key, $options); - if (is_object($val) && method_exists($val, '__toString')) { + if ('*' != $options['field'] && !in_array($key, $fields, true)) { + continue; + } + + $item = $this->parseKey($key, $options, true); + if ($val instanceof Expression) { + $result[$item] = $val->getValue(); + continue; + } elseif (is_object($val) && method_exists($val, '__toString')) { // 瀵硅薄鏁版嵁鍐欏叆 $val = $val->__toString(); } @@ -111,16 +117,15 @@ abstract class Builder } elseif (is_null($val)) { $result[$item] = 'NULL'; } elseif (is_array($val) && !empty($val)) { - switch ($val[0]) { - case 'exp': - $result[$item] = $val[1]; - break; + switch (strtolower($val[0])) { case 'inc': - $result[$item] = $this->parseKey($val[1]) . '+' . floatval($val[2]); + $result[$item] = $item . '+' . floatval($val[1]); break; case 'dec': - $result[$item] = $this->parseKey($val[1]) . '-' . floatval($val[2]); + $result[$item] = $item . '-' . floatval($val[1]); break; + case 'exp': + throw new Exception('not support data:[' . $val[0] . ']'); } } elseif (is_scalar($val)) { // 杩囨护闈炴爣閲忔暟鎹 @@ -143,7 +148,7 @@ abstract class Builder * @param array $options * @return string */ - protected function parseKey($key, $options = []) + protected function parseKey($key, $options = [], $strict = false) { return $key; } @@ -184,8 +189,10 @@ abstract class Builder // 鏀寔 'field1'=>'field2' 杩欐牱鐨勫瓧娈靛埆鍚嶅畾涔 $array = []; foreach ($fields as $key => $field) { - if (!is_numeric($key)) { - $array[] = $this->parseKey($key, $options) . ' AS ' . $this->parseKey($field, $options); + if ($field instanceof Expression) { + $array[] = $field->getValue(); + } elseif (!is_numeric($key)) { + $array[] = $this->parseKey($key, $options) . ' AS ' . $this->parseKey($field, $options, true); } else { $array[] = $this->parseKey($field, $options); } @@ -264,7 +271,9 @@ abstract class Builder foreach ($where as $key => $val) { $str = []; foreach ($val as $field => $value) { - if ($value instanceof \Closure) { + if ($value instanceof Expression) { + $str[] = ' ' . $key . ' ( ' . $value->getValue() . ' )'; + } elseif ($value instanceof \Closure) { // 浣跨敤闂寘鏌ヨ $query = new Query($this->connection); call_user_func_array($value, [ & $query]); @@ -305,7 +314,7 @@ abstract class Builder protected function parseWhereItem($field, $val, $rule = '', $options = [], $binds = [], $bindName = null) { // 瀛楁鍒嗘瀽 - $key = $field ? $this->parseKey($field, $options) : ''; + $key = $field ? $this->parseKey($field, $options, true) : ''; // 鏌ヨ瑙勫垯鍜屾潯浠 if (!is_array($val)) { @@ -338,13 +347,15 @@ abstract class Builder throw new Exception('where express error:' . $exp); } } - $bindName = $bindName ?: 'where_' . str_replace(['.', '-'], '_', $field); + $bindName = $bindName ?: 'where_' . $rule . '_' . str_replace(['.', '-'], '_', $field); if (preg_match('/\W/', $bindName)) { // 澶勭悊甯﹂潪鍗曡瘝瀛楃鐨勫瓧娈靛悕 $bindName = md5($bindName); } - if (is_object($value) && method_exists($value, '__toString')) { + if ($value instanceof Expression) { + + } elseif (is_object($value) && method_exists($value, '__toString')) { // 瀵硅薄鏁版嵁鍐欏叆 $value = $value->__toString(); } @@ -381,7 +392,11 @@ abstract class Builder } } elseif ('EXP' == $exp) { // 琛ㄨ揪寮忔煡璇 - $whereStr .= '( ' . $key . ' ' . $value . ' )'; + if ($value instanceof Expression) { + $whereStr .= '( ' . $key . ' ' . $value->getValue() . ' )'; + } else { + throw new Exception('where express error:' . $exp); + } } elseif (in_array($exp, ['NOT NULL', 'NULL'])) { // NULL 鏌ヨ $whereStr .= $key . ' IS ' . $exp; @@ -499,6 +514,11 @@ abstract class Builder } } $bindName = $bindName ?: $key; + + if ($this->query->isBind($bindName)) { + $bindName .= '_' . str_replace('.', '_', uniqid('', true)); + } + $this->query->bind($bindName, $value, $bindType); return ':' . $bindName; } @@ -529,7 +549,9 @@ abstract class Builder list($table, $type, $on) = $item; $condition = []; foreach ((array) $on as $val) { - if (strpos($val, '=')) { + if ($val instanceof Expression) { + $condition[] = $val->getValue(); + } elseif (strpos($val, '=')) { list($val1, $val2) = explode('=', $val, 2); $condition[] = $this->parseKey($val1, $options) . '=' . $this->parseKey($val2, $options); } else { @@ -553,28 +575,29 @@ abstract class Builder */ protected function parseOrder($order, $options = []) { - if (is_array($order)) { - $array = []; - foreach ($order as $key => $val) { - if (is_numeric($key)) { - if ('[rand]' == $val) { - if (method_exists($this, 'parseRand')) { - $array[] = $this->parseRand(); - } else { - throw new BadMethodCallException('method not exists:' . get_class($this) . '-> parseRand'); - } - } elseif (false === strpos($val, '(')) { - $array[] = $this->parseKey($val, $options); - } else { - $array[] = $val; - } - } else { - $sort = in_array(strtolower(trim($val)), ['asc', 'desc']) ? ' ' . $val : ''; - $array[] = $this->parseKey($key, $options) . ' ' . $sort; - } - } - $order = implode(',', $array); + if (empty($order)) { + return ''; } + + $array = []; + foreach ($order as $key => $val) { + if ($val instanceof Expression) { + $array[] = $val->getValue(); + } elseif ('[rand]' == $val) { + $array[] = $this->parseRand(); + } else { + if (is_numeric($key)) { + list($key, $sort) = explode(' ', strpos($val, ' ') ? $val : $val . ' '); + } else { + $sort = $val; + } + $sort = strtoupper($sort); + $sort = in_array($sort, ['ASC', 'DESC'], true) ? ' ' . $sort : ''; + $array[] = $this->parseKey($key, $options, true) . $sort; + } + } + $order = implode(',', $array); + return !empty($order) ? ' ORDER BY ' . $order : ''; } @@ -608,6 +631,9 @@ abstract class Builder */ protected function parseComment($comment) { + if (false !== strpos($comment, '*/')) { + $comment = strstr($comment, '*/', true); + } return !empty($comment) ? ' /* ' . $comment . ' */' : ''; } @@ -657,11 +683,7 @@ abstract class Builder return ''; } - if (is_array($index)) { - $index = join(",", $index); - } - - return sprintf(" FORCE INDEX ( %s ) ", $index); + return sprintf(" FORCE INDEX ( %s ) ", is_array($index) ? implode(',', $index) : $index); } /** @@ -779,10 +801,14 @@ abstract class Builder $values[] = 'SELECT ' . implode(',', $value); if (!isset($insertFields)) { - $insertFields = array_map([$this, 'parseKey'], array_keys($data)); + $insertFields = array_keys($data); } } + foreach ($insertFields as $field) { + $fields[] = $this->parseKey($field, $options, true); + } + return str_replace( ['%INSERT%', '%TABLE%', '%FIELD%', '%DATA%', '%COMMENT%'], [ diff --git a/thinkphp/library/think/db/Connection.php b/thinkphp/library/think/db/Connection.php index e77abf8ab..578cc8f98 100644 --- a/thinkphp/library/think/db/Connection.php +++ b/thinkphp/library/think/db/Connection.php @@ -90,6 +90,8 @@ abstract class Connection 'master_num' => 1, // 鎸囧畾浠庢湇鍔″櫒搴忓彿 'slave_no' => '', + // 妯″瀷鍐欏叆鍚庤嚜鍔ㄨ鍙栦富鏈嶅姟鍣 + 'read_master' => false, // 鏄惁涓ユ牸妫鏌ュ瓧娈垫槸鍚﹀瓨鍦 'fields_strict' => true, // 鏁版嵁杩斿洖绫诲瀷 @@ -359,14 +361,9 @@ abstract class Connection // 璋冭瘯寮濮 $this->debug(true); - // 閲婃斁鍓嶆鐨勬煡璇㈢粨鏋 - if (!empty($this->PDOStatement)) { - $this->free(); - } // 棰勫鐞 - if (empty($this->PDOStatement)) { - $this->PDOStatement = $this->linkID->prepare($sql); - } + $this->PDOStatement = $this->linkID->prepare($sql); + // 鏄惁涓哄瓨鍌ㄨ繃绋嬭皟鐢 $procedure = in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']); // 鍙傛暟缁戝畾 @@ -378,7 +375,7 @@ abstract class Connection // 鎵ц鏌ヨ $this->PDOStatement->execute(); // 璋冭瘯缁撴潫 - $this->debug(false); + $this->debug(false, '', $master); // 杩斿洖缁撴灉闆 return $this->getResult($pdo, $procedure); } catch (\PDOException $e) { @@ -402,13 +399,14 @@ abstract class Connection /** * 鎵ц璇彞 * @access public - * @param string $sql sql鎸囦护 - * @param array $bind 鍙傛暟缁戝畾 + * @param string $sql sql鎸囦护 + * @param array $bind 鍙傛暟缁戝畾 + * @param Query $query 鏌ヨ瀵硅薄 * @return int * @throws PDOException * @throws \Exception */ - public function execute($sql, $bind = []) + public function execute($sql, $bind = [], Query $query = null) { $this->initConnect(true); if (!$this->linkID) { @@ -426,14 +424,9 @@ abstract class Connection // 璋冭瘯寮濮 $this->debug(true); - //閲婃斁鍓嶆鐨勬煡璇㈢粨鏋 - if (!empty($this->PDOStatement) && $this->PDOStatement->queryString != $sql) { - $this->free(); - } // 棰勫鐞 - if (empty($this->PDOStatement)) { - $this->PDOStatement = $this->linkID->prepare($sql); - } + $this->PDOStatement = $this->linkID->prepare($sql); + // 鏄惁涓哄瓨鍌ㄨ繃绋嬭皟鐢 $procedure = in_array(strtolower(substr(trim($sql), 0, 4)), ['call', 'exec']); // 鍙傛暟缁戝畾 @@ -445,23 +438,27 @@ abstract class Connection // 鎵ц璇彞 $this->PDOStatement->execute(); // 璋冭瘯缁撴潫 - $this->debug(false); + $this->debug(false, '', true); + + if ($query && !empty($this->config['deploy']) && !empty($this->config['read_master'])) { + $query->readMaster(); + } $this->numRows = $this->PDOStatement->rowCount(); return $this->numRows; } catch (\PDOException $e) { if ($this->isBreak($e)) { - return $this->close()->execute($sql, $bind); + return $this->close()->execute($sql, $bind, $query); } throw new PDOException($e, $this->config, $this->getLastsql()); } catch (\Throwable $e) { if ($this->isBreak($e)) { - return $this->close()->execute($sql, $bind); + return $this->close()->execute($sql, $bind, $query); } throw $e; } catch (\Exception $e) { if ($this->isBreak($e)) { - return $this->close()->execute($sql, $bind); + return $this->close()->execute($sql, $bind, $query); } throw $e; } @@ -652,18 +649,15 @@ abstract class Connection ); } - } catch (\PDOException $e) { - if ($this->isBreak($e)) { - return $this->close()->startTrans(); - } - throw $e; } catch (\Exception $e) { if ($this->isBreak($e)) { + --$this->transTimes; return $this->close()->startTrans(); } throw $e; } catch (\Error $e) { if ($this->isBreak($e)) { + --$this->transTimes; return $this->close()->startTrans(); } throw $e; @@ -744,7 +738,7 @@ abstract class Connection * @param array $sqlArray SQL鎵瑰鐞嗘寚浠 * @return boolean */ - public function batchQuery($sqlArray = [], $bind = []) + public function batchQuery($sqlArray = [], $bind = [], Query $query = null) { if (!is_array($sqlArray)) { return false; @@ -753,7 +747,7 @@ abstract class Connection $this->startTrans(); try { foreach ($sqlArray as $sql) { - $this->execute($sql, $bind); + $this->execute($sql, $bind, $query); } // 鎻愪氦浜嬪姟 $this->commit(); @@ -797,6 +791,8 @@ abstract class Connection $this->linkWrite = null; $this->linkRead = null; $this->links = []; + // 閲婃斁鏌ヨ + $this->free(); return $this; } @@ -823,6 +819,7 @@ abstract class Connection 'SSL connection has been closed unexpectedly', 'Error writing data to the connection', 'Resource deadlock avoided', + 'failed with errno', ]; $error = $e->getMessage(); @@ -903,9 +900,10 @@ abstract class Connection * @access protected * @param boolean $start 璋冭瘯寮濮嬫爣璁 true 寮濮 false 缁撴潫 * @param string $sql 鎵ц鐨凷QL璇彞 鐣欑┖鑷姩鑾峰彇 + * @param boolean $master 涓讳粠鏍囪 * @return void */ - protected function debug($start, $sql = '') + protected function debug($start, $sql = '', $master = false) { if (!empty($this->config['debug'])) { // 寮鍚暟鎹簱璋冭瘯妯″紡 @@ -922,7 +920,7 @@ abstract class Connection $result = $this->getExplain($sql); } // SQL鐩戝惉 - $this->trigger($sql, $runtime, $result); + $this->trigger($sql, $runtime, $result, $master); } } } @@ -944,19 +942,27 @@ abstract class Connection * @param string $sql SQL璇彞 * @param float $runtime SQL杩愯鏃堕棿 * @param mixed $explain SQL鍒嗘瀽 - * @return bool + * @param bool $master 涓讳粠鏍囪 + * @return void */ - protected function trigger($sql, $runtime, $explain = []) + protected function trigger($sql, $runtime, $explain = [], $master = false) { if (!empty(self::$event)) { foreach (self::$event as $callback) { if (is_callable($callback)) { - call_user_func_array($callback, [$sql, $runtime, $explain]); + call_user_func_array($callback, [$sql, $runtime, $explain, $master]); } } } else { // 鏈敞鍐岀洃鍚垯璁板綍鍒版棩蹇椾腑 - Log::record('[ SQL ] ' . $sql . ' [ RunTime:' . $runtime . 's ]', 'sql'); + if ($this->config['deploy']) { + // 鍒嗗竷寮忚褰曞綋鍓嶆搷浣滅殑涓讳粠 + $master = $master ? 'master|' : 'slave|'; + } else { + $master = ''; + } + + Log::record('[ SQL ] ' . $sql . ' [ ' . $master . 'RunTime:' . $runtime . 's ]', 'sql'); if (!empty($explain)) { Log::record('[ EXPLAIN : ' . var_export($explain, true) . ' ]', 'sql'); } diff --git a/thinkphp/library/think/db/Expression.php b/thinkphp/library/think/db/Expression.php new file mode 100644 index 000000000..f1b92abd7 --- /dev/null +++ b/thinkphp/library/think/db/Expression.php @@ -0,0 +1,48 @@ + +// +---------------------------------------------------------------------- + +namespace think\db; + +class Expression +{ + /** + * 鏌ヨ琛ㄨ揪寮 + * + * @var string + */ + protected $value; + + /** + * 鍒涘缓涓涓煡璇㈣〃杈惧紡 + * + * @param string $value + * @return void + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * 鑾峰彇琛ㄨ揪寮 + * + * @return string + */ + public function getValue() + { + return $this->value; + } + + public function __toString() + { + return (string) $this->value; + } +} diff --git a/thinkphp/library/think/db/Query.php b/thinkphp/library/think/db/Query.php index d425d78a1..ac4adea16 100644 --- a/thinkphp/library/think/db/Query.php +++ b/thinkphp/library/think/db/Query.php @@ -53,6 +53,8 @@ class Query protected static $info = []; // 鍥炶皟浜嬩欢 private static $event = []; + // 璇诲彇涓诲簱 + protected static $readMaster = []; /** * 鏋勯犲嚱鏁 @@ -90,6 +92,13 @@ class Query $name = Loader::parseName(substr($method, 10)); $where[$name] = $args[0]; return $this->where($where)->value($args[1]); + } elseif ($this->model && method_exists($this->model, 'scope' . $method)) { + // 鍔ㄦ佽皟鐢ㄥ懡鍚嶈寖鍥 + $method = 'scope' . $method; + array_unshift($args, $this); + + call_user_func_array([$this->model, $method], $args); + return $this; } else { throw new Exception('method not exist:' . __CLASS__ . '->' . $method); } @@ -131,7 +140,7 @@ class Query } /** - * 鑾峰彇褰撳墠鐨勬ā鍨嬪璞″悕 + * 鑾峰彇褰撳墠鐨勬ā鍨嬪璞″疄渚 * @access public * @return Model|null */ @@ -140,6 +149,25 @@ class Query return $this->model; } + /** + * 璁剧疆鍚庣画浠庝富搴撹鍙栨暟鎹 + * @access public + * @param bool $allTable + * @return void + */ + public function readMaster($allTable = false) + { + if ($allTable) { + $table = '*'; + } else { + $table = isset($this->options['table']) ? $this->options['table'] : $this->getTable(); + } + + static::$readMaster[$table] = true; + + return $this; + } + /** * 鑾峰彇褰撳墠鐨刡uilder瀹炰緥瀵硅薄 * @access public @@ -238,7 +266,7 @@ class Query */ public function execute($sql, $bind = []) { - return $this->connection->execute($sql, $bind); + return $this->connection->execute($sql, $bind, $this); } /** @@ -403,7 +431,7 @@ class Query if (empty($this->options['table'])) { $this->options['table'] = $this->getTable(); } - $key = is_string($cache['key']) ? $cache['key'] : md5($field . serialize($this->options) . serialize($this->bind)); + $key = is_string($cache['key']) ? $cache['key'] : md5($this->connection->getConfig('database') . '.' . $field . serialize($this->options) . serialize($this->bind)); $result = Cache::get($key); } if (false === $result) { @@ -415,12 +443,13 @@ class Query // 杩斿洖SQL璇彞 return $pdo; } + $result = $pdo->fetchColumn(); if ($force) { - $result += 0; + $result = (float) $result; } - if (isset($cache)) { + if (isset($cache) && false !== $result) { // 缂撳瓨鏁版嵁 $this->cacheData($key, $result, $cache); } @@ -447,7 +476,7 @@ class Query if (empty($this->options['table'])) { $this->options['table'] = $this->getTable(); } - $guid = is_string($cache['key']) ? $cache['key'] : md5($field . serialize($this->options) . serialize($this->bind)); + $guid = is_string($cache['key']) ? $cache['key'] : md5($this->connection->getConfig('database') . '.' . $field . serialize($this->options) . serialize($this->bind)); $result = Cache::get($guid); } if (false === $result) { @@ -510,13 +539,43 @@ class Query public function count($field = '*') { if (isset($this->options['group'])) { + if (!preg_match('/^[\w\.\*]+$/', $field)) { + throw new Exception('not support data:' . $field); + } // 鏀寔GROUP $options = $this->getOptions(); $subSql = $this->options($options)->field('count(' . $field . ')')->bind($this->bind)->buildSql(); - return $this->table([$subSql => '_group_count_'])->value('COUNT(*) AS tp_count', 0, true); + + $count = $this->table([$subSql => '_group_count_'])->value('COUNT(*) AS tp_count', 0, true); + } else { + $count = $this->aggregate('COUNT', $field, true); } - return $this->value('COUNT(' . $field . ') AS tp_count', 0, true); + return is_string($count) ? $count : (int) $count; + + } + + /** + * 鑱氬悎鏌ヨ + * @access public + * @param string $aggregate 鑱氬悎鏂规硶 + * @param string $field 瀛楁鍚 + * @param bool $force 寮哄埗杞负鏁板瓧绫诲瀷 + * @return mixed + */ + public function aggregate($aggregate, $field, $force = false) + { + if (0 === stripos($field, 'DISTINCT ')) { + list($distinct, $field) = explode(' ', $field); + } + + if (!preg_match('/^[\w\.\+\-\*]+$/', $field)) { + throw new Exception('not support data:' . $field); + } + + $result = $this->value($aggregate . '(' . (!empty($distinct) ? 'DISTINCT ' : '') . $field . ') AS tp_' . strtolower($aggregate), 0, $force); + + return $result; } /** @@ -527,7 +586,7 @@ class Query */ public function sum($field) { - return $this->value('SUM(' . $field . ') AS tp_sum', 0, true); + return $this->aggregate('SUM', $field, true); } /** @@ -539,7 +598,7 @@ class Query */ public function min($field, $force = true) { - return $this->value('MIN(' . $field . ') AS tp_min', 0, $force); + return $this->aggregate('MIN', $field, $force); } /** @@ -551,7 +610,7 @@ class Query */ public function max($field, $force = true) { - return $this->value('MAX(' . $field . ') AS tp_max', 0, $force); + return $this->aggregate('MAX', $field, $force); } /** @@ -562,7 +621,7 @@ class Query */ public function avg($field) { - return $this->value('AVG(' . $field . ') AS tp_avg', 0, true); + return $this->aggregate('AVG', $field, true); } /** @@ -609,7 +668,7 @@ class Query return true; } } - return $this->setField($field, ['inc', $field, $step]); + return $this->setField($field, ['inc', $step]); } /** @@ -637,9 +696,9 @@ class Query $this->options = []; return true; } - return $this->setField($field, ['inc', $field, $step]); + return $this->setField($field, ['inc', $step]); } - return $this->setField($field, ['dec', $field, $step]); + return $this->setField($field, ['dec', $step]); } /** @@ -708,6 +767,7 @@ class Query // 浼犲叆鐨勮〃鍚嶄负鏁扮粍 if (is_array($join)) { $table = $join; + $alias = array_shift($join); } else { $join = trim($join); if (false !== strpos($join, '(')) { @@ -768,8 +828,15 @@ class Query { if (empty($field)) { return $this; + } elseif ($field instanceof Expression) { + $this->options['field'][] = $field; + return $this; } + if (is_string($field)) { + if (preg_match('/[\<\'\"\(]/', $field)) { + return $this->fieldRaw($field); + } $field = array_map('trim', explode(',', $field)); } if (true === $field) { @@ -793,12 +860,30 @@ class Query } if (isset($this->options['field'])) { - $field = array_merge($this->options['field'], $field); + $field = array_merge((array) $this->options['field'], $field); } $this->options['field'] = array_unique($field); return $this; } + /** + * 琛ㄨ揪寮忔柟寮忔寚瀹氭煡璇㈠瓧娈 + * @access public + * @param string $field 瀛楁鍚 + * @param array $bind 鍙傛暟缁戝畾 + * @return $this + */ + public function fieldRaw($field, array $bind = []) + { + $this->options['field'][] = $this->raw($field); + + if ($bind) { + $this->bind($bind); + } + + return $this; + } + /** * 璁剧疆鏁版嵁 * @access public @@ -827,7 +912,7 @@ class Query { $fields = is_string($field) ? explode(',', $field) : $field; foreach ($fields as $field) { - $this->data($field, ['inc', $field, $step]); + $this->data($field, ['inc', $step]); } return $this; } @@ -843,7 +928,7 @@ class Query { $fields = is_string($field) ? explode(',', $field) : $field; foreach ($fields as $field) { - $this->data($field, ['dec', $field, $step]); + $this->data($field, ['dec', $step]); } return $this; } @@ -857,25 +942,36 @@ class Query */ public function exp($field, $value) { - $this->data($field, ['exp', $value]); + $this->data($field, $this->raw($value)); return $this; } + /** + * 浣跨敤琛ㄨ揪寮忚缃暟鎹 + * @access public + * @param mixed $value 琛ㄨ揪寮 + * @return Expression + */ + public function raw($value) + { + return new Expression($value); + } + /** * 鎸囧畾JOIN鏌ヨ瀛楁 * @access public * @param string|array $table 鏁版嵁琛 * @param string|array $field 鏌ヨ瀛楁 - * @param string|array $on JOIN鏉′欢 + * @param mixed $on JOIN鏉′欢 * @param string $type JOIN绫诲瀷 * @return $this */ public function view($join, $field = true, $on = null, $type = 'INNER') { $this->options['view'] = true; - if (is_array($join) && key($join) !== 0) { + if (is_array($join) && key($join) === 0) { foreach ($join as $key => $val) { - $this->view($key, $val[0], isset($val[1]) ? $val[1] : null, isset($val[2]) ? $val[2] : 'INNER'); + $this->view($val[0], $val[1], isset($val[2]) ? $val[2] : null, isset($val[3]) ? $val[3] : 'INNER'); } } else { $fields = []; @@ -974,6 +1070,37 @@ class Query return $this; } + /** + * 鎸囧畾琛ㄨ揪寮忔煡璇㈡潯浠 + * @access public + * @param string $where 鏌ヨ鏉′欢 + * @param array $bind 鍙傛暟缁戝畾 + * @param string $logic 鏌ヨ閫昏緫 and or xor + * @return $this + */ + public function whereRaw($where, $bind = [], $logic = 'AND') + { + $this->options['where'][$logic][] = $this->raw($where); + + if ($bind) { + $this->bind($bind); + } + + return $this; + } + + /** + * 鎸囧畾琛ㄨ揪寮忔煡璇㈡潯浠 OR + * @access public + * @param string $where 鏌ヨ鏉′欢 + * @param array $bind 鍙傛暟缁戝畾 + * @return $this + */ + public function whereOrRaw($where, $bind = []) + { + return $this->whereRaw($where, $bind, 'OR'); + } + /** * 鎸囧畾Null鏌ヨ鏉′欢 * @access public @@ -983,7 +1110,7 @@ class Query */ public function whereNull($field, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'null', null); + $this->parseWhereExp($logic, $field, 'null', null, [], true); return $this; } @@ -996,7 +1123,7 @@ class Query */ public function whereNotNull($field, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'notnull', null); + $this->parseWhereExp($logic, $field, 'notnull', null, [], true); return $this; } @@ -1036,7 +1163,7 @@ class Query */ public function whereIn($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'in', $condition); + $this->parseWhereExp($logic, $field, 'in', $condition, [], true); return $this; } @@ -1050,7 +1177,7 @@ class Query */ public function whereNotIn($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'not in', $condition); + $this->parseWhereExp($logic, $field, 'not in', $condition, [], true); return $this; } @@ -1064,7 +1191,7 @@ class Query */ public function whereLike($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'like', $condition); + $this->parseWhereExp($logic, $field, 'like', $condition, [], true); return $this; } @@ -1078,7 +1205,7 @@ class Query */ public function whereNotLike($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'not like', $condition); + $this->parseWhereExp($logic, $field, 'not like', $condition, [], true); return $this; } @@ -1092,7 +1219,7 @@ class Query */ public function whereBetween($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'between', $condition); + $this->parseWhereExp($logic, $field, 'between', $condition, [], true); return $this; } @@ -1106,7 +1233,7 @@ class Query */ public function whereNotBetween($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'not between', $condition); + $this->parseWhereExp($logic, $field, 'not between', $condition, [], true); return $this; } @@ -1120,7 +1247,7 @@ class Query */ public function whereExp($field, $condition, $logic = 'AND') { - $this->parseWhereExp($logic, $field, 'exp', $condition); + $this->parseWhereExp($logic, $field, 'exp', $this->raw($condition), [], true); return $this; } @@ -1147,9 +1274,10 @@ class Query * @param mixed $op 鏌ヨ琛ㄨ揪寮 * @param mixed $condition 鏌ヨ鏉′欢 * @param array $param 鏌ヨ鍙傛暟 + * @param bool $strict 涓ユ牸妯″紡 * @return void */ - protected function parseWhereExp($logic, $field, $op, $condition, $param = []) + protected function parseWhereExp($logic, $field, $op, $condition, $param = [], $strict = false) { $logic = strtoupper($logic); if ($field instanceof \Closure) { @@ -1160,8 +1288,17 @@ class Query if (is_string($field) && !empty($this->options['via']) && !strpos($field, '.')) { $field = $this->options['via'] . '.' . $field; } - if (is_string($field) && preg_match('/[,=\>\<\'\"\(\s]/', $field)) { - $where[] = ['exp', $field]; + + if ($field instanceof Expression) { + return $this->whereRaw($field, is_array($op) ? $op : []); + } elseif ($strict) { + // 浣跨敤涓ユ牸妯″紡鏌ヨ + $where[$field] = [$op, $condition]; + + // 璁板綍涓涓瓧娈靛娆℃煡璇㈡潯浠 + $this->options['multi'][$logic][$field][] = $where[$field]; + } elseif (is_string($field) && preg_match('/[,=\>\<\'\"\(\s]/', $field)) { + $where[] = ['exp', $this->raw($field)]; if (is_array($op)) { // 鍙傛暟缁戝畾 $this->bind($op); @@ -1182,21 +1319,28 @@ class Query $where[$field] = $param; } elseif (in_array(strtolower($op), ['null', 'notnull', 'not null'])) { // null鏌ヨ - $where[$field] = [$op, '']; + $where[$field] = [$op, '']; + $this->options['multi'][$logic][$field][] = $where[$field]; } elseif (is_null($condition)) { // 瀛楁鐩哥瓑鏌ヨ - $where[$field] = ['eq', $op]; + $where[$field] = ['eq', $op]; + $this->options['multi'][$logic][$field][] = $where[$field]; } else { - $where[$field] = [$op, $condition, isset($param[2]) ? $param[2] : null]; - if ('exp' == strtolower($op) && isset($param[2]) && is_array($param[2])) { + if ('exp' == strtolower($op)) { + $where[$field] = ['exp', $this->raw($condition)]; // 鍙傛暟缁戝畾 - $this->bind($param[2]); + if (isset($param[2]) && is_array($param[2])) { + $this->bind($param[2]); + } + } else { + $where[$field] = [$op, $condition]; } // 璁板綍涓涓瓧娈靛娆℃煡璇㈡潯浠 $this->options['multi'][$logic][$field][] = $where[$field]; } + if (!empty($where)) { if (!isset($this->options['where'][$logic])) { $this->options['where'][$logic] = []; @@ -1414,31 +1558,59 @@ class Query */ public function order($field, $order = null) { - if (!empty($field)) { - if (is_string($field)) { - if (!empty($this->options['via'])) { - $field = $this->options['via'] . '.' . $field; - } - $field = empty($order) ? $field : [$field => $order]; - } elseif (!empty($this->options['via'])) { - foreach ($field as $key => $val) { - if (is_numeric($key)) { - $field[$key] = $this->options['via'] . '.' . $val; - } else { - $field[$this->options['via'] . '.' . $key] = $val; - unset($field[$key]); - } - } + if (empty($field)) { + return $this; + } elseif ($field instanceof Expression) { + $this->options['order'][] = $field; + return $this; + } + + if (is_string($field)) { + if (!empty($this->options['via'])) { + $field = $this->options['via'] . '.' . $field; } - if (!isset($this->options['order'])) { - $this->options['order'] = []; - } - if (is_array($field)) { - $this->options['order'] = array_merge($this->options['order'], $field); + if (strpos($field, ',')) { + $field = array_map('trim', explode(',', $field)); } else { - $this->options['order'][] = $field; + $field = empty($order) ? $field : [$field => $order]; + } + } elseif (!empty($this->options['via'])) { + foreach ($field as $key => $val) { + if (is_numeric($key)) { + $field[$key] = $this->options['via'] . '.' . $val; + } else { + $field[$this->options['via'] . '.' . $key] = $val; + unset($field[$key]); + } } } + if (!isset($this->options['order'])) { + $this->options['order'] = []; + } + if (is_array($field)) { + $this->options['order'] = array_merge($this->options['order'], $field); + } else { + $this->options['order'][] = $field; + } + + return $this; + } + + /** + * 琛ㄨ揪寮忔柟寮忔寚瀹欶ield鎺掑簭 + * @access public + * @param string $field 鎺掑簭瀛楁 + * @param array $bind 鍙傛暟缁戝畾 + * @return $this + */ + public function orderRaw($field, array $bind = []) + { + $this->options['order'][] = $this->raw($field); + + if ($bind) { + $this->bind($bind); + } + return $this; } @@ -1958,14 +2130,23 @@ class Query $this->field('*'); } foreach ($relations as $key => $relation) { - $closure = false; + $closure = $name = null; if ($relation instanceof \Closure) { $closure = $relation; $relation = $key; + } elseif (!is_int($key)) { + $name = $relation; + $relation = $key; } $relation = Loader::parseName($relation, 1, false); - $count = '(' . $this->model->$relation()->getRelationCountQuery($closure) . ')'; - $this->field([$count => Loader::parseName($relation) . '_count']); + + $count = '(' . $this->model->$relation()->getRelationCountQuery($closure, $name) . ')'; + + if (empty($name)) { + $name = Loader::parseName($relation) . '_count'; + } + + $this->field([$count => $name]); } } return $this; @@ -2091,7 +2272,7 @@ class Query } // 鎵ц鎿嶄綔 - $result = 0 === $sql ? 0 : $this->execute($sql, $bind); + $result = 0 === $sql ? 0 : $this->execute($sql, $bind, $this); if ($result) { $sequence = $sequence ?: (isset($options['sequence']) ? $options['sequence'] : null); $lastInsId = $this->getLastInsID($sequence); @@ -2157,10 +2338,10 @@ class Query return $this->connection->getRealSql($sql, $bind); } elseif (is_array($sql)) { // 鎵ц鎿嶄綔 - return $this->batchQuery($sql, $bind); + return $this->batchQuery($sql, $bind, $this); } else { // 鎵ц鎿嶄綔 - return $this->execute($sql, $bind); + return $this->execute($sql, $bind, $this); } } @@ -2186,7 +2367,7 @@ class Query return $this->connection->getRealSql($sql, $bind); } else { // 鎵ц鎿嶄綔 - return $this->execute($sql, $bind); + return $this->execute($sql, $bind, $this); } } @@ -2253,7 +2434,7 @@ class Query Cache::clear($options['cache']['tag']); } // 鎵ц鎿嶄綔 - $result = '' == $sql ? 0 : $this->execute($sql, $bind); + $result = '' == $sql ? 0 : $this->execute($sql, $bind, $this); if ($result) { if (is_string($pk) && isset($where[$pk])) { $data[$pk] = $where[$pk]; @@ -2322,7 +2503,7 @@ class Query // 鍒ゆ柇鏌ヨ缂撳瓨 $cache = $options['cache']; unset($options['cache']); - $key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options) . serialize($this->bind)); + $key = is_string($cache['key']) ? $cache['key'] : md5($this->connection->getConfig('database') . '.' . serialize($options) . serialize($this->bind)); $resultSet = Cache::get($key); } if (false === $resultSet) { @@ -2423,10 +2604,16 @@ class Query } elseif (is_array($value) && is_string($value[0]) && 'eq' == strtolower($value[0])) { $data = $value[1]; } + $prefix = $this->connection->getConfig('database') . '.'; + if (isset($data)) { - return 'think:' . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data; - } else { - return md5(serialize($options) . serialize($bind)); + return 'think:' . $prefix . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data; + } + + try { + return md5($prefix . serialize($options) . serialize($bind)); + } catch (\Exception $e) { + throw new Exception('closure not support cache(true)'); } } @@ -2463,11 +2650,11 @@ class Query // 鍒ゆ柇鏌ヨ缂撳瓨 $cache = $options['cache']; if (true === $cache['key'] && !is_null($data) && !is_array($data)) { - $key = 'think:' . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data; + $key = 'think:' . $this->connection->getConfig('database') . '.' . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data; } elseif (is_string($cache['key'])) { $key = $cache['key']; } elseif (!isset($key)) { - $key = md5(serialize($options) . serialize($this->bind)); + $key = md5($this->connection->getConfig('database') . '.' . serialize($options) . serialize($this->bind)); } $result = Cache::get($key); } @@ -2719,7 +2906,7 @@ class Query Cache::clear($options['cache']['tag']); } // 鎵ц鎿嶄綔 - $result = $this->execute($sql, $bind); + $result = $this->execute($sql, $bind, $this); if ($result) { if (!is_array($data) && is_string($pk) && isset($key) && strpos($key, '|')) { list($a, $val) = explode('|', $key); @@ -2804,6 +2991,10 @@ class Query } } + if (isset(static::$readMaster['*']) || (is_string($options['table']) && isset(static::$readMaster[$options['table']]))) { + $options['master'] = true; + } + foreach (['join', 'union', 'group', 'having', 'limit', 'order', 'force', 'comment'] as $name) { if (!isset($options[$name])) { $options[$name] = ''; diff --git a/thinkphp/library/think/db/builder/Mysql.php b/thinkphp/library/think/db/builder/Mysql.php index 30fa506c2..be2af7141 100644 --- a/thinkphp/library/think/db/builder/Mysql.php +++ b/thinkphp/library/think/db/builder/Mysql.php @@ -82,17 +82,23 @@ class Mysql extends Builder /** * 瀛楁鍜岃〃鍚嶅鐞 * @access protected - * @param string $key + * @param mixed $key * @param array $options * @return string */ - protected function parseKey($key, $options = []) + protected function parseKey($key, $options = [], $strict = false) { + if (is_numeric($key)) { + return $key; + } elseif ($key instanceof Expression) { + return $key->getValue(); + } + $key = trim($key); if (strpos($key, '$.') && false === strpos($key, '(')) { // JSON瀛楁鏀寔 list($field, $name) = explode('$.', $key); - $key = 'json_extract(' . $field . ', \'$.' . $name . '\')'; + return 'json_extract(' . $field . ', \'$.' . $name . '\')'; } elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) { list($table, $key) = explode('.', $key, 2); if ('__TABLE__' == $table) { @@ -102,7 +108,11 @@ class Mysql extends Builder $table = $options['alias'][$table]; } } - if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) { + + if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) { + throw new Exception('not support data:' . $key); + } + if ('*' != $key && ($strict || !preg_match('/[,\'\"\*\(\)`.\s]/', $key))) { $key = '`' . $key . '`'; } if (isset($table)) { diff --git a/thinkphp/library/think/db/builder/Pgsql.php b/thinkphp/library/think/db/builder/Pgsql.php index 21de525cb..acc228961 100644 --- a/thinkphp/library/think/db/builder/Pgsql.php +++ b/thinkphp/library/think/db/builder/Pgsql.php @@ -44,12 +44,18 @@ class Pgsql extends Builder /** * 瀛楁鍜岃〃鍚嶅鐞 * @access protected - * @param string $key + * @param mixed $key * @param array $options * @return string */ - protected function parseKey($key, $options = []) + protected function parseKey($key, $options = [], $strict = false) { + if (is_numeric($key)) { + return $key; + } elseif ($key instanceof Expression) { + return $key->getValue(); + } + $key = trim($key); if (strpos($key, '$.') && false === strpos($key, '(')) { // JSON瀛楁鏀寔 diff --git a/thinkphp/library/think/db/builder/Sqlite.php b/thinkphp/library/think/db/builder/Sqlite.php index 960533b77..c727f04b8 100644 --- a/thinkphp/library/think/db/builder/Sqlite.php +++ b/thinkphp/library/think/db/builder/Sqlite.php @@ -52,12 +52,18 @@ class Sqlite extends Builder /** * 瀛楁鍜岃〃鍚嶅鐞 * @access protected - * @param string $key + * @param mixed $key * @param array $options * @return string */ - protected function parseKey($key, $options = []) + protected function parseKey($key, $options = [], $strict = false) { + if (is_numeric($key)) { + return $key; + } elseif ($key instanceof Expression) { + return $key->getValue(); + } + $key = trim($key); if (strpos($key, '.')) { list($table, $key) = explode('.', $key, 2); diff --git a/thinkphp/library/think/db/builder/Sqlsrv.php b/thinkphp/library/think/db/builder/Sqlsrv.php index 59ea021ff..dc425d9eb 100644 --- a/thinkphp/library/think/db/builder/Sqlsrv.php +++ b/thinkphp/library/think/db/builder/Sqlsrv.php @@ -12,6 +12,7 @@ namespace think\db\builder; use think\db\Builder; +use think\db\Expression; /** * Sqlsrv鏁版嵁搴撻┍鍔 @@ -34,25 +35,29 @@ class Sqlsrv extends Builder */ protected function parseOrder($order, $options = []) { - if (is_array($order)) { - $array = []; - foreach ($order as $key => $val) { - if (is_numeric($key)) { - if (false === strpos($val, '(')) { - $array[] = $this->parseKey($val, $options); - } elseif ('[rand]' == $val) { - $array[] = $this->parseRand(); - } else { - $array[] = $val; - } - } else { - $sort = in_array(strtolower(trim($val)), ['asc', 'desc']) ? ' ' . $val : ''; - $array[] = $this->parseKey($key, $options) . ' ' . $sort; - } - } - $order = implode(',', $array); + if (empty($order)) { + return ' ORDER BY rand()'; } - return !empty($order) ? ' ORDER BY ' . $order : ' ORDER BY rand()'; + + $array = []; + foreach ($order as $key => $val) { + if ($val instanceof Expression) { + $array[] = $val->getValue(); + } elseif (is_numeric($key)) { + if (false === strpos($val, '(')) { + $array[] = $this->parseKey($val, $options); + } elseif ('[rand]' == $val) { + $array[] = $this->parseRand(); + } else { + $array[] = $val; + } + } else { + $sort = in_array(strtolower(trim($val)), ['asc', 'desc'], true) ? ' ' . $val : ''; + $array[] = $this->parseKey($key, $options, true) . ' ' . $sort; + } + } + + return ' ORDER BY ' . implode(',', $array); } /** @@ -68,12 +73,17 @@ class Sqlsrv extends Builder /** * 瀛楁鍜岃〃鍚嶅鐞 * @access protected - * @param string $key + * @param mixed $key * @param array $options * @return string */ - protected function parseKey($key, $options = []) + protected function parseKey($key, $options = [], $strict = false) { + if (is_numeric($key)) { + return $key; + } elseif ($key instanceof Expression) { + return $key->getValue(); + } $key = trim($key); if (strpos($key, '.') && !preg_match('/[,\'\"\(\)\[\s]/', $key)) { list($table, $key) = explode('.', $key, 2); @@ -84,7 +94,11 @@ class Sqlsrv extends Builder $table = $options['alias'][$table]; } } - if (!is_numeric($key) && !preg_match('/[,\'\"\*\(\)\[.\s]/', $key)) { + + if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) { + throw new Exception('not support data:' . $key); + } + if ('*' != $key && ($strict || !preg_match('/[,\'\"\*\(\)\[.\s]/', $key))) { $key = '[' . $key . ']'; } if (isset($table)) { diff --git a/thinkphp/library/think/db/connector/Sqlsrv.php b/thinkphp/library/think/db/connector/Sqlsrv.php index 08ad45e26..35c660059 100644 --- a/thinkphp/library/think/db/connector/Sqlsrv.php +++ b/thinkphp/library/think/db/connector/Sqlsrv.php @@ -50,7 +50,10 @@ class Sqlsrv extends Connection public function getFields($tableName) { list($tableName) = explode(' ', $tableName); - $sql = "SELECT column_name, data_type, column_default, is_nullable + $tableNames = explode('.', $tableName); + $tableName = isset($tableNames[1]) ? $tableNames[1] : $tableNames[0]; + + $sql = "SELECT column_name, data_type, column_default, is_nullable FROM information_schema.tables AS t JOIN information_schema.columns AS c ON t.table_catalog = c.table_catalog diff --git a/thinkphp/library/think/debug/Html.php b/thinkphp/library/think/debug/Html.php index f8651aa92..b6be7adbe 100644 --- a/thinkphp/library/think/debug/Html.php +++ b/thinkphp/library/think/debug/Html.php @@ -53,7 +53,7 @@ class Html return false; } // 鑾峰彇鍩烘湰淇℃伅 - $runtime = number_format(microtime(true) - THINK_START_TIME, 10); + $runtime = number_format(microtime(true) - THINK_START_TIME, 10, '.', ''); $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '鈭'; $mem = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2); diff --git a/thinkphp/library/think/log/driver/File.php b/thinkphp/library/think/log/driver/File.php index 4036cc44a..f2296cfa0 100644 --- a/thinkphp/library/think/log/driver/File.php +++ b/thinkphp/library/think/log/driver/File.php @@ -25,10 +25,10 @@ class File 'file_size' => 2097152, 'path' => LOG_PATH, 'apart_level' => [], + 'max_files' => 0, + 'json' => false, ]; - protected $writed = []; - // 瀹炰緥鍖栧苟浼犲叆鍙傛暟 public function __construct($config = []) { @@ -40,92 +40,231 @@ class File /** * 鏃ュ織鍐欏叆鎺ュ彛 * @access public - * @param array $log 鏃ュ織淇℃伅 + * @param array $log 鏃ュ織淇℃伅 + * @param bool $append 鏄惁杩藉姞璇锋眰淇℃伅 * @return bool */ - public function save(array $log = []) + public function save(array $log = [], $append = false) { - if ($this->config['single']) { - $destination = $this->config['path'] . 'single.log'; - } else { - $cli = IS_CLI ? '_cli' : ''; - $destination = $this->config['path'] . date('Ym') . DS . date('d') . $cli . '.log'; - } + $destination = $this->getMasterLogFile(); $path = dirname($destination); !is_dir($path) && mkdir($path, 0755, true); - $info = ''; + $info = []; foreach ($log as $type => $val) { - $level = ''; + foreach ($val as $msg) { if (!is_string($msg)) { $msg = var_export($msg, true); } - $level .= '[ ' . $type . ' ] ' . $msg . "\r\n"; + + $info[$type][] = $this->config['json'] ? $msg : '[ ' . $type . ' ] ' . $msg; } - if (in_array($type, $this->config['apart_level'])) { + + if (!$this->config['json'] && (true === $this->config['apart_level'] || in_array($type, $this->config['apart_level']))) { // 鐙珛璁板綍鐨勬棩蹇楃骇鍒 - if ($this->config['single']) { - $filename = $path . DS . $type . '.log'; - } else { - $filename = $path . DS . date('d') . '_' . $type . $cli . '.log'; - } - $this->write($level, $filename, true); - } else { - $info .= $level; + $filename = $this->getApartLevelFile($path, $type); + + $this->write($info[$type], $filename, true, $append); + unset($info[$type]); } } + if ($info) { - return $this->write($info, $destination); + return $this->write($info, $destination, false, $append); } + return true; } - protected function write($message, $destination, $apart = false) + /** + * 鑾峰彇涓绘棩蹇楁枃浠跺悕 + * @access public + * @return string + */ + protected function getMasterLogFile() { - //妫娴嬫棩蹇楁枃浠跺ぇ灏忥紝瓒呰繃閰嶇疆澶у皬鍒欏浠芥棩蹇楁枃浠堕噸鏂扮敓鎴 - if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) { - try { - rename($destination, dirname($destination) . DS . time() . '-' . basename($destination)); - } catch (\Exception $e) { - } - $this->writed[$destination] = false; - } + if ($this->config['single']) { + $name = is_string($this->config['single']) ? $this->config['single'] : 'single'; - if (empty($this->writed[$destination]) && !IS_CLI) { - if (App::$debug && !$apart) { - // 鑾峰彇鍩烘湰淇℃伅 - if (isset($_SERVER['HTTP_HOST'])) { - $current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - } else { - $current_uri = "cmd:" . implode(' ', $_SERVER['argv']); + $destination = $this->config['path'] . $name . '.log'; + } else { + $cli = PHP_SAPI == 'cli' ? '_cli' : ''; + + if ($this->config['max_files']) { + $filename = date('Ymd') . $cli . '.log'; + $files = glob($this->config['path'] . '*.log'); + + try { + if (count($files) > $this->config['max_files']) { + unlink($files[0]); + } + } catch (\Exception $e) { } - - $runtime = round(microtime(true) - THINK_START_TIME, 10); - $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '鈭'; - $time_str = ' [杩愯鏃堕棿锛' . number_format($runtime, 6) . 's][鍚炲悙鐜囷細' . $reqs . 'req/s]'; - $memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2); - $memory_str = ' [鍐呭瓨娑堣楋細' . $memory_use . 'kb]'; - $file_load = ' [鏂囦欢鍔犺浇锛' . count(get_included_files()) . ']'; - - $message = '[ info ] ' . $current_uri . $time_str . $memory_str . $file_load . "\r\n" . $message; + } else { + $filename = date('Ym') . DIRECTORY_SEPARATOR . date('d') . $cli . '.log'; } - $now = date($this->config['time_format']); - $ip = Request::instance()->ip(); - $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'CLI'; - $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; - $message = "---------------------------------------------------------------\r\n[{$now}] {$ip} {$method} {$uri}\r\n" . $message; - $this->writed[$destination] = true; + $destination = $this->config['path'] . $filename; } - if (IS_CLI) { - $now = date($this->config['time_format']); - $message = "[{$now}]" . $message; + return $destination; + } + + /** + * 鑾峰彇鐙珛鏃ュ織鏂囦欢鍚 + * @access public + * @param string $path 鏃ュ織鐩綍 + * @param string $type 鏃ュ織绫诲瀷 + * @return string + */ + protected function getApartLevelFile($path, $type) + { + $cli = PHP_SAPI == 'cli' ? '_cli' : ''; + + if ($this->config['single']) { + $name = is_string($this->config['single']) ? $this->config['single'] : 'single'; + + $name .= '_' . $type; + } elseif ($this->config['max_files']) { + $name = date('Ymd') . '_' . $type . $cli; + } else { + $name = date('d') . '_' . $type . $cli; + } + + return $path . DIRECTORY_SEPARATOR . $name . '.log'; + } + + /** + * 鏃ュ織鍐欏叆 + * @access protected + * @param array $message 鏃ュ織淇℃伅 + * @param string $destination 鏃ュ織鏂囦欢 + * @param bool $apart 鏄惁鐙珛鏂囦欢鍐欏叆 + * @param bool $append 鏄惁杩藉姞璇锋眰淇℃伅 + * @return bool + */ + protected function write($message, $destination, $apart = false, $append = false) + { + // 妫娴嬫棩蹇楁枃浠跺ぇ灏忥紝瓒呰繃閰嶇疆澶у皬鍒欏浠芥棩蹇楁枃浠堕噸鏂扮敓鎴 + $this->checkLogSize($destination); + + // 鏃ュ織淇℃伅灏佽 + $info['timestamp'] = date($this->config['time_format']); + + foreach ($message as $type => $msg) { + $info[$type] = is_array($msg) ? implode("\r\n", $msg) : $msg; + } + + if (PHP_SAPI == 'cli') { + $message = $this->parseCliLog($info); + } else { + // 娣诲姞璋冭瘯鏃ュ織 + $this->getDebugLog($info, $append, $apart); + + $message = $this->parseLog($info); } return error_log($message, 3, $destination); } + /** + * 妫鏌ユ棩蹇楁枃浠跺ぇ灏忓苟鑷姩鐢熸垚澶囦唤鏂囦欢 + * @access protected + * @param string $destination 鏃ュ織鏂囦欢 + * @return void + */ + protected function checkLogSize($destination) + { + if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) { + try { + rename($destination, dirname($destination) . DIRECTORY_SEPARATOR . time() . '-' . basename($destination)); + } catch (\Exception $e) { + } + } + } + + /** + * CLI鏃ュ織瑙f瀽 + * @access protected + * @param array $info 鏃ュ織淇℃伅 + * @return string + */ + protected function parseCliLog($info) + { + if ($this->config['json']) { + $message = json_encode($info, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "\r\n"; + } else { + $now = $info['timestamp']; + unset($info['timestamp']); + + $message = implode("\r\n", $info); + + $message = "[{$now}]" . $message . "\r\n"; + } + + return $message; + } + + /** + * 瑙f瀽鏃ュ織 + * @access protected + * @param array $info 鏃ュ織淇℃伅 + * @return string + */ + protected function parseLog($info) + { + $request = Request::instance(); + $requestInfo = [ + 'ip' => $request->ip(), + 'method' => $request->method(), + 'host' => $request->host(), + 'uri' => $request->url(), + ]; + + if ($this->config['json']) { + $info = $requestInfo + $info; + return json_encode($info, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . "\r\n"; + } + + array_unshift($info, "---------------------------------------------------------------\r\n[{$info['timestamp']}] {$requestInfo['ip']} {$requestInfo['method']} {$requestInfo['host']}{$requestInfo['uri']}"); + unset($info['timestamp']); + + return implode("\r\n", $info) . "\r\n"; + } + + protected function getDebugLog(&$info, $append, $apart) + { + if (App::$debug && $append) { + + if ($this->config['json']) { + // 鑾峰彇鍩烘湰淇℃伅 + $runtime = round(microtime(true) - THINK_START_TIME, 10); + $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '鈭'; + + $memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2); + + $info = [ + 'runtime' => number_format($runtime, 6) . 's', + 'reqs' => $reqs . 'req/s', + 'memory' => $memory_use . 'kb', + 'file' => count(get_included_files()), + ] + $info; + + } elseif (!$apart) { + // 澧炲姞棰濆鐨勮皟璇曚俊鎭 + $runtime = round(microtime(true) - THINK_START_TIME, 10); + $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '鈭'; + + $memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2); + + $time_str = '[杩愯鏃堕棿锛' . number_format($runtime, 6) . 's] [鍚炲悙鐜囷細' . $reqs . 'req/s]'; + $memory_str = ' [鍐呭瓨娑堣楋細' . $memory_use . 'kb]'; + $file_load = ' [鏂囦欢鍔犺浇锛' . count(get_included_files()) . ']'; + + array_unshift($info, $time_str . $memory_str . $file_load); + } + } + } } diff --git a/thinkphp/library/think/log/driver/Socket.php b/thinkphp/library/think/log/driver/Socket.php index d30bba304..4f62915bc 100644 --- a/thinkphp/library/think/log/driver/Socket.php +++ b/thinkphp/library/think/log/driver/Socket.php @@ -60,7 +60,7 @@ class Socket * @param array $log 鏃ュ織淇℃伅 * @return bool */ - public function save(array $log = []) + public function save(array $log = [], $append = false) { if (!$this->check()) { return false; diff --git a/thinkphp/library/think/model/Collection.php b/thinkphp/library/think/model/Collection.php index 37d58ae10..0406533c1 100644 --- a/thinkphp/library/think/model/Collection.php +++ b/thinkphp/library/think/model/Collection.php @@ -16,20 +16,6 @@ use think\Model; class Collection extends BaseCollection { - /** - * 杩斿洖鏁扮粍涓寚瀹氱殑涓鍒 - * @param string $column_key - * @param string|null $index_key - * @return array - */ - public function column($column_key, $index_key = null) - { - if (function_exists('array_column')) { - return array_column($this->toArray(), $column_key, $index_key); - } - return parent::column($column_key, $index_key); - } - /** * 寤惰繜棰勮浇鍏ュ叧鑱旀煡璇 * @access public diff --git a/thinkphp/library/think/model/Relation.php b/thinkphp/library/think/model/Relation.php index b67bbf58a..25fe88dbd 100644 --- a/thinkphp/library/think/model/Relation.php +++ b/thinkphp/library/think/model/Relation.php @@ -49,7 +49,7 @@ abstract class Relation } /** - * 鑾峰彇褰撳墠鐨勫叧鑱旀ā鍨嬬被 + * 鑾峰彇褰撳墠鐨勫叧鑱旀ā鍨嬪璞″疄渚 * @access public * @return Model */ diff --git a/thinkphp/library/think/model/relation/BelongsTo.php b/thinkphp/library/think/model/relation/BelongsTo.php index dfd611471..c1cbab97d 100644 --- a/thinkphp/library/think/model/relation/BelongsTo.php +++ b/thinkphp/library/think/model/relation/BelongsTo.php @@ -52,6 +52,7 @@ class BelongsTo extends OneToOne call_user_func_array($closure, [ & $this->query]); } $relationModel = $this->query + ->removeWhereField($this->localKey) ->where($this->localKey, $this->parent->$foreignKey) ->relation($subRelation) ->find(); @@ -128,6 +129,7 @@ class BelongsTo extends OneToOne } if (!empty($range)) { + $this->query->removeWhereField($localKey); $data = $this->eagerlyWhere($this->query, [ $localKey => [ 'in', @@ -171,7 +173,8 @@ class BelongsTo extends OneToOne { $localKey = $this->localKey; $foreignKey = $this->foreignKey; - $data = $this->eagerlyWhere($this->query, [$localKey => $result->$foreignKey], $localKey, $relation, $subRelation, $closure); + $this->query->removeWhereField($localKey); + $data = $this->eagerlyWhere($this->query, [$localKey => $result->$foreignKey], $localKey, $relation, $subRelation, $closure); // 鍏宠仈妯″瀷 if (!isset($data[$result->$foreignKey])) { $relationModel = null; @@ -220,4 +223,21 @@ class BelongsTo extends OneToOne return $this->parent->setRelation($this->relation, null); } + + /** + * 鎵ц鍩虹鏌ヨ锛堜粎鎵ц涓娆★級 + * @access protected + * @return void + */ + protected function baseQuery() + { + if (empty($this->baseQuery)) { + if (isset($this->parent->{$this->foreignKey})) { + // 鍏宠仈鏌ヨ甯﹀叆鍏宠仈鏉′欢 + $this->query->where($this->localKey, '=', $this->parent->{$this->foreignKey}); + } + + $this->baseQuery = true; + } + } } diff --git a/thinkphp/library/think/model/relation/BelongsToMany.php b/thinkphp/library/think/model/relation/BelongsToMany.php index 2f451a72c..a41c45cee 100644 --- a/thinkphp/library/think/model/relation/BelongsToMany.php +++ b/thinkphp/library/think/model/relation/BelongsToMany.php @@ -12,6 +12,7 @@ namespace think\model\relation; use think\Collection; +use think\Db; use think\db\Query; use think\Exception; use think\Loader; @@ -28,6 +29,8 @@ class BelongsToMany extends Relation protected $pivotName; // 涓棿琛ㄦā鍨嬪璞 protected $pivot; + // 涓棿琛ㄦ暟鎹悕绉 + protected $pivotDataName = 'pivot'; /** * 鏋勯犲嚱鏁 @@ -70,17 +73,43 @@ class BelongsToMany extends Relation } /** - * 瀹炰緥鍖栦腑闂磋〃妯″瀷 + * 璁剧疆涓棿琛ㄦ暟鎹悕绉 + * @access public + * @param string $name + * @return $this + */ + public function pivotDataName($name) + { + $this->pivotDataName = $name; + return $this; + } + + /** + * 鑾峰彇涓棿琛ㄦ洿鏂版潯浠 * @param $data + * @return array + */ + protected function getUpdateWhere($data) + { + return [ + $this->localKey => $data[$this->localKey], + $this->foreignKey => $data[$this->foreignKey], + ]; + } + + /** + * 瀹炰緥鍖栦腑闂磋〃妯″瀷 + * @param array $data + * @param bool $isUpdate * @return Pivot * @throws Exception */ - protected function newPivot($data = []) + protected function newPivot($data = [], $isUpdate = false) { $class = $this->pivotName ?: '\\think\\model\\Pivot'; $pivot = new $class($data, $this->parent, $this->middle); if ($pivot instanceof Pivot) { - return $pivot; + return $isUpdate ? $pivot->isUpdate(true, $this->getUpdateWhere($data)) : $pivot; } else { throw new Exception('pivot model must extends: \think\model\Pivot'); } @@ -103,7 +132,7 @@ class BelongsToMany extends Relation } } } - $model->setRelation('pivot', $this->newPivot($pivot)); + $model->setRelation($this->pivotDataName, $this->newPivot($pivot, true)); } } @@ -331,14 +360,22 @@ class BelongsToMany extends Relation * 鑾峰彇鍏宠仈缁熻瀛愭煡璇 * @access public * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 * @return string */ - public function getRelationCountQuery($closure) + public function getRelationCountQuery($closure, &$name = null) { + if ($closure) { + $return = call_user_func_array($closure, [ & $this->query]); + if ($return && is_string($return)) { + $name = $return; + } + } + return $this->belongsToManyQuery($this->foreignKey, $this->localKey, [ 'pivot.' . $this->localKey => [ 'exp', - '=' . $this->parent->getTable() . '.' . $this->parent->getPk(), + Db::raw('=' . $this->parent->getTable() . '.' . $this->parent->getPk()), ], ])->fetchSql()->count(); } @@ -369,7 +406,7 @@ class BelongsToMany extends Relation } } } - $set->setRelation('pivot', $this->newPivot($pivot)); + $set->setRelation($this->pivotDataName, $this->newPivot($pivot, true)); $data[$pivot[$this->localKey]][] = $set; } return $data; @@ -472,7 +509,7 @@ class BelongsToMany extends Relation foreach ($ids as $id) { $pivot[$this->foreignKey] = $id; $this->pivot->insert($pivot, true); - $result[] = $this->newPivot($pivot); + $result[] = $this->newPivot($pivot, true); } if (count($result) == 1) { // 杩斿洖涓棿琛ㄦā鍨嬪璞 @@ -484,6 +521,29 @@ class BelongsToMany extends Relation } } + /** + * 鍒ゆ柇鏄惁瀛樺湪鍏宠仈鏁版嵁 + * @access public + * @param mixed $data 鏁版嵁 鍙互浣跨敤鍏宠仈妯″瀷瀵硅薄 鎴栬 鍏宠仈瀵硅薄鐨勪富閿 + * @return Pivot + * @throws Exception + */ + public function attached($data) + { + if ($data instanceof Model) { + $relationFk = $data->getPk(); + $id = $data->$relationFk; + } else { + $id = $data; + } + + $pk = $this->parent->getPk(); + + $pivot = $this->pivot->where($this->localKey, $this->parent->$pk)->where($this->foreignKey, $id)->find(); + + return $pivot ?: false; + } + /** * 瑙i櫎鍏宠仈鐨勪竴涓腑闂磋〃鏁版嵁 * @access public diff --git a/thinkphp/library/think/model/relation/HasMany.php b/thinkphp/library/think/model/relation/HasMany.php index 3a9b111d6..ebab051ad 100644 --- a/thinkphp/library/think/model/relation/HasMany.php +++ b/thinkphp/library/think/model/relation/HasMany.php @@ -143,7 +143,7 @@ class HasMany extends Relation if ($closure) { call_user_func_array($closure, [ & $this->query]); } - $count = $this->query->where([$this->foreignKey => $result->$localKey])->count(); + $count = $this->query->where($this->foreignKey, $result->$localKey)->count(); } return $count; } @@ -152,20 +152,19 @@ class HasMany extends Relation * 鍒涘缓鍏宠仈缁熻瀛愭煡璇 * @access public * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 * @return string */ - public function getRelationCountQuery($closure) + public function getRelationCountQuery($closure, &$name = null) { if ($closure) { - call_user_func_array($closure, [ & $this->query]); + $return = call_user_func_array($closure, [ & $this->query]); + if ($return && is_string($return)) { + $name = $return; + } } $localKey = $this->localKey ?: $this->parent->getPk(); - return $this->query->where([ - $this->foreignKey => [ - 'exp', - '=' . $this->parent->getTable() . '.' . $localKey, - ], - ])->fetchSql()->count(); + return $this->query->whereExp($this->foreignKey, '=' . $this->parent->getTable() . '.' . $localKey)->fetchSql()->count(); } /** @@ -206,12 +205,31 @@ class HasMany extends Relation if ($data instanceof Model) { $data = $data->getData(); } + // 淇濆瓨鍏宠仈琛ㄦ暟鎹 - $model = new $this->model; $data[$this->foreignKey] = $this->parent->{$this->localKey}; + + $model = new $this->model(); return $model->save($data) ? $model : false; } + /** + * 鍒涘缓鍏宠仈瀵硅薄瀹炰緥 + * @param array $data + * @return Model + */ + public function make($data = []) + { + if ($data instanceof Model) { + $data = $data->getData(); + } + + // 淇濆瓨鍏宠仈琛ㄦ暟鎹 + $data[$this->foreignKey] = $this->parent->{$this->localKey}; + + return new $this->model($data); + } + /** * 鎵归噺淇濆瓨褰撳墠鍏宠仈鏁版嵁瀵硅薄 * @access public diff --git a/thinkphp/library/think/model/relation/HasManyThrough.php b/thinkphp/library/think/model/relation/HasManyThrough.php index b7b3333de..3a9a5482e 100644 --- a/thinkphp/library/think/model/relation/HasManyThrough.php +++ b/thinkphp/library/think/model/relation/HasManyThrough.php @@ -120,6 +120,18 @@ class HasManyThrough extends Relation public function relationCount($result, $closure) {} + /** + * 鍒涘缓鍏宠仈缁熻瀛愭煡璇 + * @access public + * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 + * @return string + */ + public function getRelationCountQuery($closure, &$name = null) + { + throw new Exception('relation not support: withCount'); + } + /** * 鎵ц鍩虹鏌ヨ锛堣繘鎵ц涓娆★級 * @access protected diff --git a/thinkphp/library/think/model/relation/HasOne.php b/thinkphp/library/think/model/relation/HasOne.php index f64f133ff..db74e4a63 100644 --- a/thinkphp/library/think/model/relation/HasOne.php +++ b/thinkphp/library/think/model/relation/HasOne.php @@ -50,7 +50,11 @@ class HasOne extends OneToOne call_user_func_array($closure, [ & $this->query]); } // 鍒ゆ柇鍏宠仈绫诲瀷鎵ц鏌ヨ - $relationModel = $this->query->where($this->foreignKey, $this->parent->$localKey)->relation($subRelation)->find(); + $relationModel = $this->query + ->removeWhereField($this->foreignKey) + ->where($this->foreignKey, $this->parent->$localKey) + ->relation($subRelation) + ->find(); if ($relationModel) { $relationModel->setParent(clone $this->parent); @@ -130,7 +134,8 @@ class HasOne extends OneToOne } if (!empty($range)) { - $data = $this->eagerlyWhere($this, [ + $this->query->removeWhereField($foreignKey); + $data = $this->eagerlyWhere($this->query, [ $foreignKey => [ 'in', $range, @@ -172,7 +177,8 @@ class HasOne extends OneToOne { $localKey = $this->localKey; $foreignKey = $this->foreignKey; - $data = $this->eagerlyWhere($this, [$foreignKey => $result->$localKey], $foreignKey, $relation, $subRelation, $closure); + $this->query->removeWhereField($foreignKey); + $data = $this->eagerlyWhere($this->query, [$foreignKey => $result->$localKey], $foreignKey, $relation, $subRelation, $closure); // 鍏宠仈妯″瀷 if (!isset($data[$result->$localKey])) { @@ -190,4 +196,20 @@ class HasOne extends OneToOne } } + /** + * 鎵ц鍩虹鏌ヨ锛堜粎鎵ц涓娆★級 + * @access protected + * @return void + */ + protected function baseQuery() + { + if (empty($this->baseQuery)) { + if (isset($this->parent->{$this->localKey})) { + // 鍏宠仈鏌ヨ甯﹀叆鍏宠仈鏉′欢 + $this->query->where($this->foreignKey, '=', $this->parent->{$this->localKey}); + } + + $this->baseQuery = true; + } + } } diff --git a/thinkphp/library/think/model/relation/MorphMany.php b/thinkphp/library/think/model/relation/MorphMany.php index 23f7c52a7..2755d5753 100644 --- a/thinkphp/library/think/model/relation/MorphMany.php +++ b/thinkphp/library/think/model/relation/MorphMany.php @@ -11,6 +11,7 @@ namespace think\model\relation; +use think\Db; use think\db\Query; use think\Exception; use think\Loader; @@ -187,21 +188,25 @@ class MorphMany extends Relation } /** - * 鑾峰彇鍏宠仈缁熻瀛愭煡璇 + * 鍒涘缓鍏宠仈缁熻瀛愭煡璇 * @access public * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 * @return string */ - public function getRelationCountQuery($closure) + public function getRelationCountQuery($closure, &$name = null) { if ($closure) { - call_user_func_array($closure, [ & $this->query]); + $return = call_user_func_array($closure, [ & $this->query]); + if ($return && is_string($return)) { + $name = $return; + } } return $this->query->where([ $this->morphKey => [ 'exp', - '=' . $this->parent->getTable() . '.' . $this->parent->getPk(), + Db::raw('=' . $this->parent->getTable() . '.' . $this->parent->getPk()), ], $this->morphType => $this->type, ])->fetchSql()->count(); @@ -243,13 +248,36 @@ class MorphMany extends Relation if ($data instanceof Model) { $data = $data->getData(); } + // 淇濆瓨鍏宠仈琛ㄦ暟鎹 $pk = $this->parent->getPk(); - $model = new $this->model; $data[$this->morphKey] = $this->parent->$pk; $data[$this->morphType] = $this->type; - return $model->save($data) ? $model : false; + + $model = new $this->model(); + + return $model->save() ? $model : false; + } + + /** + * 鍒涘缓鍏宠仈瀵硅薄瀹炰緥 + * @param array $data + * @return Model + */ + public function make($data = []) + { + if ($data instanceof Model) { + $data = $data->getData(); + } + + // 淇濆瓨鍏宠仈琛ㄦ暟鎹 + $pk = $this->parent->getPk(); + + $data[$this->morphKey] = $this->parent->$pk; + $data[$this->morphType] = $this->type; + + return new $this->model($data); } /** diff --git a/thinkphp/library/think/model/relation/MorphOne.php b/thinkphp/library/think/model/relation/MorphOne.php index 2337599b4..5ec717248 100644 --- a/thinkphp/library/think/model/relation/MorphOne.php +++ b/thinkphp/library/think/model/relation/MorphOne.php @@ -81,8 +81,8 @@ class MorphOne extends Relation /** * 鏍规嵁鍏宠仈鏉′欢鏌ヨ褰撳墠妯″瀷 * @access public - * @param mixed $where 鏌ヨ鏉′欢锛堟暟缁勬垨鑰呴棴鍖咃級 - * @param mixed $fields 瀛楁 + * @param mixed $where 鏌ヨ鏉′欢锛堟暟缁勬垨鑰呴棴鍖咃級 + * @param mixed $fields 瀛楁 * @return Query */ public function hasWhere($where = [], $fields = null) @@ -202,13 +202,35 @@ class MorphOne extends Relation if ($data instanceof Model) { $data = $data->getData(); } + // 淇濆瓨鍏宠仈琛ㄦ暟鎹 $pk = $this->parent->getPk(); - $model = new $this->model; $data[$this->morphKey] = $this->parent->$pk; $data[$this->morphType] = $this->type; - return $model->save($data) ? $model : false; + + $model = new $this->model(); + + return $model->save() ? $model : false; + } + + /** + * 鍒涘缓鍏宠仈瀵硅薄瀹炰緥 + * @param array $data + * @return Model + */ + public function make($data = []) + { + if ($data instanceof Model) { + $data = $data->getData(); + } + // 淇濆瓨鍏宠仈琛ㄦ暟鎹 + $pk = $this->parent->getPk(); + + $data[$this->morphKey] = $this->parent->$pk; + $data[$this->morphType] = $this->type; + + return new $this->model($data); } /** @@ -227,4 +249,15 @@ class MorphOne extends Relation } } + /** + * 鍒涘缓鍏宠仈缁熻瀛愭煡璇 + * @access public + * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 + * @return string + */ + public function getRelationCountQuery($closure, &$name = null) + { + throw new Exception('relation not support: withCount'); + } } diff --git a/thinkphp/library/think/model/relation/MorphTo.php b/thinkphp/library/think/model/relation/MorphTo.php index 504130a4b..7d4526517 100644 --- a/thinkphp/library/think/model/relation/MorphTo.php +++ b/thinkphp/library/think/model/relation/MorphTo.php @@ -105,7 +105,7 @@ class MorphTo extends Relation /** * 瑙f瀽妯″瀷鐨勫畬鏁村懡鍚嶇┖闂 - * @access public + * @access protected * @param string $model 妯″瀷鍚嶏紙鎴栬呭畬鏁寸被鍚嶏級 * @return string */ @@ -285,4 +285,15 @@ class MorphTo extends Relation return $this->parent->setRelation($this->relation, null); } + /** + * 鍒涘缓鍏宠仈缁熻瀛愭煡璇 + * @access public + * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 + * @return string + */ + public function getRelationCountQuery($closure, &$name = null) + { + throw new Exception('relation not support: withCount'); + } } diff --git a/thinkphp/library/think/model/relation/OneToOne.php b/thinkphp/library/think/model/relation/OneToOne.php index 02d7d5639..353ce21b4 100644 --- a/thinkphp/library/think/model/relation/OneToOne.php +++ b/thinkphp/library/think/model/relation/OneToOne.php @@ -304,6 +304,8 @@ abstract class OneToOne extends Relation */ protected function eagerlyWhere($model, $where, $key, $relation, $subRelation = '', $closure = false) { + $this->baseQuery = true; + // 棰勮浇鍏ュ叧鑱旀煡璇 鏀寔宓屽棰勮浇鍏 if ($closure) { call_user_func_array($closure, [ & $model]); @@ -321,4 +323,15 @@ abstract class OneToOne extends Relation return $data; } + /** + * 鍒涘缓鍏宠仈缁熻瀛愭煡璇 + * @access public + * @param \Closure $closure 闂寘 + * @param string $name 缁熻鏁版嵁鍒悕 + * @return string + */ + public function getRelationCountQuery($closure, &$name = null) + { + throw new Exception('relation not support: withCount'); + } } diff --git a/thinkphp/library/think/template/driver/File.php b/thinkphp/library/think/template/driver/File.php index bf3d22af0..a9a86bf2a 100644 --- a/thinkphp/library/think/template/driver/File.php +++ b/thinkphp/library/think/template/driver/File.php @@ -15,6 +15,8 @@ use think\Exception; class File { + protected $cacheFile; + /** * 鍐欏叆缂栬瘧缂撳瓨 * @param string $cacheFile 缂撳瓨鐨勬枃浠跺悕 @@ -42,12 +44,13 @@ class File */ public function read($cacheFile, $vars = []) { + $this->cacheFile = $cacheFile; if (!empty($vars) && is_array($vars)) { // 妯℃澘闃靛垪鍙橀噺鍒嗚В鎴愪负鐙珛鍙橀噺 extract($vars, EXTR_OVERWRITE); } //杞藉叆妯$増缂撳瓨鏂囦欢 - include $cacheFile; + include $this->cacheFile; } /** diff --git a/thinkphp/library/think/view/driver/Php.php b/thinkphp/library/think/view/driver/Php.php index fa5053502..f594a4384 100644 --- a/thinkphp/library/think/view/driver/Php.php +++ b/thinkphp/library/think/view/driver/Php.php @@ -29,7 +29,11 @@ class Php 'view_suffix' => 'php', // 妯℃澘鏂囦欢鍚嶅垎闅旂 'view_depr' => DS, + // 榛樿妯℃澘娓叉煋瑙勫垯 1 瑙f瀽涓哄皬鍐+涓嬪垝绾 2 鍏ㄩ儴杞崲灏忓啓 + 'auto_rule' => 1, ]; + protected $template; + protected $content; public function __construct($config = []) { @@ -68,16 +72,12 @@ class Php if (!is_file($template)) { throw new TemplateNotFoundException('template not exists:' . $template, $template); } + $this->template = $template; // 璁板綍瑙嗗浘淇℃伅 App::$debug && Log::record('[ VIEW ] ' . $template . ' [ ' . var_export(array_keys($data), true) . ' ]', 'info'); - if (isset($data['template'])) { - $__template__ = $template; - extract($data, EXTR_OVERWRITE); - include $__template__; - } else { - extract($data, EXTR_OVERWRITE); - include $template; - } + + extract($data, EXTR_OVERWRITE); + include $this->template; } /** @@ -89,14 +89,10 @@ class Php */ public function display($content, $data = []) { - if (isset($data['content'])) { - $__content__ = $content; - extract($data, EXTR_OVERWRITE); - eval('?>' . $__content__); - } else { - extract($data, EXTR_OVERWRITE); - eval('?>' . $content); - } + $this->content = $content; + + extract($data, EXTR_OVERWRITE); + eval('?>' . $this->content); } /** @@ -132,7 +128,7 @@ class Php if ($controller) { if ('' == $template) { // 濡傛灉妯℃澘鏂囦欢鍚嶄负绌 鎸夌収榛樿瑙勫垯瀹氫綅 - $template = str_replace('.', DS, $controller) . $depr . $request->action(); + $template = str_replace('.', DS, $controller) . $depr . (1 == $this->config['auto_rule'] ? Loader::parseName($request->action(true)) : $request->action()); } elseif (false === strpos($template, $depr)) { $template = str_replace('.', DS, $controller) . $depr . $template; } diff --git a/thinkphp/library/think/view/driver/Think.php b/thinkphp/library/think/view/driver/Think.php index 46829d51e..a314ad606 100644 --- a/thinkphp/library/think/view/driver/Think.php +++ b/thinkphp/library/think/view/driver/Think.php @@ -34,6 +34,8 @@ class Think 'view_depr' => DS, // 鏄惁寮鍚ā鏉跨紪璇戠紦瀛,璁句负false鍒欐瘡娆¢兘浼氶噸鏂扮紪璇 'tpl_cache' => true, + // 榛樿妯℃澘娓叉煋瑙勫垯 1 瑙f瀽涓哄皬鍐+涓嬪垝绾 2 鍏ㄩ儴杞崲灏忓啓 + 'auto_rule' => 1, ]; public function __construct($config = []) @@ -127,7 +129,7 @@ class Think if ($controller) { if ('' == $template) { // 濡傛灉妯℃澘鏂囦欢鍚嶄负绌 鎸夌収榛樿瑙勫垯瀹氫綅 - $template = str_replace('.', DS, $controller) . $depr . $request->action(); + $template = str_replace('.', DS, $controller) . $depr . (1 == $this->config['auto_rule'] ? Loader::parseName($request->action(true)) : $request->action()); } elseif (false === strpos($template, $depr)) { $template = str_replace('.', DS, $controller) . $depr . $template; } diff --git a/thinkphp/library/traits/model/SoftDelete.php b/thinkphp/library/traits/model/SoftDelete.php index 4c8a6b82c..70f31ba29 100644 --- a/thinkphp/library/traits/model/SoftDelete.php +++ b/thinkphp/library/traits/model/SoftDelete.php @@ -2,6 +2,7 @@ namespace traits\model; +use think\Collection; use think\db\Query; use think\Model; @@ -111,7 +112,7 @@ trait SoftDelete } // 鍖呭惈杞垹闄ゆ暟鎹 - $query = self::withTrashed(); + $query = (new static())->db(false); if (is_array($data) && key($data) !== 0) { $query->where($data); $data = null; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 2c72175e7..fce8549f0 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -279,7 +279,7 @@ class ClassLoader */ public function setApcuPrefix($apcuPrefix) { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; } /** @@ -377,11 +377,11 @@ class ClassLoader $subPath = $class; while (false !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; + $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { - $length = $this->prefixLengthsPsr4[$first][$search]; - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + if (file_exists($file = $dir . $pathEnd)) { return $file; } } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b6e3887f1..06962d8e4 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,301 +6,5 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Endroid\\QrCode\\Bundle\\Controller\\QrCodeController' => $vendorDir . '/endroid/qrcode/src/Bundle/Controller/QrCodeController.php', - 'Endroid\\QrCode\\Bundle\\DependencyInjection\\Configuration' => $vendorDir . '/endroid/qrcode/src/Bundle/DependencyInjection/Configuration.php', - 'Endroid\\QrCode\\Bundle\\DependencyInjection\\EndroidQrCodeExtension' => $vendorDir . '/endroid/qrcode/src/Bundle/DependencyInjection/EndroidQrCodeExtension.php', - 'Endroid\\QrCode\\Bundle\\EndroidQrCodeBundle' => $vendorDir . '/endroid/qrcode/src/Bundle/EndroidQrCodeBundle.php', - 'Endroid\\QrCode\\Bundle\\Twig\\Extension\\QrCodeExtension' => $vendorDir . '/endroid/qrcode/src/Bundle/Twig/Extension/QrCodeExtension.php', - 'Endroid\\QrCode\\Exceptions\\DataDoesntExistsException' => $vendorDir . '/endroid/qrcode/src/Exceptions/DataDoesntExistsException.php', - 'Endroid\\QrCode\\Exceptions\\FreeTypeLibraryMissingException' => $vendorDir . '/endroid/qrcode/src/Exceptions/FreeTypeLibraryMissingException.php', - 'Endroid\\QrCode\\Exceptions\\ImageFunctionFailedException' => $vendorDir . '/endroid/qrcode/src/Exceptions/ImageFunctionFailedException.php', - 'Endroid\\QrCode\\Exceptions\\ImageFunctionUnknownException' => $vendorDir . '/endroid/qrcode/src/Exceptions/ImageFunctionUnknownException.php', - 'Endroid\\QrCode\\Exceptions\\ImageSizeTooLargeException' => $vendorDir . '/endroid/qrcode/src/Exceptions/ImageSizeTooLargeException.php', - 'Endroid\\QrCode\\Exceptions\\ImageTypeInvalidException' => $vendorDir . '/endroid/qrcode/src/Exceptions/ImageTypeInvalidException.php', - 'Endroid\\QrCode\\Exceptions\\VersionTooLargeException' => $vendorDir . '/endroid/qrcode/src/Exceptions/VersionTooLargeException.php', - 'Endroid\\QrCode\\Factory\\QrCodeFactory' => $vendorDir . '/endroid/qrcode/src/Factory/QrCodeFactory.php', - 'Endroid\\QrCode\\QrCode' => $vendorDir . '/endroid/qrcode/src/QrCode.php', 'Ip2Region' => $vendorDir . '/zoujingli/ip2region/Ip2Region.php', - 'OSS\\Core\\MimeTypes' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Core/MimeTypes.php', - 'OSS\\Core\\OssException' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php', - 'OSS\\Core\\OssUtil' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php', - 'OSS\\Http\\RequestCore' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php', - 'OSS\\Http\\RequestCore_Exception' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore_Exception.php', - 'OSS\\Http\\ResponseCore' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Http/ResponseCore.php', - 'OSS\\Model\\BucketInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php', - 'OSS\\Model\\BucketListInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php', - 'OSS\\Model\\CnameConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/CnameConfig.php', - 'OSS\\Model\\CorsConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php', - 'OSS\\Model\\CorsRule' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php', - 'OSS\\Model\\GetLiveChannelHistory' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php', - 'OSS\\Model\\GetLiveChannelInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php', - 'OSS\\Model\\GetLiveChannelStatus' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php', - 'OSS\\Model\\LifecycleAction' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php', - 'OSS\\Model\\LifecycleConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php', - 'OSS\\Model\\LifecycleRule' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php', - 'OSS\\Model\\ListMultipartUploadInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/ListMultipartUploadInfo.php', - 'OSS\\Model\\ListPartsInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/ListPartsInfo.php', - 'OSS\\Model\\LiveChannelConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php', - 'OSS\\Model\\LiveChannelHistory' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php', - 'OSS\\Model\\LiveChannelInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php', - 'OSS\\Model\\LiveChannelListInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php', - 'OSS\\Model\\LoggingConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php', - 'OSS\\Model\\ObjectInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php', - 'OSS\\Model\\ObjectListInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php', - 'OSS\\Model\\PartInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/PartInfo.php', - 'OSS\\Model\\PrefixInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php', - 'OSS\\Model\\RefererConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php', - 'OSS\\Model\\StorageCapacityConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php', - 'OSS\\Model\\UploadInfo' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php', - 'OSS\\Model\\WebsiteConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php', - 'OSS\\Model\\XmlConfig' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php', - 'OSS\\OssClient' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/OssClient.php', - 'OSS\\Result\\AclResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php', - 'OSS\\Result\\AppendResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php', - 'OSS\\Result\\BodyResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/BodyResult.php', - 'OSS\\Result\\CallbackResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php', - 'OSS\\Result\\CopyObjectResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php', - 'OSS\\Result\\DeleteObjectsResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php', - 'OSS\\Result\\ExistResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php', - 'OSS\\Result\\GetCnameResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php', - 'OSS\\Result\\GetCorsResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php', - 'OSS\\Result\\GetLifecycleResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php', - 'OSS\\Result\\GetLiveChannelHistoryResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php', - 'OSS\\Result\\GetLiveChannelInfoResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php', - 'OSS\\Result\\GetLiveChannelStatusResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php', - 'OSS\\Result\\GetLocationResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php', - 'OSS\\Result\\GetLoggingResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php', - 'OSS\\Result\\GetRefererResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php', - 'OSS\\Result\\GetStorageCapacityResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php', - 'OSS\\Result\\GetWebsiteResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php', - 'OSS\\Result\\HeaderResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php', - 'OSS\\Result\\InitiateMultipartUploadResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php', - 'OSS\\Result\\ListBucketsResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListBucketsResult.php', - 'OSS\\Result\\ListLiveChannelResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php', - 'OSS\\Result\\ListMultipartUploadResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php', - 'OSS\\Result\\ListObjectsResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php', - 'OSS\\Result\\ListPartsResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php', - 'OSS\\Result\\PutLiveChannelResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php', - 'OSS\\Result\\PutSetDeleteResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php', - 'OSS\\Result\\Result' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php', - 'OSS\\Result\\SymlinkResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php', - 'OSS\\Result\\UploadPartResult' => $vendorDir . '/aliyuncs/oss-sdk-php/src/OSS/Result/UploadPartResult.php', - 'Qiniu\\Auth' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Auth.php', - 'Qiniu\\Cdn\\CdnManager' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php', - 'Qiniu\\Config' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Config.php', - 'Qiniu\\Etag' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Etag.php', - 'Qiniu\\Http\\Client' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Http/Client.php', - 'Qiniu\\Http\\Error' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Http/Error.php', - 'Qiniu\\Http\\Request' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Http/Request.php', - 'Qiniu\\Http\\Response' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Http/Response.php', - 'Qiniu\\Processing\\ImageUrlBuilder' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php', - 'Qiniu\\Processing\\Operation' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Processing/Operation.php', - 'Qiniu\\Processing\\PersistentFop' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php', - 'Qiniu\\Storage\\BucketManager' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php', - 'Qiniu\\Storage\\FormUploader' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php', - 'Qiniu\\Storage\\ResumeUploader' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php', - 'Qiniu\\Storage\\UploadManager' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php', - 'Qiniu\\Zone' => $vendorDir . '/qiniu/php-sdk/src/Qiniu/Zone.php', - 'Symfony\\Component\\OptionsResolver\\Debug\\OptionsResolverIntrospector' => $vendorDir . '/symfony/options-resolver/Debug/OptionsResolverIntrospector.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\AccessException' => $vendorDir . '/symfony/options-resolver/Exception/AccessException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/options-resolver/Exception/ExceptionInterface.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/options-resolver/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidOptionsException' => $vendorDir . '/symfony/options-resolver/Exception/InvalidOptionsException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\MissingOptionsException' => $vendorDir . '/symfony/options-resolver/Exception/MissingOptionsException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\NoConfigurationException' => $vendorDir . '/symfony/options-resolver/Exception/NoConfigurationException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\NoSuchOptionException' => $vendorDir . '/symfony/options-resolver/Exception/NoSuchOptionException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\OptionDefinitionException' => $vendorDir . '/symfony/options-resolver/Exception/OptionDefinitionException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\UndefinedOptionsException' => $vendorDir . '/symfony/options-resolver/Exception/UndefinedOptionsException.php', - 'Symfony\\Component\\OptionsResolver\\Options' => $vendorDir . '/symfony/options-resolver/Options.php', - 'Symfony\\Component\\OptionsResolver\\OptionsResolver' => $vendorDir . '/symfony/options-resolver/OptionsResolver.php', - 'Wechat\\Lib\\Cache' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php', - 'Wechat\\Lib\\Common' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php', - 'Wechat\\Lib\\Tools' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php', - 'Wechat\\Loader' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/Loader.php', - 'Wechat\\WechatCard' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatCard.php', - 'Wechat\\WechatCustom' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php', - 'Wechat\\WechatDevice' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php', - 'Wechat\\WechatExtends' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php', - 'Wechat\\WechatHardware' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php', - 'Wechat\\WechatMedia' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php', - 'Wechat\\WechatMenu' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php', - 'Wechat\\WechatMessage' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php', - 'Wechat\\WechatOauth' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php', - 'Wechat\\WechatPay' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatPay.php', - 'Wechat\\WechatPoi' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php', - 'Wechat\\WechatReceive' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php', - 'Wechat\\WechatScript' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatScript.php', - 'Wechat\\WechatService' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatService.php', - 'Wechat\\WechatUser' => $vendorDir . '/zoujingli/wechat-php-sdk/Wechat/WechatUser.php', - 'think\\App' => $baseDir . '/thinkphp/library/think/App.php', - 'think\\Build' => $baseDir . '/thinkphp/library/think/Build.php', - 'think\\Cache' => $baseDir . '/thinkphp/library/think/Cache.php', - 'think\\Collection' => $baseDir . '/thinkphp/library/think/Collection.php', - 'think\\Config' => $baseDir . '/thinkphp/library/think/Config.php', - 'think\\Console' => $baseDir . '/thinkphp/library/think/Console.php', - 'think\\Controller' => $baseDir . '/thinkphp/library/think/Controller.php', - 'think\\Cookie' => $baseDir . '/thinkphp/library/think/Cookie.php', - 'think\\Db' => $baseDir . '/thinkphp/library/think/Db.php', - 'think\\Debug' => $baseDir . '/thinkphp/library/think/Debug.php', - 'think\\Env' => $baseDir . '/thinkphp/library/think/Env.php', - 'think\\Error' => $baseDir . '/thinkphp/library/think/Error.php', - 'think\\Exception' => $baseDir . '/thinkphp/library/think/Exception.php', - 'think\\File' => $baseDir . '/thinkphp/library/think/File.php', - 'think\\Hook' => $baseDir . '/thinkphp/library/think/Hook.php', - 'think\\Lang' => $baseDir . '/thinkphp/library/think/Lang.php', - 'think\\Loader' => $baseDir . '/thinkphp/library/think/Loader.php', - 'think\\Log' => $baseDir . '/thinkphp/library/think/Log.php', - 'think\\Model' => $baseDir . '/thinkphp/library/think/Model.php', - 'think\\Paginator' => $baseDir . '/thinkphp/library/think/Paginator.php', - 'think\\Process' => $baseDir . '/thinkphp/library/think/Process.php', - 'think\\Queue' => $vendorDir . '/topthink/think-queue/src/Queue.php', - 'think\\Request' => $baseDir . '/thinkphp/library/think/Request.php', - 'think\\Response' => $baseDir . '/thinkphp/library/think/Response.php', - 'think\\Route' => $baseDir . '/thinkphp/library/think/Route.php', - 'think\\Session' => $baseDir . '/thinkphp/library/think/Session.php', - 'think\\Template' => $baseDir . '/thinkphp/library/think/Template.php', - 'think\\Url' => $baseDir . '/thinkphp/library/think/Url.php', - 'think\\Validate' => $baseDir . '/thinkphp/library/think/Validate.php', - 'think\\View' => $baseDir . '/thinkphp/library/think/View.php', - 'think\\cache\\Driver' => $baseDir . '/thinkphp/library/think/cache/Driver.php', - 'think\\cache\\driver\\File' => $baseDir . '/thinkphp/library/think/cache/driver/File.php', - 'think\\cache\\driver\\Lite' => $baseDir . '/thinkphp/library/think/cache/driver/Lite.php', - 'think\\cache\\driver\\Memcache' => $baseDir . '/thinkphp/library/think/cache/driver/Memcache.php', - 'think\\cache\\driver\\Memcached' => $baseDir . '/thinkphp/library/think/cache/driver/Memcached.php', - 'think\\cache\\driver\\Redis' => $baseDir . '/thinkphp/library/think/cache/driver/Redis.php', - 'think\\cache\\driver\\Sqlite' => $baseDir . '/thinkphp/library/think/cache/driver/Sqlite.php', - 'think\\cache\\driver\\Wincache' => $baseDir . '/thinkphp/library/think/cache/driver/Wincache.php', - 'think\\cache\\driver\\Xcache' => $baseDir . '/thinkphp/library/think/cache/driver/Xcache.php', - 'think\\captcha\\Captcha' => $vendorDir . '/topthink/think-captcha/src/Captcha.php', - 'think\\captcha\\CaptchaController' => $vendorDir . '/topthink/think-captcha/src/CaptchaController.php', - 'think\\composer\\Plugin' => $vendorDir . '/topthink/think-installer/src/Plugin.php', - 'think\\composer\\ThinkExtend' => $vendorDir . '/topthink/think-installer/src/ThinkExtend.php', - 'think\\composer\\ThinkFramework' => $vendorDir . '/topthink/think-installer/src/ThinkFramework.php', - 'think\\composer\\ThinkTesting' => $vendorDir . '/topthink/think-installer/src/ThinkTesting.php', - 'think\\config\\driver\\Ini' => $baseDir . '/thinkphp/library/think/config/driver/Ini.php', - 'think\\config\\driver\\Json' => $baseDir . '/thinkphp/library/think/config/driver/Json.php', - 'think\\config\\driver\\Xml' => $baseDir . '/thinkphp/library/think/config/driver/Xml.php', - 'think\\console\\Command' => $baseDir . '/thinkphp/library/think/console/Command.php', - 'think\\console\\Input' => $baseDir . '/thinkphp/library/think/console/Input.php', - 'think\\console\\Output' => $baseDir . '/thinkphp/library/think/console/Output.php', - 'think\\console\\command\\Build' => $baseDir . '/thinkphp/library/think/console/command/Build.php', - 'think\\console\\command\\Clear' => $baseDir . '/thinkphp/library/think/console/command/Clear.php', - 'think\\console\\command\\Help' => $baseDir . '/thinkphp/library/think/console/command/Help.php', - 'think\\console\\command\\Lists' => $baseDir . '/thinkphp/library/think/console/command/Lists.php', - 'think\\console\\command\\Make' => $baseDir . '/thinkphp/library/think/console/command/Make.php', - 'think\\console\\command\\make\\Controller' => $baseDir . '/thinkphp/library/think/console/command/make/Controller.php', - 'think\\console\\command\\make\\Model' => $baseDir . '/thinkphp/library/think/console/command/make/Model.php', - 'think\\console\\command\\optimize\\Autoload' => $baseDir . '/thinkphp/library/think/console/command/optimize/Autoload.php', - 'think\\console\\command\\optimize\\Config' => $baseDir . '/thinkphp/library/think/console/command/optimize/Config.php', - 'think\\console\\command\\optimize\\Route' => $baseDir . '/thinkphp/library/think/console/command/optimize/Route.php', - 'think\\console\\command\\optimize\\Schema' => $baseDir . '/thinkphp/library/think/console/command/optimize/Schema.php', - 'think\\console\\input\\Argument' => $baseDir . '/thinkphp/library/think/console/input/Argument.php', - 'think\\console\\input\\Definition' => $baseDir . '/thinkphp/library/think/console/input/Definition.php', - 'think\\console\\input\\Option' => $baseDir . '/thinkphp/library/think/console/input/Option.php', - 'think\\console\\output\\Ask' => $baseDir . '/thinkphp/library/think/console/output/Ask.php', - 'think\\console\\output\\Descriptor' => $baseDir . '/thinkphp/library/think/console/output/Descriptor.php', - 'think\\console\\output\\Formatter' => $baseDir . '/thinkphp/library/think/console/output/Formatter.php', - 'think\\console\\output\\Question' => $baseDir . '/thinkphp/library/think/console/output/Question.php', - 'think\\console\\output\\descriptor\\Console' => $baseDir . '/thinkphp/library/think/console/output/descriptor/Console.php', - 'think\\console\\output\\driver\\Buffer' => $baseDir . '/thinkphp/library/think/console/output/driver/Buffer.php', - 'think\\console\\output\\driver\\Console' => $baseDir . '/thinkphp/library/think/console/output/driver/Console.php', - 'think\\console\\output\\driver\\Nothing' => $baseDir . '/thinkphp/library/think/console/output/driver/Nothing.php', - 'think\\console\\output\\formatter\\Stack' => $baseDir . '/thinkphp/library/think/console/output/formatter/Stack.php', - 'think\\console\\output\\formatter\\Style' => $baseDir . '/thinkphp/library/think/console/output/formatter/Style.php', - 'think\\console\\output\\question\\Choice' => $baseDir . '/thinkphp/library/think/console/output/question/Choice.php', - 'think\\console\\output\\question\\Confirmation' => $baseDir . '/thinkphp/library/think/console/output/question/Confirmation.php', - 'think\\controller\\Rest' => $baseDir . '/thinkphp/library/think/controller/Rest.php', - 'think\\controller\\Yar' => $baseDir . '/thinkphp/library/think/controller/Yar.php', - 'think\\db\\Builder' => $baseDir . '/thinkphp/library/think/db/Builder.php', - 'think\\db\\Connection' => $baseDir . '/thinkphp/library/think/db/Connection.php', - 'think\\db\\Query' => $baseDir . '/thinkphp/library/think/db/Query.php', - 'think\\db\\builder\\Mysql' => $baseDir . '/thinkphp/library/think/db/builder/Mysql.php', - 'think\\db\\builder\\Pgsql' => $baseDir . '/thinkphp/library/think/db/builder/Pgsql.php', - 'think\\db\\builder\\Sqlite' => $baseDir . '/thinkphp/library/think/db/builder/Sqlite.php', - 'think\\db\\builder\\Sqlsrv' => $baseDir . '/thinkphp/library/think/db/builder/Sqlsrv.php', - 'think\\db\\connector\\Mysql' => $baseDir . '/thinkphp/library/think/db/connector/Mysql.php', - 'think\\db\\connector\\Pgsql' => $baseDir . '/thinkphp/library/think/db/connector/Pgsql.php', - 'think\\db\\connector\\Sqlite' => $baseDir . '/thinkphp/library/think/db/connector/Sqlite.php', - 'think\\db\\connector\\Sqlsrv' => $baseDir . '/thinkphp/library/think/db/connector/Sqlsrv.php', - 'think\\db\\exception\\BindParamException' => $baseDir . '/thinkphp/library/think/db/exception/BindParamException.php', - 'think\\db\\exception\\DataNotFoundException' => $baseDir . '/thinkphp/library/think/db/exception/DataNotFoundException.php', - 'think\\db\\exception\\ModelNotFoundException' => $baseDir . '/thinkphp/library/think/db/exception/ModelNotFoundException.php', - 'think\\debug\\Console' => $baseDir . '/thinkphp/library/think/debug/Console.php', - 'think\\debug\\Html' => $baseDir . '/thinkphp/library/think/debug/Html.php', - 'think\\exception\\ClassNotFoundException' => $baseDir . '/thinkphp/library/think/exception/ClassNotFoundException.php', - 'think\\exception\\DbException' => $baseDir . '/thinkphp/library/think/exception/DbException.php', - 'think\\exception\\ErrorException' => $baseDir . '/thinkphp/library/think/exception/ErrorException.php', - 'think\\exception\\Handle' => $baseDir . '/thinkphp/library/think/exception/Handle.php', - 'think\\exception\\HttpException' => $baseDir . '/thinkphp/library/think/exception/HttpException.php', - 'think\\exception\\HttpResponseException' => $baseDir . '/thinkphp/library/think/exception/HttpResponseException.php', - 'think\\exception\\PDOException' => $baseDir . '/thinkphp/library/think/exception/PDOException.php', - 'think\\exception\\RouteNotFoundException' => $baseDir . '/thinkphp/library/think/exception/RouteNotFoundException.php', - 'think\\exception\\TemplateNotFoundException' => $baseDir . '/thinkphp/library/think/exception/TemplateNotFoundException.php', - 'think\\exception\\ThrowableError' => $baseDir . '/thinkphp/library/think/exception/ThrowableError.php', - 'think\\exception\\ValidateException' => $baseDir . '/thinkphp/library/think/exception/ValidateException.php', - 'think\\helper\\Arr' => $vendorDir . '/topthink/think-helper/src/Arr.php', - 'think\\helper\\Hash' => $vendorDir . '/topthink/think-helper/src/Hash.php', - 'think\\helper\\Str' => $vendorDir . '/topthink/think-helper/src/Str.php', - 'think\\helper\\Time' => $vendorDir . '/topthink/think-helper/src/Time.php', - 'think\\helper\\hash\\Bcrypt' => $vendorDir . '/topthink/think-helper/src/hash/Bcrypt.php', - 'think\\helper\\hash\\Md5' => $vendorDir . '/topthink/think-helper/src/hash/Md5.php', - 'think\\log\\driver\\File' => $baseDir . '/thinkphp/library/think/log/driver/File.php', - 'think\\log\\driver\\Socket' => $baseDir . '/thinkphp/library/think/log/driver/Socket.php', - 'think\\log\\driver\\Test' => $baseDir . '/thinkphp/library/think/log/driver/Test.php', - 'think\\model\\Collection' => $baseDir . '/thinkphp/library/think/model/Collection.php', - 'think\\model\\Merge' => $baseDir . '/thinkphp/library/think/model/Merge.php', - 'think\\model\\Pivot' => $baseDir . '/thinkphp/library/think/model/Pivot.php', - 'think\\model\\Relation' => $baseDir . '/thinkphp/library/think/model/Relation.php', - 'think\\model\\relation\\BelongsTo' => $baseDir . '/thinkphp/library/think/model/relation/BelongsTo.php', - 'think\\model\\relation\\BelongsToMany' => $baseDir . '/thinkphp/library/think/model/relation/BelongsToMany.php', - 'think\\model\\relation\\HasMany' => $baseDir . '/thinkphp/library/think/model/relation/HasMany.php', - 'think\\model\\relation\\HasManyThrough' => $baseDir . '/thinkphp/library/think/model/relation/HasManyThrough.php', - 'think\\model\\relation\\HasOne' => $baseDir . '/thinkphp/library/think/model/relation/HasOne.php', - 'think\\model\\relation\\MorphMany' => $baseDir . '/thinkphp/library/think/model/relation/MorphMany.php', - 'think\\model\\relation\\MorphOne' => $baseDir . '/thinkphp/library/think/model/relation/MorphOne.php', - 'think\\model\\relation\\MorphTo' => $baseDir . '/thinkphp/library/think/model/relation/MorphTo.php', - 'think\\model\\relation\\OneToOne' => $baseDir . '/thinkphp/library/think/model/relation/OneToOne.php', - 'think\\mongo\\Builder' => $vendorDir . '/topthink/think-mongo/src/Builder.php', - 'think\\mongo\\Connection' => $vendorDir . '/topthink/think-mongo/src/Connection.php', - 'think\\mongo\\Query' => $vendorDir . '/topthink/think-mongo/src/Query.php', - 'think\\paginator\\driver\\Bootstrap' => $baseDir . '/thinkphp/library/think/paginator/driver/Bootstrap.php', - 'think\\process\\Builder' => $baseDir . '/thinkphp/library/think/process/Builder.php', - 'think\\process\\Utils' => $baseDir . '/thinkphp/library/think/process/Utils.php', - 'think\\process\\exception\\Failed' => $baseDir . '/thinkphp/library/think/process/exception/Failed.php', - 'think\\process\\exception\\Timeout' => $baseDir . '/thinkphp/library/think/process/exception/Timeout.php', - 'think\\process\\pipes\\Pipes' => $baseDir . '/thinkphp/library/think/process/pipes/Pipes.php', - 'think\\process\\pipes\\Unix' => $baseDir . '/thinkphp/library/think/process/pipes/Unix.php', - 'think\\process\\pipes\\Windows' => $baseDir . '/thinkphp/library/think/process/pipes/Windows.php', - 'think\\queue\\CallQueuedHandler' => $vendorDir . '/topthink/think-queue/src/queue/CallQueuedHandler.php', - 'think\\queue\\Connector' => $vendorDir . '/topthink/think-queue/src/queue/Connector.php', - 'think\\queue\\Job' => $vendorDir . '/topthink/think-queue/src/queue/Job.php', - 'think\\queue\\Listener' => $vendorDir . '/topthink/think-queue/src/queue/Listener.php', - 'think\\queue\\Queueable' => $vendorDir . '/topthink/think-queue/src/queue/Queueable.php', - 'think\\queue\\ShouldQueue' => $vendorDir . '/topthink/think-queue/src/queue/ShouldQueue.php', - 'think\\queue\\Worker' => $vendorDir . '/topthink/think-queue/src/queue/Worker.php', - 'think\\queue\\command\\Listen' => $vendorDir . '/topthink/think-queue/src/queue/command/Listen.php', - 'think\\queue\\command\\Restart' => $vendorDir . '/topthink/think-queue/src/queue/command/Restart.php', - 'think\\queue\\command\\Subscribe' => $vendorDir . '/topthink/think-queue/src/queue/command/Subscribe.php', - 'think\\queue\\command\\Work' => $vendorDir . '/topthink/think-queue/src/queue/command/Work.php', - 'think\\queue\\connector\\Database' => $vendorDir . '/topthink/think-queue/src/queue/connector/Database.php', - 'think\\queue\\connector\\Redis' => $vendorDir . '/topthink/think-queue/src/queue/connector/Redis.php', - 'think\\queue\\connector\\Sync' => $vendorDir . '/topthink/think-queue/src/queue/connector/Sync.php', - 'think\\queue\\connector\\Topthink' => $vendorDir . '/topthink/think-queue/src/queue/connector/Topthink.php', - 'think\\queue\\job\\Database' => $vendorDir . '/topthink/think-queue/src/queue/job/Database.php', - 'think\\queue\\job\\Redis' => $vendorDir . '/topthink/think-queue/src/queue/job/Redis.php', - 'think\\queue\\job\\Sync' => $vendorDir . '/topthink/think-queue/src/queue/job/Sync.php', - 'think\\queue\\job\\Topthink' => $vendorDir . '/topthink/think-queue/src/queue/job/Topthink.php', - 'think\\response\\Json' => $baseDir . '/thinkphp/library/think/response/Json.php', - 'think\\response\\Jsonp' => $baseDir . '/thinkphp/library/think/response/Jsonp.php', - 'think\\response\\Redirect' => $baseDir . '/thinkphp/library/think/response/Redirect.php', - 'think\\response\\View' => $baseDir . '/thinkphp/library/think/response/View.php', - 'think\\response\\Xml' => $baseDir . '/thinkphp/library/think/response/Xml.php', - 'think\\session\\driver\\Memcache' => $baseDir . '/thinkphp/library/think/session/driver/Memcache.php', - 'think\\session\\driver\\Memcached' => $baseDir . '/thinkphp/library/think/session/driver/Memcached.php', - 'think\\session\\driver\\Redis' => $baseDir . '/thinkphp/library/think/session/driver/Redis.php', - 'think\\template\\TagLib' => $baseDir . '/thinkphp/library/think/template/TagLib.php', - 'think\\template\\driver\\File' => $baseDir . '/thinkphp/library/think/template/driver/File.php', - 'think\\template\\taglib\\Cx' => $baseDir . '/thinkphp/library/think/template/taglib/Cx.php', - 'think\\view\\driver\\Php' => $baseDir . '/thinkphp/library/think/view/driver/Php.php', - 'think\\view\\driver\\Think' => $baseDir . '/thinkphp/library/think/view/driver/Think.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index b0471ab4f..8ba25f6fb 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -15,5 +15,5 @@ return array( 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), 'Qiniu\\' => array($vendorDir . '/qiniu/php-sdk/src/Qiniu'), 'OSS\\' => array($vendorDir . '/aliyuncs/oss-sdk-php/src/OSS'), - 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qrcode/src'), + 'Endroid\\QrCode\\' => array($vendorDir . '/endroid/qr-code/src'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 186307eeb..bdf0eb311 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -84,308 +84,12 @@ class ComposerStaticInit4bc699ddf295b08fae1ab3711fa28eb4 ), 'Endroid\\QrCode\\' => array ( - 0 => __DIR__ . '/..' . '/endroid/qrcode/src', + 0 => __DIR__ . '/..' . '/endroid/qr-code/src', ), ); public static $classMap = array ( - 'Endroid\\QrCode\\Bundle\\Controller\\QrCodeController' => __DIR__ . '/..' . '/endroid/qrcode/src/Bundle/Controller/QrCodeController.php', - 'Endroid\\QrCode\\Bundle\\DependencyInjection\\Configuration' => __DIR__ . '/..' . '/endroid/qrcode/src/Bundle/DependencyInjection/Configuration.php', - 'Endroid\\QrCode\\Bundle\\DependencyInjection\\EndroidQrCodeExtension' => __DIR__ . '/..' . '/endroid/qrcode/src/Bundle/DependencyInjection/EndroidQrCodeExtension.php', - 'Endroid\\QrCode\\Bundle\\EndroidQrCodeBundle' => __DIR__ . '/..' . '/endroid/qrcode/src/Bundle/EndroidQrCodeBundle.php', - 'Endroid\\QrCode\\Bundle\\Twig\\Extension\\QrCodeExtension' => __DIR__ . '/..' . '/endroid/qrcode/src/Bundle/Twig/Extension/QrCodeExtension.php', - 'Endroid\\QrCode\\Exceptions\\DataDoesntExistsException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/DataDoesntExistsException.php', - 'Endroid\\QrCode\\Exceptions\\FreeTypeLibraryMissingException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/FreeTypeLibraryMissingException.php', - 'Endroid\\QrCode\\Exceptions\\ImageFunctionFailedException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/ImageFunctionFailedException.php', - 'Endroid\\QrCode\\Exceptions\\ImageFunctionUnknownException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/ImageFunctionUnknownException.php', - 'Endroid\\QrCode\\Exceptions\\ImageSizeTooLargeException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/ImageSizeTooLargeException.php', - 'Endroid\\QrCode\\Exceptions\\ImageTypeInvalidException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/ImageTypeInvalidException.php', - 'Endroid\\QrCode\\Exceptions\\VersionTooLargeException' => __DIR__ . '/..' . '/endroid/qrcode/src/Exceptions/VersionTooLargeException.php', - 'Endroid\\QrCode\\Factory\\QrCodeFactory' => __DIR__ . '/..' . '/endroid/qrcode/src/Factory/QrCodeFactory.php', - 'Endroid\\QrCode\\QrCode' => __DIR__ . '/..' . '/endroid/qrcode/src/QrCode.php', 'Ip2Region' => __DIR__ . '/..' . '/zoujingli/ip2region/Ip2Region.php', - 'OSS\\Core\\MimeTypes' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Core/MimeTypes.php', - 'OSS\\Core\\OssException' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Core/OssException.php', - 'OSS\\Core\\OssUtil' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Core/OssUtil.php', - 'OSS\\Http\\RequestCore' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore.php', - 'OSS\\Http\\RequestCore_Exception' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Http/RequestCore_Exception.php', - 'OSS\\Http\\ResponseCore' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Http/ResponseCore.php', - 'OSS\\Model\\BucketInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/BucketInfo.php', - 'OSS\\Model\\BucketListInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/BucketListInfo.php', - 'OSS\\Model\\CnameConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/CnameConfig.php', - 'OSS\\Model\\CorsConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/CorsConfig.php', - 'OSS\\Model\\CorsRule' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/CorsRule.php', - 'OSS\\Model\\GetLiveChannelHistory' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelHistory.php', - 'OSS\\Model\\GetLiveChannelInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelInfo.php', - 'OSS\\Model\\GetLiveChannelStatus' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/GetLiveChannelStatus.php', - 'OSS\\Model\\LifecycleAction' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleAction.php', - 'OSS\\Model\\LifecycleConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleConfig.php', - 'OSS\\Model\\LifecycleRule' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LifecycleRule.php', - 'OSS\\Model\\ListMultipartUploadInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/ListMultipartUploadInfo.php', - 'OSS\\Model\\ListPartsInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/ListPartsInfo.php', - 'OSS\\Model\\LiveChannelConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelConfig.php', - 'OSS\\Model\\LiveChannelHistory' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelHistory.php', - 'OSS\\Model\\LiveChannelInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelInfo.php', - 'OSS\\Model\\LiveChannelListInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LiveChannelListInfo.php', - 'OSS\\Model\\LoggingConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/LoggingConfig.php', - 'OSS\\Model\\ObjectInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectInfo.php', - 'OSS\\Model\\ObjectListInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/ObjectListInfo.php', - 'OSS\\Model\\PartInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/PartInfo.php', - 'OSS\\Model\\PrefixInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/PrefixInfo.php', - 'OSS\\Model\\RefererConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/RefererConfig.php', - 'OSS\\Model\\StorageCapacityConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/StorageCapacityConfig.php', - 'OSS\\Model\\UploadInfo' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/UploadInfo.php', - 'OSS\\Model\\WebsiteConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/WebsiteConfig.php', - 'OSS\\Model\\XmlConfig' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Model/XmlConfig.php', - 'OSS\\OssClient' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/OssClient.php', - 'OSS\\Result\\AclResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/AclResult.php', - 'OSS\\Result\\AppendResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/AppendResult.php', - 'OSS\\Result\\BodyResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/BodyResult.php', - 'OSS\\Result\\CallbackResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/CallbackResult.php', - 'OSS\\Result\\CopyObjectResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/CopyObjectResult.php', - 'OSS\\Result\\DeleteObjectsResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/DeleteObjectsResult.php', - 'OSS\\Result\\ExistResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/ExistResult.php', - 'OSS\\Result\\GetCnameResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetCnameResult.php', - 'OSS\\Result\\GetCorsResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetCorsResult.php', - 'OSS\\Result\\GetLifecycleResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLifecycleResult.php', - 'OSS\\Result\\GetLiveChannelHistoryResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelHistoryResult.php', - 'OSS\\Result\\GetLiveChannelInfoResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelInfoResult.php', - 'OSS\\Result\\GetLiveChannelStatusResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLiveChannelStatusResult.php', - 'OSS\\Result\\GetLocationResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLocationResult.php', - 'OSS\\Result\\GetLoggingResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetLoggingResult.php', - 'OSS\\Result\\GetRefererResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetRefererResult.php', - 'OSS\\Result\\GetStorageCapacityResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetStorageCapacityResult.php', - 'OSS\\Result\\GetWebsiteResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/GetWebsiteResult.php', - 'OSS\\Result\\HeaderResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/HeaderResult.php', - 'OSS\\Result\\InitiateMultipartUploadResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/InitiateMultipartUploadResult.php', - 'OSS\\Result\\ListBucketsResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListBucketsResult.php', - 'OSS\\Result\\ListLiveChannelResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListLiveChannelResult.php', - 'OSS\\Result\\ListMultipartUploadResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListMultipartUploadResult.php', - 'OSS\\Result\\ListObjectsResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListObjectsResult.php', - 'OSS\\Result\\ListPartsResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/ListPartsResult.php', - 'OSS\\Result\\PutLiveChannelResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/PutLiveChannelResult.php', - 'OSS\\Result\\PutSetDeleteResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/PutSetDeleteResult.php', - 'OSS\\Result\\Result' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/Result.php', - 'OSS\\Result\\SymlinkResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/SymlinkResult.php', - 'OSS\\Result\\UploadPartResult' => __DIR__ . '/..' . '/aliyuncs/oss-sdk-php/src/OSS/Result/UploadPartResult.php', - 'Qiniu\\Auth' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Auth.php', - 'Qiniu\\Cdn\\CdnManager' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php', - 'Qiniu\\Config' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Config.php', - 'Qiniu\\Etag' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Etag.php', - 'Qiniu\\Http\\Client' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Http/Client.php', - 'Qiniu\\Http\\Error' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Http/Error.php', - 'Qiniu\\Http\\Request' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Http/Request.php', - 'Qiniu\\Http\\Response' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Http/Response.php', - 'Qiniu\\Processing\\ImageUrlBuilder' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Processing/ImageUrlBuilder.php', - 'Qiniu\\Processing\\Operation' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Processing/Operation.php', - 'Qiniu\\Processing\\PersistentFop' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Processing/PersistentFop.php', - 'Qiniu\\Storage\\BucketManager' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php', - 'Qiniu\\Storage\\FormUploader' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Storage/FormUploader.php', - 'Qiniu\\Storage\\ResumeUploader' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Storage/ResumeUploader.php', - 'Qiniu\\Storage\\UploadManager' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php', - 'Qiniu\\Zone' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/Zone.php', - 'Symfony\\Component\\OptionsResolver\\Debug\\OptionsResolverIntrospector' => __DIR__ . '/..' . '/symfony/options-resolver/Debug/OptionsResolverIntrospector.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\AccessException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/AccessException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/ExceptionInterface.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/InvalidArgumentException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidOptionsException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/InvalidOptionsException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\MissingOptionsException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/MissingOptionsException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\NoConfigurationException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/NoConfigurationException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\NoSuchOptionException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/NoSuchOptionException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\OptionDefinitionException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/OptionDefinitionException.php', - 'Symfony\\Component\\OptionsResolver\\Exception\\UndefinedOptionsException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/UndefinedOptionsException.php', - 'Symfony\\Component\\OptionsResolver\\Options' => __DIR__ . '/..' . '/symfony/options-resolver/Options.php', - 'Symfony\\Component\\OptionsResolver\\OptionsResolver' => __DIR__ . '/..' . '/symfony/options-resolver/OptionsResolver.php', - 'Wechat\\Lib\\Cache' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/Lib/Cache.php', - 'Wechat\\Lib\\Common' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php', - 'Wechat\\Lib\\Tools' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php', - 'Wechat\\Loader' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/Loader.php', - 'Wechat\\WechatCard' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatCard.php', - 'Wechat\\WechatCustom' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php', - 'Wechat\\WechatDevice' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatDevice.php', - 'Wechat\\WechatExtends' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatExtends.php', - 'Wechat\\WechatHardware' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatHardware.php', - 'Wechat\\WechatMedia' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php', - 'Wechat\\WechatMenu' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatMenu.php', - 'Wechat\\WechatMessage' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatMessage.php', - 'Wechat\\WechatOauth' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatOauth.php', - 'Wechat\\WechatPay' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatPay.php', - 'Wechat\\WechatPoi' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatPoi.php', - 'Wechat\\WechatReceive' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php', - 'Wechat\\WechatScript' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatScript.php', - 'Wechat\\WechatService' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatService.php', - 'Wechat\\WechatUser' => __DIR__ . '/..' . '/zoujingli/wechat-php-sdk/Wechat/WechatUser.php', - 'think\\App' => __DIR__ . '/../..' . '/thinkphp/library/think/App.php', - 'think\\Build' => __DIR__ . '/../..' . '/thinkphp/library/think/Build.php', - 'think\\Cache' => __DIR__ . '/../..' . '/thinkphp/library/think/Cache.php', - 'think\\Collection' => __DIR__ . '/../..' . '/thinkphp/library/think/Collection.php', - 'think\\Config' => __DIR__ . '/../..' . '/thinkphp/library/think/Config.php', - 'think\\Console' => __DIR__ . '/../..' . '/thinkphp/library/think/Console.php', - 'think\\Controller' => __DIR__ . '/../..' . '/thinkphp/library/think/Controller.php', - 'think\\Cookie' => __DIR__ . '/../..' . '/thinkphp/library/think/Cookie.php', - 'think\\Db' => __DIR__ . '/../..' . '/thinkphp/library/think/Db.php', - 'think\\Debug' => __DIR__ . '/../..' . '/thinkphp/library/think/Debug.php', - 'think\\Env' => __DIR__ . '/../..' . '/thinkphp/library/think/Env.php', - 'think\\Error' => __DIR__ . '/../..' . '/thinkphp/library/think/Error.php', - 'think\\Exception' => __DIR__ . '/../..' . '/thinkphp/library/think/Exception.php', - 'think\\File' => __DIR__ . '/../..' . '/thinkphp/library/think/File.php', - 'think\\Hook' => __DIR__ . '/../..' . '/thinkphp/library/think/Hook.php', - 'think\\Lang' => __DIR__ . '/../..' . '/thinkphp/library/think/Lang.php', - 'think\\Loader' => __DIR__ . '/../..' . '/thinkphp/library/think/Loader.php', - 'think\\Log' => __DIR__ . '/../..' . '/thinkphp/library/think/Log.php', - 'think\\Model' => __DIR__ . '/../..' . '/thinkphp/library/think/Model.php', - 'think\\Paginator' => __DIR__ . '/../..' . '/thinkphp/library/think/Paginator.php', - 'think\\Process' => __DIR__ . '/../..' . '/thinkphp/library/think/Process.php', - 'think\\Queue' => __DIR__ . '/..' . '/topthink/think-queue/src/Queue.php', - 'think\\Request' => __DIR__ . '/../..' . '/thinkphp/library/think/Request.php', - 'think\\Response' => __DIR__ . '/../..' . '/thinkphp/library/think/Response.php', - 'think\\Route' => __DIR__ . '/../..' . '/thinkphp/library/think/Route.php', - 'think\\Session' => __DIR__ . '/../..' . '/thinkphp/library/think/Session.php', - 'think\\Template' => __DIR__ . '/../..' . '/thinkphp/library/think/Template.php', - 'think\\Url' => __DIR__ . '/../..' . '/thinkphp/library/think/Url.php', - 'think\\Validate' => __DIR__ . '/../..' . '/thinkphp/library/think/Validate.php', - 'think\\View' => __DIR__ . '/../..' . '/thinkphp/library/think/View.php', - 'think\\cache\\Driver' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/Driver.php', - 'think\\cache\\driver\\File' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/File.php', - 'think\\cache\\driver\\Lite' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Lite.php', - 'think\\cache\\driver\\Memcache' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Memcache.php', - 'think\\cache\\driver\\Memcached' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Memcached.php', - 'think\\cache\\driver\\Redis' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Redis.php', - 'think\\cache\\driver\\Sqlite' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Sqlite.php', - 'think\\cache\\driver\\Wincache' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Wincache.php', - 'think\\cache\\driver\\Xcache' => __DIR__ . '/../..' . '/thinkphp/library/think/cache/driver/Xcache.php', - 'think\\captcha\\Captcha' => __DIR__ . '/..' . '/topthink/think-captcha/src/Captcha.php', - 'think\\captcha\\CaptchaController' => __DIR__ . '/..' . '/topthink/think-captcha/src/CaptchaController.php', - 'think\\composer\\Plugin' => __DIR__ . '/..' . '/topthink/think-installer/src/Plugin.php', - 'think\\composer\\ThinkExtend' => __DIR__ . '/..' . '/topthink/think-installer/src/ThinkExtend.php', - 'think\\composer\\ThinkFramework' => __DIR__ . '/..' . '/topthink/think-installer/src/ThinkFramework.php', - 'think\\composer\\ThinkTesting' => __DIR__ . '/..' . '/topthink/think-installer/src/ThinkTesting.php', - 'think\\config\\driver\\Ini' => __DIR__ . '/../..' . '/thinkphp/library/think/config/driver/Ini.php', - 'think\\config\\driver\\Json' => __DIR__ . '/../..' . '/thinkphp/library/think/config/driver/Json.php', - 'think\\config\\driver\\Xml' => __DIR__ . '/../..' . '/thinkphp/library/think/config/driver/Xml.php', - 'think\\console\\Command' => __DIR__ . '/../..' . '/thinkphp/library/think/console/Command.php', - 'think\\console\\Input' => __DIR__ . '/../..' . '/thinkphp/library/think/console/Input.php', - 'think\\console\\Output' => __DIR__ . '/../..' . '/thinkphp/library/think/console/Output.php', - 'think\\console\\command\\Build' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/Build.php', - 'think\\console\\command\\Clear' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/Clear.php', - 'think\\console\\command\\Help' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/Help.php', - 'think\\console\\command\\Lists' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/Lists.php', - 'think\\console\\command\\Make' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/Make.php', - 'think\\console\\command\\make\\Controller' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/make/Controller.php', - 'think\\console\\command\\make\\Model' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/make/Model.php', - 'think\\console\\command\\optimize\\Autoload' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/optimize/Autoload.php', - 'think\\console\\command\\optimize\\Config' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/optimize/Config.php', - 'think\\console\\command\\optimize\\Route' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/optimize/Route.php', - 'think\\console\\command\\optimize\\Schema' => __DIR__ . '/../..' . '/thinkphp/library/think/console/command/optimize/Schema.php', - 'think\\console\\input\\Argument' => __DIR__ . '/../..' . '/thinkphp/library/think/console/input/Argument.php', - 'think\\console\\input\\Definition' => __DIR__ . '/../..' . '/thinkphp/library/think/console/input/Definition.php', - 'think\\console\\input\\Option' => __DIR__ . '/../..' . '/thinkphp/library/think/console/input/Option.php', - 'think\\console\\output\\Ask' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/Ask.php', - 'think\\console\\output\\Descriptor' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/Descriptor.php', - 'think\\console\\output\\Formatter' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/Formatter.php', - 'think\\console\\output\\Question' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/Question.php', - 'think\\console\\output\\descriptor\\Console' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/descriptor/Console.php', - 'think\\console\\output\\driver\\Buffer' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/driver/Buffer.php', - 'think\\console\\output\\driver\\Console' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/driver/Console.php', - 'think\\console\\output\\driver\\Nothing' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/driver/Nothing.php', - 'think\\console\\output\\formatter\\Stack' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/formatter/Stack.php', - 'think\\console\\output\\formatter\\Style' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/formatter/Style.php', - 'think\\console\\output\\question\\Choice' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/question/Choice.php', - 'think\\console\\output\\question\\Confirmation' => __DIR__ . '/../..' . '/thinkphp/library/think/console/output/question/Confirmation.php', - 'think\\controller\\Rest' => __DIR__ . '/../..' . '/thinkphp/library/think/controller/Rest.php', - 'think\\controller\\Yar' => __DIR__ . '/../..' . '/thinkphp/library/think/controller/Yar.php', - 'think\\db\\Builder' => __DIR__ . '/../..' . '/thinkphp/library/think/db/Builder.php', - 'think\\db\\Connection' => __DIR__ . '/../..' . '/thinkphp/library/think/db/Connection.php', - 'think\\db\\Query' => __DIR__ . '/../..' . '/thinkphp/library/think/db/Query.php', - 'think\\db\\builder\\Mysql' => __DIR__ . '/../..' . '/thinkphp/library/think/db/builder/Mysql.php', - 'think\\db\\builder\\Pgsql' => __DIR__ . '/../..' . '/thinkphp/library/think/db/builder/Pgsql.php', - 'think\\db\\builder\\Sqlite' => __DIR__ . '/../..' . '/thinkphp/library/think/db/builder/Sqlite.php', - 'think\\db\\builder\\Sqlsrv' => __DIR__ . '/../..' . '/thinkphp/library/think/db/builder/Sqlsrv.php', - 'think\\db\\connector\\Mysql' => __DIR__ . '/../..' . '/thinkphp/library/think/db/connector/Mysql.php', - 'think\\db\\connector\\Pgsql' => __DIR__ . '/../..' . '/thinkphp/library/think/db/connector/Pgsql.php', - 'think\\db\\connector\\Sqlite' => __DIR__ . '/../..' . '/thinkphp/library/think/db/connector/Sqlite.php', - 'think\\db\\connector\\Sqlsrv' => __DIR__ . '/../..' . '/thinkphp/library/think/db/connector/Sqlsrv.php', - 'think\\db\\exception\\BindParamException' => __DIR__ . '/../..' . '/thinkphp/library/think/db/exception/BindParamException.php', - 'think\\db\\exception\\DataNotFoundException' => __DIR__ . '/../..' . '/thinkphp/library/think/db/exception/DataNotFoundException.php', - 'think\\db\\exception\\ModelNotFoundException' => __DIR__ . '/../..' . '/thinkphp/library/think/db/exception/ModelNotFoundException.php', - 'think\\debug\\Console' => __DIR__ . '/../..' . '/thinkphp/library/think/debug/Console.php', - 'think\\debug\\Html' => __DIR__ . '/../..' . '/thinkphp/library/think/debug/Html.php', - 'think\\exception\\ClassNotFoundException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/ClassNotFoundException.php', - 'think\\exception\\DbException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/DbException.php', - 'think\\exception\\ErrorException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/ErrorException.php', - 'think\\exception\\Handle' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/Handle.php', - 'think\\exception\\HttpException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/HttpException.php', - 'think\\exception\\HttpResponseException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/HttpResponseException.php', - 'think\\exception\\PDOException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/PDOException.php', - 'think\\exception\\RouteNotFoundException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/RouteNotFoundException.php', - 'think\\exception\\TemplateNotFoundException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/TemplateNotFoundException.php', - 'think\\exception\\ThrowableError' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/ThrowableError.php', - 'think\\exception\\ValidateException' => __DIR__ . '/../..' . '/thinkphp/library/think/exception/ValidateException.php', - 'think\\helper\\Arr' => __DIR__ . '/..' . '/topthink/think-helper/src/Arr.php', - 'think\\helper\\Hash' => __DIR__ . '/..' . '/topthink/think-helper/src/Hash.php', - 'think\\helper\\Str' => __DIR__ . '/..' . '/topthink/think-helper/src/Str.php', - 'think\\helper\\Time' => __DIR__ . '/..' . '/topthink/think-helper/src/Time.php', - 'think\\helper\\hash\\Bcrypt' => __DIR__ . '/..' . '/topthink/think-helper/src/hash/Bcrypt.php', - 'think\\helper\\hash\\Md5' => __DIR__ . '/..' . '/topthink/think-helper/src/hash/Md5.php', - 'think\\log\\driver\\File' => __DIR__ . '/../..' . '/thinkphp/library/think/log/driver/File.php', - 'think\\log\\driver\\Socket' => __DIR__ . '/../..' . '/thinkphp/library/think/log/driver/Socket.php', - 'think\\log\\driver\\Test' => __DIR__ . '/../..' . '/thinkphp/library/think/log/driver/Test.php', - 'think\\model\\Collection' => __DIR__ . '/../..' . '/thinkphp/library/think/model/Collection.php', - 'think\\model\\Merge' => __DIR__ . '/../..' . '/thinkphp/library/think/model/Merge.php', - 'think\\model\\Pivot' => __DIR__ . '/../..' . '/thinkphp/library/think/model/Pivot.php', - 'think\\model\\Relation' => __DIR__ . '/../..' . '/thinkphp/library/think/model/Relation.php', - 'think\\model\\relation\\BelongsTo' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/BelongsTo.php', - 'think\\model\\relation\\BelongsToMany' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/BelongsToMany.php', - 'think\\model\\relation\\HasMany' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/HasMany.php', - 'think\\model\\relation\\HasManyThrough' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/HasManyThrough.php', - 'think\\model\\relation\\HasOne' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/HasOne.php', - 'think\\model\\relation\\MorphMany' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/MorphMany.php', - 'think\\model\\relation\\MorphOne' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/MorphOne.php', - 'think\\model\\relation\\MorphTo' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/MorphTo.php', - 'think\\model\\relation\\OneToOne' => __DIR__ . '/../..' . '/thinkphp/library/think/model/relation/OneToOne.php', - 'think\\mongo\\Builder' => __DIR__ . '/..' . '/topthink/think-mongo/src/Builder.php', - 'think\\mongo\\Connection' => __DIR__ . '/..' . '/topthink/think-mongo/src/Connection.php', - 'think\\mongo\\Query' => __DIR__ . '/..' . '/topthink/think-mongo/src/Query.php', - 'think\\paginator\\driver\\Bootstrap' => __DIR__ . '/../..' . '/thinkphp/library/think/paginator/driver/Bootstrap.php', - 'think\\process\\Builder' => __DIR__ . '/../..' . '/thinkphp/library/think/process/Builder.php', - 'think\\process\\Utils' => __DIR__ . '/../..' . '/thinkphp/library/think/process/Utils.php', - 'think\\process\\exception\\Failed' => __DIR__ . '/../..' . '/thinkphp/library/think/process/exception/Failed.php', - 'think\\process\\exception\\Timeout' => __DIR__ . '/../..' . '/thinkphp/library/think/process/exception/Timeout.php', - 'think\\process\\pipes\\Pipes' => __DIR__ . '/../..' . '/thinkphp/library/think/process/pipes/Pipes.php', - 'think\\process\\pipes\\Unix' => __DIR__ . '/../..' . '/thinkphp/library/think/process/pipes/Unix.php', - 'think\\process\\pipes\\Windows' => __DIR__ . '/../..' . '/thinkphp/library/think/process/pipes/Windows.php', - 'think\\queue\\CallQueuedHandler' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/CallQueuedHandler.php', - 'think\\queue\\Connector' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/Connector.php', - 'think\\queue\\Job' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/Job.php', - 'think\\queue\\Listener' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/Listener.php', - 'think\\queue\\Queueable' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/Queueable.php', - 'think\\queue\\ShouldQueue' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/ShouldQueue.php', - 'think\\queue\\Worker' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/Worker.php', - 'think\\queue\\command\\Listen' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/command/Listen.php', - 'think\\queue\\command\\Restart' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/command/Restart.php', - 'think\\queue\\command\\Subscribe' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/command/Subscribe.php', - 'think\\queue\\command\\Work' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/command/Work.php', - 'think\\queue\\connector\\Database' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/connector/Database.php', - 'think\\queue\\connector\\Redis' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/connector/Redis.php', - 'think\\queue\\connector\\Sync' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/connector/Sync.php', - 'think\\queue\\connector\\Topthink' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/connector/Topthink.php', - 'think\\queue\\job\\Database' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/job/Database.php', - 'think\\queue\\job\\Redis' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/job/Redis.php', - 'think\\queue\\job\\Sync' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/job/Sync.php', - 'think\\queue\\job\\Topthink' => __DIR__ . '/..' . '/topthink/think-queue/src/queue/job/Topthink.php', - 'think\\response\\Json' => __DIR__ . '/../..' . '/thinkphp/library/think/response/Json.php', - 'think\\response\\Jsonp' => __DIR__ . '/../..' . '/thinkphp/library/think/response/Jsonp.php', - 'think\\response\\Redirect' => __DIR__ . '/../..' . '/thinkphp/library/think/response/Redirect.php', - 'think\\response\\View' => __DIR__ . '/../..' . '/thinkphp/library/think/response/View.php', - 'think\\response\\Xml' => __DIR__ . '/../..' . '/thinkphp/library/think/response/Xml.php', - 'think\\session\\driver\\Memcache' => __DIR__ . '/../..' . '/thinkphp/library/think/session/driver/Memcache.php', - 'think\\session\\driver\\Memcached' => __DIR__ . '/../..' . '/thinkphp/library/think/session/driver/Memcached.php', - 'think\\session\\driver\\Redis' => __DIR__ . '/../..' . '/thinkphp/library/think/session/driver/Redis.php', - 'think\\template\\TagLib' => __DIR__ . '/../..' . '/thinkphp/library/think/template/TagLib.php', - 'think\\template\\driver\\File' => __DIR__ . '/../..' . '/thinkphp/library/think/template/driver/File.php', - 'think\\template\\taglib\\Cx' => __DIR__ . '/../..' . '/thinkphp/library/think/template/taglib/Cx.php', - 'think\\view\\driver\\Php' => __DIR__ . '/../..' . '/thinkphp/library/think/view/driver/Php.php', - 'think\\view\\driver\\Think' => __DIR__ . '/../..' . '/thinkphp/library/think/view/driver/Think.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index c83d24e18..2b9f565f9 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,115 +1,39 @@ [ { - "name": "topthink/think-installer", - "version": "v1.0.12", - "version_normalized": "1.0.12.0", + "name": "aliyuncs/oss-sdk-php", + "version": "v2.3.0", + "version_normalized": "2.3.0.0", "source": { "type": "git", - "url": "https://github.com/top-think/think-installer.git", - "reference": "1be326e68f63de4e95977ed50f46ae75f017556d" + "url": "https://github.com/aliyun/aliyun-oss-php-sdk.git", + "reference": "e69f57916678458642ac9d2fd341ae78a56996c8" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/top-think/think-installer/1be326e68f63de4e95977ed50f46ae75f017556d.zip", - "reference": "1be326e68f63de4e95977ed50f46ae75f017556d", - "shasum": "" + "url": "https://api.github.com/repos/aliyun/aliyun-oss-php-sdk/zipball/e69f57916678458642ac9d2fd341ae78a56996c8", + "reference": "e69f57916678458642ac9d2fd341ae78a56996c8", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { - "composer-plugin-api": "^1.0" - }, - "require-dev": { - "composer/composer": "1.0.*@dev" - }, - "time": "2017-05-27T06:58:09+00:00", - "type": "composer-plugin", - "extra": { - "class": "think\\composer\\Plugin" - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\composer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ] - }, - { - "name": "zoujingli/wechat-php-sdk", - "version": "dev-master", - "version_normalized": "9999999-dev", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/wechat-php-sdk.git", - "reference": "7869490b99e648d40a5a5169cc0469dccb8e8b0a" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/zoujingli/wechat-php-sdk/7869490b99e648d40a5a5169cc0469dccb8e8b0a.zip", - "reference": "7869490b99e648d40a5a5169cc0469dccb8e8b0a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2018-02-28T13:30:53+00:00", - "type": "project", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Wechat\\": "./Wechat" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "WeChat development of SDK", - "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", - "keywords": [ - "wechat-php-sdk" - ] - }, - { - "name": "qiniu/php-sdk", - "version": "v7.2.3", - "version_normalized": "7.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/qiniu/php-sdk.git", - "reference": "67852ba9cdd7f48e0e080961abebafee134fb329" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/qiniu/php-sdk/67852ba9cdd7f48e0e080961abebafee134fb329.zip", - "reference": "67852ba9cdd7f48e0e080961abebafee134fb329", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" + "php": ">=5.3" }, "require-dev": { "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.3" + "satooshi/php-coveralls": "~1.0" }, - "time": "2018-02-20T13:59:54+00:00", + "time": "2018-01-08T06:59:35+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Qiniu\\": "src/Qiniu" - }, - "files": [ - "src/Qiniu/functions.php" - ] + "OSS\\": "src/OSS" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -117,326 +41,15 @@ ], "authors": [ { - "name": "Qiniu", - "email": "sdk@qiniu.com", - "homepage": "http://www.qiniu.com" + "name": "Aliyuncs", + "homepage": "http://www.aliyun.com" } ], - "description": "Qiniu Resource (Cloud) Storage SDK for PHP", - "homepage": "http://developer.qiniu.com/", - "keywords": [ - "cloud", - "qiniu", - "sdk", - "storage" - ] + "description": "Aliyun OSS SDK for PHP", + "homepage": "http://www.aliyun.com/product/oss/" }, { - "name": "zoujingli/ip2region", - "version": "v1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/zoujingli/ip2region.git", - "reference": "5d981fbf3b574bad7fe9652e7aecba0920f54325" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/zoujingli/ip2region/5d981fbf3b574bad7fe9652e7aecba0920f54325.zip", - "reference": "5d981fbf3b574bad7fe9652e7aecba0920f54325", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2017-11-09T03:36:17+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "Ip2Region.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache 2.0" - ], - "description": "Ip2Region", - "homepage": "https://github.com/zoujingli/Ip2Region", - "keywords": [ - "Ip2Region" - ] - }, - { - "name": "topthink/framework", - "version": "v5.0.15", - "version_normalized": "5.0.15.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/framework.git", - "reference": "7c1375791fe8772e33282ee8611ea465dc215fca" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/top-think/framework/7c1375791fe8772e33282ee8611ea465dc215fca.zip", - "reference": "7c1375791fe8772e33282ee8611ea465dc215fca", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "topthink/think-installer": "~1.0" - }, - "require-dev": { - "johnkary/phpunit-speedtrap": "^1.0", - "mikey179/vfsstream": "~1.6", - "phpdocumentor/reflection-docblock": "^2.0", - "phploc/phploc": "2.*", - "phpunit/phpunit": "4.8.*", - "sebastian/phpcpd": "2.*" - }, - "time": "2018-01-31T08:40:10+00:00", - "type": "think-framework", - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\": "library/think" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - } - ], - "description": "the new thinkphp framework", - "homepage": "http://thinkphp.cn/", - "keywords": [ - "framework", - "orm", - "thinkphp" - ] - }, - { - "name": "topthink/think-captcha", - "version": "v1.0.7", - "version_normalized": "1.0.7.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-captcha.git", - "reference": "0c55455df26a1626a60d0dc35d2d89002b741d44" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/top-think/think-captcha/0c55455df26a1626a60d0dc35d2d89002b741d44.zip", - "reference": "0c55455df26a1626a60d0dc35d2d89002b741d44", - "shasum": "" - }, - "time": "2016-07-06T01:47:11+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\captcha\\": "src/" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "description": "captcha package for thinkphp5" - }, - { - "name": "topthink/think-mongo", - "version": "v1.8.2", - "version_normalized": "1.8.2.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-mongo.git", - "reference": "5433e971b4892b09cbec49090c690f5d4350a981" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/top-think/think-mongo/5433e971b4892b09cbec49090c690f5d4350a981.zip", - "reference": "5433e971b4892b09cbec49090c690f5d4350a981", - "shasum": "" - }, - "time": "2018-01-30T07:12:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\mongo\\": "src" - }, - "files": [] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "liu21st", - "email": "liu21st@gmail.com" - } - ], - "description": "mongodb driver for thinkphp5" - }, - { - "name": "topthink/think-helper", - "version": "v1.0.6", - "version_normalized": "1.0.6.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-helper.git", - "reference": "0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/top-think/think-helper/0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f.zip", - "reference": "0c99dc625b0d2d4124e1b6ca15a3ad6f0125963f", - "shasum": "" - }, - "time": "2017-04-05T07:15:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\helper\\": "src" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "description": "The ThinkPHP5 Helper Package" - }, - { - "name": "topthink/think-queue", - "version": "v1.1.4", - "version_normalized": "1.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/top-think/think-queue.git", - "reference": "ad709611d516e13d6760234bc98e91faa901cae8" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/top-think/think-queue/ad709611d516e13d6760234bc98e91faa901cae8.zip", - "reference": "ad709611d516e13d6760234bc98e91faa901cae8", - "shasum": "" - }, - "require": { - "topthink/think-helper": ">=1.0.4", - "topthink/think-installer": ">=1.0.10" - }, - "time": "2017-06-25T00:49:56+00:00", - "type": "think-extend", - "extra": { - "think-config": { - "queue": "src/config.php" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\": "src" - }, - "files": [ - "src/common.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "yunwuxin", - "email": "448901948@qq.com" - } - ], - "description": "The ThinkPHP5 Queue Package" - }, - { - "name": "symfony/options-resolver", - "version": "v3.4.5", - "version_normalized": "3.4.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "f3109a6aedd20e35c3a33190e932c2b063b7b50e" - }, - "dist": { - "type": "zip", - "url": "https://files.phpcomposer.com/files/symfony/options-resolver/f3109a6aedd20e35c3a33190e932c2b063b7b50e.zip", - "reference": "f3109a6aedd20e35c3a33190e932c2b063b7b50e", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "time": "2018-01-11T07:56:07+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ] - }, - { - "name": "endroid/qrcode", + "name": "endroid/qr-code", "version": "1.9.3", "version_normalized": "1.9.3.0", "source": { @@ -446,9 +59,15 @@ }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/endroid/qr-code/c9644bec2a9cc9318e98d1437de3c628dcd1ef93.zip", + "url": "https://api.github.com/repos/endroid/qr-code/zipball/c9644bec2a9cc9318e98d1437de3c628dcd1ef93", "reference": "c9644bec2a9cc9318e98d1437de3c628dcd1ef93", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-gd": "*", @@ -495,38 +114,46 @@ "qr", "qrcode", "symfony" - ], - "abandoned": "endroid/qr-code" + ] }, { - "name": "aliyuncs/oss-sdk-php", - "version": "v2.3.0", - "version_normalized": "2.3.0.0", + "name": "qiniu/php-sdk", + "version": "v7.2.7", + "version_normalized": "7.2.7.0", "source": { "type": "git", - "url": "https://github.com/aliyun/aliyun-oss-php-sdk.git", - "reference": "e69f57916678458642ac9d2fd341ae78a56996c8" + "url": "https://github.com/qiniu/php-sdk.git", + "reference": "88d11a5857ebc6871204e9be6ceec54bf5f381e6" }, "dist": { "type": "zip", - "url": "https://files.phpcomposer.com/files/aliyun/aliyun-oss-php-sdk/e69f57916678458642ac9d2fd341ae78a56996c8.zip", - "reference": "e69f57916678458642ac9d2fd341ae78a56996c8", - "shasum": "" + "url": "https://api.github.com/repos/qiniu/php-sdk/zipball/88d11a5857ebc6871204e9be6ceec54bf5f381e6", + "reference": "88d11a5857ebc6871204e9be6ceec54bf5f381e6", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { - "php": ">=5.3" + "php": ">=5.3.3" }, "require-dev": { "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "~1.0" + "squizlabs/php_codesniffer": "~2.3" }, - "time": "2018-01-08T06:59:35+00:00", + "time": "2018-11-06T13:34:32+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "OSS\\": "src/OSS" - } + "Qiniu\\": "src/Qiniu" + }, + "files": [ + "src/Qiniu/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -534,11 +161,469 @@ ], "authors": [ { - "name": "Aliyuncs", - "homepage": "http://www.aliyun.com" + "name": "Qiniu", + "email": "sdk@qiniu.com", + "homepage": "http://www.qiniu.com" } ], - "description": "Aliyun OSS SDK for PHP", - "homepage": "http://www.aliyun.com/product/oss/" + "description": "Qiniu Resource (Cloud) Storage SDK for PHP", + "homepage": "http://developer.qiniu.com/", + "keywords": [ + "cloud", + "qiniu", + "sdk", + "storage" + ] + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.22", + "version_normalized": "3.4.22.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "0f1cbaee6b356e72c0e025f9a4e9d76a25bf4793" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0f1cbaee6b356e72c0e025f9a4e9d76a25bf4793", + "reference": "0f1cbaee6b356e72c0e025f9a4e9d76a25bf4793", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "time": "2019-01-16T09:39:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ] + }, + { + "name": "topthink/framework", + "version": "v5.0.24", + "version_normalized": "5.0.24.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/framework.git", + "reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/framework/zipball/c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be", + "reference": "c255c22b2f5fa30f320ecf6c1d29f7740eb3e8be", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.4.0", + "topthink/think-installer": "~1.0" + }, + "require-dev": { + "johnkary/phpunit-speedtrap": "^1.0", + "mikey179/vfsstream": "~1.6", + "phpdocumentor/reflection-docblock": "^2.0", + "phploc/phploc": "2.*", + "phpunit/phpunit": "4.8.*", + "sebastian/phpcpd": "2.*" + }, + "time": "2019-01-11T08:04:58+00:00", + "type": "think-framework", + "installation-source": "dist", + "autoload": { + "psr-4": { + "think\\": "library/think" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "the new thinkphp framework", + "homepage": "http://thinkphp.cn/", + "keywords": [ + "framework", + "orm", + "thinkphp" + ] + }, + { + "name": "topthink/think-captcha", + "version": "v1.0.8", + "version_normalized": "1.0.8.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-captcha.git", + "reference": "1d64363c814c92f6086c4fa5e3223fe7e23db09d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-captcha/zipball/1d64363c814c92f6086c4fa5e3223fe7e23db09d", + "reference": "1d64363c814c92f6086c4fa5e3223fe7e23db09d", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "topthink/framework": "~5.0.0", + "topthink/think-installer": ">=1.0.10" + }, + "time": "2019-01-28T04:48:36+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "think\\captcha\\": "src/" + }, + "files": [ + "src/helper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "description": "captcha package for thinkphp5" + }, + { + "name": "topthink/think-helper", + "version": "v1.0.7", + "version_normalized": "1.0.7.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-helper.git", + "reference": "5f92178606c8ce131d36b37a57c58eb71e55f019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-helper/zipball/5f92178606c8ce131d36b37a57c58eb71e55f019", + "reference": "5f92178606c8ce131d36b37a57c58eb71e55f019", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "time": "2018-10-05T00:43:21+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "think\\helper\\": "src" + }, + "files": [ + "src/helper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "description": "The ThinkPHP5 Helper Package" + }, + { + "name": "topthink/think-installer", + "version": "v1.0.12", + "version_normalized": "1.0.12.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-installer.git", + "reference": "1be326e68f63de4e95977ed50f46ae75f017556d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-installer/zipball/1be326e68f63de4e95977ed50f46ae75f017556d", + "reference": "1be326e68f63de4e95977ed50f46ae75f017556d", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "require-dev": { + "composer/composer": "1.0.*@dev" + }, + "time": "2017-05-27T06:58:09+00:00", + "type": "composer-plugin", + "extra": { + "class": "think\\composer\\Plugin" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "think\\composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ] + }, + { + "name": "topthink/think-mongo", + "version": "v1.8.5", + "version_normalized": "1.8.5.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-mongo.git", + "reference": "657cc79bd5f090a58b0cc83776073dd69c83a3d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-mongo/zipball/657cc79bd5f090a58b0cc83776073dd69c83a3d1", + "reference": "657cc79bd5f090a58b0cc83776073dd69c83a3d1", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "time": "2018-06-03T01:51:27+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "think\\mongo\\": "src" + }, + "files": [] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "liu21st", + "email": "liu21st@gmail.com" + } + ], + "description": "mongodb driver for thinkphp5" + }, + { + "name": "topthink/think-queue", + "version": "v1.1.6", + "version_normalized": "1.1.6.0", + "source": { + "type": "git", + "url": "https://github.com/top-think/think-queue.git", + "reference": "250650eb0e8ea5af4cfdc7ae46f3f4e0a24ac245" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/top-think/think-queue/zipball/250650eb0e8ea5af4cfdc7ae46f3f4e0a24ac245", + "reference": "250650eb0e8ea5af4cfdc7ae46f3f4e0a24ac245", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "topthink/think-helper": ">=1.0.4", + "topthink/think-installer": ">=1.0.10" + }, + "require-dev": { + "topthink/framework": "~5.0.0" + }, + "time": "2018-10-15T10:16:55+00:00", + "type": "think-extend", + "extra": { + "think-config": { + "queue": "src/config.php" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "think\\": "src" + }, + "files": [ + "src/common.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "yunwuxin", + "email": "448901948@qq.com" + } + ], + "description": "The ThinkPHP5 Queue Package" + }, + { + "name": "zoujingli/ip2region", + "version": "v1.0.5", + "version_normalized": "1.0.5.0", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/ip2region.git", + "reference": "944dc687304133027c4586a35ff78b57e56dd659" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/ip2region/zipball/944dc687304133027c4586a35ff78b57e56dd659", + "reference": "944dc687304133027c4586a35ff78b57e56dd659", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3" + }, + "time": "2019-01-23T06:23:53+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "Ip2Region.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Anyon", + "email": "zoujingli@qq.com", + "homepage": "http://ctolog.com" + } + ], + "description": "Ip2Region for PHP", + "homepage": "https://github.com/zoujingli/Ip2Region", + "keywords": [ + "Ip2Region" + ] + }, + { + "name": "zoujingli/wechat-php-sdk", + "version": "dev-master", + "version_normalized": "9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/zoujingli/wechat-php-sdk.git", + "reference": "afb0dfd1a0fd71cfe58b6811d559b6b0fc8f9de0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zoujingli/wechat-php-sdk/zipball/afb0dfd1a0fd71cfe58b6811d559b6b0fc8f9de0", + "reference": "afb0dfd1a0fd71cfe58b6811d559b6b0fc8f9de0", + "shasum": "", + "mirrors": [ + { + "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2018-10-23T09:57:56+00:00", + "type": "project", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Wechat\\": "./Wechat" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WeChat development of SDK", + "homepage": "http://www.kancloud.cn/zoujingli/wechat-php-sdk", + "keywords": [ + "wechat-php-sdk" + ] } ] diff --git a/vendor/endroid/qrcode/.gitignore b/vendor/endroid/qr-code/.gitignore similarity index 100% rename from vendor/endroid/qrcode/.gitignore rename to vendor/endroid/qr-code/.gitignore diff --git a/vendor/endroid/qrcode/.travis.yml b/vendor/endroid/qr-code/.travis.yml similarity index 93% rename from vendor/endroid/qrcode/.travis.yml rename to vendor/endroid/qr-code/.travis.yml index 9233d9aa1..de30ea6f7 100644 --- a/vendor/endroid/qrcode/.travis.yml +++ b/vendor/endroid/qr-code/.travis.yml @@ -1,21 +1,21 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - hhvm - -matrix: - fast_finish: true - -before_install: - - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi; - - composer self-update && composer install --no-interaction - -script: bin/phpunit - -notifications: - email: info@endroid.nl +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - hhvm + +matrix: + fast_finish: true + +before_install: + - if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi; + - composer self-update && composer install --no-interaction + +script: bin/phpunit + +notifications: + email: info@endroid.nl diff --git a/vendor/endroid/qrcode/LICENSE b/vendor/endroid/qr-code/LICENSE similarity index 100% rename from vendor/endroid/qrcode/LICENSE rename to vendor/endroid/qr-code/LICENSE diff --git a/vendor/endroid/qrcode/README.md b/vendor/endroid/qr-code/README.md similarity index 96% rename from vendor/endroid/qrcode/README.md rename to vendor/endroid/qr-code/README.md index c4fcf39a7..2c51a989f 100644 --- a/vendor/endroid/qrcode/README.md +++ b/vendor/endroid/qr-code/README.md @@ -1,132 +1,132 @@ -QR Code -======= - -*By [endroid](http://endroid.nl/)* - -[![Latest Stable Version](http://img.shields.io/packagist/v/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) -[![Build Status](http://img.shields.io/travis/endroid/QrCode.svg)](http://travis-ci.org/endroid/QrCode) -[![Total Downloads](http://img.shields.io/packagist/dt/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) -[![Monthly Downloads](http://img.shields.io/packagist/dm/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) -[![License](http://img.shields.io/packagist/l/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) - -This library based on QRcode Perl CGI & PHP scripts by Y. Swetake helps you generate images containing a QR code. - -## Installation - -Use [Composer](https://getcomposer.org/) to install the library. - -``` bash -$ composer require endroid/qrcode -``` - -## Usage - -```php -use Endroid\QrCode\QrCode; - -$qrCode = new QrCode(); -$qrCode - ->setText('Life is too short to be generating QR codes') - ->setSize(300) - ->setPadding(10) - ->setErrorCorrection('high') - ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]) - ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]) - ->setLabel('Scan the code') - ->setLabelFontSize(16) - ->setImageType(QrCode::IMAGE_TYPE_PNG) -; - -// now we can directly output the qrcode -header('Content-Type: '.$qrCode->getContentType()); -$qrCode->render(); - -// save it to a file -$qrCode->save('qrcode.png'); - -// or create a response object -$response = new Response($qrCode->get(), 200, ['Content-Type' => $qrCode->getContentType()]); -``` - -![QR Code](http://endroid.nl/qrcode/Life%20is%20too%20short%20to%20be%20generating%20QR%20codes.png?label=Scan%20the%20code) - -## Symfony integration - -Register the Symfony bundle in the kernel. - -```php -// app/AppKernel.php - -public function registerBundles() -{ - $bundles = [ - // ... - new Endroid\QrCode\Bundle\EndroidQrCodeBundle(), - ]; -} -``` - -The default parameters can be overridden via the configuration. -Alpha channel available range is [0, 127] in foreground and background colors. - -```yaml -endroid_qr_code: - size: 100 - padding: 10 - extension: gif - error_correction_level: high - foreground_color: { r: 0, g: 0, b: 0, a: 0 } - background_color: { r: 255, g: 255, b: 255, a: 0 } - label: 'My label' - label_font_size: 16 -``` - -Now you can retrieve the factory as follows. - -```php -$factory = $this->get('endroid.qrcode.factory'); -$factory->createQrCode(); -``` - -Add the following section to your routing to be able to handle QR code URLs. -This step can be skipped when you only use data URIs to display your images. - -``` yml -EndroidQrCodeBundle: - resource: "@EndroidQrCodeBundle/Controller/" - type: annotation - prefix: /qrcode -``` - -After installation and configuration, QR codes can be generated by appending -the QR code text to the url as mounted, followed by .png, .jpg or .gif. - -## Twig extension - -The bundle also provides a Twig extension for quickly generating QR code urls. -Optional parameters are extension, size, padding and errorCorrectionLevel. When -a parameter is omitted, the value in the bundle configuration is used. - -``` twig - - - -``` - -You can also use the data URI helper to embed the QR code within your HTML -instead of requiring a separate HTTP request to load your image. - -``` twig - -``` - -## Versioning - -Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility -breaking changes will be kept to a minimum but be aware that these can occur. -Lock your dependencies for production and test your code when upgrading. - -## License - -This bundle is under the MIT license. For the full copyright and license -information please view the LICENSE file that was distributed with this source code. +QR Code +======= + +*By [endroid](http://endroid.nl/)* + +[![Latest Stable Version](http://img.shields.io/packagist/v/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) +[![Build Status](http://img.shields.io/travis/endroid/QrCode.svg)](http://travis-ci.org/endroid/QrCode) +[![Total Downloads](http://img.shields.io/packagist/dt/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) +[![Monthly Downloads](http://img.shields.io/packagist/dm/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) +[![License](http://img.shields.io/packagist/l/endroid/qrcode.svg)](https://packagist.org/packages/endroid/qrcode) + +This library based on QRcode Perl CGI & PHP scripts by Y. Swetake helps you generate images containing a QR code. + +## Installation + +Use [Composer](https://getcomposer.org/) to install the library. + +``` bash +$ composer require endroid/qrcode +``` + +## Usage + +```php +use Endroid\QrCode\QrCode; + +$qrCode = new QrCode(); +$qrCode + ->setText('Life is too short to be generating QR codes') + ->setSize(300) + ->setPadding(10) + ->setErrorCorrection('high') + ->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]) + ->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]) + ->setLabel('Scan the code') + ->setLabelFontSize(16) + ->setImageType(QrCode::IMAGE_TYPE_PNG) +; + +// now we can directly output the qrcode +header('Content-Type: '.$qrCode->getContentType()); +$qrCode->render(); + +// save it to a file +$qrCode->save('qrcode.png'); + +// or create a response object +$response = new Response($qrCode->get(), 200, ['Content-Type' => $qrCode->getContentType()]); +``` + +![QR Code](http://endroid.nl/qrcode/Life%20is%20too%20short%20to%20be%20generating%20QR%20codes.png?label=Scan%20the%20code) + +## Symfony integration + +Register the Symfony bundle in the kernel. + +```php +// app/AppKernel.php + +public function registerBundles() +{ + $bundles = [ + // ... + new Endroid\QrCode\Bundle\EndroidQrCodeBundle(), + ]; +} +``` + +The default parameters can be overridden via the configuration. +Alpha channel available range is [0, 127] in foreground and background colors. + +```yaml +endroid_qr_code: + size: 100 + padding: 10 + extension: gif + error_correction_level: high + foreground_color: { r: 0, g: 0, b: 0, a: 0 } + background_color: { r: 255, g: 255, b: 255, a: 0 } + label: 'My label' + label_font_size: 16 +``` + +Now you can retrieve the factory as follows. + +```php +$factory = $this->get('endroid.qrcode.factory'); +$factory->createQrCode(); +``` + +Add the following section to your routing to be able to handle QR code URLs. +This step can be skipped when you only use data URIs to display your images. + +``` yml +EndroidQrCodeBundle: + resource: "@EndroidQrCodeBundle/Controller/" + type: annotation + prefix: /qrcode +``` + +After installation and configuration, QR codes can be generated by appending +the QR code text to the url as mounted, followed by .png, .jpg or .gif. + +## Twig extension + +The bundle also provides a Twig extension for quickly generating QR code urls. +Optional parameters are extension, size, padding and errorCorrectionLevel. When +a parameter is omitted, the value in the bundle configuration is used. + +``` twig + + + +``` + +You can also use the data URI helper to embed the QR code within your HTML +instead of requiring a separate HTTP request to load your image. + +``` twig + +``` + +## Versioning + +Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility +breaking changes will be kept to a minimum but be aware that these can occur. +Lock your dependencies for production and test your code when upgrading. + +## License + +This bundle is under the MIT license. For the full copyright and license +information please view the LICENSE file that was distributed with this source code. diff --git a/vendor/endroid/qrcode/assets/data/qrv10_0.dat b/vendor/endroid/qr-code/assets/data/qrv10_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv10_0.dat rename to vendor/endroid/qr-code/assets/data/qrv10_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv10_1.dat b/vendor/endroid/qr-code/assets/data/qrv10_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv10_1.dat rename to vendor/endroid/qr-code/assets/data/qrv10_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv10_2.dat b/vendor/endroid/qr-code/assets/data/qrv10_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv10_2.dat rename to vendor/endroid/qr-code/assets/data/qrv10_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv10_3.dat b/vendor/endroid/qr-code/assets/data/qrv10_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv10_3.dat rename to vendor/endroid/qr-code/assets/data/qrv10_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv11_0.dat b/vendor/endroid/qr-code/assets/data/qrv11_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv11_0.dat rename to vendor/endroid/qr-code/assets/data/qrv11_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv11_1.dat b/vendor/endroid/qr-code/assets/data/qrv11_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv11_1.dat rename to vendor/endroid/qr-code/assets/data/qrv11_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv11_2.dat b/vendor/endroid/qr-code/assets/data/qrv11_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv11_2.dat rename to vendor/endroid/qr-code/assets/data/qrv11_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv11_3.dat b/vendor/endroid/qr-code/assets/data/qrv11_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv11_3.dat rename to vendor/endroid/qr-code/assets/data/qrv11_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv12_0.dat b/vendor/endroid/qr-code/assets/data/qrv12_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv12_0.dat rename to vendor/endroid/qr-code/assets/data/qrv12_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv12_1.dat b/vendor/endroid/qr-code/assets/data/qrv12_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv12_1.dat rename to vendor/endroid/qr-code/assets/data/qrv12_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv12_2.dat b/vendor/endroid/qr-code/assets/data/qrv12_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv12_2.dat rename to vendor/endroid/qr-code/assets/data/qrv12_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv12_3.dat b/vendor/endroid/qr-code/assets/data/qrv12_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv12_3.dat rename to vendor/endroid/qr-code/assets/data/qrv12_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv13_0.dat b/vendor/endroid/qr-code/assets/data/qrv13_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv13_0.dat rename to vendor/endroid/qr-code/assets/data/qrv13_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv13_1.dat b/vendor/endroid/qr-code/assets/data/qrv13_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv13_1.dat rename to vendor/endroid/qr-code/assets/data/qrv13_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv13_2.dat b/vendor/endroid/qr-code/assets/data/qrv13_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv13_2.dat rename to vendor/endroid/qr-code/assets/data/qrv13_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv13_3.dat b/vendor/endroid/qr-code/assets/data/qrv13_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv13_3.dat rename to vendor/endroid/qr-code/assets/data/qrv13_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv14_0.dat b/vendor/endroid/qr-code/assets/data/qrv14_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv14_0.dat rename to vendor/endroid/qr-code/assets/data/qrv14_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv14_1.dat b/vendor/endroid/qr-code/assets/data/qrv14_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv14_1.dat rename to vendor/endroid/qr-code/assets/data/qrv14_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv14_2.dat b/vendor/endroid/qr-code/assets/data/qrv14_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv14_2.dat rename to vendor/endroid/qr-code/assets/data/qrv14_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv14_3.dat b/vendor/endroid/qr-code/assets/data/qrv14_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv14_3.dat rename to vendor/endroid/qr-code/assets/data/qrv14_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv15_0.dat b/vendor/endroid/qr-code/assets/data/qrv15_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv15_0.dat rename to vendor/endroid/qr-code/assets/data/qrv15_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv15_1.dat b/vendor/endroid/qr-code/assets/data/qrv15_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv15_1.dat rename to vendor/endroid/qr-code/assets/data/qrv15_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv15_2.dat b/vendor/endroid/qr-code/assets/data/qrv15_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv15_2.dat rename to vendor/endroid/qr-code/assets/data/qrv15_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv15_3.dat b/vendor/endroid/qr-code/assets/data/qrv15_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv15_3.dat rename to vendor/endroid/qr-code/assets/data/qrv15_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv16_0.dat b/vendor/endroid/qr-code/assets/data/qrv16_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv16_0.dat rename to vendor/endroid/qr-code/assets/data/qrv16_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv16_1.dat b/vendor/endroid/qr-code/assets/data/qrv16_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv16_1.dat rename to vendor/endroid/qr-code/assets/data/qrv16_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv16_2.dat b/vendor/endroid/qr-code/assets/data/qrv16_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv16_2.dat rename to vendor/endroid/qr-code/assets/data/qrv16_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv16_3.dat b/vendor/endroid/qr-code/assets/data/qrv16_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv16_3.dat rename to vendor/endroid/qr-code/assets/data/qrv16_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv17_0.dat b/vendor/endroid/qr-code/assets/data/qrv17_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv17_0.dat rename to vendor/endroid/qr-code/assets/data/qrv17_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv17_1.dat b/vendor/endroid/qr-code/assets/data/qrv17_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv17_1.dat rename to vendor/endroid/qr-code/assets/data/qrv17_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv17_2.dat b/vendor/endroid/qr-code/assets/data/qrv17_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv17_2.dat rename to vendor/endroid/qr-code/assets/data/qrv17_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv17_3.dat b/vendor/endroid/qr-code/assets/data/qrv17_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv17_3.dat rename to vendor/endroid/qr-code/assets/data/qrv17_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv18_0.dat b/vendor/endroid/qr-code/assets/data/qrv18_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv18_0.dat rename to vendor/endroid/qr-code/assets/data/qrv18_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv18_1.dat b/vendor/endroid/qr-code/assets/data/qrv18_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv18_1.dat rename to vendor/endroid/qr-code/assets/data/qrv18_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv18_2.dat b/vendor/endroid/qr-code/assets/data/qrv18_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv18_2.dat rename to vendor/endroid/qr-code/assets/data/qrv18_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv18_3.dat b/vendor/endroid/qr-code/assets/data/qrv18_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv18_3.dat rename to vendor/endroid/qr-code/assets/data/qrv18_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv19_0.dat b/vendor/endroid/qr-code/assets/data/qrv19_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv19_0.dat rename to vendor/endroid/qr-code/assets/data/qrv19_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv19_1.dat b/vendor/endroid/qr-code/assets/data/qrv19_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv19_1.dat rename to vendor/endroid/qr-code/assets/data/qrv19_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv19_2.dat b/vendor/endroid/qr-code/assets/data/qrv19_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv19_2.dat rename to vendor/endroid/qr-code/assets/data/qrv19_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv19_3.dat b/vendor/endroid/qr-code/assets/data/qrv19_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv19_3.dat rename to vendor/endroid/qr-code/assets/data/qrv19_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv1_0.dat b/vendor/endroid/qr-code/assets/data/qrv1_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv1_0.dat rename to vendor/endroid/qr-code/assets/data/qrv1_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv1_1.dat b/vendor/endroid/qr-code/assets/data/qrv1_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv1_1.dat rename to vendor/endroid/qr-code/assets/data/qrv1_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv1_2.dat b/vendor/endroid/qr-code/assets/data/qrv1_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv1_2.dat rename to vendor/endroid/qr-code/assets/data/qrv1_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv1_3.dat b/vendor/endroid/qr-code/assets/data/qrv1_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv1_3.dat rename to vendor/endroid/qr-code/assets/data/qrv1_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv20_0.dat b/vendor/endroid/qr-code/assets/data/qrv20_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv20_0.dat rename to vendor/endroid/qr-code/assets/data/qrv20_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv20_1.dat b/vendor/endroid/qr-code/assets/data/qrv20_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv20_1.dat rename to vendor/endroid/qr-code/assets/data/qrv20_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv20_2.dat b/vendor/endroid/qr-code/assets/data/qrv20_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv20_2.dat rename to vendor/endroid/qr-code/assets/data/qrv20_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv20_3.dat b/vendor/endroid/qr-code/assets/data/qrv20_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv20_3.dat rename to vendor/endroid/qr-code/assets/data/qrv20_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv21_0.dat b/vendor/endroid/qr-code/assets/data/qrv21_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv21_0.dat rename to vendor/endroid/qr-code/assets/data/qrv21_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv21_1.dat b/vendor/endroid/qr-code/assets/data/qrv21_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv21_1.dat rename to vendor/endroid/qr-code/assets/data/qrv21_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv21_2.dat b/vendor/endroid/qr-code/assets/data/qrv21_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv21_2.dat rename to vendor/endroid/qr-code/assets/data/qrv21_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv21_3.dat b/vendor/endroid/qr-code/assets/data/qrv21_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv21_3.dat rename to vendor/endroid/qr-code/assets/data/qrv21_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv22_0.dat b/vendor/endroid/qr-code/assets/data/qrv22_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv22_0.dat rename to vendor/endroid/qr-code/assets/data/qrv22_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv22_1.dat b/vendor/endroid/qr-code/assets/data/qrv22_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv22_1.dat rename to vendor/endroid/qr-code/assets/data/qrv22_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv22_2.dat b/vendor/endroid/qr-code/assets/data/qrv22_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv22_2.dat rename to vendor/endroid/qr-code/assets/data/qrv22_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv22_3.dat b/vendor/endroid/qr-code/assets/data/qrv22_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv22_3.dat rename to vendor/endroid/qr-code/assets/data/qrv22_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv23_0.dat b/vendor/endroid/qr-code/assets/data/qrv23_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv23_0.dat rename to vendor/endroid/qr-code/assets/data/qrv23_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv23_1.dat b/vendor/endroid/qr-code/assets/data/qrv23_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv23_1.dat rename to vendor/endroid/qr-code/assets/data/qrv23_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv23_2.dat b/vendor/endroid/qr-code/assets/data/qrv23_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv23_2.dat rename to vendor/endroid/qr-code/assets/data/qrv23_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv23_3.dat b/vendor/endroid/qr-code/assets/data/qrv23_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv23_3.dat rename to vendor/endroid/qr-code/assets/data/qrv23_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv24_0.dat b/vendor/endroid/qr-code/assets/data/qrv24_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv24_0.dat rename to vendor/endroid/qr-code/assets/data/qrv24_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv24_1.dat b/vendor/endroid/qr-code/assets/data/qrv24_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv24_1.dat rename to vendor/endroid/qr-code/assets/data/qrv24_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv24_2.dat b/vendor/endroid/qr-code/assets/data/qrv24_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv24_2.dat rename to vendor/endroid/qr-code/assets/data/qrv24_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv24_3.dat b/vendor/endroid/qr-code/assets/data/qrv24_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv24_3.dat rename to vendor/endroid/qr-code/assets/data/qrv24_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv25_0.dat b/vendor/endroid/qr-code/assets/data/qrv25_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv25_0.dat rename to vendor/endroid/qr-code/assets/data/qrv25_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv25_1.dat b/vendor/endroid/qr-code/assets/data/qrv25_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv25_1.dat rename to vendor/endroid/qr-code/assets/data/qrv25_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv25_2.dat b/vendor/endroid/qr-code/assets/data/qrv25_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv25_2.dat rename to vendor/endroid/qr-code/assets/data/qrv25_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv25_3.dat b/vendor/endroid/qr-code/assets/data/qrv25_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv25_3.dat rename to vendor/endroid/qr-code/assets/data/qrv25_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv26_0.dat b/vendor/endroid/qr-code/assets/data/qrv26_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv26_0.dat rename to vendor/endroid/qr-code/assets/data/qrv26_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv26_1.dat b/vendor/endroid/qr-code/assets/data/qrv26_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv26_1.dat rename to vendor/endroid/qr-code/assets/data/qrv26_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv26_2.dat b/vendor/endroid/qr-code/assets/data/qrv26_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv26_2.dat rename to vendor/endroid/qr-code/assets/data/qrv26_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv26_3.dat b/vendor/endroid/qr-code/assets/data/qrv26_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv26_3.dat rename to vendor/endroid/qr-code/assets/data/qrv26_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv27_0.dat b/vendor/endroid/qr-code/assets/data/qrv27_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv27_0.dat rename to vendor/endroid/qr-code/assets/data/qrv27_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv27_1.dat b/vendor/endroid/qr-code/assets/data/qrv27_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv27_1.dat rename to vendor/endroid/qr-code/assets/data/qrv27_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv27_2.dat b/vendor/endroid/qr-code/assets/data/qrv27_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv27_2.dat rename to vendor/endroid/qr-code/assets/data/qrv27_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv27_3.dat b/vendor/endroid/qr-code/assets/data/qrv27_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv27_3.dat rename to vendor/endroid/qr-code/assets/data/qrv27_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv28_0.dat b/vendor/endroid/qr-code/assets/data/qrv28_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv28_0.dat rename to vendor/endroid/qr-code/assets/data/qrv28_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv28_1.dat b/vendor/endroid/qr-code/assets/data/qrv28_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv28_1.dat rename to vendor/endroid/qr-code/assets/data/qrv28_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv28_2.dat b/vendor/endroid/qr-code/assets/data/qrv28_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv28_2.dat rename to vendor/endroid/qr-code/assets/data/qrv28_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv28_3.dat b/vendor/endroid/qr-code/assets/data/qrv28_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv28_3.dat rename to vendor/endroid/qr-code/assets/data/qrv28_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv29_0.dat b/vendor/endroid/qr-code/assets/data/qrv29_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv29_0.dat rename to vendor/endroid/qr-code/assets/data/qrv29_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv29_1.dat b/vendor/endroid/qr-code/assets/data/qrv29_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv29_1.dat rename to vendor/endroid/qr-code/assets/data/qrv29_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv29_2.dat b/vendor/endroid/qr-code/assets/data/qrv29_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv29_2.dat rename to vendor/endroid/qr-code/assets/data/qrv29_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv29_3.dat b/vendor/endroid/qr-code/assets/data/qrv29_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv29_3.dat rename to vendor/endroid/qr-code/assets/data/qrv29_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv2_0.dat b/vendor/endroid/qr-code/assets/data/qrv2_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv2_0.dat rename to vendor/endroid/qr-code/assets/data/qrv2_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv2_1.dat b/vendor/endroid/qr-code/assets/data/qrv2_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv2_1.dat rename to vendor/endroid/qr-code/assets/data/qrv2_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv2_2.dat b/vendor/endroid/qr-code/assets/data/qrv2_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv2_2.dat rename to vendor/endroid/qr-code/assets/data/qrv2_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv2_3.dat b/vendor/endroid/qr-code/assets/data/qrv2_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv2_3.dat rename to vendor/endroid/qr-code/assets/data/qrv2_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv30_0.dat b/vendor/endroid/qr-code/assets/data/qrv30_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv30_0.dat rename to vendor/endroid/qr-code/assets/data/qrv30_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv30_1.dat b/vendor/endroid/qr-code/assets/data/qrv30_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv30_1.dat rename to vendor/endroid/qr-code/assets/data/qrv30_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv30_2.dat b/vendor/endroid/qr-code/assets/data/qrv30_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv30_2.dat rename to vendor/endroid/qr-code/assets/data/qrv30_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv30_3.dat b/vendor/endroid/qr-code/assets/data/qrv30_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv30_3.dat rename to vendor/endroid/qr-code/assets/data/qrv30_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv31_0.dat b/vendor/endroid/qr-code/assets/data/qrv31_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv31_0.dat rename to vendor/endroid/qr-code/assets/data/qrv31_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv31_1.dat b/vendor/endroid/qr-code/assets/data/qrv31_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv31_1.dat rename to vendor/endroid/qr-code/assets/data/qrv31_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv31_2.dat b/vendor/endroid/qr-code/assets/data/qrv31_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv31_2.dat rename to vendor/endroid/qr-code/assets/data/qrv31_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv31_3.dat b/vendor/endroid/qr-code/assets/data/qrv31_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv31_3.dat rename to vendor/endroid/qr-code/assets/data/qrv31_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv32_0.dat b/vendor/endroid/qr-code/assets/data/qrv32_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv32_0.dat rename to vendor/endroid/qr-code/assets/data/qrv32_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv32_1.dat b/vendor/endroid/qr-code/assets/data/qrv32_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv32_1.dat rename to vendor/endroid/qr-code/assets/data/qrv32_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv32_2.dat b/vendor/endroid/qr-code/assets/data/qrv32_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv32_2.dat rename to vendor/endroid/qr-code/assets/data/qrv32_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv32_3.dat b/vendor/endroid/qr-code/assets/data/qrv32_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv32_3.dat rename to vendor/endroid/qr-code/assets/data/qrv32_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv33_0.dat b/vendor/endroid/qr-code/assets/data/qrv33_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv33_0.dat rename to vendor/endroid/qr-code/assets/data/qrv33_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv33_1.dat b/vendor/endroid/qr-code/assets/data/qrv33_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv33_1.dat rename to vendor/endroid/qr-code/assets/data/qrv33_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv33_2.dat b/vendor/endroid/qr-code/assets/data/qrv33_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv33_2.dat rename to vendor/endroid/qr-code/assets/data/qrv33_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv33_3.dat b/vendor/endroid/qr-code/assets/data/qrv33_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv33_3.dat rename to vendor/endroid/qr-code/assets/data/qrv33_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv34_0.dat b/vendor/endroid/qr-code/assets/data/qrv34_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv34_0.dat rename to vendor/endroid/qr-code/assets/data/qrv34_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv34_1.dat b/vendor/endroid/qr-code/assets/data/qrv34_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv34_1.dat rename to vendor/endroid/qr-code/assets/data/qrv34_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv34_2.dat b/vendor/endroid/qr-code/assets/data/qrv34_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv34_2.dat rename to vendor/endroid/qr-code/assets/data/qrv34_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv34_3.dat b/vendor/endroid/qr-code/assets/data/qrv34_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv34_3.dat rename to vendor/endroid/qr-code/assets/data/qrv34_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv35_0.dat b/vendor/endroid/qr-code/assets/data/qrv35_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv35_0.dat rename to vendor/endroid/qr-code/assets/data/qrv35_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv35_1.dat b/vendor/endroid/qr-code/assets/data/qrv35_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv35_1.dat rename to vendor/endroid/qr-code/assets/data/qrv35_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv35_2.dat b/vendor/endroid/qr-code/assets/data/qrv35_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv35_2.dat rename to vendor/endroid/qr-code/assets/data/qrv35_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv35_3.dat b/vendor/endroid/qr-code/assets/data/qrv35_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv35_3.dat rename to vendor/endroid/qr-code/assets/data/qrv35_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv36_0.dat b/vendor/endroid/qr-code/assets/data/qrv36_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv36_0.dat rename to vendor/endroid/qr-code/assets/data/qrv36_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv36_1.dat b/vendor/endroid/qr-code/assets/data/qrv36_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv36_1.dat rename to vendor/endroid/qr-code/assets/data/qrv36_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv36_2.dat b/vendor/endroid/qr-code/assets/data/qrv36_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv36_2.dat rename to vendor/endroid/qr-code/assets/data/qrv36_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv36_3.dat b/vendor/endroid/qr-code/assets/data/qrv36_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv36_3.dat rename to vendor/endroid/qr-code/assets/data/qrv36_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv37_0.dat b/vendor/endroid/qr-code/assets/data/qrv37_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv37_0.dat rename to vendor/endroid/qr-code/assets/data/qrv37_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv37_1.dat b/vendor/endroid/qr-code/assets/data/qrv37_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv37_1.dat rename to vendor/endroid/qr-code/assets/data/qrv37_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv37_2.dat b/vendor/endroid/qr-code/assets/data/qrv37_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv37_2.dat rename to vendor/endroid/qr-code/assets/data/qrv37_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv37_3.dat b/vendor/endroid/qr-code/assets/data/qrv37_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv37_3.dat rename to vendor/endroid/qr-code/assets/data/qrv37_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv38_0.dat b/vendor/endroid/qr-code/assets/data/qrv38_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv38_0.dat rename to vendor/endroid/qr-code/assets/data/qrv38_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv38_1.dat b/vendor/endroid/qr-code/assets/data/qrv38_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv38_1.dat rename to vendor/endroid/qr-code/assets/data/qrv38_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv38_2.dat b/vendor/endroid/qr-code/assets/data/qrv38_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv38_2.dat rename to vendor/endroid/qr-code/assets/data/qrv38_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv38_3.dat b/vendor/endroid/qr-code/assets/data/qrv38_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv38_3.dat rename to vendor/endroid/qr-code/assets/data/qrv38_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv39_0.dat b/vendor/endroid/qr-code/assets/data/qrv39_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv39_0.dat rename to vendor/endroid/qr-code/assets/data/qrv39_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv39_1.dat b/vendor/endroid/qr-code/assets/data/qrv39_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv39_1.dat rename to vendor/endroid/qr-code/assets/data/qrv39_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv39_2.dat b/vendor/endroid/qr-code/assets/data/qrv39_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv39_2.dat rename to vendor/endroid/qr-code/assets/data/qrv39_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv39_3.dat b/vendor/endroid/qr-code/assets/data/qrv39_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv39_3.dat rename to vendor/endroid/qr-code/assets/data/qrv39_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv3_0.dat b/vendor/endroid/qr-code/assets/data/qrv3_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv3_0.dat rename to vendor/endroid/qr-code/assets/data/qrv3_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv3_1.dat b/vendor/endroid/qr-code/assets/data/qrv3_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv3_1.dat rename to vendor/endroid/qr-code/assets/data/qrv3_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv3_2.dat b/vendor/endroid/qr-code/assets/data/qrv3_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv3_2.dat rename to vendor/endroid/qr-code/assets/data/qrv3_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv3_3.dat b/vendor/endroid/qr-code/assets/data/qrv3_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv3_3.dat rename to vendor/endroid/qr-code/assets/data/qrv3_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv40_0.dat b/vendor/endroid/qr-code/assets/data/qrv40_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv40_0.dat rename to vendor/endroid/qr-code/assets/data/qrv40_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv40_1.dat b/vendor/endroid/qr-code/assets/data/qrv40_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv40_1.dat rename to vendor/endroid/qr-code/assets/data/qrv40_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv40_2.dat b/vendor/endroid/qr-code/assets/data/qrv40_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv40_2.dat rename to vendor/endroid/qr-code/assets/data/qrv40_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv40_3.dat b/vendor/endroid/qr-code/assets/data/qrv40_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv40_3.dat rename to vendor/endroid/qr-code/assets/data/qrv40_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv4_0.dat b/vendor/endroid/qr-code/assets/data/qrv4_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv4_0.dat rename to vendor/endroid/qr-code/assets/data/qrv4_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv4_1.dat b/vendor/endroid/qr-code/assets/data/qrv4_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv4_1.dat rename to vendor/endroid/qr-code/assets/data/qrv4_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv4_2.dat b/vendor/endroid/qr-code/assets/data/qrv4_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv4_2.dat rename to vendor/endroid/qr-code/assets/data/qrv4_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv4_3.dat b/vendor/endroid/qr-code/assets/data/qrv4_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv4_3.dat rename to vendor/endroid/qr-code/assets/data/qrv4_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv5_0.dat b/vendor/endroid/qr-code/assets/data/qrv5_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv5_0.dat rename to vendor/endroid/qr-code/assets/data/qrv5_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv5_1.dat b/vendor/endroid/qr-code/assets/data/qrv5_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv5_1.dat rename to vendor/endroid/qr-code/assets/data/qrv5_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv5_2.dat b/vendor/endroid/qr-code/assets/data/qrv5_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv5_2.dat rename to vendor/endroid/qr-code/assets/data/qrv5_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv5_3.dat b/vendor/endroid/qr-code/assets/data/qrv5_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv5_3.dat rename to vendor/endroid/qr-code/assets/data/qrv5_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv6_0.dat b/vendor/endroid/qr-code/assets/data/qrv6_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv6_0.dat rename to vendor/endroid/qr-code/assets/data/qrv6_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv6_1.dat b/vendor/endroid/qr-code/assets/data/qrv6_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv6_1.dat rename to vendor/endroid/qr-code/assets/data/qrv6_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv6_2.dat b/vendor/endroid/qr-code/assets/data/qrv6_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv6_2.dat rename to vendor/endroid/qr-code/assets/data/qrv6_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv6_3.dat b/vendor/endroid/qr-code/assets/data/qrv6_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv6_3.dat rename to vendor/endroid/qr-code/assets/data/qrv6_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv7_0.dat b/vendor/endroid/qr-code/assets/data/qrv7_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv7_0.dat rename to vendor/endroid/qr-code/assets/data/qrv7_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv7_1.dat b/vendor/endroid/qr-code/assets/data/qrv7_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv7_1.dat rename to vendor/endroid/qr-code/assets/data/qrv7_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv7_2.dat b/vendor/endroid/qr-code/assets/data/qrv7_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv7_2.dat rename to vendor/endroid/qr-code/assets/data/qrv7_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv7_3.dat b/vendor/endroid/qr-code/assets/data/qrv7_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv7_3.dat rename to vendor/endroid/qr-code/assets/data/qrv7_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv8_0.dat b/vendor/endroid/qr-code/assets/data/qrv8_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv8_0.dat rename to vendor/endroid/qr-code/assets/data/qrv8_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv8_1.dat b/vendor/endroid/qr-code/assets/data/qrv8_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv8_1.dat rename to vendor/endroid/qr-code/assets/data/qrv8_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv8_2.dat b/vendor/endroid/qr-code/assets/data/qrv8_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv8_2.dat rename to vendor/endroid/qr-code/assets/data/qrv8_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv8_3.dat b/vendor/endroid/qr-code/assets/data/qrv8_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv8_3.dat rename to vendor/endroid/qr-code/assets/data/qrv8_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv9_0.dat b/vendor/endroid/qr-code/assets/data/qrv9_0.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv9_0.dat rename to vendor/endroid/qr-code/assets/data/qrv9_0.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv9_1.dat b/vendor/endroid/qr-code/assets/data/qrv9_1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv9_1.dat rename to vendor/endroid/qr-code/assets/data/qrv9_1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv9_2.dat b/vendor/endroid/qr-code/assets/data/qrv9_2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv9_2.dat rename to vendor/endroid/qr-code/assets/data/qrv9_2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrv9_3.dat b/vendor/endroid/qr-code/assets/data/qrv9_3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrv9_3.dat rename to vendor/endroid/qr-code/assets/data/qrv9_3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr1.dat b/vendor/endroid/qr-code/assets/data/qrvfr1.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr1.dat rename to vendor/endroid/qr-code/assets/data/qrvfr1.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr10.dat b/vendor/endroid/qr-code/assets/data/qrvfr10.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr10.dat rename to vendor/endroid/qr-code/assets/data/qrvfr10.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr11.dat b/vendor/endroid/qr-code/assets/data/qrvfr11.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr11.dat rename to vendor/endroid/qr-code/assets/data/qrvfr11.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr12.dat b/vendor/endroid/qr-code/assets/data/qrvfr12.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr12.dat rename to vendor/endroid/qr-code/assets/data/qrvfr12.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr13.dat b/vendor/endroid/qr-code/assets/data/qrvfr13.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr13.dat rename to vendor/endroid/qr-code/assets/data/qrvfr13.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr14.dat b/vendor/endroid/qr-code/assets/data/qrvfr14.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr14.dat rename to vendor/endroid/qr-code/assets/data/qrvfr14.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr15.dat b/vendor/endroid/qr-code/assets/data/qrvfr15.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr15.dat rename to vendor/endroid/qr-code/assets/data/qrvfr15.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr16.dat b/vendor/endroid/qr-code/assets/data/qrvfr16.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr16.dat rename to vendor/endroid/qr-code/assets/data/qrvfr16.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr17.dat b/vendor/endroid/qr-code/assets/data/qrvfr17.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr17.dat rename to vendor/endroid/qr-code/assets/data/qrvfr17.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr18.dat b/vendor/endroid/qr-code/assets/data/qrvfr18.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr18.dat rename to vendor/endroid/qr-code/assets/data/qrvfr18.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr19.dat b/vendor/endroid/qr-code/assets/data/qrvfr19.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr19.dat rename to vendor/endroid/qr-code/assets/data/qrvfr19.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr2.dat b/vendor/endroid/qr-code/assets/data/qrvfr2.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr2.dat rename to vendor/endroid/qr-code/assets/data/qrvfr2.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr20.dat b/vendor/endroid/qr-code/assets/data/qrvfr20.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr20.dat rename to vendor/endroid/qr-code/assets/data/qrvfr20.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr21.dat b/vendor/endroid/qr-code/assets/data/qrvfr21.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr21.dat rename to vendor/endroid/qr-code/assets/data/qrvfr21.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr22.dat b/vendor/endroid/qr-code/assets/data/qrvfr22.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr22.dat rename to vendor/endroid/qr-code/assets/data/qrvfr22.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr23.dat b/vendor/endroid/qr-code/assets/data/qrvfr23.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr23.dat rename to vendor/endroid/qr-code/assets/data/qrvfr23.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr24.dat b/vendor/endroid/qr-code/assets/data/qrvfr24.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr24.dat rename to vendor/endroid/qr-code/assets/data/qrvfr24.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr25.dat b/vendor/endroid/qr-code/assets/data/qrvfr25.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr25.dat rename to vendor/endroid/qr-code/assets/data/qrvfr25.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr26.dat b/vendor/endroid/qr-code/assets/data/qrvfr26.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr26.dat rename to vendor/endroid/qr-code/assets/data/qrvfr26.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr27.dat b/vendor/endroid/qr-code/assets/data/qrvfr27.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr27.dat rename to vendor/endroid/qr-code/assets/data/qrvfr27.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr28.dat b/vendor/endroid/qr-code/assets/data/qrvfr28.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr28.dat rename to vendor/endroid/qr-code/assets/data/qrvfr28.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr29.dat b/vendor/endroid/qr-code/assets/data/qrvfr29.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr29.dat rename to vendor/endroid/qr-code/assets/data/qrvfr29.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr3.dat b/vendor/endroid/qr-code/assets/data/qrvfr3.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr3.dat rename to vendor/endroid/qr-code/assets/data/qrvfr3.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr30.dat b/vendor/endroid/qr-code/assets/data/qrvfr30.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr30.dat rename to vendor/endroid/qr-code/assets/data/qrvfr30.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr31.dat b/vendor/endroid/qr-code/assets/data/qrvfr31.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr31.dat rename to vendor/endroid/qr-code/assets/data/qrvfr31.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr32.dat b/vendor/endroid/qr-code/assets/data/qrvfr32.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr32.dat rename to vendor/endroid/qr-code/assets/data/qrvfr32.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr33.dat b/vendor/endroid/qr-code/assets/data/qrvfr33.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr33.dat rename to vendor/endroid/qr-code/assets/data/qrvfr33.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr34.dat b/vendor/endroid/qr-code/assets/data/qrvfr34.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr34.dat rename to vendor/endroid/qr-code/assets/data/qrvfr34.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr35.dat b/vendor/endroid/qr-code/assets/data/qrvfr35.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr35.dat rename to vendor/endroid/qr-code/assets/data/qrvfr35.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr36.dat b/vendor/endroid/qr-code/assets/data/qrvfr36.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr36.dat rename to vendor/endroid/qr-code/assets/data/qrvfr36.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr37.dat b/vendor/endroid/qr-code/assets/data/qrvfr37.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr37.dat rename to vendor/endroid/qr-code/assets/data/qrvfr37.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr38.dat b/vendor/endroid/qr-code/assets/data/qrvfr38.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr38.dat rename to vendor/endroid/qr-code/assets/data/qrvfr38.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr39.dat b/vendor/endroid/qr-code/assets/data/qrvfr39.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr39.dat rename to vendor/endroid/qr-code/assets/data/qrvfr39.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr4.dat b/vendor/endroid/qr-code/assets/data/qrvfr4.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr4.dat rename to vendor/endroid/qr-code/assets/data/qrvfr4.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr40.dat b/vendor/endroid/qr-code/assets/data/qrvfr40.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr40.dat rename to vendor/endroid/qr-code/assets/data/qrvfr40.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr5.dat b/vendor/endroid/qr-code/assets/data/qrvfr5.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr5.dat rename to vendor/endroid/qr-code/assets/data/qrvfr5.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr6.dat b/vendor/endroid/qr-code/assets/data/qrvfr6.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr6.dat rename to vendor/endroid/qr-code/assets/data/qrvfr6.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr7.dat b/vendor/endroid/qr-code/assets/data/qrvfr7.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr7.dat rename to vendor/endroid/qr-code/assets/data/qrvfr7.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr8.dat b/vendor/endroid/qr-code/assets/data/qrvfr8.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr8.dat rename to vendor/endroid/qr-code/assets/data/qrvfr8.dat diff --git a/vendor/endroid/qrcode/assets/data/qrvfr9.dat b/vendor/endroid/qr-code/assets/data/qrvfr9.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/qrvfr9.dat rename to vendor/endroid/qr-code/assets/data/qrvfr9.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc10.dat b/vendor/endroid/qr-code/assets/data/rsc10.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc10.dat rename to vendor/endroid/qr-code/assets/data/rsc10.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc13.dat b/vendor/endroid/qr-code/assets/data/rsc13.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc13.dat rename to vendor/endroid/qr-code/assets/data/rsc13.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc15.dat b/vendor/endroid/qr-code/assets/data/rsc15.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc15.dat rename to vendor/endroid/qr-code/assets/data/rsc15.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc16.dat b/vendor/endroid/qr-code/assets/data/rsc16.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc16.dat rename to vendor/endroid/qr-code/assets/data/rsc16.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc17.dat b/vendor/endroid/qr-code/assets/data/rsc17.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc17.dat rename to vendor/endroid/qr-code/assets/data/rsc17.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc18.dat b/vendor/endroid/qr-code/assets/data/rsc18.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc18.dat rename to vendor/endroid/qr-code/assets/data/rsc18.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc20.dat b/vendor/endroid/qr-code/assets/data/rsc20.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc20.dat rename to vendor/endroid/qr-code/assets/data/rsc20.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc22.dat b/vendor/endroid/qr-code/assets/data/rsc22.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc22.dat rename to vendor/endroid/qr-code/assets/data/rsc22.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc24.dat b/vendor/endroid/qr-code/assets/data/rsc24.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc24.dat rename to vendor/endroid/qr-code/assets/data/rsc24.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc26.dat b/vendor/endroid/qr-code/assets/data/rsc26.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc26.dat rename to vendor/endroid/qr-code/assets/data/rsc26.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc28.dat b/vendor/endroid/qr-code/assets/data/rsc28.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc28.dat rename to vendor/endroid/qr-code/assets/data/rsc28.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc30.dat b/vendor/endroid/qr-code/assets/data/rsc30.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc30.dat rename to vendor/endroid/qr-code/assets/data/rsc30.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc32.dat b/vendor/endroid/qr-code/assets/data/rsc32.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc32.dat rename to vendor/endroid/qr-code/assets/data/rsc32.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc34.dat b/vendor/endroid/qr-code/assets/data/rsc34.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc34.dat rename to vendor/endroid/qr-code/assets/data/rsc34.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc36.dat b/vendor/endroid/qr-code/assets/data/rsc36.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc36.dat rename to vendor/endroid/qr-code/assets/data/rsc36.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc40.dat b/vendor/endroid/qr-code/assets/data/rsc40.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc40.dat rename to vendor/endroid/qr-code/assets/data/rsc40.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc42.dat b/vendor/endroid/qr-code/assets/data/rsc42.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc42.dat rename to vendor/endroid/qr-code/assets/data/rsc42.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc44.dat b/vendor/endroid/qr-code/assets/data/rsc44.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc44.dat rename to vendor/endroid/qr-code/assets/data/rsc44.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc46.dat b/vendor/endroid/qr-code/assets/data/rsc46.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc46.dat rename to vendor/endroid/qr-code/assets/data/rsc46.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc48.dat b/vendor/endroid/qr-code/assets/data/rsc48.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc48.dat rename to vendor/endroid/qr-code/assets/data/rsc48.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc50.dat b/vendor/endroid/qr-code/assets/data/rsc50.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc50.dat rename to vendor/endroid/qr-code/assets/data/rsc50.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc52.dat b/vendor/endroid/qr-code/assets/data/rsc52.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc52.dat rename to vendor/endroid/qr-code/assets/data/rsc52.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc54.dat b/vendor/endroid/qr-code/assets/data/rsc54.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc54.dat rename to vendor/endroid/qr-code/assets/data/rsc54.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc56.dat b/vendor/endroid/qr-code/assets/data/rsc56.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc56.dat rename to vendor/endroid/qr-code/assets/data/rsc56.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc58.dat b/vendor/endroid/qr-code/assets/data/rsc58.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc58.dat rename to vendor/endroid/qr-code/assets/data/rsc58.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc60.dat b/vendor/endroid/qr-code/assets/data/rsc60.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc60.dat rename to vendor/endroid/qr-code/assets/data/rsc60.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc62.dat b/vendor/endroid/qr-code/assets/data/rsc62.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc62.dat rename to vendor/endroid/qr-code/assets/data/rsc62.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc64.dat b/vendor/endroid/qr-code/assets/data/rsc64.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc64.dat rename to vendor/endroid/qr-code/assets/data/rsc64.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc66.dat b/vendor/endroid/qr-code/assets/data/rsc66.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc66.dat rename to vendor/endroid/qr-code/assets/data/rsc66.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc68.dat b/vendor/endroid/qr-code/assets/data/rsc68.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc68.dat rename to vendor/endroid/qr-code/assets/data/rsc68.dat diff --git a/vendor/endroid/qrcode/assets/data/rsc7.dat b/vendor/endroid/qr-code/assets/data/rsc7.dat similarity index 100% rename from vendor/endroid/qrcode/assets/data/rsc7.dat rename to vendor/endroid/qr-code/assets/data/rsc7.dat diff --git a/vendor/endroid/qrcode/assets/font/opensans.ttf b/vendor/endroid/qr-code/assets/font/opensans.ttf similarity index 100% rename from vendor/endroid/qrcode/assets/font/opensans.ttf rename to vendor/endroid/qr-code/assets/font/opensans.ttf diff --git a/vendor/endroid/qrcode/assets/image/b.png b/vendor/endroid/qr-code/assets/image/b.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/b.png rename to vendor/endroid/qr-code/assets/image/b.png diff --git a/vendor/endroid/qrcode/assets/image/d.png b/vendor/endroid/qr-code/assets/image/d.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/d.png rename to vendor/endroid/qr-code/assets/image/d.png diff --git a/vendor/endroid/qrcode/assets/image/logo.png b/vendor/endroid/qr-code/assets/image/logo.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/logo.png rename to vendor/endroid/qr-code/assets/image/logo.png diff --git a/vendor/endroid/qrcode/assets/image/qrv1.png b/vendor/endroid/qr-code/assets/image/qrv1.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv1.png rename to vendor/endroid/qr-code/assets/image/qrv1.png diff --git a/vendor/endroid/qrcode/assets/image/qrv10.png b/vendor/endroid/qr-code/assets/image/qrv10.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv10.png rename to vendor/endroid/qr-code/assets/image/qrv10.png diff --git a/vendor/endroid/qrcode/assets/image/qrv11.png b/vendor/endroid/qr-code/assets/image/qrv11.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv11.png rename to vendor/endroid/qr-code/assets/image/qrv11.png diff --git a/vendor/endroid/qrcode/assets/image/qrv12.png b/vendor/endroid/qr-code/assets/image/qrv12.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv12.png rename to vendor/endroid/qr-code/assets/image/qrv12.png diff --git a/vendor/endroid/qrcode/assets/image/qrv13.png b/vendor/endroid/qr-code/assets/image/qrv13.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv13.png rename to vendor/endroid/qr-code/assets/image/qrv13.png diff --git a/vendor/endroid/qrcode/assets/image/qrv14.png b/vendor/endroid/qr-code/assets/image/qrv14.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv14.png rename to vendor/endroid/qr-code/assets/image/qrv14.png diff --git a/vendor/endroid/qrcode/assets/image/qrv15.png b/vendor/endroid/qr-code/assets/image/qrv15.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv15.png rename to vendor/endroid/qr-code/assets/image/qrv15.png diff --git a/vendor/endroid/qrcode/assets/image/qrv16.png b/vendor/endroid/qr-code/assets/image/qrv16.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv16.png rename to vendor/endroid/qr-code/assets/image/qrv16.png diff --git a/vendor/endroid/qrcode/assets/image/qrv17.png b/vendor/endroid/qr-code/assets/image/qrv17.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv17.png rename to vendor/endroid/qr-code/assets/image/qrv17.png diff --git a/vendor/endroid/qrcode/assets/image/qrv18.png b/vendor/endroid/qr-code/assets/image/qrv18.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv18.png rename to vendor/endroid/qr-code/assets/image/qrv18.png diff --git a/vendor/endroid/qrcode/assets/image/qrv19.png b/vendor/endroid/qr-code/assets/image/qrv19.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv19.png rename to vendor/endroid/qr-code/assets/image/qrv19.png diff --git a/vendor/endroid/qrcode/assets/image/qrv2.png b/vendor/endroid/qr-code/assets/image/qrv2.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv2.png rename to vendor/endroid/qr-code/assets/image/qrv2.png diff --git a/vendor/endroid/qrcode/assets/image/qrv20.png b/vendor/endroid/qr-code/assets/image/qrv20.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv20.png rename to vendor/endroid/qr-code/assets/image/qrv20.png diff --git a/vendor/endroid/qrcode/assets/image/qrv21.png b/vendor/endroid/qr-code/assets/image/qrv21.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv21.png rename to vendor/endroid/qr-code/assets/image/qrv21.png diff --git a/vendor/endroid/qrcode/assets/image/qrv22.png b/vendor/endroid/qr-code/assets/image/qrv22.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv22.png rename to vendor/endroid/qr-code/assets/image/qrv22.png diff --git a/vendor/endroid/qrcode/assets/image/qrv23.png b/vendor/endroid/qr-code/assets/image/qrv23.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv23.png rename to vendor/endroid/qr-code/assets/image/qrv23.png diff --git a/vendor/endroid/qrcode/assets/image/qrv24.png b/vendor/endroid/qr-code/assets/image/qrv24.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv24.png rename to vendor/endroid/qr-code/assets/image/qrv24.png diff --git a/vendor/endroid/qrcode/assets/image/qrv25.png b/vendor/endroid/qr-code/assets/image/qrv25.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv25.png rename to vendor/endroid/qr-code/assets/image/qrv25.png diff --git a/vendor/endroid/qrcode/assets/image/qrv26.png b/vendor/endroid/qr-code/assets/image/qrv26.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv26.png rename to vendor/endroid/qr-code/assets/image/qrv26.png diff --git a/vendor/endroid/qrcode/assets/image/qrv27.png b/vendor/endroid/qr-code/assets/image/qrv27.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv27.png rename to vendor/endroid/qr-code/assets/image/qrv27.png diff --git a/vendor/endroid/qrcode/assets/image/qrv28.png b/vendor/endroid/qr-code/assets/image/qrv28.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv28.png rename to vendor/endroid/qr-code/assets/image/qrv28.png diff --git a/vendor/endroid/qrcode/assets/image/qrv29.png b/vendor/endroid/qr-code/assets/image/qrv29.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv29.png rename to vendor/endroid/qr-code/assets/image/qrv29.png diff --git a/vendor/endroid/qrcode/assets/image/qrv3.png b/vendor/endroid/qr-code/assets/image/qrv3.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv3.png rename to vendor/endroid/qr-code/assets/image/qrv3.png diff --git a/vendor/endroid/qrcode/assets/image/qrv30.png b/vendor/endroid/qr-code/assets/image/qrv30.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv30.png rename to vendor/endroid/qr-code/assets/image/qrv30.png diff --git a/vendor/endroid/qrcode/assets/image/qrv31.png b/vendor/endroid/qr-code/assets/image/qrv31.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv31.png rename to vendor/endroid/qr-code/assets/image/qrv31.png diff --git a/vendor/endroid/qrcode/assets/image/qrv32.png b/vendor/endroid/qr-code/assets/image/qrv32.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv32.png rename to vendor/endroid/qr-code/assets/image/qrv32.png diff --git a/vendor/endroid/qrcode/assets/image/qrv33.png b/vendor/endroid/qr-code/assets/image/qrv33.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv33.png rename to vendor/endroid/qr-code/assets/image/qrv33.png diff --git a/vendor/endroid/qrcode/assets/image/qrv34.png b/vendor/endroid/qr-code/assets/image/qrv34.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv34.png rename to vendor/endroid/qr-code/assets/image/qrv34.png diff --git a/vendor/endroid/qrcode/assets/image/qrv35.png b/vendor/endroid/qr-code/assets/image/qrv35.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv35.png rename to vendor/endroid/qr-code/assets/image/qrv35.png diff --git a/vendor/endroid/qrcode/assets/image/qrv36.png b/vendor/endroid/qr-code/assets/image/qrv36.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv36.png rename to vendor/endroid/qr-code/assets/image/qrv36.png diff --git a/vendor/endroid/qrcode/assets/image/qrv37.png b/vendor/endroid/qr-code/assets/image/qrv37.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv37.png rename to vendor/endroid/qr-code/assets/image/qrv37.png diff --git a/vendor/endroid/qrcode/assets/image/qrv38.png b/vendor/endroid/qr-code/assets/image/qrv38.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv38.png rename to vendor/endroid/qr-code/assets/image/qrv38.png diff --git a/vendor/endroid/qrcode/assets/image/qrv39.png b/vendor/endroid/qr-code/assets/image/qrv39.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv39.png rename to vendor/endroid/qr-code/assets/image/qrv39.png diff --git a/vendor/endroid/qrcode/assets/image/qrv4.png b/vendor/endroid/qr-code/assets/image/qrv4.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv4.png rename to vendor/endroid/qr-code/assets/image/qrv4.png diff --git a/vendor/endroid/qrcode/assets/image/qrv40.png b/vendor/endroid/qr-code/assets/image/qrv40.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv40.png rename to vendor/endroid/qr-code/assets/image/qrv40.png diff --git a/vendor/endroid/qrcode/assets/image/qrv5.png b/vendor/endroid/qr-code/assets/image/qrv5.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv5.png rename to vendor/endroid/qr-code/assets/image/qrv5.png diff --git a/vendor/endroid/qrcode/assets/image/qrv6.png b/vendor/endroid/qr-code/assets/image/qrv6.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv6.png rename to vendor/endroid/qr-code/assets/image/qrv6.png diff --git a/vendor/endroid/qrcode/assets/image/qrv7.png b/vendor/endroid/qr-code/assets/image/qrv7.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv7.png rename to vendor/endroid/qr-code/assets/image/qrv7.png diff --git a/vendor/endroid/qrcode/assets/image/qrv8.png b/vendor/endroid/qr-code/assets/image/qrv8.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv8.png rename to vendor/endroid/qr-code/assets/image/qrv8.png diff --git a/vendor/endroid/qrcode/assets/image/qrv9.png b/vendor/endroid/qr-code/assets/image/qrv9.png similarity index 100% rename from vendor/endroid/qrcode/assets/image/qrv9.png rename to vendor/endroid/qr-code/assets/image/qrv9.png diff --git a/vendor/endroid/qrcode/composer.json b/vendor/endroid/qr-code/composer.json similarity index 100% rename from vendor/endroid/qrcode/composer.json rename to vendor/endroid/qr-code/composer.json diff --git a/vendor/endroid/qrcode/phpunit.xml.dist b/vendor/endroid/qr-code/phpunit.xml.dist similarity index 100% rename from vendor/endroid/qrcode/phpunit.xml.dist rename to vendor/endroid/qr-code/phpunit.xml.dist diff --git a/vendor/endroid/qrcode/src/Bundle/Controller/QrCodeController.php b/vendor/endroid/qr-code/src/Bundle/Controller/QrCodeController.php similarity index 100% rename from vendor/endroid/qrcode/src/Bundle/Controller/QrCodeController.php rename to vendor/endroid/qr-code/src/Bundle/Controller/QrCodeController.php diff --git a/vendor/endroid/qrcode/src/Bundle/DependencyInjection/Configuration.php b/vendor/endroid/qr-code/src/Bundle/DependencyInjection/Configuration.php similarity index 100% rename from vendor/endroid/qrcode/src/Bundle/DependencyInjection/Configuration.php rename to vendor/endroid/qr-code/src/Bundle/DependencyInjection/Configuration.php diff --git a/vendor/endroid/qrcode/src/Bundle/DependencyInjection/EndroidQrCodeExtension.php b/vendor/endroid/qr-code/src/Bundle/DependencyInjection/EndroidQrCodeExtension.php similarity index 100% rename from vendor/endroid/qrcode/src/Bundle/DependencyInjection/EndroidQrCodeExtension.php rename to vendor/endroid/qr-code/src/Bundle/DependencyInjection/EndroidQrCodeExtension.php diff --git a/vendor/endroid/qrcode/src/Bundle/EndroidQrCodeBundle.php b/vendor/endroid/qr-code/src/Bundle/EndroidQrCodeBundle.php similarity index 100% rename from vendor/endroid/qrcode/src/Bundle/EndroidQrCodeBundle.php rename to vendor/endroid/qr-code/src/Bundle/EndroidQrCodeBundle.php diff --git a/vendor/endroid/qrcode/src/Bundle/Resources/config/services.yml b/vendor/endroid/qr-code/src/Bundle/Resources/config/services.yml similarity index 100% rename from vendor/endroid/qrcode/src/Bundle/Resources/config/services.yml rename to vendor/endroid/qr-code/src/Bundle/Resources/config/services.yml diff --git a/vendor/endroid/qrcode/src/Bundle/Twig/Extension/QrCodeExtension.php b/vendor/endroid/qr-code/src/Bundle/Twig/Extension/QrCodeExtension.php similarity index 100% rename from vendor/endroid/qrcode/src/Bundle/Twig/Extension/QrCodeExtension.php rename to vendor/endroid/qr-code/src/Bundle/Twig/Extension/QrCodeExtension.php diff --git a/vendor/endroid/qrcode/src/Exceptions/DataDoesntExistsException.php b/vendor/endroid/qr-code/src/Exceptions/DataDoesntExistsException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/DataDoesntExistsException.php rename to vendor/endroid/qr-code/src/Exceptions/DataDoesntExistsException.php diff --git a/vendor/endroid/qrcode/src/Exceptions/FreeTypeLibraryMissingException.php b/vendor/endroid/qr-code/src/Exceptions/FreeTypeLibraryMissingException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/FreeTypeLibraryMissingException.php rename to vendor/endroid/qr-code/src/Exceptions/FreeTypeLibraryMissingException.php diff --git a/vendor/endroid/qrcode/src/Exceptions/ImageFunctionFailedException.php b/vendor/endroid/qr-code/src/Exceptions/ImageFunctionFailedException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/ImageFunctionFailedException.php rename to vendor/endroid/qr-code/src/Exceptions/ImageFunctionFailedException.php diff --git a/vendor/endroid/qrcode/src/Exceptions/ImageFunctionUnknownException.php b/vendor/endroid/qr-code/src/Exceptions/ImageFunctionUnknownException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/ImageFunctionUnknownException.php rename to vendor/endroid/qr-code/src/Exceptions/ImageFunctionUnknownException.php diff --git a/vendor/endroid/qrcode/src/Exceptions/ImageSizeTooLargeException.php b/vendor/endroid/qr-code/src/Exceptions/ImageSizeTooLargeException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/ImageSizeTooLargeException.php rename to vendor/endroid/qr-code/src/Exceptions/ImageSizeTooLargeException.php diff --git a/vendor/endroid/qrcode/src/Exceptions/ImageTypeInvalidException.php b/vendor/endroid/qr-code/src/Exceptions/ImageTypeInvalidException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/ImageTypeInvalidException.php rename to vendor/endroid/qr-code/src/Exceptions/ImageTypeInvalidException.php diff --git a/vendor/endroid/qrcode/src/Exceptions/VersionTooLargeException.php b/vendor/endroid/qr-code/src/Exceptions/VersionTooLargeException.php similarity index 100% rename from vendor/endroid/qrcode/src/Exceptions/VersionTooLargeException.php rename to vendor/endroid/qr-code/src/Exceptions/VersionTooLargeException.php diff --git a/vendor/endroid/qrcode/src/Factory/QrCodeFactory.php b/vendor/endroid/qr-code/src/Factory/QrCodeFactory.php similarity index 100% rename from vendor/endroid/qrcode/src/Factory/QrCodeFactory.php rename to vendor/endroid/qr-code/src/Factory/QrCodeFactory.php diff --git a/vendor/endroid/qrcode/src/QrCode.php b/vendor/endroid/qr-code/src/QrCode.php similarity index 100% rename from vendor/endroid/qrcode/src/QrCode.php rename to vendor/endroid/qr-code/src/QrCode.php diff --git a/vendor/endroid/qrcode/tests/Bundle/Controller/QrCodeControllerTest.php b/vendor/endroid/qr-code/tests/Bundle/Controller/QrCodeControllerTest.php similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/Controller/QrCodeControllerTest.php rename to vendor/endroid/qr-code/tests/Bundle/Controller/QrCodeControllerTest.php diff --git a/vendor/endroid/qrcode/tests/Bundle/EndroidQrCodeBundleTest.php b/vendor/endroid/qr-code/tests/Bundle/EndroidQrCodeBundleTest.php similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/EndroidQrCodeBundleTest.php rename to vendor/endroid/qr-code/tests/Bundle/EndroidQrCodeBundleTest.php diff --git a/vendor/endroid/qrcode/tests/Bundle/app/.gitignore b/vendor/endroid/qr-code/tests/Bundle/app/.gitignore similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/app/.gitignore rename to vendor/endroid/qr-code/tests/Bundle/app/.gitignore diff --git a/vendor/endroid/qrcode/tests/Bundle/app/AppKernel.php b/vendor/endroid/qr-code/tests/Bundle/app/AppKernel.php similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/app/AppKernel.php rename to vendor/endroid/qr-code/tests/Bundle/app/AppKernel.php diff --git a/vendor/endroid/qrcode/tests/Bundle/app/bootstrap.php b/vendor/endroid/qr-code/tests/Bundle/app/bootstrap.php similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/app/bootstrap.php rename to vendor/endroid/qr-code/tests/Bundle/app/bootstrap.php diff --git a/vendor/endroid/qrcode/tests/Bundle/app/config/config.yml b/vendor/endroid/qr-code/tests/Bundle/app/config/config.yml similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/app/config/config.yml rename to vendor/endroid/qr-code/tests/Bundle/app/config/config.yml diff --git a/vendor/endroid/qrcode/tests/Bundle/app/config/routing.yml b/vendor/endroid/qr-code/tests/Bundle/app/config/routing.yml similarity index 100% rename from vendor/endroid/qrcode/tests/Bundle/app/config/routing.yml rename to vendor/endroid/qr-code/tests/Bundle/app/config/routing.yml diff --git a/vendor/endroid/qrcode/tests/QrCodeTest.php b/vendor/endroid/qr-code/tests/QrCodeTest.php similarity index 100% rename from vendor/endroid/qrcode/tests/QrCodeTest.php rename to vendor/endroid/qr-code/tests/QrCodeTest.php diff --git a/vendor/qiniu/php-sdk/CHANGELOG.md b/vendor/qiniu/php-sdk/CHANGELOG.md index 8547bd882..8a284bdf6 100644 --- a/vendor/qiniu/php-sdk/CHANGELOG.md +++ b/vendor/qiniu/php-sdk/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 7.2.7 (2018-11-06) +* 娣诲姞 QVM 鍐呯綉涓婁紶鍒 KODO 鐨 zone 璁剧疆 + +## 7.2.6 (2018-05-18) +* 淇rs锛宺sf鍦ㄤ笉鍚屾満鎴块粯璁ょ殑https鍩熷悕 + +## 7.2.5 (2018-05-10) +* 淇琛ㄥ崟涓婁紶涓浣欑殑鍙傛暟checkCrc瀵艰嚧鐨刦name閿欎綅闂 + +## 7.2.4 (2018-05-09) +### 澧炲姞 +* 杩為害鍔熻兘 + ## 7.2.3 (2018-01-20) ### 澧炲姞 * 鏂板姞鍧℃満鎴 diff --git a/vendor/qiniu/php-sdk/README.md b/vendor/qiniu/php-sdk/README.md index 453eef4d1..16c8b49f5 100644 --- a/vendor/qiniu/php-sdk/README.md +++ b/vendor/qiniu/php-sdk/README.md @@ -1,4 +1,4 @@ -# Qiniu Resource Storage SDK for PHP +# Qiniu Cloud SDK for PHP [![doxygen.io](http://doxygen.io/github.com/qiniu/php-sdk/?status.svg)](http://doxygen.io/github.com/qiniu/php-sdk/) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE) [![Build Status](https://travis-ci.org/qiniu/php-sdk.svg)](https://travis-ci.org/qiniu/php-sdk) diff --git a/vendor/qiniu/php-sdk/docs/rtc/README.md b/vendor/qiniu/php-sdk/docs/rtc/README.md new file mode 100644 index 000000000..7b98ca0f9 --- /dev/null +++ b/vendor/qiniu/php-sdk/docs/rtc/README.md @@ -0,0 +1,71 @@ +# Rtc Streaming Cloud Server-Side Library For PHP + +## Features + +- Appclient + - [x] 鍒涘缓鎴块棿: client->createApp() + - [x] 鏌ョ湅鎴块棿: client->getApp() + - [x] 鍒犻櫎鎴块棿: client->deleteApp() + - [x] 鐢熸垚鎴块棿token: client->appToken() + + + +## Contents + +- [Installation](#installation) +- [Usage](#usage) + - [Configuration](#configuration) + - [App](#app) + - [Create a app](#create-a-app) + - [Get a app](#get-a-app) + - [Delete a app](#delete-a-app) + - [Generate a app token](#generate-a-app-token) + + +## Usage + +### App + +#### Create a app + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->createApp("901","testApp"); +print_r($resp); +``` + +#### Get an app + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->getApp("deq02uhb6"); +print_r($resp); +``` + +#### Delete an app + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->deleteApp("deq02uhb6"); +print_r($resp); +``` + +#### Generate an app token + +```php +$ak = "gwd_gV4gPKZZsmEOvAuNU1AcumicmuHooTfu64q5"; +$sk = "xxxx"; +$auth = new Auth($ak, $sk); +$client = new Qiniu\Rtc\AppClient($auth); +$resp=$client->appToken("deq02uhb6", "lfx", '1111', (time()+3600), 'user'); +print_r($resp); +``` \ No newline at end of file diff --git a/vendor/qiniu/php-sdk/docs/rtc/example.php b/vendor/qiniu/php-sdk/docs/rtc/example.php new file mode 100644 index 000000000..f30b9b415 --- /dev/null +++ b/vendor/qiniu/php-sdk/docs/rtc/example.php @@ -0,0 +1,42 @@ +createApp($hub, $title, $maxUsers); + print_r($resp); + // 鑾峰彇app鐘舵 + $resp = $client->getApp('dgdl5ge8y'); + print_r($resp); + //淇敼app鐘舵 + $mergePublishRtmp = null; + $mergePublishRtmp['enable'] = true; + $resp = $client->updateApp('dgdl5ge8y', $hub, $title, $maxUsers, $mergePublishRtmp); + print_r($resp); + //鍒犻櫎app + $resp = $client->deleteApp('dgdl5ge8y'); + print_r($resp); + //鑾峰彇鎴块棿杩為害鐨勬垚鍛 + $resp=$client->listUser("dgbfvvzid", 'lfxl'); + print_r($resp); + //鍓旈櫎鎴块棿鐨勮繛楹︽垚鍛 + $resp=$client->kickUser("dgbfvvzid", 'lfx', "qiniu-f6e07b78-4dc8-45fb-a701-a9e158abb8e6"); + print_r($resp); + // 鍒椾妇鎴块棿 + $resp=$client->listActiveRooms("dgbfvvzid", 'lfx', null, null); + print_r($resp); + //閴存潈鐨勬湁鏁堟椂闂: 1涓皬鏃. + $resp = $client->appToken("dgd4vecde", "lfxl", '1111', (time()+3600), 'user'); + print_r($resp); +} catch (\Exception $e) { + echo "Error:", $e, "\n"; +} diff --git a/vendor/qiniu/php-sdk/examples/persistent_fop_status.php b/vendor/qiniu/php-sdk/examples/persistent_fop_status.php index b1f408349..0c26f7a88 100644 --- a/vendor/qiniu/php-sdk/examples/persistent_fop_status.php +++ b/vendor/qiniu/php-sdk/examples/persistent_fop_status.php @@ -3,10 +3,16 @@ require_once __DIR__ . '/../autoload.php'; use Qiniu\Processing\PersistentFop; +$pfop = new Qiniu\Processing\PersistentFop(null, null); + // 瑙﹀彂鎸佷箙鍖栧鐞嗗悗杩斿洖鐨 Id -$persistentId = 'z0.564d5f977823de48a85ece59'; +$persistentId = 'z1.5b8a48e5856db843bc24cfc3'; // 閫氳繃persistentId鏌ヨ璇 瑙﹀彂鎸佷箙鍖栧鐞嗙殑鐘舵 -$status = PersistentFop::status($persistentId); +list($ret, $err) = $pfop->status($persistentId); -var_dump($status); +if ($err) { + print_r($err); +} else { + print_r($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/pulpvideo.php b/vendor/qiniu/php-sdk/examples/pulpvideo.php new file mode 100644 index 000000000..bad8821c5 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/pulpvideo.php @@ -0,0 +1,55 @@ + 'pulp', + 'params' => array( + 'labels' => array( + array( + 'label' => "1", + 'select' => 1, + 'score' => 2, + ), + ) + ) + ), +); + +$params = array(); +$params = array( + 'async' => false, + 'vframe' => array( + 'mode' => 1, + 'interval' => 8, + ) +); + +$req = array(); +$req['data'] = $reqBody; +$req['ops'] = $ops; +$req['params'] = $params; +$body = json_encode($req); + +$vid = "xxxx"; +list($ret, $err) = $argusManager->pulpVideo($body, $vid); + +if ($err !== null) { + var_dump($err); +} else { + var_dump($ret); +} diff --git a/vendor/qiniu/php-sdk/examples/rs_change_status.php b/vendor/qiniu/php-sdk/examples/rs_change_status.php new file mode 100644 index 000000000..cbcea5c28 --- /dev/null +++ b/vendor/qiniu/php-sdk/examples/rs_change_status.php @@ -0,0 +1,20 @@ +changeStatus($bucket, $key, $status); +if ($err) { + print_r($err); +} diff --git a/vendor/qiniu/php-sdk/examples/upload_and_callback.php b/vendor/qiniu/php-sdk/examples/upload_and_callback.php index 8782e87d1..4762bd330 100644 --- a/vendor/qiniu/php-sdk/examples/upload_and_callback.php +++ b/vendor/qiniu/php-sdk/examples/upload_and_callback.php @@ -4,6 +4,13 @@ require_once __DIR__ . '/../autoload.php'; use Qiniu\Auth; use Qiniu\Storage\UploadManager; +// use Qiniu\Config; +// use Qiniu\Zone; + +// 鎸囧畾zone涓婁紶 +// $zone = Zone::zoneZ0(); //鍗庝笢QVM鍐呯綉涓婁紶鎸囧畾host +// $config = new Config($zone); + $accessKey = getenv('QINIU_ACCESS_KEY'); $secretKey = getenv('QINIU_SECRET_KEY'); $bucket = getenv('QINIU_TEST_BUCKET'); @@ -20,6 +27,8 @@ $uptoken = $auth->uploadToken($bucket, null, 3600, $policy); //涓婁紶鏂囦欢鐨勬湰鍦拌矾寰 $filePath = './php-logo.png'; +//鎸囧畾 config +// $uploadMgr = new UploadManager($config); $uploadMgr = new UploadManager(); list($ret, $err) = $uploadMgr->putFile($uptoken, null, $filePath); diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php index a460ec2df..0e6abac08 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/Cdn/CdnManager.php @@ -175,6 +175,7 @@ final class CdnManager $deadline = time() + $durationInSeconds; $expireHex = dechex($deadline); $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; + $path = implode('/', array_map('rawurlencode', explode('/', $path))); $strToSign = $encryptKey . $path . $expireHex; $signStr = md5($strToSign); diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Config.php b/vendor/qiniu/php-sdk/src/Qiniu/Config.php index 296caa9cd..b1f63674b 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/Config.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/Config.php @@ -3,7 +3,7 @@ namespace Qiniu; final class Config { - const SDK_VER = '7.2.3'; + const SDK_VER = '7.2.7'; const BLOCK_SIZE = 4194304; //4*1024*1024 鍒嗗潡涓婁紶鍧楀ぇ灏忥紝璇ュ弬鏁颁负鎺ュ彛瑙勬牸锛屼笉鑳戒慨鏀 @@ -11,6 +11,9 @@ final class Config const API_HOST = 'api.qiniu.com'; const RS_HOST = 'rs.qiniu.com'; //RS Host const UC_HOST = 'https://api.qiniu.com'; //UC Host + const RTCAPI_HOST = 'http://rtc.qiniuapi.com'; + const ARGUS_HOST = 'argus.atlab.ai'; + const RTCAPI_VERSION = 'v3'; // Zone 绌洪棿瀵瑰簲鐨勬満鎴 public $zone; diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php b/vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php index 21beb05f8..425c314cf 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/Http/Client.php @@ -13,6 +13,12 @@ final class Client return self::sendRequest($request); } + public static function delete($url, array $headers = array()) + { + $request = new Request('DELETE', $url, $headers); + return self::sendRequest($request); + } + public static function post($url, $body, array $headers = array()) { $request = new Request('POST', $url, $headers, $body); @@ -129,7 +135,7 @@ final class Client $headerLine = trim($line); $kv = explode(':', $headerLine); if (count($kv) > 1) { - $kv[0] = ucwords($kv[0], '-'); + $kv[0] =self::ucwordsHyphen($kv[0]); $headers[$kv[0]] = trim($kv[1]); } } @@ -142,4 +148,9 @@ final class Client $replace = array("\\\\", "\\\""); return str_replace($find, $replace, $str); } + + private static function ucwordsHyphen($str) + { + return str_replace('- ', '-', ucwords(str_replace('-', '- ', $str))); + } } diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php new file mode 100644 index 000000000..c07ee72f3 --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Rtc/AppClient.php @@ -0,0 +1,204 @@ +auth = $auth; + + $this->baseURL = sprintf("%s/%s/apps", Config::RTCAPI_HOST, Config::RTCAPI_VERSION); + } + + /* + * hub: 鐩存挱绌洪棿鍚 + * title: app 鐨勫悕绉 娉ㄦ剰锛孴itle 涓嶆槸鍞竴鏍囪瘑锛岄噸澶 create 鍔ㄤ綔灏嗙敓鎴愬涓 app + * maxUsers锛氫汉鏁伴檺鍒 + * NoAutoKickUser: bool 绫诲瀷锛屽彲閫夛紝绂佹鑷姩韪汉锛堟姠娴侊級銆傞粯璁や负 false 锛 + 鍗冲悓涓涓韩浠界殑 client (app/room/user) 锛屾柊鐨勮繛楹﹁姹傚彲浠ユ垚鍔燂紝鏃ц繛鎺ヨ鍏抽棴銆 + */ + public function createApp($hub, $title, $maxUsers = null, $noAutoKickUser = null) + { + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if (!empty($noAutoKickUser)) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + $body = json_encode($params); + $ret = $this->post($this->baseURL, $body); + return $ret; + } + + /* + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚銆 + * Title: app 鐨勫悕绉帮紝 鍙夈 + * Hub: 缁戝畾鐨勭洿鎾 hub锛屽彲閫夛紝鐢ㄤ簬鍚堟祦鍚 rtmp 鎺ㄦ祦銆 + * MaxUsers: int 绫诲瀷锛屽彲閫夛紝杩為害鎴块棿鏀寔鐨勬渶澶у湪绾夸汉鏁般 + * NoAutoKickUser: bool 绫诲瀷锛屽彲閫夛紝绂佹鑷姩韪汉銆 + * MergePublishRtmp: 杩為害鍚堟祦杞帹 RTMP 鐨勯厤缃紝鍙夋嫨銆傚叾璇︾粏閰嶇疆鍖呮嫭濡備笅 + Enable: 甯冨皵绫诲瀷锛岀敤浜庡紑鍚拰鍏抽棴鎵鏈夋埧闂寸殑鍚堟祦鍔熻兘銆 + AudioOnly: 甯冨皵绫诲瀷锛屽彲閫夛紝鎸囧畾鏄惁鍙悎鎴愰煶棰戙 + Height, Width: int64锛屽彲閫夛紝鎸囧畾鍚堟祦杈撳嚭鐨勯珮鍜屽锛岄粯璁や负 640 x 480銆 + OutputFps: int64锛屽彲閫夛紝鎸囧畾鍚堟祦杈撳嚭鐨勫抚鐜囷紝榛樿涓 25 fps 銆 + OutputKbps: int64锛屽彲閫夛紝鎸囧畾鍚堟祦杈撳嚭鐨勭爜鐜囷紝榛樿涓 1000 銆 + URL: 鍚堟祦鍚庤浆鎺ㄦ梺璺洿鎾殑鍦板潃锛屽彲閫夛紝鏀寔榄旀硶鍙橀噺閰嶇疆鎸夌収杩為害鎴块棿鍙风敓鎴愪笉鍚岀殑鎺ㄦ祦鍦板潃銆傚鏋滄槸杞帹鍒颁竷鐗涚洿鎾簯锛屼笉寤鸿浣跨敤璇ラ厤缃 + StreamTitle: 杞帹涓冪墰鐩存挱浜戠殑娴佸悕锛屽彲閫夛紝鏀寔榄旀硶鍙橀噺閰嶇疆鎸夌収杩為害鎴块棿鍙风敓鎴愪笉鍚岀殑娴佸悕銆備緥濡傦紝閰嶇疆 Hub 涓 qn-zhibo 锛岄厤缃 StreamTitle 涓 $(roomName) 锛屽垯鎴块棿 meeting-001 鐨勫悎娴佸皢浼氳杞帹鍒 rtmp://pili-publish.qn-zhibo.***.com/qn-zhibo/meeting-001鍦板潃銆傝缁嗛厤缃粏鍒欙紝璇峰挩璇竷鐗涙妧鏈敮鎸併 + */ + public function updateApp($appId, $hub, $title, $maxUsers = null, $mergePublishRtmp = null, $noAutoKickUser = null) + { + $url = $this->baseURL . '/' . $appId; + $params['hub'] = $hub; + $params['title'] = $title; + if (!empty($maxUsers)) { + $params['maxUsers'] = $maxUsers; + } + if (!empty($noAutoKickUser)) { + $params['noAutoKickUser'] = $noAutoKickUser; + } + if (!empty($mergePublishRtmp)) { + $params['mergePublishRtmp'] = $mergePublishRtmp; + } + $body = json_encode($params); + $ret = $this->post($url, $body); + return $ret; + } + + /* + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚銆 + */ + public function getApp($appId) + { + $url = $this->baseURL . '/' . $appId; + $ret = $this->get($url); + return $ret; + } + + /* + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚 + */ + public function deleteApp($appId) + { + $url = $this->baseURL . '/' . $appId; + list(, $err) = $this->delete($url); + return $err; + } + + /* + * 鑾峰彇鎴块棿鐨勪汉鏁 + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚銆 + * roomName: 鎿嶄綔鎵鏌ヨ鐨勮繛楹︽埧闂淬 + */ + public function listUser($appId, $roomName) + { + $url = sprintf("%s/%s/rooms/%s/users", $this->baseURL, $appId, $roomName); + $ret = $this->get($url); + return $ret; + } + + /* + * 韪㈠嚭鐜╁ + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚銆 + * roomName: 杩為害鎴块棿 + * userId: 璇锋眰鍔犲叆鎴块棿鐨勭敤鎴稩D + */ + public function kickUser($appId, $roomName, $userId) + { + $url = sprintf("%s/%s/rooms/%s/users/%s", $this->baseURL, $appId, $roomName, $userId); + list(, $err) = $this->delete($url); + return $err; + } + + /* + * 鑾峰彇鎴块棿鐨勪汉鏁 + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚銆 + * prefix: 鎵鏌ヨ鎴块棿鍚嶇殑鍓嶇紑绱㈠紩锛屽彲浠ヤ负绌恒 + * offset: int 绫诲瀷锛屽垎椤垫煡璇㈢殑浣嶇Щ鏍囪銆 + * limit: int 绫诲瀷锛屾娆℃煡璇㈢殑鏈澶ч暱搴︺ + * GET /v3/apps//rooms?prefix=&offset=&limit= + */ + public function listActiveRooms($appId, $prefix = null, $offset = null, $limit = null) + { + if (isset($prefix)) { + $query['prefix'] = $prefix; + } + if (isset($offset)) { + $query['offset'] = $offset; + } + if (isset($limit)) { + $query['limit'] = $limit; + } + if (isset($query) && !empty($query)) { + $query = '?' . http_build_query($query); + $url = sprintf("%s/%s/rooms%s", $this->baseURL, $appId, $query); + } else { + $url = sprintf("%s/%s/rooms", $this->baseURL, $appId); + } + $ret = $this->get($url); + return $ret; + } + + /* + * appId: app 鐨勫敮涓鏍囪瘑锛屽垱寤虹殑鏃跺欑敱绯荤粺鐢熸垚銆 + * roomName: 鎴块棿鍚嶇О锛岄渶婊¤冻瑙勬牸 ^[a-zA-Z0-9_-]{3,64}$ + * userId: 璇锋眰鍔犲叆鎴块棿鐨勭敤鎴 ID锛岄渶婊¤冻瑙勬牸 ^[a-zA-Z0-9_-]{3,50}$ + * expireAt: int64 绫诲瀷锛岄壌鏉冪殑鏈夋晥鏃堕棿锛屼紶鍏ヤ互绉掍负鍗曚綅鐨64浣峌nix + 缁濆鏃堕棿锛宼oken 灏嗗湪璇ユ椂闂村悗澶辨晥銆 + * permission: 璇ョ敤鎴风殑鎴块棿绠$悊鏉冮檺锛"admin" 鎴 "user"锛岄粯璁や负 "user" 銆 + 褰撴潈闄愯鑹蹭负 "admin" 鏃讹紝鎷ユ湁灏嗗叾浠栫敤鎴风Щ闄ゅ嚭鎴块棿绛夌壒鏉. + */ + public function appToken($appId, $roomName, $userId, $expireAt, $permission) + { + $params['appId'] = $appId; + $params['userId'] = $userId; + $params['roomName'] = $roomName; + $params['permission'] = $permission; + $params['expireAt'] = $expireAt; + $appAccessString = json_encode($params); + return $this->auth->signWithData($appAccessString); + } + + private function get($url, $cType = null) + { + $rtcToken = $this->auth->authorizationV2($url, "GET", null, $cType); + $rtcToken['Content-Type'] = $cType; + $ret = Client::get($url, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function delete($url, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "DELETE", null, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::delete($url, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + return array($ret->json(), null); + } + + private function post($url, $body, $contentType = 'application/json') + { + $rtcToken = $this->auth->authorizationV2($url, "POST", $body, $contentType); + $rtcToken['Content-Type'] = $contentType; + $ret = Client::post($url, $body, $rtcToken); + if (!$ret->ok()) { + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php new file mode 100644 index 000000000..08893708c --- /dev/null +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/ArgusManager.php @@ -0,0 +1,73 @@ +auth = $auth; + if ($config == null) { + $this->config = new Config(); + } else { + $this->config = $config; + } + } + + /** + * 瑙嗛閴撮粍 + * + * @param $body body淇℃伅 + * @param $vid videoID + * + * @return mixed 鎴愬姛杩斿洖NULL锛屽け璐ヨ繑鍥炲璞iniu\Http\Error + * @link https://developer.qiniu.com/dora/manual/4258/video-pulp + */ + public function pulpVideo($body, $vid) + { + $path = '/v1/video/' . $vid; + + return $this->arPost($path, $body); + } + + private function getArHost() + { + $scheme = "http://"; + if ($this->config->useHTTPS == true) { + $scheme = "https://"; + } + return $scheme . Config::ARGUS_HOST; + } + + private function arPost($path, $body = null) + { + $url = $this->getArHost() . $path; + return $this->post($url, $body); + } + + private function post($url, $body) + { + $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json'); + $headers['Content-Type']='application/json'; + $ret = Client::post($url, $body, $headers); + if (!$ret->ok()) { + print($ret->statusCode); + return array(null, new Error($url, $ret)); + } + $r = ($ret->body === null) ? array() : $ret->json(); + return array($r, null); + } +} diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php index d5269f381..2e82a1477 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/BucketManager.php @@ -225,6 +225,23 @@ final class BucketManager return $error; } + /** + * 淇敼鏂囦欢鐨勫瓨鍌ㄧ姸鎬侊紝鍗崇鐢ㄧ姸鎬佸拰鍚敤鐘舵侀棿鐨勭殑浜掔浉杞崲 + * + * @param $bucket 寰呮搷浣滆祫婧愭墍鍦ㄧ┖闂 + * @param $key 寰呮搷浣滆祫婧愭枃浠跺悕 + * @param $status 寰呮搷浣滄枃浠剁洰鏍囨枃浠剁被鍨 + * + * @return mixed 鎴愬姛杩斿洖NULL锛屽け璐ヨ繑鍥炲璞iniu\Http\Error + * @link https://developer.qiniu.com/kodo/api/4173/modify-the-file-status + */ + public function changeStatus($bucket, $key, $status) + { + $resource = \Qiniu\entry($bucket, $key); + $path = '/chstatus/' . $resource . '/status/' . $status; + list(, $error) = $this->rsPost($path); + return $error; + } /** * 浠庢寚瀹歎RL鎶撳彇璧勬簮锛屽苟灏嗚璧勬簮瀛樺偍鍒版寚瀹氱┖闂翠腑 diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php b/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php index ce58b2fe9..209df11ad 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/Storage/UploadManager.php @@ -108,7 +108,6 @@ final class UploadManager $this->config, $params, $mime, - $checkCrc, basename($filePath) ); } @@ -134,8 +133,9 @@ final class UploadManager } $ret = array(); foreach ($params as $k => $v) { - $pos = strpos($k, 'x:'); - if ($pos === 0 && !empty($v)) { + $pos1 = strpos($k, 'x:'); + $pos2 = strpos($k, 'x-qn-meta-'); + if (($pos1 === 0 || $pos2 === 0) && !empty($v)) { $ret[$k] = $v; } } diff --git a/vendor/qiniu/php-sdk/src/Qiniu/Zone.php b/vendor/qiniu/php-sdk/src/Qiniu/Zone.php index 1a66d39bf..9b142dcc7 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/Zone.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/Zone.php @@ -44,22 +44,48 @@ final class Zone $Zone_z0 = new Zone( array("up.qiniup.com", 'up-jjh.qiniup.com', 'up-xs.qiniup.com'), array('upload.qiniup.com', 'upload-jjh.qiniup.com', 'upload-xs.qiniup.com'), - 'rs.qiniu.com', - 'rsf.qiniu.com', + 'rs.qbox.me', + 'rsf.qbox.me', 'api.qiniu.com', 'iovip.qbox.me' ); return $Zone_z0; } + //鍗庝笢鏈烘埧鍐呯綉涓婁紶 + public static function zoneZ0() + { + $Zone_z01 = new Zone( + array("free-qvm-z0-xs.qiniup.com"), + 'rs.qbox.me', + 'rsf.qbox.me', + 'api.qiniu.com', + 'iovip.qbox.me' + ); + return $Zone_z01; + } + + //鍗庡寳鏈烘埧鍐呯綉涓婁紶 + public static function zoneZ1() + { + $Zone_z12 = new Zone( + array("free-qvm-z1-zz.qiniup.com"), + "rs-z1.qbox.me", + "rsf-z1.qbox.me", + "api-z1.qiniu.com", + "iovip-z1.qbox.me" + ); + return $Zone_z12; + } + //鍗庡寳鏈烘埧 public static function zone1() { $Zone_z1 = new Zone( array('up-z1.qiniup.com'), array('upload-z1.qiniup.com'), - "rs-z1.qiniu.com", - "rsf-z1.qiniu.com", + "rs-z1.qbox.me", + "rsf-z1.qbox.me", "api-z1.qiniu.com", "iovip-z1.qbox.me" ); @@ -73,8 +99,8 @@ final class Zone $Zone_z2 = new Zone( array('up-z2.qiniup.com', 'up-dg.qiniup.com', 'up-fs.qiniup.com'), array('upload-z2.qiniup.com', 'upload-dg.qiniup.com', 'upload-fs.qiniup.com'), - "rs-z2.qiniu.com", - "rsf-z2.qiniu.com", + "rs-z2.qbox.me", + "rsf-z2.qbox.me", "api-z2.qiniu.com", "iovip-z2.qbox.me" ); @@ -88,8 +114,8 @@ final class Zone $Zone_na0 = new Zone( array('up-na0.qiniup.com'), array('upload-na0.qiniup.com'), - "rs-na0.qiniu.com", - "rsf-na0.qiniu.com", + "rs-na0.qbox.me", + "rsf-na0.qbox.me", "api-na0.qiniu.com", "iovip-na0.qbox.me" ); @@ -103,8 +129,8 @@ final class Zone $Zone_as0 = new Zone( array('up-as0.qiniup.com'), array('upload-as0.qiniup.com'), - "rs-as0.qiniu.com", - "rsf-as0.qiniu.com", + "rs-as0.qbox.me", + "rsf-as0.qbox.me", "api-as0.qiniu.com", "iovip-as0.qbox.me" ); @@ -145,24 +171,24 @@ final class Zone //set specific hosts if (strstr($zone->iovipHost, "z1") !== false) { - $zone->rsHost = "rs-z1.qiniu.com"; - $zone->rsfHost = "rsf-z1.qiniu.com"; + $zone->rsHost = "rs-z1.qbox.me"; + $zone->rsfHost = "rsf-z1.qbox.me"; $zone->apiHost = "api-z1.qiniu.com"; } elseif (strstr($zone->iovipHost, "z2") !== false) { - $zone->rsHost = "rs-z2.qiniu.com"; - $zone->rsfHost = "rsf-z2.qiniu.com"; + $zone->rsHost = "rs-z2.qbox.me"; + $zone->rsfHost = "rsf-z2.qbox.me"; $zone->apiHost = "api-z2.qiniu.com"; } elseif (strstr($zone->iovipHost, "na0") !== false) { - $zone->rsHost = "rs-na0.qiniu.com"; - $zone->rsfHost = "rsf-na0.qiniu.com"; + $zone->rsHost = "rs-na0.qbox.me"; + $zone->rsfHost = "rsf-na0.qbox.me"; $zone->apiHost = "api-na0.qiniu.com"; } elseif (strstr($zone->iovipHost, "as0") !== false) { - $zone->rsHost = "rs-as0.qiniu.com"; - $zone->rsfHost = "rsf-as0.qiniu.com"; + $zone->rsHost = "rs-as0.qbox.me"; + $zone->rsfHost = "rsf-as0.qbox.me"; $zone->apiHost = "api-as0.qiniu.com"; } else { - $zone->rsHost = "rs.qiniu.com"; - $zone->rsfHost = "rsf.qiniu.com"; + $zone->rsHost = "rs.qbox.me"; + $zone->rsfHost = "rsf.qbox.me"; $zone->apiHost = "api.qiniu.com"; } diff --git a/vendor/qiniu/php-sdk/src/Qiniu/functions.php b/vendor/qiniu/php-sdk/src/Qiniu/functions.php index 2ccdf3234..5831a51b7 100644 --- a/vendor/qiniu/php-sdk/src/Qiniu/functions.php +++ b/vendor/qiniu/php-sdk/src/Qiniu/functions.php @@ -255,7 +255,7 @@ if (!defined('QINIU_FUNCTIONS_VERSION')) { return array(null, null, "invalid uptoken"); } $accessKey = $items[0]; - $putPolicy = json_decode(base64_decode($items[2])); + $putPolicy = json_decode(base64_urlSafeDecode($items[2])); $scope = $putPolicy->scope; $scopeItems = explode(':', $scope); $bucket = $scopeItems[0]; diff --git a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php index 41e6ea8ab..00008d457 100644 --- a/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php +++ b/vendor/qiniu/php-sdk/tests/Qiniu/Tests/ResumeUpTest.php @@ -35,7 +35,7 @@ class ResumeUpTest extends \PHPUnit_Framework_TestCase public function test4ML2() { $key = 'resumePutFile4ML'; - $zone = new Zone(array('up.fake.qiniu.com'), array('up.qiniup.com')); + $zone = new Zone(array('up.qiniup.com')); $cfg = new Config($zone); $upManager = new UploadManager($cfg); $token = $this->auth->uploadToken($this->bucketName, $key); diff --git a/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php b/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php index 60317243e..146c18bf2 100644 --- a/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php +++ b/vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php @@ -49,7 +49,7 @@ class OptionsResolverIntrospector */ public function getDefault($option) { - return call_user_func($this->get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); + return \call_user_func($this->get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); } /** @@ -61,7 +61,7 @@ class OptionsResolverIntrospector */ public function getLazyClosures($option) { - return call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); + return \call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); } /** @@ -73,7 +73,7 @@ class OptionsResolverIntrospector */ public function getAllowedTypes($option) { - return call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); + return \call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); } /** @@ -85,7 +85,7 @@ class OptionsResolverIntrospector */ public function getAllowedValues($option) { - return call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); + return \call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); } /** @@ -97,6 +97,6 @@ class OptionsResolverIntrospector */ public function getNormalizer($option) { - return call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); + return \call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); } } diff --git a/vendor/symfony/options-resolver/LICENSE b/vendor/symfony/options-resolver/LICENSE index 21d7fb9e2..a677f4376 100644 --- a/vendor/symfony/options-resolver/LICENSE +++ b/vendor/symfony/options-resolver/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/options-resolver/OptionsResolver.php b/vendor/symfony/options-resolver/OptionsResolver.php index 95a492de9..82efa15e3 100644 --- a/vendor/symfony/options-resolver/OptionsResolver.php +++ b/vendor/symfony/options-resolver/OptionsResolver.php @@ -29,51 +29,51 @@ class OptionsResolver implements Options /** * The names of all defined options. */ - private $defined = array(); + private $defined = []; /** * The default option values. */ - private $defaults = array(); + private $defaults = []; /** * The names of required options. */ - private $required = array(); + private $required = []; /** * The resolved option values. */ - private $resolved = array(); + private $resolved = []; /** * A list of normalizer closures. * * @var \Closure[] */ - private $normalizers = array(); + private $normalizers = []; /** * A list of accepted values for each option. */ - private $allowedValues = array(); + private $allowedValues = []; /** * A list of accepted types for each option. */ - private $allowedTypes = array(); + private $allowedTypes = []; /** * A list of closures for evaluating lazy options. */ - private $lazy = array(); + private $lazy = []; /** * A list of lazy options whose closure is currently being called. * * This list helps detecting circular dependencies between lazy options. */ - private $calling = array(); + private $calling = []; /** * Whether the instance is locked for reading. @@ -85,11 +85,11 @@ class OptionsResolver implements Options */ private $locked = false; - private static $typeAliases = array( + private static $typeAliases = [ 'boolean' => 'bool', 'integer' => 'int', 'double' => 'float', - ); + ]; /** * Sets the default value of a given option. @@ -154,7 +154,7 @@ class OptionsResolver implements Options // Ignore previous lazy options if the closure has no second parameter if (!isset($this->lazy[$option]) || !isset($params[1])) { - $this->lazy[$option] = array(); + $this->lazy[$option] = []; } // Store closure for later evaluation @@ -353,11 +353,9 @@ class OptionsResolver implements Options * * The normalizer should be a closure with the following signature: * - * ```php - * function (Options $options, $value) { - * // ... - * } - * ``` + * function (Options $options, $value) { + * // ... + * } * * The closure is invoked when {@link resolve()} is called. The closure * has access to the resolved values of other options through the passed @@ -383,11 +381,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf( - 'The option "%s" does not exist. Defined options are: "%s".', - $option, - implode('", "', array_keys($this->defined)) - )); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); } $this->normalizers[$option] = $normalizer; @@ -426,14 +420,10 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf( - 'The option "%s" does not exist. Defined options are: "%s".', - $option, - implode('", "', array_keys($this->defined)) - )); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); } - $this->allowedValues[$option] = is_array($allowedValues) ? $allowedValues : array($allowedValues); + $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues]; // Make sure the option is processed unset($this->resolved[$option]); @@ -471,15 +461,11 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf( - 'The option "%s" does not exist. Defined options are: "%s".', - $option, - implode('", "', array_keys($this->defined)) - )); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); } - if (!is_array($allowedValues)) { - $allowedValues = array($allowedValues); + if (!\is_array($allowedValues)) { + $allowedValues = [$allowedValues]; } if (!isset($this->allowedValues[$option])) { @@ -516,11 +502,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf( - 'The option "%s" does not exist. Defined options are: "%s".', - $option, - implode('", "', array_keys($this->defined)) - )); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); } $this->allowedTypes[$option] = (array) $allowedTypes; @@ -555,11 +537,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf( - 'The option "%s" does not exist. Defined options are: "%s".', - $option, - implode('", "', array_keys($this->defined)) - )); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); } if (!isset($this->allowedTypes[$option])) { @@ -612,14 +590,14 @@ class OptionsResolver implements Options throw new AccessException('Options cannot be cleared from a lazy option or normalizer.'); } - $this->defined = array(); - $this->defaults = array(); - $this->required = array(); - $this->resolved = array(); - $this->lazy = array(); - $this->normalizers = array(); - $this->allowedTypes = array(); - $this->allowedValues = array(); + $this->defined = []; + $this->defaults = []; + $this->required = []; + $this->resolved = []; + $this->lazy = []; + $this->normalizers = []; + $this->allowedTypes = []; + $this->allowedValues = []; return $this; } @@ -648,7 +626,7 @@ class OptionsResolver implements Options * @throws NoSuchOptionException If a lazy option reads an unavailable option * @throws AccessException If called from a lazy option or normalizer */ - public function resolve(array $options = array()) + public function resolve(array $options = []) { if ($this->locked) { throw new AccessException('Options cannot be resolved from a lazy option or normalizer.'); @@ -660,15 +638,11 @@ class OptionsResolver implements Options // Make sure that no unknown options are passed $diff = array_diff_key($options, $clone->defined); - if (count($diff) > 0) { + if (\count($diff) > 0) { ksort($clone->defined); ksort($diff); - throw new UndefinedOptionsException(sprintf( - (count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', - implode('", "', array_keys($diff)), - implode('", "', array_keys($clone->defined)) - )); + throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', implode('", "', array_keys($diff)), implode('", "', array_keys($clone->defined)))); } // Override options set by the user @@ -680,13 +654,10 @@ class OptionsResolver implements Options // Check whether any required option is missing $diff = array_diff_key($clone->required, $clone->defaults); - if (count($diff) > 0) { + if (\count($diff) > 0) { ksort($diff); - throw new MissingOptionsException(sprintf( - count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', - implode('", "', array_keys($diff)) - )); + throw new MissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', implode('", "', array_keys($diff)))); } // Lock the container @@ -730,17 +701,10 @@ class OptionsResolver implements Options // Check whether the option is set at all if (!array_key_exists($option, $this->defaults)) { if (!isset($this->defined[$option])) { - throw new NoSuchOptionException(sprintf( - 'The option "%s" does not exist. Defined options are: "%s".', - $option, - implode('", "', array_keys($this->defined)) - )); + throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); } - throw new NoSuchOptionException(sprintf( - 'The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', - $option - )); + throw new NoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $option)); } $value = $this->defaults[$option]; @@ -750,10 +714,7 @@ class OptionsResolver implements Options // If the closure is already being called, we have a cyclic // dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf( - 'The options "%s" have a cyclic dependency.', - implode('", "', array_keys($this->calling)) - )); + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling)))); } // The following section must be protected from cyclic @@ -774,7 +735,7 @@ class OptionsResolver implements Options // Validate the type of the resolved option if (isset($this->allowedTypes[$option])) { $valid = false; - $invalidTypes = array(); + $invalidTypes = []; foreach ($this->allowedTypes[$option] as $type) { $type = isset(self::$typeAliases[$type]) ? self::$typeAliases[$type] : $type; @@ -785,21 +746,20 @@ class OptionsResolver implements Options } if (!$valid) { - throw new InvalidOptionsException(sprintf( - 'The option "%s" with value %s is expected to be of type '. - '"%s", but is of type "%s".', - $option, - $this->formatValue($value), - implode('" or "', $this->allowedTypes[$option]), - implode('|', array_keys($invalidTypes)) - )); + $keys = array_keys($invalidTypes); + + if (1 === \count($keys) && '[]' === substr($keys[0], -2)) { + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), $keys[0])); + } + + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $option, $this->formatValue($value), implode('" or "', $this->allowedTypes[$option]), implode('|', array_keys($invalidTypes)))); } } // Validate the value of the resolved option if (isset($this->allowedValues[$option])) { $success = false; - $printableAllowedValues = array(); + $printableAllowedValues = []; foreach ($this->allowedValues[$option] as $allowedValue) { if ($allowedValue instanceof \Closure) { @@ -810,7 +770,9 @@ class OptionsResolver implements Options // Don't include closures in the exception message continue; - } elseif ($value === $allowedValue) { + } + + if ($value === $allowedValue) { $success = true; break; } @@ -825,7 +787,7 @@ class OptionsResolver implements Options $this->formatValue($value) ); - if (count($printableAllowedValues) > 0) { + if (\count($printableAllowedValues) > 0) { $message .= sprintf( ' Accepted values are: %s.', $this->formatValues($printableAllowedValues) @@ -841,10 +803,7 @@ class OptionsResolver implements Options // If the closure is already being called, we have a cyclic // dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf( - 'The options "%s" have a cyclic dependency.', - implode('", "', array_keys($this->calling)) - )); + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling)))); } $normalizer = $this->normalizers[$option]; @@ -877,23 +836,8 @@ class OptionsResolver implements Options */ private function verifyTypes($type, $value, array &$invalidTypes) { - if ('[]' === substr($type, -2) && is_array($value)) { - $originalType = $type; - $type = substr($type, 0, -2); - $invalidValues = array_filter( // Filter out valid values, keeping invalid values in the resulting array - $value, - function ($value) use ($type) { - return !self::isValueValidType($type, $value); - } - ); - - if (!$invalidValues) { - return true; - } - - $invalidTypes[$this->formatTypeOf($value, $originalType)] = true; - - return false; + if (\is_array($value) && '[]' === substr($type, -2)) { + return $this->verifyArrayType($type, $value, $invalidTypes); } if (self::isValueValidType($type, $value)) { @@ -907,6 +851,46 @@ class OptionsResolver implements Options return false; } + /** + * @return bool + */ + private function verifyArrayType($type, array $value, array &$invalidTypes, $level = 0) + { + $type = substr($type, 0, -2); + + $suffix = '[]'; + while (\strlen($suffix) <= $level * 2) { + $suffix .= '[]'; + } + + if ('[]' === substr($type, -2)) { + $success = true; + foreach ($value as $item) { + if (!\is_array($item)) { + $invalidTypes[$this->formatTypeOf($item, null).$suffix] = true; + + return false; + } + + if (!$this->verifyArrayType($type, $item, $invalidTypes, $level + 1)) { + $success = false; + } + } + + return $success; + } + + foreach ($value as $item) { + if (!self::isValueValidType($type, $item)) { + $invalidTypes[$this->formatTypeOf($item, $type).$suffix] = $value; + + return false; + } + } + + return true; + } + /** * Returns whether a resolved option with the given name exists. * @@ -964,7 +948,7 @@ class OptionsResolver implements Options throw new AccessException('Counting is only supported within closures of lazy options and normalizers.'); } - return count($this->defaults); + return \count($this->defaults); } /** @@ -990,14 +974,14 @@ class OptionsResolver implements Options while ('[]' === substr($type, -2)) { $type = substr($type, 0, -2); $value = array_shift($value); - if (!is_array($value)) { + if (!\is_array($value)) { break; } $suffix .= '[]'; } - if (is_array($value)) { - $subTypes = array(); + if (\is_array($value)) { + $subTypes = []; foreach ($value as $val) { $subTypes[$this->formatTypeOf($val, null)] = true; } @@ -1006,7 +990,7 @@ class OptionsResolver implements Options } } - return (is_object($value) ? get_class($value) : gettype($value)).$suffix; + return (\is_object($value) ? \get_class($value) : \gettype($value)).$suffix; } /** @@ -1022,19 +1006,19 @@ class OptionsResolver implements Options */ private function formatValue($value) { - if (is_object($value)) { - return get_class($value); + if (\is_object($value)) { + return \get_class($value); } - if (is_array($value)) { + if (\is_array($value)) { return 'array'; } - if (is_string($value)) { + if (\is_string($value)) { return '"'.$value.'"'; } - if (is_resource($value)) { + if (\is_resource($value)) { return 'resource'; } @@ -1076,6 +1060,6 @@ class OptionsResolver implements Options private static function isValueValidType($type, $value) { - return (function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type; + return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type; } } diff --git a/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php b/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php index 7c4753ab5..8dd7997dd 100644 --- a/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php +++ b/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php @@ -64,7 +64,7 @@ class OptionsResolverIntrospectorTest extends TestCase public function testGetLazyClosures() { $resolver = new OptionsResolver(); - $closures = array(); + $closures = []; $resolver->setDefault($option = 'foo', $closures[] = function (Options $options) {}); $debug = new OptionsResolverIntrospector($resolver); @@ -100,7 +100,7 @@ class OptionsResolverIntrospectorTest extends TestCase { $resolver = new OptionsResolver(); $resolver->setDefined($option = 'foo'); - $resolver->setAllowedTypes($option = 'foo', $allowedTypes = array('string', 'bool')); + $resolver->setAllowedTypes($option = 'foo', $allowedTypes = ['string', 'bool']); $debug = new OptionsResolverIntrospector($resolver); $this->assertSame($allowedTypes, $debug->getAllowedTypes($option)); @@ -135,7 +135,7 @@ class OptionsResolverIntrospectorTest extends TestCase { $resolver = new OptionsResolver(); $resolver->setDefined($option = 'foo'); - $resolver->setAllowedValues($option = 'foo', $allowedValues = array('bar', 'baz')); + $resolver->setAllowedValues($option = 'foo', $allowedValues = ['bar', 'baz']); $debug = new OptionsResolverIntrospector($resolver); $this->assertSame($allowedValues, $debug->getAllowedValues($option)); diff --git a/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php b/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php index 440af8b57..abf0aa015 100644 --- a/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php +++ b/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php @@ -29,10 +29,6 @@ class OptionsResolverTest extends TestCase $this->resolver = new OptionsResolver(); } - //////////////////////////////////////////////////////////////////////////// - // resolve() - //////////////////////////////////////////////////////////////////////////// - /** * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException * @expectedExceptionMessage The option "foo" does not exist. Defined options are: "a", "z". @@ -42,7 +38,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('z', '1'); $this->resolver->setDefault('a', '2'); - $this->resolver->resolve(array('foo' => 'bar')); + $this->resolver->resolve(['foo' => 'bar']); } /** @@ -54,7 +50,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('z', '1'); $this->resolver->setDefault('a', '2'); - $this->resolver->resolve(array('ping' => 'pong', 'foo' => 'bar', 'baz' => 'bam')); + $this->resolver->resolve(['ping' => 'pong', 'foo' => 'bar', 'baz' => 'bam']); } /** @@ -63,16 +59,12 @@ class OptionsResolverTest extends TestCase public function testResolveFailsFromLazyOption() { $this->resolver->setDefault('foo', function (Options $options) { - $options->resolve(array()); + $options->resolve([]); }); $this->resolver->resolve(); } - //////////////////////////////////////////////////////////////////////////// - // setDefault()/hasDefault() - //////////////////////////////////////////////////////////////////////////// - public function testSetDefaultReturnsThis() { $this->assertSame($this->resolver, $this->resolver->setDefault('foo', 'bar')); @@ -83,10 +75,10 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('one', '1'); $this->resolver->setDefault('two', '20'); - $this->assertEquals(array( + $this->assertEquals([ 'one' => '1', 'two' => '20', - ), $this->resolver->resolve()); + ], $this->resolver->resolve()); } /** @@ -115,10 +107,6 @@ class OptionsResolverTest extends TestCase $this->assertTrue($this->resolver->hasDefault('foo')); } - //////////////////////////////////////////////////////////////////////////// - // lazy setDefault() - //////////////////////////////////////////////////////////////////////////// - public function testSetLazyReturnsThis() { $this->assertSame($this->resolver, $this->resolver->setDefault('foo', function (Options $options) {})); @@ -130,7 +118,7 @@ class OptionsResolverTest extends TestCase return 'lazy'; }); - $this->assertEquals(array('foo' => 'lazy'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'lazy'], $this->resolver->resolve()); } public function testClosureWithoutTypeHintNotInvoked() @@ -141,7 +129,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', $closure); - $this->assertSame(array('foo' => $closure), $this->resolver->resolve()); + $this->assertSame(['foo' => $closure], $this->resolver->resolve()); } public function testClosureWithoutParametersNotInvoked() @@ -152,7 +140,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', $closure); - $this->assertSame(array('foo' => $closure), $this->resolver->resolve()); + $this->assertSame(['foo' => $closure], $this->resolver->resolve()); } public function testAccessPreviousDefaultValue() @@ -167,7 +155,7 @@ class OptionsResolverTest extends TestCase return 'lazy'; }); - $this->assertEquals(array('foo' => 'lazy'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'lazy'], $this->resolver->resolve()); } public function testAccessPreviousLazyDefaultValue() @@ -184,7 +172,7 @@ class OptionsResolverTest extends TestCase return 'lazy'; }); - $this->assertEquals(array('foo' => 'lazy'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'lazy'], $this->resolver->resolve()); } public function testPreviousValueIsNotEvaluatedIfNoSecondArgument() @@ -199,7 +187,7 @@ class OptionsResolverTest extends TestCase return 'lazy'; }); - $this->assertEquals(array('foo' => 'lazy'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'lazy'], $this->resolver->resolve()); } public function testOverwrittenLazyOptionNotEvaluated() @@ -210,7 +198,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testInvokeEachLazyOptionOnlyOnce() @@ -232,10 +220,6 @@ class OptionsResolverTest extends TestCase $this->assertSame(2, $calls); } - //////////////////////////////////////////////////////////////////////////// - // setRequired()/isRequired()/getRequiredOptions() - //////////////////////////////////////////////////////////////////////////// - public function testSetRequiredReturnsThis() { $this->assertSame($this->resolver, $this->resolver->setRequired('foo')); @@ -275,7 +259,7 @@ class OptionsResolverTest extends TestCase { $this->resolver->setRequired('foo'); - $this->assertNotEmpty($this->resolver->resolve(array('foo' => 'bar'))); + $this->assertNotEmpty($this->resolver->resolve(['foo' => 'bar'])); } public function testIsRequired() @@ -323,17 +307,13 @@ class OptionsResolverTest extends TestCase public function testGetRequiredOptions() { - $this->resolver->setRequired(array('foo', 'bar')); + $this->resolver->setRequired(['foo', 'bar']); $this->resolver->setDefault('bam', 'baz'); $this->resolver->setDefault('foo', 'boo'); - $this->assertSame(array('foo', 'bar'), $this->resolver->getRequiredOptions()); + $this->assertSame(['foo', 'bar'], $this->resolver->getRequiredOptions()); } - //////////////////////////////////////////////////////////////////////////// - // isMissing()/getMissingOptions() - //////////////////////////////////////////////////////////////////////////// - public function testIsMissingIfNotSet() { $this->assertFalse($this->resolver->isMissing('foo')); @@ -366,17 +346,13 @@ class OptionsResolverTest extends TestCase public function testGetMissingOptions() { - $this->resolver->setRequired(array('foo', 'bar')); + $this->resolver->setRequired(['foo', 'bar']); $this->resolver->setDefault('bam', 'baz'); $this->resolver->setDefault('foo', 'boo'); - $this->assertSame(array('bar'), $this->resolver->getMissingOptions()); + $this->assertSame(['bar'], $this->resolver->getMissingOptions()); } - //////////////////////////////////////////////////////////////////////////// - // setDefined()/isDefined()/getDefinedOptions() - //////////////////////////////////////////////////////////////////////////// - /** * @expectedException \Symfony\Component\OptionsResolver\Exception\AccessException */ @@ -393,7 +369,7 @@ class OptionsResolverTest extends TestCase { $this->resolver->setDefined('foo'); - $this->assertSame(array(), $this->resolver->resolve()); + $this->assertSame([], $this->resolver->resolve()); } public function testDefinedOptionsIncludedIfDefaultSetBefore() @@ -401,7 +377,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', 'bar'); $this->resolver->setDefined('foo'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testDefinedOptionsIncludedIfDefaultSetAfter() @@ -409,14 +385,14 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefined('foo'); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testDefinedOptionsIncludedIfPassedToResolve() { $this->resolver->setDefined('foo'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve(array('foo' => 'bar'))); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve(['foo' => 'bar'])); } public function testIsDefined() @@ -449,11 +425,11 @@ class OptionsResolverTest extends TestCase public function testGetDefinedOptions() { - $this->resolver->setDefined(array('foo', 'bar')); + $this->resolver->setDefined(['foo', 'bar']); $this->resolver->setDefault('baz', 'bam'); $this->resolver->setRequired('boo'); - $this->assertSame(array('foo', 'bar', 'baz', 'boo'), $this->resolver->getDefinedOptions()); + $this->assertSame(['foo', 'bar', 'baz', 'boo'], $this->resolver->getDefinedOptions()); } public function testRemovedOptionsAreNotDefined() @@ -474,10 +450,6 @@ class OptionsResolverTest extends TestCase $this->assertFalse($this->resolver->isDefined('foo')); } - //////////////////////////////////////////////////////////////////////////// - // setAllowedTypes() - //////////////////////////////////////////////////////////////////////////// - /** * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException */ @@ -490,9 +462,9 @@ class OptionsResolverTest extends TestCase { $this->resolver->setDefined('foo'); $this->resolver->setAllowedTypes('foo', 'string[]'); - $options = $this->resolver->resolve(array('foo' => array('bar', 'baz'))); + $options = $this->resolver->resolve(['foo' => ['bar', 'baz']]); - $this->assertSame(array('foo' => array('bar', 'baz')), $options); + $this->assertSame(['foo' => ['bar', 'baz']], $options); } /** @@ -511,14 +483,14 @@ class OptionsResolverTest extends TestCase /** * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but is of type "DateTime[]". + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "DateTime[]". */ public function testResolveFailsIfInvalidTypedArray() { $this->resolver->setDefined('foo'); $this->resolver->setAllowedTypes('foo', 'int[]'); - $this->resolver->resolve(array('foo' => array(new \DateTime()))); + $this->resolver->resolve(['foo' => [new \DateTime()]]); } /** @@ -530,12 +502,12 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefined('foo'); $this->resolver->setAllowedTypes('foo', 'int[]'); - $this->resolver->resolve(array('foo' => 'bar')); + $this->resolver->resolve(['foo' => 'bar']); } /** * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but is of type "integer|stdClass|array|DateTime[]". + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[]", but one of the elements is of type "stdClass[]". */ public function testResolveFailsIfTypedArrayContainsInvalidTypes() { @@ -543,16 +515,16 @@ class OptionsResolverTest extends TestCase $this->resolver->setAllowedTypes('foo', 'int[]'); $values = range(1, 5); $values[] = new \stdClass(); - $values[] = array(); + $values[] = []; $values[] = new \DateTime(); $values[] = 123; - $this->resolver->resolve(array('foo' => $values)); + $this->resolver->resolve(['foo' => $values]); } /** * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException - * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but is of type "double[][]". + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "double[][]". */ public function testResolveFailsWithCorrectLevelsButWrongScalar() { @@ -560,11 +532,11 @@ class OptionsResolverTest extends TestCase $this->resolver->setAllowedTypes('foo', 'int[][]'); $this->resolver->resolve( - array( - 'foo' => array( - array(1.2), - ), - ) + [ + 'foo' => [ + [1.2], + ], + ] ); } @@ -583,21 +555,21 @@ class OptionsResolverTest extends TestCase $this->setExpectedException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException', $exceptionMessage); } - $this->resolver->resolve(array('option' => $actualType)); + $this->resolver->resolve(['option' => $actualType]); } public function provideInvalidTypes() { - return array( - array(true, 'string', 'The option "option" with value true is expected to be of type "string", but is of type "boolean".'), - array(false, 'string', 'The option "option" with value false is expected to be of type "string", but is of type "boolean".'), - array(fopen(__FILE__, 'r'), 'string', 'The option "option" with value resource is expected to be of type "string", but is of type "resource".'), - array(array(), 'string', 'The option "option" with value array is expected to be of type "string", but is of type "array".'), - array(new OptionsResolver(), 'string', 'The option "option" with value Symfony\Component\OptionsResolver\OptionsResolver is expected to be of type "string", but is of type "Symfony\Component\OptionsResolver\OptionsResolver".'), - array(42, 'string', 'The option "option" with value 42 is expected to be of type "string", but is of type "integer".'), - array(null, 'string', 'The option "option" with value null is expected to be of type "string", but is of type "NULL".'), - array('bar', '\stdClass', 'The option "option" with value "bar" is expected to be of type "\stdClass", but is of type "string".'), - ); + return [ + [true, 'string', 'The option "option" with value true is expected to be of type "string", but is of type "boolean".'], + [false, 'string', 'The option "option" with value false is expected to be of type "string", but is of type "boolean".'], + [fopen(__FILE__, 'r'), 'string', 'The option "option" with value resource is expected to be of type "string", but is of type "resource".'], + [[], 'string', 'The option "option" with value array is expected to be of type "string", but is of type "array".'], + [new OptionsResolver(), 'string', 'The option "option" with value Symfony\Component\OptionsResolver\OptionsResolver is expected to be of type "string", but is of type "Symfony\Component\OptionsResolver\OptionsResolver".'], + [42, 'string', 'The option "option" with value 42 is expected to be of type "string", but is of type "integer".'], + [null, 'string', 'The option "option" with value null is expected to be of type "string", but is of type "NULL".'], + ['bar', '\stdClass', 'The option "option" with value "bar" is expected to be of type "\stdClass", but is of type "string".'], + ]; } public function testResolveSucceedsIfValidType() @@ -615,7 +587,7 @@ class OptionsResolverTest extends TestCase public function testResolveFailsIfInvalidTypeMultiple() { $this->resolver->setDefault('foo', 42); - $this->resolver->setAllowedTypes('foo', array('string', 'bool')); + $this->resolver->setAllowedTypes('foo', ['string', 'bool']); $this->resolver->resolve(); } @@ -623,7 +595,7 @@ class OptionsResolverTest extends TestCase public function testResolveSucceedsIfValidTypeMultiple() { $this->resolver->setDefault('foo', true); - $this->resolver->setAllowedTypes('foo', array('string', 'bool')); + $this->resolver->setAllowedTypes('foo', ['string', 'bool']); $this->assertNotEmpty($this->resolver->resolve()); } @@ -639,14 +611,14 @@ class OptionsResolverTest extends TestCase public function testResolveSucceedsIfTypedArray() { $this->resolver->setDefault('foo', null); - $this->resolver->setAllowedTypes('foo', array('null', 'DateTime[]')); + $this->resolver->setAllowedTypes('foo', ['null', 'DateTime[]']); - $data = array( - 'foo' => array( + $data = [ + 'foo' => [ new \DateTime(), new \DateTime(), - ), - ); + ], + ]; $result = $this->resolver->resolve($data); $this->assertEquals($data, $result); } @@ -662,10 +634,6 @@ class OptionsResolverTest extends TestCase $this->resolver->resolve(); } - //////////////////////////////////////////////////////////////////////////// - // addAllowedTypes() - //////////////////////////////////////////////////////////////////////////// - /** * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException */ @@ -713,7 +681,7 @@ class OptionsResolverTest extends TestCase public function testResolveFailsIfInvalidAddedTypeMultiple() { $this->resolver->setDefault('foo', 42); - $this->resolver->addAllowedTypes('foo', array('string', 'bool')); + $this->resolver->addAllowedTypes('foo', ['string', 'bool']); $this->resolver->resolve(); } @@ -721,7 +689,7 @@ class OptionsResolverTest extends TestCase public function testResolveSucceedsIfValidAddedTypeMultiple() { $this->resolver->setDefault('foo', 'bar'); - $this->resolver->addAllowedTypes('foo', array('string', 'bool')); + $this->resolver->addAllowedTypes('foo', ['string', 'bool']); $this->assertNotEmpty($this->resolver->resolve()); } @@ -748,10 +716,6 @@ class OptionsResolverTest extends TestCase $this->assertNotEmpty($this->resolver->resolve()); } - //////////////////////////////////////////////////////////////////////////// - // setAllowedValues() - //////////////////////////////////////////////////////////////////////////// - /** * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException */ @@ -783,7 +747,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefined('foo'); $this->resolver->setAllowedValues('foo', 'bar'); - $this->resolver->resolve(array('foo' => 42)); + $this->resolver->resolve(['foo' => 42]); } /** @@ -814,7 +778,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', 'bar'); $this->resolver->setAllowedValues('foo', 'bar'); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } public function testResolveSucceedsIfValidValueIsNull() @@ -822,7 +786,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', null); $this->resolver->setAllowedValues('foo', null); - $this->assertEquals(array('foo' => null), $this->resolver->resolve()); + $this->assertEquals(['foo' => null], $this->resolver->resolve()); } /** @@ -832,7 +796,7 @@ class OptionsResolverTest extends TestCase public function testResolveFailsIfInvalidValueMultiple() { $this->resolver->setDefault('foo', 42); - $this->resolver->setAllowedValues('foo', array('bar', false, null)); + $this->resolver->setAllowedValues('foo', ['bar', false, null]); $this->resolver->resolve(); } @@ -840,9 +804,9 @@ class OptionsResolverTest extends TestCase public function testResolveSucceedsIfValidValueMultiple() { $this->resolver->setDefault('foo', 'baz'); - $this->resolver->setAllowedValues('foo', array('bar', 'baz')); + $this->resolver->setAllowedValues('foo', ['bar', 'baz']); - $this->assertEquals(array('foo' => 'baz'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'baz'], $this->resolver->resolve()); } public function testResolveFailsIfClosureReturnsFalse() @@ -872,7 +836,7 @@ class OptionsResolverTest extends TestCase return true; }); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); $this->assertSame('bar', $passedValue); } @@ -882,11 +846,11 @@ class OptionsResolverTest extends TestCase public function testResolveFailsIfAllClosuresReturnFalse() { $this->resolver->setDefault('foo', 42); - $this->resolver->setAllowedValues('foo', array( + $this->resolver->setAllowedValues('foo', [ function () { return false; }, function () { return false; }, function () { return false; }, - )); + ]); $this->resolver->resolve(); } @@ -894,19 +858,15 @@ class OptionsResolverTest extends TestCase public function testResolveSucceedsIfAnyClosureReturnsTrue() { $this->resolver->setDefault('foo', 'bar'); - $this->resolver->setAllowedValues('foo', array( + $this->resolver->setAllowedValues('foo', [ function () { return false; }, function () { return true; }, function () { return false; }, - )); + ]); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } - //////////////////////////////////////////////////////////////////////////// - // addAllowedValues() - //////////////////////////////////////////////////////////////////////////// - /** * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException */ @@ -945,7 +905,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', 'bar'); $this->resolver->addAllowedValues('foo', 'bar'); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } public function testResolveSucceedsIfValidAddedValueIsNull() @@ -953,7 +913,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('foo', null); $this->resolver->addAllowedValues('foo', null); - $this->assertEquals(array('foo' => null), $this->resolver->resolve()); + $this->assertEquals(['foo' => null], $this->resolver->resolve()); } /** @@ -962,7 +922,7 @@ class OptionsResolverTest extends TestCase public function testResolveFailsIfInvalidAddedValueMultiple() { $this->resolver->setDefault('foo', 42); - $this->resolver->addAllowedValues('foo', array('bar', 'baz')); + $this->resolver->addAllowedValues('foo', ['bar', 'baz']); $this->resolver->resolve(); } @@ -970,9 +930,9 @@ class OptionsResolverTest extends TestCase public function testResolveSucceedsIfValidAddedValueMultiple() { $this->resolver->setDefault('foo', 'bar'); - $this->resolver->addAllowedValues('foo', array('bar', 'baz')); + $this->resolver->addAllowedValues('foo', ['bar', 'baz']); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } public function testAddAllowedValuesDoesNotOverwrite() @@ -981,7 +941,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setAllowedValues('foo', 'bar'); $this->resolver->addAllowedValues('foo', 'baz'); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } public function testAddAllowedValuesDoesNotOverwrite2() @@ -990,7 +950,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setAllowedValues('foo', 'bar'); $this->resolver->addAllowedValues('foo', 'baz'); - $this->assertEquals(array('foo' => 'baz'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'baz'], $this->resolver->resolve()); } /** @@ -1011,7 +971,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setAllowedValues('foo', function () { return false; }); $this->resolver->addAllowedValues('foo', function () { return true; }); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } public function testResolveSucceedsIfAnyAddedClosureReturnsTrue2() @@ -1020,13 +980,9 @@ class OptionsResolverTest extends TestCase $this->resolver->setAllowedValues('foo', function () { return true; }); $this->resolver->addAllowedValues('foo', function () { return false; }); - $this->assertEquals(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'bar'], $this->resolver->resolve()); } - //////////////////////////////////////////////////////////////////////////// - // setNormalizer() - //////////////////////////////////////////////////////////////////////////// - public function testSetNormalizerReturnsThis() { $this->resolver->setDefault('foo', 'bar'); @@ -1040,7 +996,7 @@ class OptionsResolverTest extends TestCase return 'normalized'; }); - $this->assertEquals(array('foo' => 'normalized'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'normalized'], $this->resolver->resolve()); } /** @@ -1073,7 +1029,7 @@ class OptionsResolverTest extends TestCase return 'normalized['.$value.']'; }); - $this->assertEquals(array('foo' => 'normalized[bar]'), $this->resolver->resolve()); + $this->assertEquals(['foo' => 'normalized[bar]'], $this->resolver->resolve()); } public function testNormalizerReceivesPassedOption() @@ -1084,9 +1040,9 @@ class OptionsResolverTest extends TestCase return 'normalized['.$value.']'; }); - $resolved = $this->resolver->resolve(array('foo' => 'baz')); + $resolved = $this->resolver->resolve(['foo' => 'baz']); - $this->assertEquals(array('foo' => 'normalized[baz]'), $resolved); + $this->assertEquals(['foo' => 'normalized[baz]'], $resolved); } /** @@ -1133,10 +1089,10 @@ class OptionsResolverTest extends TestCase return 'normalized'; }); - $this->assertEquals(array( + $this->assertEquals([ 'default' => 'bar', 'norm' => 'normalized', - ), $this->resolver->resolve()); + ], $this->resolver->resolve()); } public function testNormalizerCanAccessLazyOptions() @@ -1153,10 +1109,10 @@ class OptionsResolverTest extends TestCase return 'normalized'; }); - $this->assertEquals(array( + $this->assertEquals([ 'lazy' => 'bar', 'norm' => 'normalized', - ), $this->resolver->resolve()); + ], $this->resolver->resolve()); } /** @@ -1200,7 +1156,7 @@ class OptionsResolverTest extends TestCase { $throw = true; - $this->resolver->setDefaults(array('catcher' => null, 'thrower' => null)); + $this->resolver->setDefaults(['catcher' => null, 'thrower' => null]); $this->resolver->setNormalizer('catcher', function (Options $options) { try { @@ -1219,7 +1175,7 @@ class OptionsResolverTest extends TestCase return true; }); - $this->assertSame(array('catcher' => false, 'thrower' => true), $this->resolver->resolve()); + $this->assertSame(['catcher' => false, 'thrower' => true], $this->resolver->resolve()); } public function testCaughtExceptionFromLazyDoesNotCrashOptionResolver() @@ -1243,7 +1199,7 @@ class OptionsResolverTest extends TestCase return true; }); - $this->assertSame(array('catcher' => false, 'thrower' => true), $this->resolver->resolve()); + $this->assertSame(['catcher' => false, 'thrower' => true], $this->resolver->resolve()); } public function testInvokeEachNormalizerOnlyOnce() @@ -1278,13 +1234,9 @@ class OptionsResolverTest extends TestCase $this->assertEmpty($this->resolver->resolve()); } - //////////////////////////////////////////////////////////////////////////// - // setDefaults() - //////////////////////////////////////////////////////////////////////////// - public function testSetDefaultsReturnsThis() { - $this->assertSame($this->resolver, $this->resolver->setDefaults(array('foo', 'bar'))); + $this->assertSame($this->resolver, $this->resolver->setDefaults(['foo', 'bar'])); } public function testSetDefaults() @@ -1292,16 +1244,16 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('one', '1'); $this->resolver->setDefault('two', 'bar'); - $this->resolver->setDefaults(array( + $this->resolver->setDefaults([ 'two' => '2', 'three' => '3', - )); + ]); - $this->assertEquals(array( + $this->assertEquals([ 'one' => '1', 'two' => '2', 'three' => '3', - ), $this->resolver->resolve()); + ], $this->resolver->resolve()); } /** @@ -1310,16 +1262,12 @@ class OptionsResolverTest extends TestCase public function testFailIfSetDefaultsFromLazyOption() { $this->resolver->setDefault('foo', function (Options $options) { - $options->setDefaults(array('two' => '2')); + $options->setDefaults(['two' => '2']); }); $this->resolver->resolve(); } - //////////////////////////////////////////////////////////////////////////// - // remove() - //////////////////////////////////////////////////////////////////////////// - public function testRemoveReturnsThis() { $this->resolver->setDefault('foo', 'bar'); @@ -1333,7 +1281,7 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('baz', 'boo'); $this->resolver->remove('foo'); - $this->assertSame(array('baz' => 'boo'), $this->resolver->resolve()); + $this->assertSame(['baz' => 'boo'], $this->resolver->resolve()); } public function testRemoveMultipleOptions() @@ -1342,9 +1290,9 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefault('baz', 'boo'); $this->resolver->setDefault('doo', 'dam'); - $this->resolver->remove(array('foo', 'doo')); + $this->resolver->remove(['foo', 'doo']); - $this->assertSame(array('baz' => 'boo'), $this->resolver->resolve()); + $this->assertSame(['baz' => 'boo'], $this->resolver->resolve()); } public function testRemoveLazyOption() @@ -1354,7 +1302,7 @@ class OptionsResolverTest extends TestCase }); $this->resolver->remove('foo'); - $this->assertSame(array(), $this->resolver->resolve()); + $this->assertSame([], $this->resolver->resolve()); } public function testRemoveNormalizer() @@ -1366,7 +1314,7 @@ class OptionsResolverTest extends TestCase $this->resolver->remove('foo'); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testRemoveAllowedTypes() @@ -1376,17 +1324,17 @@ class OptionsResolverTest extends TestCase $this->resolver->remove('foo'); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testRemoveAllowedValues() { $this->resolver->setDefault('foo', 'bar'); - $this->resolver->setAllowedValues('foo', array('baz', 'boo')); + $this->resolver->setAllowedValues('foo', ['baz', 'boo']); $this->resolver->remove('foo'); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } /** @@ -1408,10 +1356,6 @@ class OptionsResolverTest extends TestCase $this->assertNotNull($this->resolver->remove('foo')); } - //////////////////////////////////////////////////////////////////////////// - // clear() - //////////////////////////////////////////////////////////////////////////// - public function testClearReturnsThis() { $this->assertSame($this->resolver, $this->resolver->clear()); @@ -1434,7 +1378,7 @@ class OptionsResolverTest extends TestCase }); $this->resolver->clear(); - $this->assertSame(array(), $this->resolver->resolve()); + $this->assertSame([], $this->resolver->resolve()); } public function testClearNormalizer() @@ -1446,7 +1390,7 @@ class OptionsResolverTest extends TestCase $this->resolver->clear(); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testClearAllowedTypes() @@ -1456,7 +1400,7 @@ class OptionsResolverTest extends TestCase $this->resolver->clear(); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } public function testClearAllowedValues() @@ -1466,7 +1410,7 @@ class OptionsResolverTest extends TestCase $this->resolver->clear(); $this->resolver->setDefault('foo', 'bar'); - $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve()); + $this->assertSame(['foo' => 'bar'], $this->resolver->resolve()); } /** @@ -1498,10 +1442,6 @@ class OptionsResolverTest extends TestCase $this->assertEmpty($this->resolver->resolve()); } - //////////////////////////////////////////////////////////////////////////// - // ArrayAccess - //////////////////////////////////////////////////////////////////////////// - public function testArrayAccess() { $this->resolver->setDefault('default1', 0); @@ -1529,7 +1469,7 @@ class OptionsResolverTest extends TestCase // accessed }); - $this->resolver->resolve(array('default2' => 42, 'required' => 'value')); + $this->resolver->resolve(['default2' => 42, 'required' => 'value']); } /** @@ -1616,10 +1556,6 @@ class OptionsResolverTest extends TestCase $this->resolver->resolve(); } - //////////////////////////////////////////////////////////////////////////// - // Countable - //////////////////////////////////////////////////////////////////////////// - public function testCount() { $this->resolver->setDefault('default', 0); @@ -1631,7 +1567,7 @@ class OptionsResolverTest extends TestCase Assert::assertCount(4, $options); }); - $this->assertCount(4, $this->resolver->resolve(array('required' => 'value'))); + $this->assertCount(4, $this->resolver->resolve(['required' => 'value'])); } /** @@ -1648,6 +1584,153 @@ class OptionsResolverTest extends TestCase $this->resolver->setDefined('bar'); $this->resolver->setDefault('lazy1', function () {}); - count($this->resolver); + \count($this->resolver); + } + + public function testNestedArrays() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][]'); + + $this->assertEquals([ + 'foo' => [ + [ + 1, 2, + ], + ], + ], $this->resolver->resolve( + [ + 'foo' => [ + [1, 2], + ], + ] + )); + } + + public function testNested2Arrays() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][][][]'); + + $this->assertEquals([ + 'foo' => [ + [ + [ + [ + 1, 2, + ], + ], + ], + ], + ], $this->resolver->resolve( + [ + 'foo' => [ + [ + [ + [1, 2], + ], + ], + ], + ] + )); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "float[][][][]", but one of the elements is of type "integer[][][][]". + */ + public function testNestedArraysException() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'float[][][][]'); + + $this->resolver->resolve( + [ + 'foo' => [ + [ + [ + [1, 2], + ], + ], + ], + ] + ); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]". + */ + public function testNestedArrayException1() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][]'); + $this->resolver->resolve([ + 'foo' => [ + [1, true, 'str', [2, 3]], + ], + ]); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "int[][]", but one of the elements is of type "boolean[][]". + */ + public function testNestedArrayException2() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'int[][]'); + $this->resolver->resolve([ + 'foo' => [ + [true, 'str', [2, 3]], + ], + ]); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "string[][]". + */ + public function testNestedArrayException3() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'string[][][]'); + $this->resolver->resolve([ + 'foo' => [ + ['str', [1, 2]], + ], + ]); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[][][]", but one of the elements is of type "integer[][][]". + */ + public function testNestedArrayException4() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'string[][][]'); + $this->resolver->resolve([ + 'foo' => [ + [ + ['str'], [1, 2], ], + ], + ]); + } + + /** + * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException + * @expectedExceptionMessage The option "foo" with value array is expected to be of type "string[]", but one of the elements is of type "array[]". + */ + public function testNestedArrayException5() + { + $this->resolver->setDefined('foo'); + $this->resolver->setAllowedTypes('foo', 'string[]'); + $this->resolver->resolve([ + 'foo' => [ + [ + ['str'], [1, 2], ], + ], + ]); } } diff --git a/vendor/symfony/options-resolver/phpunit.xml.dist b/vendor/symfony/options-resolver/phpunit.xml.dist index 7e04e6049..9a2ec111c 100644 --- a/vendor/symfony/options-resolver/phpunit.xml.dist +++ b/vendor/symfony/options-resolver/phpunit.xml.dist @@ -1,7 +1,7 @@ validate($data,[ - 'captcha|楠岃瘉鐮'=>'required|captcha' + 'captcha|楠岃瘉鐮'=>'require|captcha' ]); ~~~ 鎴栬呮墜鍔ㄩ獙璇 diff --git a/vendor/topthink/think-captcha/composer.json b/vendor/topthink/think-captcha/composer.json index 272e5163e..d56bb3c97 100644 --- a/vendor/topthink/think-captcha/composer.json +++ b/vendor/topthink/think-captcha/composer.json @@ -8,7 +8,10 @@ } ], "license": "Apache-2.0", - "require": {}, + "require": { + "topthink/think-installer": ">=1.0.10", + "topthink/framework": "~5.0.0" + }, "autoload": { "psr-4": { "think\\captcha\\": "src/" diff --git a/vendor/topthink/think-captcha/src/Captcha.php b/vendor/topthink/think-captcha/src/Captcha.php index a09a86ca6..6c7f8f4a5 100644 --- a/vendor/topthink/think-captcha/src/Captcha.php +++ b/vendor/topthink/think-captcha/src/Captcha.php @@ -13,43 +13,61 @@ namespace think\captcha; use think\Session; +/** + * @property mixed seKey + * @property mixed expire + * @property mixed length + * @property mixed fontSize + * @property float|mixed imageH + * @property float|int|mixed imageW + * @property mixed zhSet + * @property mixed codeSet + * @property mixed reset + * @property mixed fontttf + * @property mixed useZh + * @property mixed useNoise + * @property mixed useCurve + * @property mixed useImgBg + * @property mixed useArithmetic + */ class Captcha { protected $config = [ - 'seKey' => 'ThinkPHP.CN', + 'seKey' => 'ThinkPHP.CN', // 楠岃瘉鐮佸姞瀵嗗瘑閽 - 'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY', + 'codeSet' => '2345678abcdefhijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY', // 楠岃瘉鐮佸瓧绗﹂泦鍚 - 'expire' => 1800, + 'expire' => 1800, // 楠岃瘉鐮佽繃鏈熸椂闂达紙s锛 - 'useZh' => false, + 'useZh' => false, // 浣跨敤涓枃楠岃瘉鐮 - 'zhSet' => '浠互鎴戝埌浠栦細浣滄椂瑕佸姩鍥戒骇鐨勪竴鏄伐灏卞勾闃朵箟鍙戞垚閮ㄦ皯鍙嚭鑳芥柟杩涘湪浜嗕笉鍜屾湁澶ц繖涓讳腑浜轰笂涓烘潵鍒嗙敓瀵逛簬瀛︿笅绾у湴涓敤鍚岃闈㈣绉嶈繃鍛藉害闈╄屽瀛愬悗鑷ぞ鍔犲皬鏈轰篃缁忓姏绾挎湰鐢甸珮閲忛暱鍏氬緱瀹炲瀹氭繁娉曡〃鐫姘寸悊鍖栦簤鐜版墍浜岃捣鏀夸笁濂藉崄鎴樻棤鍐滀娇鎬у墠绛夊弽浣撳悎鏂楄矾鍥炬妸缁撶閲屾鏂板紑璁轰箣鐗╀粠褰撲袱浜涜繕澶╄祫浜嬮槦鎵圭偣鑲查噸鍏舵濅笌闂村唴鍘诲洜浠舵棩鍒╃浉鐢卞帇鍛樻皵涓氫唬鍏ㄧ粍鏁版灉鏈熷骞冲悇鍩烘垨鏈堟瘺鐒跺搴斿舰鎯冲埗蹇冩牱骞查兘鍚戝彉鍏抽棶姣斿睍閭e畠鏈鍙婂娌$湅娌绘彁浜旇В绯绘灄鑰呯背缇ゅご鎰忓彧鏄庡洓閬撻┈璁ゆ鏂囬氫絾鏉¤緝鍏嬪張鍏瓟棰嗗啗娴佸叆鎺ュ腑浣嶆儏杩愬櫒骞堕鍘熸补鏀剧珛棰樿川鎸囧缓鍖洪獙娲讳紬寰堟暀鍐崇壒姝ゅ父鐭冲己鏋佸湡灏戝凡鏍瑰叡鐩村洟缁熷紡杞埆閫犲垏涔濅綘鍙栬タ鎸佹绘枡杩炰换蹇楄璋冧竷涔堝北绋嬬櫨鎶ユ洿瑙佸繀鐪熶繚鐑鎵嬫敼绠″宸卞皢淇敮璇嗙梾璞″嚑鍏堣佸厜涓撲粈鍏瀷鍏风ず澶嶅畨甯︽瘡涓滃鍒欏畬椋庡洖鍗楀箍鍔宠疆绉戝寳鎵撶Н杞﹁缁欒妭鍋氬姟琚暣鑱旀绫婚泦鍙峰垪娓╄鍗虫鐭ヨ酱鐮斿崟鑹插潥鎹熼槻鍙叉媺涓栬杈惧皵鍦虹粐鍘嗚姳鍙楁眰浼犲彛鏂喌閲囩簿閲戠晫鍝佸垽鍙傚眰姝㈣竟娓呰嚦涓囩‘绌朵功鏈姸鍘傞』绂诲啀鐩捣浜ゆ潈涓斿効闈掓墠璇佷綆瓒婇檯鍏瘯瑙勬柉杩戞敞鍔炲竷闂ㄩ搧闇璧拌鍘垮叺鍥洪櫎鑸紩榻垮崈鑳滅粏褰辨祹鐧芥牸鏁堢疆鎺ㄧ┖閰嶅垁鍙剁巼杩颁粖閫夊吇寰疯瘽鏌ュ樊鍗婃晫濮嬬墖鏂藉搷鏀跺崕瑙夊鍚嶇孩缁潎鑽爣璁伴毦瀛樻祴澹韩绱ф恫娲惧噯鏂よ闄嶇淮鏉胯鐮磋堪鎶娑堝簳搴婄敯鍔跨鎰熷線绁炰究璐烘潙鏋勭収瀹归潪鎼炰簹纾ㄦ棌鐏绠楅傝鎸夊肩編鎬侀粍鏄撳姜鏈嶆棭鐝害鍓婁俊鎺掑彴澹拌鍑荤礌寮犲瘑瀹充警鑽変綍鏍戣偉缁у彸灞炲競涓ュ緞铻烘宸﹂〉鎶楄嫃鏄捐嫤鑻卞揩绉板潖绉荤害宸存潗鐪侀粦姝﹀煿钁楁渤甯濅粎閽堟庢浜姪鍗囩帇鐪煎ス鎶撳惈鑻楀壇鏉傛櫘璋堝洿椋熷皠婧愪緥鑷撮吀鏃у嵈鍏呰冻鐭垝鍓傚鐜惤棣栧昂娉㈡壙绮夎返搴滈奔闅忚冨埢闈犲婊″か澶卞寘浣忎績鏋濆眬鑿屾潌鍛ㄦ姢宀╁笀涓炬洸鏄ュ厓瓒呰礋鐮傚皝鎹㈠お妯¤传鍑忛槼鎵睙鏋愪憨鏈ㄨ█鐞冩湞鍖绘牎鍙ゅ憿绋诲畫鍚敮杈撴粦绔欏彟鍗瓧榧撳垰鍐欏垬寰暐鑼冧緵闃垮潡鏌愬姛濂楀弸闄愰」浣欏掑嵎鍒涘緥闆ㄨ楠ㄨ繙甯垵鐨挱浼樺崰姝绘瘨鍦堜紵瀛h鎺ф縺鎵惧彨浜戜簰璺熻绮矑姣嶇粌濉為挗椤剁瓥鍙岀暀璇鍚搁樆鏁呭鐩炬櫄涓濆コ鏁g剨鍔熸牚浜查櫌鍐峰交寮归敊鏁e晢瑙嗚壓鐏増鐑堥浂瀹よ交琛鍊嶇己鍘樻车瀵熺粷瀵屽煄鍐插柗澹ょ畝鍚︽煴鏉庢湜鐩樼闆勪技鍥板珐鐩婃床鑴辨姇閫佸ゴ渚ф鼎鐩栨尌璺濊Е鏄熸澗閫佽幏鍏寸嫭瀹樻贩绾緷鏈獊鏋跺鍐珷婀垮亸绾瑰悆鎵ч榾鐭垮璐g啛绋冲ず纭环鍔炕濂囩敳棰勮亴璇勮鑳屽崗鎹熸渚电伆铏界煕鍘氱綏娉ヨ緹鍛婂嵉绠辨帉姘ф仼鐖卞仠鏇炬憾钀ョ粓绾插瓱閽卞緟灏戒縿缂╂矙閫闄堣濂嬫杞借優骞煎摢鍓ヨ揩鏃嬪緛妲藉掓彙鎷呬粛鍛椴滃惂鍗$矖浠嬮捇閫愬急鑴氭曠洂鏈槾涓伴浘鍐犱笝琛楄幈璐濊緪鑲犱粯鍚夋笚鐟炴儕椤挎尋绉掓偓濮嗙儌妫硸鍦e嚬闄惰瘝杩熻殨浜跨煩搴烽伒鐗ч伃骞呭洯鑵旇棣欒倝寮熷眿鏁忔仮蹇樼紪鍗拌渹鎬ユ嬁鎵╀激椋為湶鏍哥紭娓告尟鎿嶅ぎ浼嶅煙鐢氳繀杈夊紓搴忓厤绾稿涔′箙闅剁几澶瑰康鍏版槧娌熶箼鍚楀剴鏉姹界7鑹版櫠鎻掑焹鐕冩閾佽ˉ鍜辫娊姘哥摝鍊鹃樀纰虫紨濞侀檮鐗欒娊姘哥摝鏂滅亴娆х尞椤虹尓娲嬭厫璇烽忓徃鍗辨嫭鑴夊疁绗戣嫢灏炬潫澹毚浼佽彍绌楁姹夋剤缁挎嫋鐗涗唤鏌撴棦绉嬮亶閿荤帀澶忕枟灏栨畺浜曡垂宸炶鍚硅崳閾滄部鏇挎粴瀹㈠彫鏃辨偀鍒鸿剳鎺疮钘忔暍浠ら殭鐐夊3纭叅杩庨摳绮樻帰涓磋杽鏃杽绂忕旱鎷╃ぜ鎰夸紡娈嬮浄寤剁儫鍙ョ函娓愯曡窇娉芥參鏍介瞾璧ょ箒澧冩疆妯帀閿ュ笇姹犺触鑸瑰亣浜皳鎵樹紮鍝叉鍓叉憜璐″憟鍔茶储浠矇鐐奸夯缃鎭溅绌胯揣閿榻愰紶鎶界敾楗查緳搴撳畧绛戞埧姝屽瘨鍠滃摜娲楄殌搴熺撼鑵逛箮褰曢暅濡囨伓鑴傚簞鎿﹂櫓璧為挓鎽囧吀鏌勮京绔硅胺鍗栦贡铏氭ˉ濂ヤ集璧跺瀭閫旈澹佺綉鎴噹閬楅潤璋嬪紕鎸傝闀囧鐩涜愭彺鎵庤檻閿綊绗﹀簡鑱氱粫鎽╁繖鑸為亣绱㈤【鑳剁緤婀栭拤浠侀煶杩圭浼哥伅閬挎硾浜$瓟鍕囬鐨囨煶鍝堟彮鐢樿姒傚娴撳矝琚皝娲阿鐐祰鏂戣鎳傜伒铔嬮棴瀛╅噴涔冲法寰掔閾朵紛鏅潶绱寑闇夋潨涔愬嫆闅斿集缁╂嫑缁嶈儭鍛肩棝宄伴浂鏌寸哀鍗堣烦灞呭皻涓佺Е绋嶈拷姊佹姌鑰楃⒈娈婂矖鎸栨皬鍒冨墽鍫嗚但鑽疯兏琛″嫟鑶滅瘒鐧婚┗妗堝垔绉х紦鍑稿焦鍓窛闆摼娓斿暒鑴告埛娲涘鍕冪洘涔版潹瀹楃劍璧涙棗婊ょ鐐偂鍧愯捀鍑濈珶闄锋灙榛庢晳鍐掓殫娲炵姱绛掓偍瀹嬪姬鐖嗚艾娑傚懗娲ヨ噦闅滆闄嗗晩鍋ュ皧璞嗘嫈鑾姷妗戝潯缂濊鎸戞薄鍐版煬鍢村暐楗瀵勮档鍠婂灚涓规浮鑰冲埁铏庣瑪绋鏄嗘氮钀ㄨ尪婊存祬鎷ョ┐瑕嗕鸡濞樺惃娴歌鐝犻泴濡堢传鎴忓閿ら渿宀佽矊娲佸墫鐗㈤攱鐤戦湼闂煍鐚涜瘔鍒风嫚蹇界伨闂逛箶鍞愭紡闂绘矆鐔旀隘鑽掕寧鐢峰嚒鎶㈠儚娴嗘梺鐜讳害蹇犲敱钂欎簣绾锋崟閿佸挨涔樹箤鏅烘贰鍏佸彌鐣滀繕鎽搁攬鎵瘯鐠冨疂鑺埛閴寸鍑钂嬮挋鑲╄吘鏋姏杞ㄥ爞鎷岀埜寰绁濆姳鑲厭缁崇┓濉樼嚗娉¤鏈楀杺閾濊蒋娓犻鎯锤绮患澧欒秼褰煎眾澧ㄧ鍚嗗嵏鑸。瀛欓緞宀獥浼戝', + 'zhSet' => '浠互鎴戝埌浠栦細浣滄椂瑕佸姩鍥戒骇鐨勪竴鏄伐灏卞勾闃朵箟鍙戞垚閮ㄦ皯鍙嚭鑳芥柟杩涘湪浜嗕笉鍜屾湁澶ц繖涓讳腑浜轰笂涓烘潵鍒嗙敓瀵逛簬瀛︿笅绾у湴涓敤鍚岃闈㈣绉嶈繃鍛藉害闈╄屽瀛愬悗鑷ぞ鍔犲皬鏈轰篃缁忓姏绾挎湰鐢甸珮閲忛暱鍏氬緱瀹炲瀹氭繁娉曡〃鐫姘寸悊鍖栦簤鐜版墍浜岃捣鏀夸笁濂藉崄鎴樻棤鍐滀娇鎬у墠绛夊弽浣撳悎鏂楄矾鍥炬妸缁撶閲屾鏂板紑璁轰箣鐗╀粠褰撲袱浜涜繕澶╄祫浜嬮槦鎵圭偣鑲查噸鍏舵濅笌闂村唴鍘诲洜浠舵棩鍒╃浉鐢卞帇鍛樻皵涓氫唬鍏ㄧ粍鏁版灉鏈熷骞冲悇鍩烘垨鏈堟瘺鐒跺搴斿舰鎯冲埗蹇冩牱骞查兘鍚戝彉鍏抽棶姣斿睍閭e畠鏈鍙婂娌$湅娌绘彁浜旇В绯绘灄鑰呯背缇ゅご鎰忓彧鏄庡洓閬撻┈璁ゆ鏂囬氫絾鏉¤緝鍏嬪張鍏瓟棰嗗啗娴佸叆鎺ュ腑浣嶆儏杩愬櫒骞堕鍘熸补鏀剧珛棰樿川鎸囧缓鍖洪獙娲讳紬寰堟暀鍐崇壒姝ゅ父鐭冲己鏋佸湡灏戝凡鏍瑰叡鐩村洟缁熷紡杞埆閫犲垏涔濅綘鍙栬タ鎸佹绘枡杩炰换蹇楄璋冧竷涔堝北绋嬬櫨鎶ユ洿瑙佸繀鐪熶繚鐑鎵嬫敼绠″宸卞皢淇敮璇嗙梾璞″嚑鍏堣佸厜涓撲粈鍏瀷鍏风ず澶嶅畨甯︽瘡涓滃鍒欏畬椋庡洖鍗楀箍鍔宠疆绉戝寳鎵撶Н杞﹁缁欒妭鍋氬姟琚暣鑱旀绫婚泦鍙峰垪娓╄鍗虫鐭ヨ酱鐮斿崟鑹插潥鎹熼槻鍙叉媺涓栬杈惧皵鍦虹粐鍘嗚姳鍙楁眰浼犲彛鏂喌閲囩簿閲戠晫鍝佸垽鍙傚眰姝㈣竟娓呰嚦涓囩‘绌朵功鏈姸鍘傞』绂诲啀鐩捣浜ゆ潈涓斿効闈掓墠璇佷綆瓒婇檯鍏瘯瑙勬柉杩戞敞鍔炲竷闂ㄩ搧闇璧拌鍘垮叺鍥洪櫎鑸紩榻垮崈鑳滅粏褰辨祹鐧芥牸鏁堢疆鎺ㄧ┖閰嶅垁鍙剁巼杩颁粖閫夊吇寰疯瘽鏌ュ樊鍗婃晫濮嬬墖鏂藉搷鏀跺崕瑙夊鍚嶇孩缁潎鑽爣璁伴毦瀛樻祴澹韩绱ф恫娲惧噯鏂よ闄嶇淮鏉胯鐮磋堪鎶娑堝簳搴婄敯鍔跨鎰熷線绁炰究璐烘潙鏋勭収瀹归潪鎼炰簹纾ㄦ棌鐏绠楅傝鎸夊肩編鎬侀粍鏄撳姜鏈嶆棭鐝害鍓婁俊鎺掑彴澹拌鍑荤礌寮犲瘑瀹充警鑽変綍鏍戣偉缁у彸灞炲競涓ュ緞铻烘宸﹂〉鎶楄嫃鏄捐嫤鑻卞揩绉板潖绉荤害宸存潗鐪侀粦姝﹀煿钁楁渤甯濅粎閽堟庢浜姪鍗囩帇鐪煎ス鎶撳惈鑻楀壇鏉傛櫘璋堝洿椋熷皠婧愪緥鑷撮吀鏃у嵈鍏呰冻鐭垝鍓傚鐜惤棣栧昂娉㈡壙绮夎返搴滈奔闅忚冨埢闈犲婊″か澶卞寘浣忎績鏋濆眬鑿屾潌鍛ㄦ姢宀╁笀涓炬洸鏄ュ厓瓒呰礋鐮傚皝鎹㈠お妯¤传鍑忛槼鎵睙鏋愪憨鏈ㄨ█鐞冩湞鍖绘牎鍙ゅ憿绋诲畫鍚敮杈撴粦绔欏彟鍗瓧榧撳垰鍐欏垬寰暐鑼冧緵闃垮潡鏌愬姛濂楀弸闄愰」浣欏掑嵎鍒涘緥闆ㄨ楠ㄨ繙甯垵鐨挱浼樺崰姝绘瘨鍦堜紵瀛h鎺ф縺鎵惧彨浜戜簰璺熻绮矑姣嶇粌濉為挗椤剁瓥鍙岀暀璇鍚搁樆鏁呭鐩炬櫄涓濆コ鏁g剨鍔熸牚浜查櫌鍐峰交寮归敊鏁e晢瑙嗚壓鐏増鐑堥浂瀹よ交琛鍊嶇己鍘樻车瀵熺粷瀵屽煄鍐插柗澹ょ畝鍚︽煴鏉庢湜鐩樼闆勪技鍥板珐鐩婃床鑴辨姇閫佸ゴ渚ф鼎鐩栨尌璺濊Е鏄熸澗閫佽幏鍏寸嫭瀹樻贩绾緷鏈獊鏋跺鍐珷婀垮亸绾瑰悆鎵ч榾鐭垮璐g啛绋冲ず纭环鍔炕濂囩敳棰勮亴璇勮鑳屽崗鎹熸渚电伆铏界煕鍘氱綏娉ヨ緹鍛婂嵉绠辨帉姘ф仼鐖卞仠鏇炬憾钀ョ粓绾插瓱閽卞緟灏戒縿缂╂矙閫闄堣濂嬫杞借優骞煎摢鍓ヨ揩鏃嬪緛妲藉掓彙鎷呬粛鍛椴滃惂鍗$矖浠嬮捇閫愬急鑴氭曠洂鏈槾涓伴浘鍐犱笝琛楄幈璐濊緪鑲犱粯鍚夋笚鐟炴儕椤挎尋绉掓偓濮嗙儌妫硸鍦e嚬闄惰瘝杩熻殨浜跨煩搴烽伒鐗ч伃骞呭洯鑵旇棣欒倝寮熷眿鏁忔仮蹇樼紪鍗拌渹鎬ユ嬁鎵╀激椋為湶鏍哥紭娓告尟鎿嶅ぎ浼嶅煙鐢氳繀杈夊紓搴忓厤绾稿涔′箙闅剁几澶瑰康鍏版槧娌熶箼鍚楀剴鏉姹界7鑹版櫠鎻掑焹鐕冩閾佽ˉ鍜辫娊姘哥摝鍊鹃樀纰虫紨濞侀檮鐗欒娊姘哥摝鏂滅亴娆х尞椤虹尓娲嬭厫璇烽忓徃鍗辨嫭鑴夊疁绗戣嫢灏炬潫澹毚浼佽彍绌楁姹夋剤缁挎嫋鐗涗唤鏌撴棦绉嬮亶閿荤帀澶忕枟灏栨畺浜曡垂宸炶鍚硅崳閾滄部鏇挎粴瀹㈠彫鏃辨偀鍒鸿剳鎺疮钘忔暍浠ら殭鐐夊3纭叅杩庨摳绮樻帰涓磋杽鏃杽绂忕旱鎷╃ぜ鎰夸紡娈嬮浄寤剁儫鍙ョ函娓愯曡窇娉芥參鏍介瞾璧ょ箒澧冩疆妯帀閿ュ笇姹犺触鑸瑰亣浜皳鎵樹紮鍝叉鍓叉憜璐″憟鍔茶储浠矇鐐奸夯缃鎭溅绌胯揣閿榻愰紶鎶界敾楗查緳搴撳畧绛戞埧姝屽瘨鍠滃摜娲楄殌搴熺撼鑵逛箮褰曢暅濡囨伓鑴傚簞鎿﹂櫓璧為挓鎽囧吀鏌勮京绔硅胺鍗栦贡铏氭ˉ濂ヤ集璧跺瀭閫旈澹佺綉鎴噹閬楅潤璋嬪紕鎸傝闀囧鐩涜愭彺鎵庤檻閿綊绗﹀簡鑱氱粫鎽╁繖鑸為亣绱㈤【鑳剁緤婀栭拤浠侀煶杩圭浼哥伅閬挎硾浜$瓟鍕囬鐨囨煶鍝堟彮鐢樿姒傚娴撳矝琚皝娲阿鐐祰鏂戣鎳傜伒铔嬮棴瀛╅噴涔冲法寰掔閾朵紛鏅潶绱寑闇夋潨涔愬嫆闅斿集缁╂嫑缁嶈儭鍛肩棝宄伴浂鏌寸哀鍗堣烦灞呭皻涓佺Е绋嶈拷姊佹姌鑰楃⒈娈婂矖鎸栨皬鍒冨墽鍫嗚但鑽疯兏琛″嫟鑶滅瘒鐧婚┗妗堝垔绉х紦鍑稿焦鍓窛闆摼娓斿暒鑴告埛娲涘鍕冪洘涔版潹瀹楃劍璧涙棗婊ょ鐐偂鍧愯捀鍑濈珶闄锋灙榛庢晳鍐掓殫娲炵姱绛掓偍瀹嬪姬鐖嗚艾娑傚懗娲ヨ噦闅滆闄嗗晩鍋ュ皧璞嗘嫈鑾姷妗戝潯缂濊鎸戞薄鍐版煬鍢村暐楗瀵勮档鍠婂灚涓规浮鑰冲埁铏庣瑪绋鏄嗘氮钀ㄨ尪婊存祬鎷ョ┐瑕嗕鸡濞樺惃娴歌鐝犻泴濡堢传鎴忓閿ら渿宀佽矊娲佸墫鐗㈤攱鐤戦湼闂煍鐚涜瘔鍒风嫚蹇界伨闂逛箶鍞愭紡闂绘矆鐔旀隘鑽掕寧鐢峰嚒鎶㈠儚娴嗘梺鐜讳害蹇犲敱钂欎簣绾锋崟閿佸挨涔樹箤鏅烘贰鍏佸彌鐣滀繕鎽搁攬鎵瘯鐠冨疂鑺埛閴寸鍑钂嬮挋鑲╄吘鏋姏杞ㄥ爞鎷岀埜寰绁濆姳鑲厭缁崇┓濉樼嚗娉¤鏈楀杺閾濊蒋娓犻鎯锤绮患澧欒秼褰煎眾澧ㄧ鍚嗗嵏鑸。瀛欓緞宀獥浼戝', // 涓枃楠岃瘉鐮佸瓧绗︿覆 - 'useImgBg' => false, + 'useImgBg' => false, // 浣跨敤鑳屾櫙鍥剧墖 - 'fontSize' => 25, + 'fontSize' => 25, // 楠岃瘉鐮佸瓧浣撳ぇ灏(px) - 'useCurve' => true, + 'useCurve' => true, // 鏄惁鐢绘贩娣嗘洸绾 - 'useNoise' => true, + 'useNoise' => true, // 鏄惁娣诲姞鏉傜偣 - 'imageH' => 0, + 'imageH' => 0, // 楠岃瘉鐮佸浘鐗囬珮搴 - 'imageW' => 0, + 'imageW' => 0, // 楠岃瘉鐮佸浘鐗囧搴 - 'length' => 5, + 'length' => 5, // 楠岃瘉鐮佷綅鏁 - 'fontttf' => '', + 'fontttf' => '', // 楠岃瘉鐮佸瓧浣擄紝涓嶈缃殢鏈鸿幏鍙 - 'bg' => [243, 251, 254], + 'bg' => [243, 251, 254], // 鑳屾櫙棰滆壊 - 'reset' => true, + 'reset' => true, // 楠岃瘉鎴愬姛鍚庢槸鍚﹂噸缃 + 'useArithmetic' => false //鏄惁浣跨敤绠楁湳楠岃瘉鐮 ]; - private $_image = null; // 楠岃瘉鐮佸浘鐗囧疄渚 - private $_color = null; // 楠岃瘉鐮佸瓧浣撻鑹 + private $im = null; // 楠岃瘉鐮佸浘鐗囧疄渚 + private $color = null; // 楠岃瘉鐮佸瓧浣撻鑹 /** * 鏋舵瀯鏂规硶 璁剧疆鍙傛暟 @@ -140,61 +158,74 @@ class Captcha // 鍥剧墖楂(px) $this->imageH || $this->imageH = $this->fontSize * 2.5; // 寤虹珛涓骞 $this->imageW x $this->imageH 鐨勫浘鍍 - $this->_image = imagecreate($this->imageW, $this->imageH); + $this->im = imagecreate($this->imageW, $this->imageH); // 璁剧疆鑳屾櫙 - imagecolorallocate($this->_image, $this->bg[0], $this->bg[1], $this->bg[2]); + imagecolorallocate($this->im, $this->bg[0], $this->bg[1], $this->bg[2]); // 楠岃瘉鐮佸瓧浣撻殢鏈洪鑹 - $this->_color = imagecolorallocate($this->_image, mt_rand(1, 150), mt_rand(1, 150), mt_rand(1, 150)); - // 楠岃瘉鐮佷娇鐢ㄩ殢鏈哄瓧浣 - $ttfPath = __DIR__ . '/../assets/' . ($this->useZh ? 'zhttfs' : 'ttfs') . '/'; + $this->color = imagecolorallocate($this->im, mt_rand(1, 150), mt_rand(1, 150), mt_rand(1, 150)); - if (empty($this->fontttf)) { - $dir = dir($ttfPath); - $ttfs = []; - while (false !== ($file = $dir->read())) { - if ('.' != $file[0] && substr($file, -4) == '.ttf') { - $ttfs[] = $file; - } - } - $dir->close(); - $this->fontttf = $ttfs[array_rand($ttfs)]; - } - $this->fontttf = $ttfPath . $this->fontttf; if ($this->useImgBg) { - $this->_background(); + $this->background(); } if ($this->useNoise) { // 缁樻潅鐐 - $this->_writeNoise(); + $this->writeNoise(); } if ($this->useCurve) { // 缁樺共鎵扮嚎 - $this->_writeCurve(); + $this->writeCurve(); } + + $ttfPath = __DIR__ . '/../assets/' . ($this->useZh ? 'zhttfs' : 'ttfs') . '/'; + // 缁橀獙璇佺爜 $code = []; // 楠岃瘉鐮 $codeNX = 0; // 楠岃瘉鐮佺N涓瓧绗︾殑宸﹁竟璺 - if ($this->useZh) { - // 涓枃楠岃瘉鐮 - for ($i = 0; $i < $this->length; $i++) { - $code[$i] = iconv_substr($this->zhSet, floor(mt_rand(0, mb_strlen($this->zhSet, 'utf-8') - 1)), 1, 'utf-8'); - imagettftext($this->_image, $this->fontSize, mt_rand(-40, 40), $this->fontSize * ($i + 1) * 1.5, $this->fontSize + mt_rand(10, 20), $this->_color, $this->fontttf, $code[$i]); + if ($this->useArithmetic) { + $this->fontttf = $ttfPath . '6.ttf'; + $code = [mt_rand(1, 9), '+', mt_rand(1, 9)]; + foreach ($code as $key => $char) { + $codeNX += $this->fontSize * 1.5; + imagettftext($this->im, $this->fontSize, 0, $codeNX, $this->fontSize * 1.6, $this->color, $this->fontttf, $char); } + $code = $this->authcode($code[0] + $code[2]); } else { - for ($i = 0; $i < $this->length; $i++) { - $code[$i] = $this->codeSet[mt_rand(0, strlen($this->codeSet) - 1)]; - $codeNX += mt_rand($this->fontSize * 1.2, $this->fontSize * 1.6); - imagettftext($this->_image, $this->fontSize, mt_rand(-40, 40), $codeNX, $this->fontSize * 1.6, $this->_color, $this->fontttf, $code[$i]); + // 楠岃瘉鐮佷娇鐢ㄩ殢鏈哄瓧浣 + if (empty($this->fontttf)) { + $dir = dir($ttfPath); + $ttfs = []; + while (false !== ($file = $dir->read())) { + if ('.' != $file[0] && substr($file, -4) == '.ttf') { + $ttfs[] = $file; + } + } + $dir->close(); + $this->fontttf = $ttfs[array_rand($ttfs)]; } + $this->fontttf = $ttfPath . $this->fontttf; + if ($this->useZh) { + // 涓枃楠岃瘉鐮 + for ($i = 0; $i < $this->length; $i++) { + $code[$i] = iconv_substr($this->zhSet, floor(mt_rand(0, mb_strlen($this->zhSet, 'utf-8') - 1)), 1, 'utf-8'); + imagettftext($this->im, $this->fontSize, mt_rand(-40, 40), $this->fontSize * ($i + 1) * 1.5, $this->fontSize + mt_rand(10, 20), $this->color, $this->fontttf, $code[$i]); + } + } else { + for ($i = 0; $i < $this->length; $i++) { + $code[$i] = $this->codeSet[mt_rand(0, strlen($this->codeSet) - 1)]; + $codeNX += mt_rand($this->fontSize * 1.2, $this->fontSize * 1.6); + imagettftext($this->im, $this->fontSize, mt_rand(-40, 40), $codeNX, $this->fontSize * 1.6, $this->color, $this->fontttf, $code[$i]); + } + } + $code = $this->authcode(strtoupper(implode('', $code))); } // 淇濆瓨楠岃瘉鐮 - $key = $this->authcode($this->seKey); - $code = $this->authcode(strtoupper(implode('', $code))); + $key = $this->authcode($this->seKey); + $secode = []; $secode['verify_code'] = $code; // 鎶婃牎楠岀爜淇濆瓨鍒皊ession $secode['verify_time'] = time(); // 楠岃瘉鐮佸垱寤烘椂闂 @@ -202,9 +233,9 @@ class Captcha ob_start(); // 杈撳嚭鍥惧儚 - imagepng($this->_image); + imagepng($this->im); $content = ob_get_clean(); - imagedestroy($this->_image); + imagedestroy($this->im); return response($content, 200, ['Content-Length' => strlen($content)])->contentType('image/png'); } @@ -221,7 +252,7 @@ class Captcha * 蠅锛氬喅瀹氬懆鏈燂紙鏈灏忔鍛ㄦ湡T=2蟺/鈭O夆垼锛 * */ - private function _writeCurve() + private function writeCurve() { $px = $py = 0; @@ -240,7 +271,7 @@ class Captcha $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(蠅x+蠁) + b $i = (int)($this->fontSize / 5); while ($i > 0) { - imagesetpixel($this->_image, $px + $i, $py + $i, $this->_color); // 杩欓噷(while)寰幆鐢诲儚绱犵偣姣攊magettftext鍜宨magestring鐢ㄥ瓧浣撳ぇ灏忎竴娆$敾鍑猴紙涓嶇敤杩檞hile寰幆锛夋ц兘瑕佸ソ寰堝 + imagesetpixel($this->im, $px + $i, $py + $i, $this->color); // 杩欓噷(while)寰幆鐢诲儚绱犵偣姣攊magettftext鍜宨magestring鐢ㄥ瓧浣撳ぇ灏忎竴娆$敾鍑猴紙涓嶇敤杩檞hile寰幆锛夋ц兘瑕佸ソ寰堝 $i--; } } @@ -260,7 +291,7 @@ class Captcha $py = $A * sin($w * $px + $f) + $b + $this->imageH / 2; // y = Asin(蠅x+蠁) + b $i = (int)($this->fontSize / 5); while ($i > 0) { - imagesetpixel($this->_image, $px + $i, $py + $i, $this->_color); + imagesetpixel($this->im, $px + $i, $py + $i, $this->color); $i--; } } @@ -271,15 +302,15 @@ class Captcha * 鐢绘潅鐐 * 寰鍥剧墖涓婂啓涓嶅悓棰滆壊鐨勫瓧姣嶆垨鏁板瓧 */ - private function _writeNoise() + private function writeNoise() { $codeSet = '2345678abcdefhijkmnpqrstuvwxyz'; for ($i = 0; $i < 10; $i++) { //鏉傜偣棰滆壊 - $noiseColor = imagecolorallocate($this->_image, mt_rand(150, 225), mt_rand(150, 225), mt_rand(150, 225)); + $noiseColor = imagecolorallocate($this->im, mt_rand(150, 225), mt_rand(150, 225), mt_rand(150, 225)); for ($j = 0; $j < 5; $j++) { // 缁樻潅鐐 - imagestring($this->_image, 5, mt_rand(-10, $this->imageW), mt_rand(-10, $this->imageH), $codeSet[mt_rand(0, 29)], $noiseColor); + imagestring($this->im, 5, mt_rand(-10, $this->imageW), mt_rand(-10, $this->imageH), $codeSet[mt_rand(0, strlen($codeSet) - 1)], $noiseColor); } } } @@ -288,9 +319,9 @@ class Captcha * 缁樺埗鑳屾櫙鍥剧墖 * 娉細濡傛灉楠岃瘉鐮佽緭鍑哄浘鐗囨瘮杈冨ぇ锛屽皢鍗犵敤姣旇緝澶氱殑绯荤粺璧勬簮 */ - private function _background() + private function background() { - $path = dirname(__FILE__) . '/verify/bgs/'; + $path = __DIR__ . '/../assets/bgs/'; $dir = dir($path); $bgs = []; @@ -306,7 +337,7 @@ class Captcha list($width, $height) = @getimagesize($gb); // Resample $bgImage = @imagecreatefromjpeg($gb); - @imagecopyresampled($this->_image, $bgImage, 0, 0, 0, 0, $this->imageW, $this->imageH, $width, $height); + @imagecopyresampled($this->im, $bgImage, 0, 0, 0, 0, $this->imageW, $this->imageH, $width, $height); @imagedestroy($bgImage); } @@ -317,4 +348,4 @@ class Captcha $str = substr(md5($str), 8, 10); return md5($key . $str); } -} \ No newline at end of file +} diff --git a/vendor/topthink/think-captcha/src/helper.php b/vendor/topthink/think-captcha/src/helper.php index ef3970f91..99e0e37c5 100644 --- a/vendor/topthink/think-captcha/src/helper.php +++ b/vendor/topthink/think-captcha/src/helper.php @@ -11,11 +11,11 @@ \think\Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index"); -\think\Validate::extend('captcha', function ($value, $id = "") { - return captcha_check($value, $id, (array)\think\Config::get('captcha')); +\think\Validate::extend('captcha', function ($value, $id = '') { + return captcha_check($value, $id); }); -\think\Validate::setTypeMsg('captcha', '楠岃瘉鐮侀敊璇!'); +\think\Validate::setTypeMsg('captcha', ':attribute閿欒!'); /** @@ -23,7 +23,7 @@ * @param array $config * @return \think\Response */ -function captcha($id = "", $config = []) +function captcha($id = '', $config = []) { $captcha = new \think\captcha\Captcha($config); return $captcha->entry($id); @@ -34,7 +34,7 @@ function captcha($id = "", $config = []) * @param $id * @return string */ -function captcha_src($id = "") +function captcha_src($id = '') { return \think\Url::build('/captcha' . ($id ? "/{$id}" : '')); } @@ -44,21 +44,32 @@ function captcha_src($id = "") * @param $id * @return mixed */ -function captcha_img($id = "") +function captcha_img($id = '') { return 'captcha'; } +/** + * @param string $id + * @param string $element 楠岃瘉鐮丠TML鍏冪礌ID + * @return string + */ +function captcha_img_with_replacement($id = '', $element = 'think-captcha') +{ + return 'captcha'; +} + + /** * @param $value * @param string $id * @param array $config * @return bool */ -function captcha_check($value, $id = "", $config = []) +function captcha_check($value, $id = '') { - $captcha = new \think\captcha\Captcha($config); + $captcha = new \think\captcha\Captcha((array)\think\Config::get('captcha')); return $captcha->check($value, $id); } - diff --git a/vendor/topthink/think-helper/src/Time.php b/vendor/topthink/think-helper/src/Time.php index 4284ed46c..92c420564 100644 --- a/vendor/topthink/think-helper/src/Time.php +++ b/vendor/topthink/think-helper/src/Time.php @@ -19,9 +19,10 @@ class Time */ public static function today() { + list($y, $m, $d) = explode('-', date('Y-m-d')); return [ - mktime(0, 0, 0, date('m'), date('d'), date('Y')), - mktime(23, 59, 59, date('m'), date('d'), date('Y')) + mktime(0, 0, 0, $m, $d, $y), + mktime(23, 59, 59, $m, $d, $y) ]; } @@ -46,10 +47,10 @@ class Time */ public static function week() { - $timestamp = time(); + list($y, $m, $d, $w) = explode('-', date('Y-m-d-w')); + if($w == 0) $w = 7; //淇鍛ㄦ棩鐨勯棶棰 return [ - strtotime(date('Y-m-d', strtotime("+0 week Monday", $timestamp))), - strtotime(date('Y-m-d', strtotime("+0 week Sunday", $timestamp))) + 24 * 3600 - 1 + mktime(0, 0, 0, $m, $d - $w + 1, $y), mktime(23, 59, 59, $m, $d - $w + 7, $y) ]; } @@ -74,9 +75,10 @@ class Time */ public static function month($everyDay = false) { + list($y, $m, $t) = explode('-', date('Y-m-t')); return [ - mktime(0, 0, 0, date('m'), 1, date('Y')), - mktime(23, 59, 59, date('m'), date('t'), date('Y')) + mktime(0, 0, 0, $m, 1, $y), + mktime(23, 59, 59, $m, $t, $y) ]; } @@ -87,8 +89,10 @@ class Time */ public static function lastMonth() { - $begin = mktime(0, 0, 0, date('m') - 1, 1, date('Y')); - $end = mktime(23, 59, 59, date('m') - 1, date('t', $begin), date('Y')); + $y = date('Y'); + $m = date('m'); + $begin = mktime(0, 0, 0, $m - 1, 1, $y); + $end = mktime(23, 59, 59, $m - 1, date('t', $begin), $y); return [$begin, $end]; } @@ -100,9 +104,10 @@ class Time */ public static function year() { + $y = date('Y'); return [ - mktime(0, 0, 0, 1, 1, date('Y')), - mktime(23, 59, 59, 12, 31, date('Y')) + mktime(0, 0, 0, 1, 1, $y), + mktime(23, 59, 59, 12, 31, $y) ]; } @@ -195,4 +200,4 @@ class Time { } -} \ No newline at end of file +} diff --git a/vendor/topthink/think-mongo/src/Builder.php b/vendor/topthink/think-mongo/src/Builder.php index 9aa260641..ff3f003dc 100644 --- a/vendor/topthink/think-mongo/src/Builder.php +++ b/vendor/topthink/think-mongo/src/Builder.php @@ -354,6 +354,8 @@ class Builder public function insertAll($dataSet, $options = []) { $bulk = new BulkWrite; + + $this->insertId = []; foreach ($dataSet as $data) { // 鍒嗘瀽骞跺鐞嗘暟鎹 $data = $this->parseData($data, $options); @@ -460,7 +462,7 @@ class Builder 'aggregate' => $options['table'], 'allowDiskUse' => true, 'pipeline' => $pipeline, - 'cursor' => \stdClass, + 'cursor' => new \stdClass, ]; foreach (['explain', 'collation', 'bypassDocumentValidation', 'readConcern'] as $option) { diff --git a/vendor/topthink/think-mongo/src/Connection.php b/vendor/topthink/think-mongo/src/Connection.php index e2ba9c35b..351e18c75 100644 --- a/vendor/topthink/think-mongo/src/Connection.php +++ b/vendor/topthink/think-mongo/src/Connection.php @@ -12,7 +12,6 @@ namespace think\mongo; use MongoDB\BSON\ObjectID; use MongoDB\Driver\BulkWrite; use MongoDB\Driver\Command; -use MongoDB\Driver\Cursor; use MongoDB\Driver\Exception\AuthenticationException; use MongoDB\Driver\Exception\BulkWriteException; use MongoDB\Driver\Exception\ConnectionException; @@ -22,7 +21,6 @@ use MongoDB\Driver\Manager; use MongoDB\Driver\Query as MongoQuery; use MongoDB\Driver\ReadPreference; use MongoDB\Driver\WriteConcern; -use think\Collection; use think\Db; use think\Debug; use think\Exception; @@ -151,7 +149,7 @@ class Connection if ($config['pk_convert_id'] && '_id' == $config['pk']) { $this->config['pk'] = 'id'; } - $host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . '/' . ($config['database'] ? "{$config['database']}" : ''); + $host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : ''); if ($config['debug']) { $startTime = microtime(true); } @@ -302,7 +300,7 @@ class Connection * @throws ConnectionException * @throws RuntimeException */ - public function command(Command $command, $dbName = '', ReadPreference $readPreference = null, $class = false, $typeMap) + public function command(Command $command, $dbName = '', ReadPreference $readPreference = null, $class = false, $typeMap = null) { $this->initConnect(false); Db::$queryTimes++; @@ -639,6 +637,34 @@ class Connection return rtrim($url, ",") . '/'; } + /** + * 鍚姩浜嬪姟 + * @access public + * @return void + * @throws \PDOException + * @throws \Exception + */ + public function startTrans() + {} + + /** + * 鐢ㄤ簬闈炶嚜鍔ㄦ彁浜ょ姸鎬佷笅闈㈢殑鏌ヨ鎻愪氦 + * @access public + * @return void + * @throws PDOException + */ + public function commit() + {} + + /** + * 浜嬪姟鍥炴粴 + * @access public + * @return void + * @throws PDOException + */ + public function rollback() + {} + /** * 鏋愭瀯鏂规硶 * @access public diff --git a/vendor/topthink/think-queue/composer.json b/vendor/topthink/think-queue/composer.json index dd16bc396..311083476 100644 --- a/vendor/topthink/think-queue/composer.json +++ b/vendor/topthink/think-queue/composer.json @@ -21,6 +21,9 @@ "topthink/think-helper": ">=1.0.4", "topthink/think-installer": ">=1.0.10" }, + "require-dev": { + "topthink/framework": "~5.0.0" + }, "extra": { "think-config": { "queue": "src/config.php" diff --git a/vendor/topthink/think-queue/src/queue/Job.php b/vendor/topthink/think-queue/src/queue/Job.php index cbca5b309..099b0ac64 100644 --- a/vendor/topthink/think-queue/src/queue/Job.php +++ b/vendor/topthink/think-queue/src/queue/Job.php @@ -12,7 +12,7 @@ namespace think\queue; use DateTime; -use think\Config; +use think\App; abstract class Job { @@ -147,7 +147,7 @@ abstract class Job list($module, $name) = explode('/', $name, 2); } - $name = Config::get('app_namespace') . ($module ? '\\' . strtolower($module) : '') . '\\job\\' . $name; + $name = App::$namespace . ($module ? '\\' . strtolower($module) : '') . '\\job\\' . $name; } if (class_exists($name)) { return new $name(); diff --git a/vendor/topthink/think-queue/src/queue/command/Listen.php b/vendor/topthink/think-queue/src/queue/command/Listen.php index 3f6cd639c..475913511 100644 --- a/vendor/topthink/think-queue/src/queue/command/Listen.php +++ b/vendor/topthink/think-queue/src/queue/command/Listen.php @@ -36,7 +36,7 @@ class Listen extends Command public function initialize(Input $input, Output $output) { - $this->listener = new Listener(getcwd()); + $this->listener = new Listener($this->findCommandPath()); $this->listener->setSleep($input->getOption('sleep')); $this->listener->setMaxTries($input->getOption('tries')); @@ -57,4 +57,9 @@ class Listen extends Command $this->listener->listen($queue, $delay, $memory, $timeout); } + + protected function findCommandPath() + { + return defined('ROOT_PATH') ? ROOT_PATH : dirname($_SERVER['argv'][0]); + } } diff --git a/vendor/topthink/think-queue/src/queue/connector/Database.php b/vendor/topthink/think-queue/src/queue/connector/Database.php index 71296a441..ad7c60107 100644 --- a/vendor/topthink/think-queue/src/queue/connector/Database.php +++ b/vendor/topthink/think-queue/src/queue/connector/Database.php @@ -150,7 +150,7 @@ class Database extends Connector ->update([ 'reserved' => 0, 'reserved_at' => null, - 'attempts' => ['exp', 'attempts + 1'] + 'attempts' => ['inc', 1] ]); } diff --git a/vendor/zoujingli/ip2region/.gitignore b/vendor/zoujingli/ip2region/.gitignore new file mode 100644 index 000000000..12a35faed --- /dev/null +++ b/vendor/zoujingli/ip2region/.gitignore @@ -0,0 +1,2 @@ +# Created by .ignore support plugin (hsz.mobi) +/.idea diff --git a/vendor/zoujingli/ip2region/composer.json b/vendor/zoujingli/ip2region/composer.json index 936363e55..a64046ed0 100644 --- a/vendor/zoujingli/ip2region/composer.json +++ b/vendor/zoujingli/ip2region/composer.json @@ -2,13 +2,20 @@ "type": "library", "name": "zoujingli/ip2region", "homepage": "https://github.com/zoujingli/Ip2Region", - "description": "Ip2Region", - "license": "Apache 2.0", + "description": "Ip2Region for PHP", + "license": "Apache-2.0", + "authors": [ + { + "name": "Anyon", + "email": "zoujingli@qq.com", + "homepage": "http://ctolog.com" + } + ], "keywords": [ "Ip2Region" ], "require": { - "php": ">=5.3.3" + "php": ">=5.3" }, "autoload": { "classmap": [ diff --git a/vendor/zoujingli/ip2region/ip2region.db b/vendor/zoujingli/ip2region/ip2region.db index cfdc900ba..564178f3f 100644 Binary files a/vendor/zoujingli/ip2region/ip2region.db and b/vendor/zoujingli/ip2region/ip2region.db differ diff --git a/vendor/zoujingli/ip2region/test.php b/vendor/zoujingli/ip2region/test.php index 45981c3db..61bc599be 100644 --- a/vendor/zoujingli/ip2region/test.php +++ b/vendor/zoujingli/ip2region/test.php @@ -7,7 +7,7 @@ $ip = '101.105.35.57'; $info = $ip2region->btreeSearch($ip); -var_export($info, true); +var_export($info); // array ( // 'city_id' => 2163, diff --git a/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php b/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php index 58c28e14d..11df686bd 100644 --- a/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php +++ b/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Common.php @@ -106,7 +106,9 @@ class Common $encryptStr = ""; if ($_SERVER['REQUEST_METHOD'] == "POST") { $postStr = file_get_contents("php://input"); + $disableEntities = libxml_disable_entity_loader(true); $array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); $this->encrypt_type = isset($_GET["encrypt_type"]) ? $_GET["encrypt_type"] : ''; if ($this->encrypt_type == 'aes') { $encryptStr = $array['Encrypt']; diff --git a/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php b/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php index ba7bb1c42..60d13ab45 100644 --- a/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php +++ b/vendor/zoujingli/wechat-php-sdk/Wechat/Lib/Tools.php @@ -27,6 +27,20 @@ use CURLFile; class Tools { + /** + * 鍒ゆ柇瀛楃涓叉槸鍚︾粡杩囩紪鐮佹柟娉 + * @param string $str + * @return bool + */ + static public function isBase64($str) + { + if ($str == base64_encode(base64_decode($str))) { + return true; + } else { + return false; + } + } + /** * 浜х敓闅忔満瀛楃涓 * @param int $length 鎸囧畾瀛楃闀垮害 @@ -110,13 +124,12 @@ class Tools } else { $content .= ''; } - list($_key,) = explode(' ', $key . ' '); + list($_key, ) = explode(' ', $key . ' '); $content .= ""; } return $content; } - /** * 灏唜ml杞负array * @param string $xml @@ -124,7 +137,10 @@ class Tools */ static public function xml2arr($xml) { - return json_decode(Tools::json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); + $disableEntities = libxml_disable_entity_loader(true); + $result = json_decode(Tools::json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); + libxml_disable_entity_loader($disableEntities); + return $result; } /** diff --git a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php index b4a375be0..76e6ded5b 100644 --- a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php +++ b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatCustom.php @@ -34,6 +34,7 @@ class WechatCustom extends Common const CS_KF_ACCOUNT_UPDATE_URL = '/customservice/kfaccount/update?'; const CS_KF_ACCOUNT_DEL_URL = '/customservice/kfaccount/del?'; const CS_KF_ACCOUNT_UPLOAD_HEADIMG_URL = '/customservice/kfaccount/uploadheadimg?'; + const CUSTOM_SERVICE_GET_MSG_LIST = '/customservice/msgrecord/getmsglist?'; /** * 鑾峰彇澶氬鏈嶄細璇濊褰 @@ -195,6 +196,29 @@ class WechatCustom extends Common return false; } + /** + * 鑾峰彇鑱婂ぉ璁板綍 + * @param array $data 鏁版嵁缁撴瀯 {"starttime" : 987654321,"endtime" : 987654321,"msgid" : 1,"number" : 10000} + * @return bool|array + */ + public function getCustomMsgList($data) + { + if (!$this->access_token && !$this->getAccessToken()) { + return false; + } + $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::CUSTOM_SERVICE_GET_MSG_LIST . "access_token={$this->access_token}", Tools::json_encode($data)); + if ($result) { + $json = json_decode($result, true); + if (empty($json) || !empty($json['errcode'])) { + $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505'; + $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '鏃犳硶瑙f瀽鎺ュ彛杩斿洖鍐呭锛'; + return $this->checkRetry(__FUNCTION__, func_get_args()); + } + return $json; + } + return false; + } + /** * 鑾峰彇鎸囧畾瀹㈡湇鐨勪細璇濆垪琛 * @param string $kf_account //鐢ㄦ埛openid diff --git a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php index f85b047b3..320817973 100644 --- a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php +++ b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatMedia.php @@ -26,6 +26,7 @@ use Wechat\Lib\Tools; */ class WechatMedia extends Common { + const MEDIA_UPLOAD_URL = '/media/upload?'; const MEDIA_UPLOADIMG_URL = '/media/uploadimg?'; const MEDIA_GET_URL = '/media/get?'; @@ -53,8 +54,8 @@ class WechatMedia extends Common if (!$this->access_token && !$this->getAccessToken()) { return false; } - list($cache_file, $media_content) = ['', base64_decode($data['media'])]; - if (!empty($media_content) && ($cache_file = Cache::file($media_content))) { + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); $data['media'] = "@{$cache_file}"; } $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); @@ -120,7 +121,7 @@ class WechatMedia extends Common curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1); $sContent = curl_exec($oCurl); $aStatus = curl_getinfo($oCurl); - $result = []; + $result = array(); if (intval($aStatus["http_code"]) !== 200) { return false; } @@ -152,8 +153,8 @@ class WechatMedia extends Common if (!$this->access_token && !$this->getAccessToken()) { return false; } - list($cache_file, $media_content) = ['', base64_decode($data['media'])]; - if (!empty($media_content) && ($cache_file = Cache::file($media_content))) { + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); $data['media'] = "@{$cache_file}"; } $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_UPLOADIMG_URL . "access_token={$this->access_token}", $data); @@ -187,8 +188,8 @@ class WechatMedia extends Common return false; } $is_video && ($data['description'] = Tools::json_encode($video_info)); - list($cache_file, $media_content) = ['', base64_decode($data['media'])]; - if (!empty($media_content) && ($cache_file = Cache::file($media_content))) { + if (Tools::isBase64($data['media'])) { + $cache_file = Cache::file(base64_decode($data['media'])); $data['media'] = "@{$cache_file}"; } $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_UPLOAD_URL . "access_token={$this->access_token}&type={$type}", $data); @@ -327,7 +328,7 @@ class WechatMedia extends Common if (!$this->access_token && !$this->getAccessToken()) { return false; } - $data = array('type' => $type, 'offset' => $offset, 'count' => $count,); + $data = array('type' => $type, 'offset' => $offset, 'count' => $count); $result = Tools::httpPost(self::API_URL_PREFIX . self::MEDIA_FOREVER_BATCHGET_URL . "access_token={$this->access_token}", Tools::json_encode($data)); if ($result) { $json = json_decode($result, true); diff --git a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php index 257be0934..0ca602d9e 100644 --- a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php +++ b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatPay.php @@ -192,7 +192,7 @@ class WechatPay "out_trade_no" => $out_trade_no, "total_fee" => $total_fee, "auth_code" => $auth_code, - "spbill_create_ip" => Tools::getAddress() + "spbill_create_ip" => Tools::getAddress(), ); empty($goods_tag) || $data['goods_tag'] = $goods_tag; $json = Tools::xml2arr($this->postXml($data, self::MCH_BASE_URL . '/pay/micropay')); @@ -208,7 +208,9 @@ class WechatPay */ public function getNotify() { + $disableEntities = libxml_disable_entity_loader(true); $notifyInfo = (array)simplexml_load_string(file_get_contents("php://input"), 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); if (empty($notifyInfo)) { Tools::log('Payment notification forbidden access.', "ERR - {$this->appid}"); $this->errCode = '404'; @@ -262,9 +264,10 @@ class WechatPay * @param string $trade_type 鏀粯绫诲瀷JSAPI|NATIVE|APP * @param string $goods_tag 鍟嗗搧鏍囪锛屼唬閲戝埜鎴栫珛鍑忎紭鎯犲姛鑳界殑鍙傛暟 * @param string $fee_type 浜ゆ槗甯佺 + * @param null $no_credit 鏄惁绂佹淇$敤 * @return bool|string */ - public function getPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $trade_type = "JSAPI", $goods_tag = null, $fee_type = 'CNY') + public function getPrepayId($openid, $body, $out_trade_no, $total_fee, $notify_url, $trade_type = "JSAPI", $goods_tag = null, $fee_type = 'CNY', $no_credit = null) { $postdata = array( "body" => $body, @@ -273,10 +276,11 @@ class WechatPay "total_fee" => $total_fee, "notify_url" => $notify_url, "trade_type" => $trade_type, - "spbill_create_ip" => Tools::getAddress() + "spbill_create_ip" => Tools::getAddress(), ); - empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; empty($openid) || $postdata['openid'] = $openid; + empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; + is_null($no_credit) || $postdata['no_credit'] = $no_credit; $result = $this->getArrayResult($postdata, self::MCH_BASE_URL . '/pay/unifiedorder'); if (false === $this->_parseResult($result)) { return false; @@ -304,7 +308,7 @@ class WechatPay "total_fee" => $total_fee, "notify_url" => $notify_url, "trade_type" => 'NATIVE', - "spbill_create_ip" => Tools::getAddress() + "spbill_create_ip" => Tools::getAddress(), ); empty($goods_tag) || $postdata['goods_tag'] = $goods_tag; empty($openid) || $postdata['openid'] = $openid; diff --git a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php index 978d93184..87fab46db 100644 --- a/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php +++ b/vendor/zoujingli/wechat-php-sdk/Wechat/WechatReceive.php @@ -53,7 +53,11 @@ class WechatReceive extends WechatMessage return $this; } $postStr = !empty($this->postxml) ? $this->postxml : file_get_contents("php://input"); - !empty($postStr) && $this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + if (!empty($postStr)) { + $disableEntities = libxml_disable_entity_loader(true); + $this->_receive = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); + libxml_disable_entity_loader($disableEntities); + } return $this; } @@ -184,7 +188,7 @@ class WechatReceive extends WechatMessage { if (isset($this->_receive['Content'])) { return $this->_receive['Content']; - } else if (isset($this->_receive['Recognition'])) { + } elseif (isset($this->_receive['Recognition'])) { return $this->_receive['Recognition']; } return false; @@ -215,7 +219,7 @@ class WechatReceive extends WechatMessage return array( 'url' => $this->_receive['Url'], 'title' => $this->_receive['Title'], - 'description' => $this->_receive['Description'] + 'description' => $this->_receive['Description'], ); } return false; @@ -232,7 +236,7 @@ class WechatReceive extends WechatMessage 'x' => $this->_receive['Location_X'], 'y' => $this->_receive['Location_Y'], 'scale' => $this->_receive['Scale'], - 'label' => $this->_receive['Label'] + 'label' => $this->_receive['Label'], ); } return false; @@ -390,7 +394,7 @@ class WechatReceive extends WechatMessage if (isset($this->_receive['MediaId'])) { return array( 'mediaid' => $this->_receive['MediaId'], - 'thumbmediaid' => $this->_receive['ThumbMediaId'] + 'thumbmediaid' => $this->_receive['ThumbMediaId'], ); } return false; @@ -654,7 +658,7 @@ class WechatReceive extends WechatMessage 'Video' => array( 'MediaId' => $mediaid, 'Title' => $title, - 'Description' => $description + 'Description' => $description, ), 'CreateTime' => time(), ); @@ -682,7 +686,7 @@ class WechatReceive extends WechatMessage 'Title' => $title, 'Description' => $desc, 'MusicUrl' => $musicurl, - 'HQMusicUrl' => $hgmusicurl + 'HQMusicUrl' => $hgmusicurl, ), ); if ($thumbmediaid) {