{"id":21296768,"url":"https://github.com/sunmking/yii2-dysms","last_synced_at":"2025-10-14T05:07:38.591Z","repository":{"id":62540658,"uuid":"111760935","full_name":"sunmking/yii2-dysms","owner":"sunmking","description":"阿里云 dysms 官方 SDK 的 Composer 封装，支持 yii2 项目。","archived":false,"fork":false,"pushed_at":"2018-09-03T08:38:42.000Z","size":1073,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-14T05:07:34.802Z","etag":null,"topics":["aliyun","aliyun-sms","dysms","php","yii2"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunmking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-23T03:54:24.000Z","updated_at":"2021-06-20T17:35:57.000Z","dependencies_parsed_at":"2022-11-02T15:45:37.702Z","dependency_job_id":null,"html_url":"https://github.com/sunmking/yii2-dysms","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sunmking/yii2-dysms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunmking%2Fyii2-dysms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunmking%2Fyii2-dysms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunmking%2Fyii2-dysms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunmking%2Fyii2-dysms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunmking","download_url":"https://codeload.github.com/sunmking/yii2-dysms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunmking%2Fyii2-dysms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018016,"owners_count":26086237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliyun","aliyun-sms","dysms","php","yii2"],"created_at":"2024-11-21T14:29:28.002Z","updated_at":"2025-10-14T05:07:38.558Z","avatar_url":"https://github.com/sunmking.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aliyun-dysms\n\n## 安装\n\n```bash\ncomposer require \"saviorlv/yii2-dysms:dev-master\"\n```\n\n\u003e or添加下列代码在composer.json文件中并执行composer update 操作\n\n```bash\n{\n    \"require\": {\n       \"saviorlv/yii2-dysms\":\"dev-master\"\n    }\n}\n```\n\n## 设置方法\n\n#### 全局使用\n\u003e 在config/main.php配置文件中定义component配置信息\n```bash\n'components' =\u003e [\n  .....\n  'aliyun' =\u003e [\n      'class' =\u003e 'saviorlv\\aliyun\\Sms',\n      'accessKeyId' =\u003e '123455',\n      'accessKeySecret' =\u003e '122345666'\n    ],\n  ....\n]\n\n```\n\u003e 代码中调用（调用短信发送接口示例）\n\n```bash\n// 单条发送\n$response = Yii::$app-\u003ealiyun-\u003esendSms(\n            \"孙坤峰\", // 短信签名\n            \"SMS_76350132\", // 短信模板编号\n            \"136*****134\", // 短信接收者\n            Array(  // 短信模板中字段的值\n                \"code\"=\u003e\"12345\",\n                \"product\"=\u003e\"dsd\"\n            ),\n            \"123\"\n        );\n        print_r($response);\n        \n//批量发送\n\n$response = Yii::$app-\u003ealiyun-\u003esendBatchSms(\n            array(\"孙坤峰\",\"孙坤峰\"), // 短信签名\n            \"SMS_76350132\", // 短信模板编号\n            array(\"136*****134\",\"180*****459\"), // 短信接收者\n            array(array(  // 短信模板中字段的值\n                \"code\"=\u003e\"12345\",\n                \"product\"=\u003e\"dsd\"\n            ),array(  // 短信模板中字段的值\n                \"code\"=\u003e\"123456\",\n                \"product\"=\u003e\"dsd\"\n            )),\n            \"123\"\n        );\n//批量发送 签名、手机号、模板字段 数组长度必须相等\n\n如上所示 180*******259收到的短信 签名是\"孙坤峰\" 内容为  123456\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunmking%2Fyii2-dysms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunmking%2Fyii2-dysms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunmking%2Fyii2-dysms/lists"}