[{"data":1,"prerenderedAt":65},["ShallowReactive",2],{"article-59":3},{"code":4,"msg":5,"data":6,"count":14},200,"查询成功",{"id":7,"title":8,"keywords":9,"description":10,"category_id":11,"content":12,"body_html":13,"thumb_up":14,"clicks":15,"sort":14,"remark":16,"status":17,"is_open":17,"is_deleted":14,"is_top":14,"is_recommend":14,"create_time":18,"update_time":19,"image_id":20,"url":13,"member_id":14,"cate_name":21,"prev":22,"next":25,"tags":28,"words":37,"read_time":11,"comments":14,"cover":38,"relevant":39},59,"Yii2安装使用InfluxDB","Yii2,InfluxDB","InfluxDB 是一个时间序列数据库，用于处理海量写入与负载查询，本文介绍PHP项目中如何使用InfluxDB，并且将基本操作封装成类使用，",2,"##### 1、安装influxdb-php\n在项目中打开cmder，执行如下命令，电脑必须安装了composer\n```bash\ncomposer require influxdb\u002Finfluxdb-php\n```\n##### 2、简单的操作\n###### 创建链接对象\n###### 方式一\n```php\n$client = new InfluxDB\\Client($host, $port);\n```\n###### 方式二\n```php\n$database = InfluxDB\\Client::fromDSN(sprintf('influxdb:\u002F\u002Fuser:pass@%s:%s\u002F%s', $host, $port, $dbname));\n$client = $database->getClient();\n```\n###### 设置查询数据库\n```php\n$database = $client->selectDB('testdb');\n```\n###### 执行查询语句\n```php\n$result = $database->query('select * from test LIMIT 5');\n```\n###### 将结果集转成一个数组\n```php\n$points = $result->getPoints();\n```\n###### 可以使用getQueryBuilder简化查询\n```php\n$result = $database->getQueryBuilder()\n\t->select('cpucount')\n\t->from('test')\n\t->limit(2)\n\t->offset(2)\n\t->getResultSet()\n\t->getPoints();\n$query = $database->getQueryBuilder()\n\t->select('cpucount')\n\t->from('test')\n\t->where([\"region = 'us-west'\"])\n\t->getQuery();\n```\n###### 添加数据\n```php\n$points = array(\n\tnew Point(\n\t\t'test', \u002F\u002F name of the measurement\n\t\t0.64, \u002F\u002F the measurement value\n\t\t['host' => 'server01', 'region' => 'us-west'], \u002F\u002F optional tags\n\t\t['cpucount' => 10], \u002F\u002F optional additional fields\n\t\t1435255849 \u002F\u002F Time precision has to be set to seconds!\n\t),\n    new Point(\n    \t'test', \u002F\u002F name of the measurement\n\t\t0.84, \u002F\u002F the measurement value\n\t\t['host' => 'server01', 'region' => 'us-west'], \u002F\u002F optional tags\n\t\t['cpucount' => 10], \u002F\u002F optional additional fields\n\t\t1435255849 \u002F\u002F Time precision has to be set to seconds!\n\t)\n);\n$result = $database->writePoints($points, Database::PRECISION_SECONDS);\n```\n##### 3、封装成类使用\n详细的到一下地址查看\n",null,0,530,"",1,"2019-05-23 14:11:27","2026-04-19 15:12:30",125,"PHP",{"id":23,"title":24},58,"Window环境下安装并使用InfluxDB",{"id":26,"title":27},60,"解决Nginx自动忽略header包含下划线参数方法",[29,32,35],{"id":30,"name":31},56,"InfluxDB",{"id":33,"name":34},31,"Yii2",{"id":36,"name":21},25,959,"https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Farticle\u002Fde\u002Fe160ee009b815eba64cecaaccf60f8.jpg",[40,45,50,55,60],{"id":41,"title":42,"create_time":43,"description":44},93,"PHP执行Python脚本解压，压缩文件夹操作","2020-08-06 14:59:05","PHP是有解压缩类文件的，但在实际项目中，用户方使用Python脚本压缩，很容易出现中文解压乱码，导致文件内容丢失的情况，本文主要介绍PHP执行Python脚本解压缩出现的问题以及解决方法",{"id":46,"title":47,"create_time":48,"description":49},92,"PHP对图片的处理","2020-07-30 15:53:38","图片处理函数功能：缩放、剪切、相框、水印、锐化、旋转、翻转、透明度、反色处理并保存历史记录的思路：当有图片有改动时自动生成一张新图片",{"id":51,"title":52,"create_time":53,"description":54},96,"PHP中字符串跟0做比较永远是true","2021-02-04 16:16:27","最近在项目中做数据对比的功能，发现一个特殊的情况，0跟任何字符串做比较永远返回true，特意了解了一下。",{"id":56,"title":57,"create_time":58,"description":59},13,"Win系统下配置PHP链接Oracle","2019-01-17 22:23:36","该文章内容主要介绍window系统下，php连接oracle的配置。",{"id":61,"title":62,"create_time":63,"description":64},103,"面向对象三大特性五大原则 + 低耦合高内聚[转载]","2021-10-31 23:18:58","面向对象的三大特性是\"封装、\"多态\"、\"继承\"，五大原则是\"单一职责原则\"、\"开放封闭原则\"、\"里氏替换原则\"、\"依赖倒置原则\"、\"接口分离原则\"。",1783431663713]