mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]Composer组件更新
This commit is contained in:
parent
a167b48cb5
commit
9ae12f4efe
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929::getLoader();
|
return ComposerAutoloaderInit100512daef0328603db43c7860e1b81c::getLoader();
|
||||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929
|
class ComposerAutoloaderInit100512daef0328603db43c7860e1b81c
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -19,15 +19,15 @@ class ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929
|
|||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit100512daef0328603db43c7860e1b81c', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInit100512daef0328603db43c7860e1b81c', 'loadClassLoader'));
|
||||||
|
|
||||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
||||||
if ($useStaticLoader) {
|
if ($useStaticLoader) {
|
||||||
require_once __DIR__ . '/autoload_static.php';
|
require_once __DIR__ . '/autoload_static.php';
|
||||||
|
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInit100512daef0328603db43c7860e1b81c::getInitializer($loader));
|
||||||
} else {
|
} else {
|
||||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||||
foreach ($map as $namespace => $path) {
|
foreach ($map as $namespace => $path) {
|
||||||
@ -48,19 +48,19 @@ class ComposerAutoloaderInitf3ef7a459e4b29cdf35865d01f6cf929
|
|||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
if ($useStaticLoader) {
|
if ($useStaticLoader) {
|
||||||
$includeFiles = Composer\Autoload\ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$files;
|
$includeFiles = Composer\Autoload\ComposerStaticInit100512daef0328603db43c7860e1b81c::$files;
|
||||||
} else {
|
} else {
|
||||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||||
}
|
}
|
||||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||||
composerRequiref3ef7a459e4b29cdf35865d01f6cf929($fileIdentifier, $file);
|
composerRequire100512daef0328603db43c7860e1b81c($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $loader;
|
return $loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequiref3ef7a459e4b29cdf35865d01f6cf929($fileIdentifier, $file)
|
function composerRequire100512daef0328603db43c7860e1b81c($fileIdentifier, $file)
|
||||||
{
|
{
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
require $file;
|
require $file;
|
||||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929
|
class ComposerStaticInit100512daef0328603db43c7860e1b81c
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||||
@ -314,9 +314,9 @@ class ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929
|
|||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInit100512daef0328603db43c7860e1b81c::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInit100512daef0328603db43c7860e1b81c::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInitf3ef7a459e4b29cdf35865d01f6cf929::$classMap;
|
$loader->classMap = ComposerStaticInit100512daef0328603db43c7860e1b81c::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
12
vendor/composer/installed.json
vendored
12
vendor/composer/installed.json
vendored
@ -260,20 +260,20 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "topthink/think-mongo",
|
"name": "topthink/think-mongo",
|
||||||
"version": "v1.6",
|
"version": "v1.7",
|
||||||
"version_normalized": "1.6.0.0",
|
"version_normalized": "1.7.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/top-think/think-mongo.git",
|
"url": "https://github.com/top-think/think-mongo.git",
|
||||||
"reference": "1c6d29f58bd7caa8da088c167b4e65ddac621588"
|
"reference": "fc552c8fe5798679a52f4f0d7e60763f64aeb155"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://files.phpcomposer.com/files/top-think/think-mongo/1c6d29f58bd7caa8da088c167b4e65ddac621588.zip",
|
"url": "https://files.phpcomposer.com/files/top-think/think-mongo/fc552c8fe5798679a52f4f0d7e60763f64aeb155.zip",
|
||||||
"reference": "1c6d29f58bd7caa8da088c167b4e65ddac621588",
|
"reference": "fc552c8fe5798679a52f4f0d7e60763f64aeb155",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"time": "2017-02-13 07:17:51",
|
"time": "2017-05-05 07:52:33",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
55
vendor/topthink/think-mongo/src/Connection.php
vendored
55
vendor/topthink/think-mongo/src/Connection.php
vendored
@ -66,6 +66,8 @@ class Connection
|
|||||||
'hostname' => '',
|
'hostname' => '',
|
||||||
// 数据库名
|
// 数据库名
|
||||||
'database' => '',
|
'database' => '',
|
||||||
|
// 是否是复制集
|
||||||
|
'is_replica_set' => false,
|
||||||
// 用户名
|
// 用户名
|
||||||
'username' => '',
|
'username' => '',
|
||||||
// 密码
|
// 密码
|
||||||
@ -162,6 +164,18 @@ class Connection
|
|||||||
return $this->links[$linkNum];
|
return $this->links[$linkNum];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定当前使用的查询对象
|
||||||
|
* @access public
|
||||||
|
* @param Query $query 查询对象
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setQuery($query, $model = 'db')
|
||||||
|
{
|
||||||
|
$this->query[$model] = $query;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建指定模型的查询对象
|
* 创建指定模型的查询对象
|
||||||
* @access public
|
* @access public
|
||||||
@ -567,7 +581,11 @@ class Connection
|
|||||||
// 主从式采用读写分离
|
// 主从式采用读写分离
|
||||||
if ($master) // 主服务器写入
|
if ($master) // 主服务器写入
|
||||||
{
|
{
|
||||||
$r = $m;
|
if ($this->config['is_replica_set']) {
|
||||||
|
return $this->replicaSetConnect();
|
||||||
|
} else {
|
||||||
|
$r = $m;
|
||||||
|
}
|
||||||
} elseif (is_numeric($this->config['slave_no'])) {
|
} elseif (is_numeric($this->config['slave_no'])) {
|
||||||
// 指定服务器读
|
// 指定服务器读
|
||||||
$r = $this->config['slave_no'];
|
$r = $this->config['slave_no'];
|
||||||
@ -586,6 +604,41 @@ class Connection
|
|||||||
return $this->connect($dbConfig, $r);
|
return $this->connect($dbConfig, $r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建基于复制集的连接
|
||||||
|
* @return Manager
|
||||||
|
*/
|
||||||
|
public function replicaSetConnect()
|
||||||
|
{
|
||||||
|
$this->dbName = $this->config['database'];
|
||||||
|
$this->typeMap = $this->config['type_map'];
|
||||||
|
if ($this->config['debug']) {
|
||||||
|
$startTime = microtime(true);
|
||||||
|
}
|
||||||
|
$this->config['params']['replicaSet'] = $this->config['database'];
|
||||||
|
$manager = new Manager($this->buildUrl(), $this->config['params']);
|
||||||
|
if ($this->config['debug']) {
|
||||||
|
// 记录数据库连接信息
|
||||||
|
Log::record('[ DB ] CONNECT:[ UseTime:' . number_format(microtime(true) - $startTime, 6) . 's ] ' . $this->config['dsn'], 'sql');
|
||||||
|
}
|
||||||
|
return $manager;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据配置信息 生成适用于链接复制集的 URL
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function buildUrl()
|
||||||
|
{
|
||||||
|
$url = 'mongodb://' . ($this->config['username'] ? "{$this->config['username']}" : '') . ($this->config['password'] ? ":{$this->config['password']}@" : '');
|
||||||
|
$hostList = explode(',', $this->config['hostname']);
|
||||||
|
$portList = explode(',', $this->config['hostport']);
|
||||||
|
for ($i = 0; $i < count($hostList); $i++) {
|
||||||
|
$url = $url . $hostList[$i] . ':' . $portList[0] . ',';
|
||||||
|
}
|
||||||
|
return rtrim($url, ",") . '/';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 析构方法
|
* 析构方法
|
||||||
* @access public
|
* @access public
|
||||||
|
15
vendor/topthink/think-mongo/src/Query.php
vendored
15
vendor/topthink/think-mongo/src/Query.php
vendored
@ -1044,6 +1044,17 @@ class Query
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置软删除字段及条件(暂无支持)
|
||||||
|
* @access public
|
||||||
|
* @param false|string $field 查询字段
|
||||||
|
* @param mixed $condition 查询条件
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function useSoftDelete($field, $condition = null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 不主动获取数据集
|
* 不主动获取数据集
|
||||||
* @access public
|
* @access public
|
||||||
@ -1800,7 +1811,7 @@ class Query
|
|||||||
* 查找单条记录
|
* 查找单条记录
|
||||||
* @access public
|
* @access public
|
||||||
* @param array|string|Query|\Closure $data
|
* @param array|string|Query|\Closure $data
|
||||||
* @return array|false|Cursor|string|Model
|
* @return array|null|Cursor|string|Model
|
||||||
* @throws ModelNotFoundException
|
* @throws ModelNotFoundException
|
||||||
* @throws DataNotFoundException
|
* @throws DataNotFoundException
|
||||||
* @throws AuthenticationException
|
* @throws AuthenticationException
|
||||||
@ -2005,6 +2016,8 @@ class Query
|
|||||||
$result = $this->table($tableName)->find();
|
$result = $this->table($tableName)->find();
|
||||||
if ($result instanceof Model) {
|
if ($result instanceof Model) {
|
||||||
$result = $result->toArray();
|
$result = $result->toArray();
|
||||||
|
} elseif (!$result) {
|
||||||
|
$result = [];
|
||||||
}
|
}
|
||||||
$fields = array_keys($result);
|
$fields = array_keys($result);
|
||||||
$type = [];
|
$type = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user