Browse Source

安装阿里云 远程调用客户端

master
lanzu_qsy 5 years ago
parent
commit
5c961a6fd5
  1. 42
      app/Admin/Controllers/Test.php
  2. 1
      composer.json
  3. 403
      composer.lock

42
app/Admin/Controllers/Test.php

@ -0,0 +1,42 @@
<?php
namespace App\Admin\Controllers;
use AlibabaCloud\Client\AlibabaCloud;
use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
use Dcat\Admin\Controllers\AdminController;
class Test extends AdminController
{
public function sentSms()
{
AlibabaCloud::accessKeyClient('LTAI4GBjK1Ha8r8fvDdq9atk','ZbRGJT44SEE2GGGy29bPmBVY2e2D6l')
->regionId('cn-shenzhen')
->asDefaultClient();
try {
$result = AlibabaCloud::rpc()
->product('Dysmsapi')
->version('2020-09-4')
->action('SendSms')
->method('POST')
->host('dysmsapi.aliyuncs.com')
->options([
'query' => [
'RegionId' => "cn-shenzhen",
'PhoneNumbers' => "13481194554",
'SignName' => "懒族 ",
],
])
->request();
dd($result);
}catch (ClientException $e){
echo $e->getErrorMessage() . PHP_EOL;
}catch (ServerException $e){
echo $e->getErrorMessage() . PHP_EOL;
}
}
}

1
composer.json

@ -9,6 +9,7 @@
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^7.2.5", "php": "^7.2.5",
"alibabacloud/client": "^1.5",
"dcat/laravel-admin": "^1.6", "dcat/laravel-admin": "^1.6",
"fideloper/proxy": "^4.2", "fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0", "fruitcake/laravel-cors": "^1.0",

403
composer.lock

