Deprecated
: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in
/www/wwwroot/testblog.58heshihu.com/var/Widget/Archive.php
on line
1057
首页
关于
Search
1
给你10个市场数据调研报告的免费下载网站!以后竞品数据就从这里找!
182 阅读
2
php接口优化 使用curl_multi_init批量请求
144 阅读
3
《从菜鸟到大师之路 ElasticSearch 篇》
107 阅读
4
2024年备考系统架构设计师
104 阅读
5
PHP 文件I/O
92 阅读
php
thinkphp
laravel
工具
开源
mysql
数据结构
总结
思维逻辑
令人感动的创富故事
读书笔记
前端
vue
js
css
书籍
开源之旅
架构
消息队列
docker
教程
代码片段
redis
服务器
nginx
linux
科普
java
c
ElasticSearch
测试
php进阶
php基础
登录
Search
标签搜索
php函数
php语法
性能优化
安全
错误和异常处理
问题
vue
Composer
Session
缓存
框架
Swoole
api
并发
异步
正则表达式
php-fpm
mysql 索引
开发规范
协程
dafenqi
累计撰写
786
篇文章
累计收到
28
条评论
首页
栏目
php
thinkphp
laravel
工具
开源
mysql
数据结构
总结
思维逻辑
令人感动的创富故事
读书笔记
前端
vue
js
css
书籍
开源之旅
架构
消息队列
docker
教程
代码片段
副业
redis
服务器
nginx
linux
科普
java
c
ElasticSearch
测试
php进阶
php基础
页面
关于
搜索到
5
篇与
的结果
2023-08-10
php 插入mongodb uuid类型
php 插入mongodb uuid类型 $luuid ='e4eaaaf2-d142-11e1-b3e4-080027620cdd'; //格式一定要正确 » RFC 4122. $uuid='0123456789abcdef'; $id = new \MongoDB\BSON\Binary($uuid,\MongoDB\BSON\Binary::TYPE_UUID);查mongodb的LUUID类型为以下代码: $luuid= str_replace("-","",$luuid); $id= new \MongoDB\BSON\Binary(hex2bin($luuid),\MongoDB\BSON\Binary::TYPE_OLD_UUID); $id=bin2hex($id); var_dump($id);luuid 转为uuid: $luuid=二进制字符 $id=bin2hex($luuid); $a = substr($id,6, 2).substr($id,4, 2).substr($id,2, 2).substr($id,0, 2); $b = substr($id,10, 2).substr($id,8, 2); $c = substr($id,14, 2).substr($id,12, 2); $d = substr($id,16, 16); $id = $a.$b.$c.$d; $id = substr($id,0, 8).'-'.substr($id,8, 4).'-'.substr($id,12, 4).'-'.substr($id,16, 4).'-'.substr($id,20, 12); var_dump($id);uuid与luuid互转:publicfunctionreplayLuuid($id,$type) { $id = str_replace("-","",$id); $a = substr($id,6, 2).substr($id,4, 2).substr($id,2, 2).substr($id,0, 2); $b = substr($id,10, 2).substr($id,8, 2); $c = substr($id,14, 2).substr($id,12, 2); $d = substr($id,16, 16); $id = $a.$b.$c.$d; if ($type =='to') { $id= new \MongoDB\BSON\Binary(hex2bin($id),\MongoDB\BSON\Binary::TYPE_OLD_UUID); }else{ $id = substr($id,0, 8).'-'.substr($id,8, 4).'-'.substr($id,12, 4).'-'.substr($id,16, 4).'-'.substr($id,20, 12); } return $id; }
2023年08月10日
13 阅读
0 评论
0 点赞
2023-08-10
PHP mongodb 操作类
PHP mongodb 操作类<?php namespace Mongodb; class Mongo_db { private $config; private $hostname; private $port = 27017; private $database; private $username; private $password; private $debug = false; private $collection = ''; private $selects; private $wheres; private $updates; private $limit = 999999; private $offset = 0; private $sorts; private $manager; private $result; public function __construct($config) { $this->config = $config; $this->connect(); } /** * 预处理 */ private function prepareConfig() { if (isset($this->config['hostname'])) { $this->hostname = trim($this->config['hostname']); } if (isset($this->config['port'])) { $this->port = trim($this->config['port']); } if (!empty($this->config['username'])) { $this->username = trim($this->config['username']); } if (!empty($this->config['password'])) { $this->password = trim($this->config['password']); } if (isset($this->config['database'])) { $this->database = trim($this->config['database']); } if (isset($this->config['db_debug'])) { $this->debug = $this->config['db_debug']; } } /** * 链接 */ private function connect() { $this->prepareConfig(); try { if (strstr($this->hostname, ',')) { $dsn = "mongodb://{$this->hostname}/{$this->database}"; }else { $dsn = "mongodb://{$this->hostname}:{$this->port}/{$this->database}"; } $options = array( 'username' => $this->username, 'password' => $this->password ); $this->manager = new \MongoDB\Driver\Manager($dsn, $options); } catch (\Exception $e) { $this->showError($e); } } /** * 获取当前连接 * @return mixed */ public function getManager() { return $this->manager; } /** * @param mixed $collection */ public function getCollection(): string { return $this->collection; } /** * 获取查询所需胡字段 * @return array */ public function getSelects(): array { return $this->selects; } /** * 获取条件 * @return array */ public function getWheres(): array { return $this->wheres; } /** * 获取更新内容 * @return array */ public function getUpdates(): array { return $this->updates; } /** * 获取条数 * @return int */ public function getLimit(): int { return $this->limit; } /** * 获取偏移量 * @return int */ public function getOffset(): int { return $this->offset; } /** * 获取排序 * @return array */ public function getSorts(): array { return $this->sorts; } /** * @param mixed $collection */ public function setCollection(string $collection) { $this->collection = $collection; } /** * @param array $selects */ public function setSelects(array $selects) { $this->selects = $selects; } /** * @param array $wheres */ public function setWheres(array $wheres) { $this->wheres = $wheres; } /** * @param array $updates */ public function setUpdates(array $updates) { $this->updates = $updates; } /** * @param int $limit */ public function setLimit(int $limit) { $this->limit = $limit; } /** * @param int $offset */ public function setOffset(int $offset) { $this->offset = $offset; } /** * @param array $sorts */ public function setSorts(array $sorts) { $this->sorts = $sorts; } /** * @param $database * @return $this */ public function switch_db($database) { $this->database = $database; return $this; } /** * @param $table * @return $this */ public function collection($collection) { $this->collection = $collection; return $this; } /** * @param $collection * @return Mongo_db */ public function table($collection) { return $this->collection($collection); } /** * 增 * @param array $document * @param string $wstring * @param int $wtimeout * @return mixed */ public function insert( $document = array(), $wstring = \MongoDB\Driver\WriteConcern::MAJORITY, $wtimeout = 1000) { try { $wc = new \MongoDB\Driver\WriteConcern($wstring, $wtimeout); $bulk = new \MongoDB\Driver\BulkWrite(); $bulk->insert($document); $dbc = $this->database . '.' . $this->collection; $result = $this->manager->executeBulkWrite($dbc, $bulk, $wc); $this->result = $result; //增加几条 return $result->getInsertedCount(); } catch (\Exception $e) { $this->showError($e); } } /** * 批量添加 * @param array $documents * @param string $wstring * @param int $wtimeout * @return mixed */ public function batch_insert( $documents = array(), $wstring = \MongoDB\Driver\WriteConcern::MAJORITY, $wtimeout = 1000) { try { $wc = new \MongoDB\Driver\WriteConcern($wstring, $wtimeout); $bulk = new \MongoDB\Driver\BulkWrite(); foreach ($documents as $k => $document) { $bulk->insert($document); } $dbc = $this->database . '.' . $this->collection; $result = $this->manager->executeBulkWrite($dbc, $bulk, $wc); $this->result = $result; //增加几条 return $result->getInsertedCount(); } catch (\Exception $e) { $this->showError($e); } } /** * 删 * @param array $deleteOptions * @param string $wstring * @param int $wtimeout * @return mixed */ public function delete( $deleteOptions = ["limit" => 1], $wstring = \MongoDB\Driver\WriteConcern::MAJORITY, $wtimeout = 1000 ) { try { $wc = new \MongoDB\Driver\WriteConcern($wstring, $wtimeout); $bulk = new \MongoDB\Driver\BulkWrite(); $filter = $this->wheres; if (count($filter) < 1 && $deleteOptions['limit'] == 1) { throw new \Exception('filter is error!'); } $bulk->delete($filter, $deleteOptions); $dbc = $this->database . '.' . $this->collection; $result = $this->manager->executeBulkWrite($dbc, $bulk, $wc); $this->result = $result; //删除几条 return $result->getDeletedCount(); } catch (\Exception $e) { $this->showError($e); } } /** * 删除所有 * @param array $deleteOptions * @param string $wstring * @param int $wtimeout * @return mixed */ public function delete_all( $deleteOptions = ["limit" => 0], $wstring = \MongoDB\Driver\WriteConcern::MAJORITY, $wtimeout = 1000 ) { return $this->delete($deleteOptions, $wstring, $wtimeout); } /** * 更新 * @param array $updateOptions * @param string $wstring * @param int $wtimeout */ public function update( $updateOptions = ['multi' => false, 'upsert' => false], $wstring = \MongoDB\Driver\WriteConcern::MAJORITY, $wtimeout = 1000 ) { try { $wc = new \MongoDB\Driver\WriteConcern($wstring, $wtimeout); $bulk = new \MongoDB\Driver\BulkWrite(); $filter = $this->wheres; if (count($filter) < 1 && $updateOptions['multi'] == false) { throw new \Exception('filter is error!'); } $newObj = $this->updates; $bulk->update( $filter, $newObj, $updateOptions ); $dbc = $this->database . '.' . $this->collection; $result = $this->manager->executeBulkWrite($dbc, $bulk, $wc); $this->result = $result; return $result->getModifiedCount(); } catch (\Exception $e) { $this->showError($e); } } /** * 更新所有 * @param array $updateOptions * @param string $wstring * @param int $wtimeout */ public function update_all( $updateOptions = ['multi' => true, 'upsert' => false], $wstring = \MongoDB\Driver\WriteConcern::MAJORITY, $wtimeout = 1000 ) { return $this->update($updateOptions, $wstring, $wtimeout); } /** * 查询单条 * @param null $id * @return mixed|null */ public function find($id = null) { if ($id != null) { $this->where('_id', new \MongoDB\BSON\ObjectID($id)); } $filter = $this->wheres; $options = [ 'projection' => $this->selects, "sort" => $this->sorts, "skip" => 0, "limit" => 1, ]; $query = new \MongoDB\Driver\Query($filter, $options); $dbc = $this->database . '.' . $this->collection; $documents = $this->manager->executeQuery($dbc, $query); $this->result = $documents; $returns = null; foreach ($documents as $document) { $bson = \MongoDB\BSON\fromPHP($document); $returns = json_decode(\MongoDB\BSON\toJSON($bson), true); } return $returns; } /** * command * @param $db * @param $commands * @return mixed */ public function command($db, $commands) { try { $cursor = $this->manager->executeCommand($db, $commands); $this->result = $cursor; return $cursor; } catch (\Exception $e) { $this->showError($e); } } public function dropDatabase() { $cmd = array( 'dropDatabase' => 1, ); $db = $this->database; $commands = new \MongoDB\Driver\Command($cmd); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = current($cursor->toArray()); return $response; } public function drop_collection() { $cmd = array( 'drop' => $this->collection, ); $db = $this->database; $commands = new \MongoDB\Driver\Command($cmd); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = current($cursor->toArray()); return $response; } //unique public function add_index($key, $name = 'index') { $cmd = array( 'createIndexes' => $this->collection, 'indexes' => array( array( 'name' => $name, 'key' => $key, ) ) ); $db = $this->database; $commands = new \MongoDB\Driver\Command($cmd); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = current($cursor->toArray()); return $response; } public function remove_index($index) { $cmd = array( 'dropIndexes' => $this->collection, 'index' => $index ); $db = $this->database; $commands = new \MongoDB\Driver\Command($cmd); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = current($cursor->toArray()); return $response; } public function list_indexes() { $cmd = array( 'listIndexes' => $this->collection, ); $db = $this->database; $commands = new \MongoDB\Driver\Command($cmd); $cursor = $this->command($db, $commands); $this->result = $cursor; return $cursor; } public function aggregate($commands) { $db = $this->database; $commands = new \MongoDB\Driver\Command( [ 'aggregate' => $this->collection, 'pipeline' => [$commands] ] ); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = current($cursor->toArray())->result; return $response; } /** * @param $key * @return mixed */ public function distinct($key) { $db = $this->database; $commands = new \MongoDB\Driver\Command( [ 'distinct' => $this->collection, 'key' => $key, 'query' => $this->wheres ] ); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = current($cursor->toArray())->values; return $response; } /** * count * @return mixed */ public function count() { $db = $this->database; $commands = new \MongoDB\Driver\Command( [ "count" => $this->collection, "query" => $this->wheres ] ); $cursor = $this->command($db, $commands); $this->result = $cursor; $response = $cursor->toArray()[0]; return $response->n; } /** * 查 * @return mixed */ public function get() { try { $filter = (array)$this->wheres; $options = [ 'projection' => (array)$this->selects, "sort" => (array)$this->sorts, "skip" => (int)$this->offset, "limit" => (int)$this->limit, ]; $query = new \MongoDB\Driver\Query($filter, $options); $dbc = $this->database . '.' . $this->collection; $documents = $this->manager->executeQuery($dbc, $query); $this->result = $documents; $returns = array(); foreach ($documents as $document) { $bson = \MongoDB\BSON\fromPHP($document); $returns[] = json_decode(\MongoDB\BSON\toJSON($bson), true); } return $returns; } catch (\Exception $e) { $this->showError($e); } } /** * @param $fields * @param null $value * @return $this */ public function set($fields, $value = NULL) { if (is_string($fields)) { $this->updates['$set'][$fields] = $value; } elseif (is_array($fields)) { foreach ($fields as $field => $value) { $this->updates['$set'][$field] = $value; } } return $this; } /** * 要获取的字段 * @param $wheres * @param null $value * @return $this */ public function field($includes = array(), $excludes = array()) { if (!is_array($includes)) { $includes = array(); } if (!is_array($excludes)) { $excludes = array(); } if (!empty($includes)) { foreach ($includes as $col) { $this->selects[$col] = 1; } } if (!empty($excludes)) { foreach ($excludes as $col) { $this->selects[$col] = 0; } } return $this; } /** * 条件 * @param $wheres * @param null $value * @return $this */ public function where($wheres, $value = null) { if (is_array($wheres)) { foreach ($wheres as $wh => $val) { $this->wheres[$wh] = $val; } } else { $this->wheres[$wheres] = $value; } return $this; } public function where_in($field = "", $in = array()) { $this->wheres[$field]['$in'] = $in; return $this; } public function where_in_all($field = "", $in = array()) { $this->wheres[$field]['$all'] = $in; return $this; } public function where_or($wheres = array()) { foreach ($wheres as $wh => $val) { $this->wheres['$or'][] = array($wh => $val); } return $this; } public function where_not_in($field = "", $in = array()) { $this->wheres[$field]['$nin'] = $in; return $this; } public function where_gt($field = "", $x) { $this->wheres[$field]['$gt'] = $x; return $this; } public function where_gte($field = "", $x) { $this->wheres[$field]['$gte'] = $x; return $this; } public function where_lt($field = "", $x) { $this->wheres[$field]['$lt'] = $x; return $this; } public function where_lte($field = "", $x) { $this->wheres[$field]['$lte'] = $x; return $this; } public function where_between($field = "", $x, $y) { $this->wheres[$field]['$gte'] = $x; $this->wheres[$field]['$lte'] = $y; return $this; } public function where_between_ne($field = "", $x, $y) { $this->wheres[$field]['$gt'] = $x; $this->wheres[$field]['$lt'] = $y; return $this; } public function where_ne($field = '', $x) { $this->wheres[$field]['$ne'] = $x; return $this; } public function push($fields, $value = array()) { if (is_string($fields)) { $this->updates['$push'][$fields] = $value; } elseif (is_array($fields)) { foreach ($fields as $field => $value) { $this->updates['$push'][$field] = $value; } } return $this; } public function addtoset($field, $values) { if (is_string($values)) { $this->updates['$addToSet'][$field] = $values; } elseif (is_array($values)) { $this->updates['$addToSet'][$field] = array('$each' => $values); } return $this; } public function pop($field) { if (is_string($field)) { $this->updates['$pop'][$field] = -1; } elseif (is_array($field)) { foreach ($field as $pop_field) { $this->updates['$pop'][$pop_field] = -1; } } return $this; } public function pull($field = "", $value = array()) { $this->updates['$pull'] = array($field => $value); return $this; } public function rename_field($old, $new) { $this->updates['$rename'] = array($old => $new); return $this; } public function unset_field($fields) { if (is_string($fields)) { $this->updates['$unset'][$fields] = 1; } elseif (is_array($fields)) { foreach ($fields as $field) { $this->updates['$unset'][$field] = 1; } } return $this; } public function inc($fields = array(), $value = 0) { if (is_string($fields)) { $this->updates['$inc'][$fields] = $value; } elseif (is_array($fields)) { foreach ($fields as $field => $value) { $this->updates['$inc'][$field] = $value; } } return $this; } public function mul($fields = array(), $value = 0) { if (is_string($fields)) { $this->updates['$mul'][$fields] = $value; } elseif (is_array($fields)) { foreach ($fields as $field => $value) { $this->updates['$mul'][$field] = $value; } } return $this; } public function max($fields = array(), $value = 0) { if (is_string($fields)) { $this->updates['$max'][$fields] = $value; } elseif (is_array($fields)) { foreach ($fields as $field => $value) { $this->updates['$max'][$field] = $value; } } return $this; } public function min($fields = array(), $value = 0) { if (is_string($fields)) { $this->updates['$min'][$fields] = $value; } elseif (is_array($fields)) { foreach ($fields as $field => $value) { $this->updates['$min'][$field] = $value; } } return $this; } /** * 排序 * @param array $fields * @return $this */ public function order_by($fields = array()) { foreach ($fields as $col => $val) { if ($val == -1 || $val === FALSE || strtolower($val) == 'desc') { $this->sorts[$col] = -1; } else { $this->sorts[$col] = 1; } } return $this; } /** * 条数 * @param int $x * @return $this */ public function limit($x = 99999) { if ($x !== NULL && is_numeric($x) && $x >= 1) { $this->limit = (int)$x; } return $this; } /** * 偏移量 * @param int $x * @return $this */ public function offset($x = 0) { if ($x !== NULL && is_numeric($x) && $x >= 1) { $this->offset = (int)$x; } return $this; } /** * 生成mongo时间 * @param bool $stamp * @return \MongoDB\BSON\UTCDatetime */ public function date($stamp = false) { if ($stamp == false) { return new \MongoDB\BSON\UTCDatetime(time() * 1000); } else { return new \MongoDB\BSON\UTCDatetime($stamp); } } /** * 生成mongo时间戳 * @param bool $stamp * @return \MongoDB\BSON\Timestamp */ public function timestamp($stamp = false) { if ($stamp == false) { return new \MongoDB\BSON\Timestamp(0, time()); } else { return new \MongoDB\BSON\Timestamp(0, $stamp); } } /** * 生成mongo uuid * @param bool $stamp * @return */ public function uuid($uuid) { return new \MongoDB\BSON\Binary($uuid,\MongoDB\BSON\Binary::TYPE_UUID); } /** * 抛出异常 * @param $e */ public function showError($e) { exit($e->getMessage()); } }
2023年08月10日
12 阅读
0 评论
0 点赞
2023-08-08
安装 redis mongodb memcached
centos 6.5 安装 redis 3.0 及php redis扩展centos 6.5 安装 mongodb3.0 及 php mongo扩展基于libmemcached,php扩展memcached的安装
2023年08月08日
20 阅读
0 评论
0 点赞
2023-08-08
php mongodb 操作类
php mongodb 操作类<?php /** * php mongodb 操作类,主要用于存取图片 * * @package MongoDriver * @version $id$ * @copyright 2015 * @author Lenix * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt} */ class MongoDriver { protected $connection;//连接 protected $db;//数据库 protected $collection;//集合 /** * __construct * 连接数据库,并创建或选择数据库与集合 * * @param string $server * @param string $db * @param string $coll * @access public * @return void * @example $server:mongodb://192.168.6.76:27017 */ public function __construct($server,$db,$coll) { try { $this->connection=new MongoClient($server);//链接到远程服务器,使用自定义的端口 } catch (MongoConnectionException $e) { return $e->getMessage(); } $this->db = $this->connection->$db; //创建 or 选择数据库 $this->collection = $this->db->$coll;//选择创建集合 } /** * insert 插入一条数据 * * @param array $data * @access public * @return void */ public function insert(array $data) { $this->collection->insert($data); } /** * insertBin 把二进制数据插入数据库 * * @param array $param 查询条件数组 * @param bin $data * @access public * @return void * [example] * $data=file_get_contents("images/photo.jpg"); * $param = array( "filename" => "hello.jpg", "field" => "pic",//字段名 ); [/example] */ public function insertBin(array $param=array(),$data=null) { $this->collection && $count=$this->collection->count($param); if(empty($count) && $this->collection){ $field=$param['field']; $param[$field]=new MongoBinData($data, MongoBinData::GENERIC); try{ $this->collection->save($param); } catch(MongoException $e) { echo $e->getMessage(); } catch(MongoCursorException $e) { echo $e->getMessage(); } catch(MongoCursorTimeoutException $e) { echo $e->getMessage(); } }else{ return 'the file already exists';//不能重复插入同名文件 } } /** * findOne 获取单条记录 * * @param string $field 字段名 * @access public * @return void */ public function findOne($field) { $document = $this->collection->findOne(); if($document) { return $document[$field]->bin;//输出二进制 }else { return false; } } /** * find 获取多条记录 * * @access public * @return array */ public function find() { $cursor=$this->collection->find(); $v=[]; foreach ( $cursor as $id => $value ) { $v[$id]=$value; } return $v; } /** * count 统计集合记录数 * * @param array $query 查询条件 * @access public * @return void * @example */ public function count(array $query=array()) { return $this->collection->count($query); } /** * query 条件查询 * * @param array $query 查询条件 * @access public * @return void * @example $query = array( 'filename' => 'hello.jpg','field'=>'pic' ); */ public function query(array $query) { $field=$query['field']; if($this->collection) { $cursor = $this->collection->find($query); $v=[]; while ( $cursor->hasNext() ) { $v[]=$cursor->getNext()[$field]->bin; } return $v; } } /** * remove 条件删除 * * @param array $query * @access public * @return array * @example $query = array( 'filename' => 'hello.jpg' ); */ public function remove(array $query) { return $this->collection->remove($query); } /** * drop 删除集合 * * @access public * @return void */ public function drop() { $this->collection->drop(); } /** * addIndex 添加索引 * * @param array $keys * @access public * @return void * @example $keys=array('x' => 1); */ public function addIndex(array $keys) { $this->collection->createIndex($keys); } /** * __destruct 关闭连接 * * @access protected * @return void */ function __destruct() { //$this->connection->close($this->collection);//此行一般不需要 $this->connection=null; $this->collection=null; $this->db=null; } } ?> 用法 <?php include 'mongodb.class.php'; //使用方法 $mongo=new MongoDriver('mongodb://192.168.6.76:27017','wenestthumb','thumb'); //insert $data=file_get_contents("images/photo.jpg"); $profile = array( "filename" => "phpto.jpg", "field" => "pic", ); //$mongo->insertBin($profile,$data); $abc=$mongo->find(); var_dump($abc); exit; //output //header('Content-Type: image/jpg'); //$one= $mongo->findOne('pic'); //echo $one; $query = array( 'filename' => 'phpto.jpg', 'field'=>'pic', ); $query22 = array( 'filenameaa' => 'phptsfao.jpg', ); $af=$mongo->remove($query22); var_dump($af); //echo $mongo->count(array()); exit; $pics=$mongo->query($query); echo $pics[0]; ?>
2023年08月08日
14 阅读
0 评论
0 点赞
2023-08-08
php 连接mongodb,mongodb异常退出再启动,php开始几次取不到数据的问题解决
php 连接mongodb,mongodb异常退出再启动,php开始几次取不到数据的问题解决是由于mongodb的长连接导致的,长连接是默认的。解决 办法 ,在php脚本 结束后 ,强制关闭mongodb连接$mongo= new MongoClient("mongodb://whisky:13000/?replicaset=seta");$mongo->close(true);
2023年08月08日
26 阅读
0 评论
0 点赞