README.md 4.9 KB
Newer Older
1 2 3 4 5 6
<img align="right" width="100" src="https://kodo-cdn.dtapp.net/04/999e9f2f06d396968eacc10ce9bc8a.png" alt="www.dtapp.net"/>

<h1 align="left"><a href="https://www.dtapp.net/">ThinkPHP6扩展包</a></h1>

📦 ThinkPHP6扩展包

李光春 已提交
7 8 9
[![Latest Stable Version](https://poser.pugx.org/liguangchun/think-library/v/stable)](https://packagist.org/packages/liguangchun/think-library)
[![Latest Unstable Version](https://poser.pugx.org/liguangchun/think-library/v/unstable)](https://packagist.org/packages/liguangchun/think-library)
[![Total Downloads](https://poser.pugx.org/liguangchun/think-library/downloads)](https://packagist.org/packages/liguangchun/think-library)
10 11 12 13 14 15 16 17 18 19 20 21 22 23
[![License](https://poser.pugx.org/liguangchun/think-library/license)](https://packagist.org/packages/liguangchun/think-library)
[![PHP Version](https://img.shields.io/badge/php-%3E%3D7.1-8892BF.svg)](http://www.php.net/)
[![Build Status](https://travis-ci.org/GC0202/ThinkLibrary.svg?branch=6.0)](https://travis-ci.org/GC0202/ThinkLibrary)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/GC0202/ThinkLibrary/badges/quality-score.png?b=6.0)](https://scrutinizer-ci.com/g/GC0202/ThinkLibrary/?branch=6.0)
[![Code Coverage](https://scrutinizer-ci.com/g/GC0202/ThinkLibrary/badges/coverage.png?b=6.0)](https://scrutinizer-ci.com/g/GC0202/ThinkLibrary/?branch=6.0)

## 依赖环境

1. PHP7.1 版本及以上

## 托管

- 国外仓库地址:[https://github.com/GC0202/ThinkLibrary](https://github.com/GC0202/ThinkLibrary)
- 国内仓库地址:[https://gitee.com/liguangchun/ThinkLibrary](https://gitee.com/liguangchun/ThinkLibrary)
李光春 已提交
24 25
- Packagist
  地址:[https://packagist.org/packages/liguangchun/think-library](https://packagist.org/packages/liguangchun/think-library)
26 27

### 开发版
李光春 已提交
28

29 30 31 32 33
```text
composer require liguangchun/think-library ^6.x-dev -vvv
```

### 稳定版
李光春 已提交
34

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
```text
composer require liguangchun/think-library ^6.0.* -vvv
```

## 更新

```text
composer update liguangchun/think-library -vvv
```

## 删除

```text
composer remove liguangchun/think-library -vvv
```

## 获取电脑Mac地址服务使用示例

```php
use DtApp\ThinkLibrary\service\SystemService;

dump(SystemService::instance()
->mac());
```

## 百度地图服务使用示例

```php
use DtApp\ThinkLibrary\service\baidu\LbsYunService;

dump(LbsYunService::instance()
        ->ak("")
        ->weather());
```

## 高德地图服务使用示例

```php
use DtApp\ThinkLibrary\service\amap\AmApService;

dump(AmApService::instance()
        ->key("")
        ->weather());
```

## 抖音服务使用示例

```php
use DtApp\ThinkLibrary\exception\DtaException;
use DtApp\ThinkLibrary\service\douyin\WatermarkService;

try {
    // 方法一之网址
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getAll()
->toArray());
    // 方法一之粘贴
    dump(WatermarkService::instance()->url('#在抖音,记录美好生活#美丽电白欢迎您 https://v.douyin.com/vPGAdM/ 复制此链接,打开【抖音短视频】,直接观看视频!')->getAll()->toArray());
    // 方法二之网址
    $dy = WatermarkService::instance()->url('https://v.douyin.com/vPafcr/');
    dump($dy->getAll()->toArray());
    // 方法二之粘贴
    $dy = WatermarkService::instance()->url('#在抖音,记录美好生活#2020茂名加油,广州加油,武汉加油!中国加油,众志成城!#航拍 #茂名#武汉 #广州 #旅拍 @抖音小助手 https://v.douyin.com/vPafcr/ 复制此链接,打开【抖音短视频】,直接观看视频!');
    dump($dy->getAll()->toArray());
    // 获取全部信息
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getAll()
->toArray());
    // 获取原全部信息
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getApi()
->toArray());
    // 获取视频信息
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getVideoInfo()
->toArray());
    // 获取音频信息
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getMusicInfo()
->toArray());
    // 获取分享信息
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getShareInfo()
->toArray());
    // 获取作者信息
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getAuthorInfo()
->toArray());
    // 返回数组数据方法
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getAll()
->toArray());
    // 返回Object数据方法
    dump(WatermarkService::instance()->url('https://v.douyin.com/vPGAdM/')
->getAll()
->toObject());
} catch (DtaException $e) {
    // 错误提示
    dump($e->getMessage());
}
```

## 纯真数据库

```php
use DtApp\ThinkLibrary\service\QqWryService;

// 获取IP信息
dump(QqWryService::instance()
        ->getLocation());
```