@ -4,8 +4,150 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "b3d2ad98d7c44d90fdb1789d0ac90e0f",
"content-hash": "5fc4493cba11b36fcbba5ca797e0355a",
"packages": [ "packages": [
{
"name": "adbario/php-dot-notation",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/adbario/php-dot-notation.git",
"reference": "eee4fc81296531e6aafba4c2bbccfc5adab1676e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/adbario/php-dot-notation/zipball/eee4fc81296531e6aafba4c2bbccfc5adab1676e",
"reference": "eee4fc81296531e6aafba4c2bbccfc5adab1676e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-json": "*",
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "^4.0|^5.0|^6.0",
"squizlabs/php_codesniffer": "^3.0"
},
"type": "library",
"autoload": {
"files": [
"src/helpers.php"
],
"psr-4": {
"Adbar\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Riku Särkinen",
"email": "riku@adbar.io"
}
],
"description": "PHP dot notation access to arrays",
"homepage": "https://github.com/adbario/php-dot-notation",
"keywords": [
"ArrayAccess",
"dotnotation"
],
"time": "2019-01-01T23:59:15+00:00"
},
{
"name": "alibabacloud/client",
"version": "1.5.29",
"source": {
"type": "git",
"url": "https://github.com/aliyun/openapi-sdk-php-client.git",
"reference": "2d0137828ef5c44664dcb8cc90eac4f545dd3301"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aliyun/openapi-sdk-php-client/zipball/2d0137828ef5c44664dcb8cc90eac4f545dd3301",
"reference": "2d0137828ef5c44664dcb8cc90eac4f545dd3301",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"adbario/php-dot-notation": "^2.2",
"clagiordano/weblibs-configmanager": "^1.0",
"danielstjules/stringy": "^3.1",
"ext-curl": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-simplexml": "*",
"ext-xmlwriter": "*",
"guzzlehttp/guzzle": "^6.3|^7.0",
"mtdowling/jmespath.php": "^2.5",
"php": ">=5.5"
},
"require-dev": {
"composer/composer": "^1.8",
"drupal/coder": "^8.3",
"ext-dom": "*",
"ext-pcre": "*",
"ext-sockets": "*",
"ext-spl": "*",
"league/climate": "^3.2.4",
"mikey179/vfsstream": "^1.6",
"monolog/monolog": "^1.24",
"phpunit/phpunit": "^5.7.27",
"psr/cache": "^1.0",
"symfony/dotenv": "^3.4",
"symfony/var-dumper": "^3.4"
},
"suggest": {
"ext-sockets": "To use client-side monitoring"
},
"type": "library",
"autoload": {
"psr-4": {
"AlibabaCloud\\Client\\": "src"
},
"files": [
"src/Functions.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "Alibaba Cloud SDK",
"email": "sdk-team@alibabacloud.com",
"homepage": "http://www.alibabacloud.com"
}
],
"description": "Alibaba Cloud Client for PHP - Use Alibaba Cloud in your PHP project",
"homepage": "https://www.alibabacloud.com/",
"keywords": [
"alibaba",
"alibabacloud",
"aliyun",
"client",
"cloud",
"library",
"sdk",
"tool"
],
"time": "2020-08-03T06:19:07+00:00"
},
{ {
"name": "aliyuncs/oss-sdk-php", "name": "aliyuncs/oss-sdk-php",
"version": "v2.3.1", "version": "v2.3.1",
@ -163,6 +305,122 @@
], ],
"time": "2020-04-15T15:59:35+00:00" "time": "2020-04-15T15:59:35+00:00"
}, },
{
"name": "clagiordano/weblibs-configmanager",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/clagiordano/weblibs-configmanager.git",
"reference": "ecf584f5b3a27929175ff0abdba52f0131bef795"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/clagiordano/weblibs-configmanager/zipball/ecf584f5b3a27929175ff0abdba52f0131bef795",
"reference": "ecf584f5b3a27929175ff0abdba52f0131bef795",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.4"
},
"require-dev": {
"clagiordano/phpunit-result-printer": "^1",
"phpunit/phpunit": "^4.8"
},
"type": "library",
"autoload": {
"psr-4": {
"clagiordano\\weblibs\\configmanager\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Claudio Giordano",
"email": "claudio.giordano@autistici.org",
"role": "Developer"
}
],
"description": "weblibs-configmanager is a tool library for easily read and access to php config array file and direct read/write configuration file / object",
"keywords": [
"clagiordano",
"configuration",
"manager",
"tool",
"weblibs"
],
"time": "2020-07-20T20:39:25+00:00"
},
{
"name": "danielstjules/stringy",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/danielstjules/Stringy.git",
"reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/danielstjules/Stringy/zipball/df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e",
"reference": "df24ab62d2d8213bbbe88cc36fc35a4503b4bd7e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.4.0",
"symfony/polyfill-mbstring": "~1.1"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Stringy\\": "src/"
},
"files": [
"src/Create.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel St. Jules",
"email": "danielst.jules@gmail.com",
"homepage": "http://www.danielstjules.com"
}
],
"description": "A string manipulation library with multibyte support",
"homepage": "https://github.com/danielstjules/Stringy",
"keywords": [
"UTF",
"helpers",
"manipulation",
"methods",
"multibyte",
"string",
"utf-8",
"utility",
"utils"
],
"time": "2017-06-12T01:10:27+00:00"
},
{ {
"name": "dcat/laravel-admin", "name": "dcat/laravel-admin",
"version": "1.6.5", "version": "1.6.5",
@ -1804,6 +2062,69 @@
], ],
"time": "2020-07-23T08:41:23+00:00" "time": "2020-07-23T08:41:23+00:00"
}, },
{
"name": "mtdowling/jmespath.php",
"version": "2.6.0",
"source": {
"type": "git",
"url": "https://github.com/jmespath/jmespath.php.git",
"reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
"reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^5.4 || ^7.0 || ^8.0",
"symfony/polyfill-mbstring": "^1.17"
},
"require-dev": {
"composer/xdebug-handler": "^1.4",
"phpunit/phpunit": "^4.8.36 || ^7.5.15"
},
"bin": [
"bin/jp.php"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-4": {
"JmesPath\\": "src/"
},
"files": [
"src/JmesPath.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Declaratively specify how to extract elements from a JSON document",
"keywords": [
"json",
"jsonpath"
],
"time": "2020-07-31T21:01:56+00:00"
},
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "2.37.0", "version": "2.37.0",
@ -2131,12 +2452,6 @@
"wechat", "wechat",
"weibo" "weibo"
], ],
"funding": [
{
"url": "https://www.patreon.com/overtrue",
"type": "patreon"
}
],
"time": "2020-03-04T15:22:25+00:00" "time": "2020-03-04T15:22:25+00:00"
}, },
{ {
@ -2210,20 +2525,6 @@
"weixin", "weixin",
"weixin-sdk" "weixin-sdk"
], ],
"funding": [
{
"url": "https://www.easywechat.com/img/pay/wechat.jpg",
"type": "custom"
},
{
"url": "https://github.com/overtrue",
"type": "github"
},
{
"url": "https://www.patreon.com/overtrue",
"type": "patreon"
}
],
"time": "2020-07-29T07:36:50+00:00" "time": "2020-07-29T07:36:50+00:00"
}, },
{ {
@ -3203,20 +3504,6 @@
"caching", "caching",
"psr6" "psr6"
], ],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-23T17:22:30+00:00" "time": "2020-07-23T17:22:30+00:00"
}, },
{ {
@ -3285,20 +3572,6 @@
"interoperability", "interoperability",
"standards" "standards"
], ],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00" "time": "2020-07-06T13:23:11+00:00"
}, },
{ {
@ -4898,20 +5171,6 @@
"psr-17", "psr-17",
"psr-7" "psr-7"
], ],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-25T08:21:47+00:00" "time": "2020-06-25T08:21:47+00:00"
}, },
{ {
@ -5441,20 +5700,6 @@
"instantiate", "instantiate",
"serialize" "serialize"
], ],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-06-07T15:42:22+00:00" "time": "2020-06-07T15:42:22+00:00"
}, },
{ {
@ -6902,6 +7147,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"abandoned": true,
"time": "2019-09-17T06:23:10+00:00" "time": "2019-09-17T06:23:10+00:00"
}, },
{ {
@ -7865,6 +8111,5 @@
"platform": { "platform": {
"php": "^7.2.5" "php": "^7.2.5"
}, },
"platform-dev": [],
"plugin-api-version": "1.1.0"
"platform-dev": []
} }
Loading…
Cancel
Save