1 Star 0 Fork 3

mickelfeng / msg

forked from aspnmy / msg 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
GPL-2.0

消息通知服务1.0

说明:

  • 暂无介绍

消息通知服务2.0

###gitee地址msg消息通知微服务 消息通知服务2.0 的软件环境

  • php版本 >= 7.2
  • 数据库 mysql >= 5.6
  • PHP扩展要求
    • Pcntl
    • Redis
    • shmop
    • posix
    • mysqlnd
    • Reflection
    • sysvsem
    • sysvshm

数据库表相关:

  • 行业短信发送记录表
CREATE TABLE `msg_mobile_hangye_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增长主键id',
  `request_client` varchar(100) NOT NULL DEFAULT '' COMMENT '请求所属客户端',
  `msg_id` varchar(100) NOT NULL DEFAULT '' COMMENT '消息id',
  `appoint_api` varchar(50) NOT NULL DEFAULT '' COMMENT '指定的请求发送端指定发送短信的api',
  `by_account` varchar(255) NOT NULL DEFAULT '' COMMENT 'json字串发送的账号',
  `to` varchar(20) NOT NULL DEFAULT '' COMMENT '手机短信接收方',
  `sign` varchar(20) NOT NULL DEFAULT '' COMMENT '使用的服务商签名',
  `template_id` int(11) NOT NULL DEFAULT '0' COMMENT '短信模板id',
  `var_content` varchar(100) NOT NULL DEFAULT '' COMMENT '短信内容所属变量',
  `add_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
  `api_time` int(11) NOT NULL DEFAULT '0' COMMENT '接口请求带入的时间戳',
  `send_time` int(11) NOT NULL DEFAULT '0' COMMENT '发送时间',
  `accept_time` int(11) NOT NULL DEFAULT '0' COMMENT '成功或者失败的时间',
  `insert_time` int(11) NOT NULL DEFAULT '0' COMMENT '数据插入时间',
  `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态 0表示待发送,1表示发送成功,2 表示发送失败',
  `status_info` varchar(100) NOT NULL DEFAULT '' COMMENT '成功或者失败的状态信息,服务端的编码或者客户端的错误日志',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `status` (`status`),
  KEY `idx_to` (`to`),
  KEY `msg_id` (`msg_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='手机短信行业发送流水表';
  • 营销短信发送记录表
CREATE TABLE `msg_mobile_yingxiao_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增长主键id',
  `request_client` varchar(100) NOT NULL DEFAULT '' COMMENT '请求所属客户端',
  `msg_id` varchar(100) NOT NULL DEFAULT '' COMMENT '消息id',
  `appoint_api` varchar(50) NOT NULL DEFAULT '' COMMENT '指定的请求发送端指定发送短信的api',
  `by_account` varchar(255) NOT NULL DEFAULT '' COMMENT 'json字串发送的账号',
  `to` varchar(20) NOT NULL DEFAULT '' COMMENT '手机短信接收方',
  `sign` varchar(20) NOT NULL DEFAULT '' COMMENT '使用的服务商签名',
  `template_id` int(11) NOT NULL DEFAULT '0' COMMENT '短信模板id',
  `var_content` varchar(100) NOT NULL DEFAULT '' COMMENT '短信内容所属变量',
  `add_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
  `api_time` int(11) NOT NULL DEFAULT '0' COMMENT '接口请求带入的时间戳',
  `send_time` int(11) NOT NULL DEFAULT '0' COMMENT '发送时间',
  `accept_time` int(11) NOT NULL DEFAULT '0' COMMENT '成功或者失败的时间',
  `insert_time` int(11) NOT NULL DEFAULT '0',
  `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态 0表示待发送,1表示发送成功,2 表示发送失败',
  `status_info` varchar(100) NOT NULL DEFAULT '' COMMENT '成功或者失败的状态信息,服务端的编码或者客户端的错误日志',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `status` (`status`),
  KEY `idx_to` (`to`),
  KEY `msg_id` (`msg_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='手机短信发送流水表';
  • 短信发送模板表
CREATE TABLE `msg_mobile_template` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增长主键id',
  `template_use` varchar(100) NOT NULL DEFAULT '' COMMENT '短信模板用途,名称必须唯一',
  `content` text COMMENT '短信模板内容',
  `var_content` varchar(100) NOT NULL DEFAULT '' COMMENT '短信内容需要的变量',
  `add_person` varchar(50) NOT NULL DEFAULT '' COMMENT '添加模板人员',
  `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `last_update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '邮件最后更新时间,如果和添加时间相同说没有没有被更新过',
  `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,默认0代表正常, 1代表删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_template_use` (`template_use`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='短信模板配置表';
  • 消息发送模板表说明
 1. 说明适用表项:msg_email_template , ms_mobile_template 
 2. 内容说明 :
    > id  接口中dba要求接口的 template的值以模板表id值为依据传入
    > content 字段中包含内容的一般格式如: 您好@test,您的验证码是@number,如有疑问请call@phone,blablabla@test 
    > var_content|var_title 字段包含内容:["@test","@number","@phone"] (json转码之后的变量数组)
        * 这个变量在json 中的位置决定前端接口请求时变量值对应的位置
        * 只有var_content或者var_title中指定的变量名才会被发送时解析,其他则保持不变
        * 在发送时如果接口传入var_content:["**先生","8888","1399999999"],则content变成:您好**先生,您的验证码是8888,如有疑问请call@1399999999,blablabla**先生
  • 邮件发送记录表
CREATE TABLE `msg_email_list` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增长主键id',
  `request_client` varchar(40) NOT NULL DEFAULT '' COMMENT '请求所属客户端',
  `channel` varchar(200) NOT NULL DEFAULT '' COMMENT '发送邮件的配置',
  `to` varchar(60) NOT NULL DEFAULT '' COMMENT '接收账号,邮件接收账号上限设定为200个,否则会引起内存问题',
  `template_id` int(11) NOT NULL DEFAULT '0' COMMENT '邮件模板id',
  `var_title` varchar(50) NOT NULL DEFAULT '' COMMENT '邮件标题所属变量',
  `var_content` varchar(500) NOT NULL DEFAULT '' COMMENT '邮件内容所属变量',
  `add_time` int(11) NOT NULL DEFAULT '0' COMMENT '插入时间',
  `api_time` int(11) NOT NULL DEFAULT '0' COMMENT '接收的数据中带的时间戳',
  `send_time` int(11) NOT NULL DEFAULT '0' COMMENT '发送时间',
  `accept_time` int(11) NOT NULL DEFAULT '0' COMMENT '成功或者失败时间',
  `insert_time` int(11) NOT NULL DEFAULT '0' COMMENT '插入时间',
  `status` tinyint(2) NOT NULL DEFAULT '0' COMMENT '状态0表示待发送,1表示发送成功,2表示发送失败,3表示任务已分配',
  `status_info` varchar(500) NOT NULL DEFAULT '' COMMENT '成功或者失败的状态信息,服务端的编码或者客户端的错误日志',
  PRIMARY KEY (`id`),
  KEY `idx_to` (`to`),
  KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='邮件发送流水表';
  • 邮件发送记录表
CREATE TABLE `msg_email_template` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增长主键id',
  `template_use` varchar(100) NOT NULL DEFAULT '' COMMENT '邮件模板用途,名称必须唯一',
  `title` varchar(100) NOT NULL DEFAULT '' COMMENT '邮件模板标题',
  `var_title` varchar(50) NOT NULL DEFAULT '' COMMENT '邮件标题需要的变量',
  `content` mediumtext COMMENT '邮件模板内容',
  `var_content` varchar(500) NOT NULL DEFAULT '' COMMENT '邮件内容需要的变量',
  `add_person` varchar(50) NOT NULL DEFAULT '' COMMENT '添加模板人员',
  `add_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  `last_update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '邮件最后更新时间,如果和添加时间相同说没有没有被更新过',
  `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除,默认0代表正常, 1代表删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_template_use` (`template_use`),
  KEY `idx_title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COMMENT='邮件模板配置表';
  • 系统配置表

CREATE TABLE `msg_setting` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `key` char(40) NOT NULL DEFAULT '' COMMENT '配项key,每个配置项的所属名称',
  `type` char(40) NOT NULL DEFAULT '' COMMENT '配置项类型,sms_account:短信发送账号配置',
  `setting` text NOT NULL COMMENT '设置项',
  `status` tinyint(2) NOT NULL DEFAULT '1' COMMENT '配置项是否启用 :1启用,0禁用,',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `key` (`key`) USING BTREE,
  KEY `status` (`status`) USING BTREE,
  KEY `type` (`type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
  • 系统设置表说明 msg_setting
    1. 系统设置主要存储信息的字段是:setting 。 存储的数据信息格式为json类型,示列:
        > {"config_update_times":"14409#此时间单位是分钟"}
        > {"default":"【玖融网】"}
    2. 区分设置类型的字段是:type 。
    3. 唯一对应每个设置的表示的字段是 : key 。全局唯一。
    4. 目前系统配置表可添加并且会自动应用的两种设置类型(type): EMAIL_ACCOUNT_SETTING , MOBILE_ACCOUNT_SETTING
    5. EMAIL_ACCOUNT_SETTING : 邮件发送账号信息设置 (包含邮件服务商端口号),具体setting信息如下:
        > host : 邮件服务商的服务地址
        > port : 邮件服务商发送端口号
        > smtp_tls : 是否启用安全协议,不启用填空,启用则需要填写为"tls"或者 "ssl" ,注意区分大小写
        > username : 邮件发送服务商提供的账号
        > password : 邮件发送服务商提供的密码
        > from_name : 这个是发送方名称 ,一般用来表示是谁发送的
        > reply_to : 如果需要被接收人回复,需要此项
        > 示列:{"host":"c.net","port":"25","smtp_tls":"tls","username":"kefu@qq.com","password":"152454545","from_name":"京东","reply_to":"kefu@qq.com"}
    
    6. MOBILE_ACCOUNT_SETTING : 短信发送账号设置,具体setting信息如下:
        > service_name : 短信服务商名称
        > api : 使用的api 类名 
        > yingxiao : 营销短信发送通道,包含的子数据组信息如下:
            * account : 短信发送方提供账号
            * password : 短信发送方提供的密码
        > 示列:{"service_name":"创蓝","api":"ChuangLan","yingxiao":{"account":"1445455","password":"455144"},"hangye":{"account":"9994","password":"11112"}}
  • 接口请求数据规定之短信请求数据
// 没错! 是post传入json格式的数据,而不是post键值对
{
    "timely":"0",
    "sms_service":"Santong", // 可选
    "msg_type":"mobile",
    "content_type":"0|1", // 0:行业,1:营销,2:html(Email 可用)
    "time":"1599999999",
    "sign":"【xxx公司】",
    "data":[
        {
            "to":"15997457695,13264706160",
            "var_content":["值1","值2"],// 可选
            "template":"1"
        },
        {
            "to":"15997457695,13264706160,15997457695,13264706160,15997457695,13264706160,",
            "template":"2"
        }
        //..... 更多
    ]
}
  • 接口请求数据值邮件请求数据
//email 接口说明:
{
    "timely":"0",
    "sms_service":"", // 可选
    "msg_type":"email",
    "content_type":"2",// 0:行业,1:营销,2:html(Email 可用)
    "time":"15997457695",
    "sign":"京东", // 发送邮件时如果此处不选择  则会默认取 系统设置中邮件的from_name 
    "data":[
        {
            "to":"55555sdf@qq.com,894545@qq.com",
            "content_var":["值1","值2"], // 可选
            "title_var":["值1","值2"],  // 可选
            "template":"1"
        },
        {
            "to":"55555sdf@qq.com,894545@qq.com,55555sdf@qq.com,894545@qq.com,",
            "content_var":["值1","值2"],
            "template":"2"
        }
        //..... 更多
    ]
}
/*
  注意:
      系统在发送邮件的时候会依次使用数据库的配置账号,当出现错误的时候会重试,达到重试错误最大次数将放弃使用这个账号 ,第二天会自动恢复使用
*/

###接口请求数据规定之短信发送接口请求数据各字段说明:

    1. timely : 是否及时,值 [ 0 , 1 ] ,说明 :1 代表需要及时发送,0 代表不需要及时发送
        // 注意:
        // 一般不是验证码的建议timely 为0 否则会影响验证码的及时性
    2. msg_type : 消息类型,值 [ mobile , email ],说明:mobile代表发送手机短信,email 代表发送邮件信息
    3. content_type : 内容类型 [ 0 , 1 , 2 ],说明:msg_type为email的内容类型必须为 2 (代表html) , 发送短信验证码一般是0 (行业) ,营销类的短信一般都是 1 (营销)
    4. time : 请求时的时间戳,一般是为查询延时用,
    5. sign : 如何msg_type是mobile 则必须是服务商审核过的名称标志,如果msg_type 是email 则此处代表发送方公司标识 # 可选字段
    6. sms_service : 是否制定服务发送方,如果指定则只会使用指定的服务发送方发送,值是选择性的,目前只有ChuangLan,SanTong两种 # 可选字段
    6. data : 是实际发送内容子信息,包含多维数据源(个多json子串) ,子串说明:
        > to :消息接收方,可以是多个,用逗号分隔
        > template : 使用的模板id
        > var_content : 模板变量的值格式是json值组如:["值1","值2"] ,模板如果没有设置变量则不需要传入此参数 #可选字段
  
  • 接口返回结果说明
    // 接口返回值 成功的json数据

    {
        error:0,
        info:成功,
        data:[] //备用字段
    }
    
    // 失败的 json 数据
    {
        error: 12 ,
        info : 可用通道余额不足,
        data : [] //备用字段
    }
    # 结果中 json属性error值为0代表成功,其他值代表失败 
    
    //info 对照
    
        0=>'成功',
    
        10000 => '~~~~~~~~',
        10001 => '空参数!',
        10002 => '无法解析为json数据!',
        10003 => '没有可用有效数据!',
        10004 => 'msg_type参数错误!',
        10005 => 'content_type参数错误!',
        10006 => 'data参数错误!',
        10007 => 'data参数不能为空!',
        10008 => 'time参数错误!',
        10009 => '不支持的消息发送类型!',
    
        10010 => '指定的短信服务商代码错误或者不存在!',
        10011 => '该短信发送服务商已经被禁用~',
        10012 => '当前短信服务商不可用或已欠费!',
        10013 => 'to参数为接收人,不能为空',
        10014 => 'to参数为接收人,参数不合法',
        10015 => 'to参数含手机号不能超过500~',
        10016 => 'to参数含有非合法手机号!',
        10017 => '指定模板不可为空!',
        10018 => '模板id不合法!',
        10019 => '不存在此短信模板!',
        10020 => '短信模板变量格式不合法!',
        10021 => '传入短信模板变量不能少于规定数量',
    
        20001 => '收件人不能为空!',
        20002 => '无效的收件人邮箱',
        20003 => '单次发送收件人数量不能超过500',
        20004 => '邮件模板不能为空!',
        20005 => '邮件模板数据不合法!',
        20006 => '不存在此邮件模板!',
        20007 => '此模板内容变量不能为空',
        20008 => '内容变量数据格式不符合要求!',
        20009 => '内容变量个数不符合模板要求!',
        20010 => '此模板标题变量不能为空!',
        20011 => '标题变量数据格式不符合要求',
        20012 => '标题变量个数不符合模板要求',
    
        40000=>'系统异常!',
        40001=>'系统异常![redis无法链接]',
        40002=>'数据库异常!',
        40003=>'数据库异常![mysql插入异常!]',
    
        50000 => '功能未开发~',

###注意:

  • 构造请求时请用post方法。
  • 请求数据是json类型(application/json),否则为非合法请求。
  • 环境为调试状态时不会真实发送,数据库状态信息会有详细说明,
  • 临时测试环境请配置host 【192.168.1.146 msg.cn】

##测试建议

  • 短信功能测试应该分为三部分测试 ,
  • 第一部分是接口测试大致为:响应稳定性测试,错误响应测试,成功场景测试
  • 第二部分为服务稳定性测试:
    • 服务稳定性测试大致包含:及时性,发送成功率 ,以及发送丢失概率
    • 及时性测试有两方面
      1. 测试短信验证码发送及时性,一般服务商正常响应为五秒内,所以要求短信发送从接口请求到收到短信在五秒内即为及时性合格。
      2. 可延迟发送短信是指短信发送从请求接口开始,到短信服务发送之间间隔不能超过十分钟。这个间隔时间不是请发送请求开始到实
        际收到时间的间隔,因为对于营销短信服务商从审核发哦最终发送之间间隔比较长,一般为半小时。可能会出现从接口请求到实际
        收到短信可能超过四十分钟。所以这个及时性测试只是测试从接口请求到短信服务发送时间间隔不能超过十分钟。即数据表send_time
        与api_time之间的差值不能超过600秒。
  • 第三部分为平台客户端测试:
    • 平台短信发送在请求短信服务的过程,就相对于客户端请求服务端。客户端集成在平台各个功能中,包含但不限于用户注册,用户开户
      ,找回密码等等功能之中。 需要列出具体功能一一测试

##消息服务程序后台服务管理

消息发送服务实行白名单机制,只有白名单ip才可访问 项目配置项config.php中:"sms_debug"=>true,此模式下,所有消息都不会真实发出,实际使用请改为:"sms_debug"=>false

白名单的设置在项目根目录的white_ip_list.conf 中

  • 配置语法是nginx 的geo 语法,示列: 192.168.1.1 京东; , 保存之后自动生效 ,注意:必须严格按照此格式,否则会造成web服务器崩溃、停止 ,

原始启动命令:

shell切换到项目根目录执行 :./think sms:start 启动服务,但是会阻塞当前shell ,如果推出则服务停止, 增强的管理脚本命令,shell切换到项目根目录执行 : ./mobile start 启动服务 mobile脚本接受两个参数 start,stop用来管理服务 需要考虑使用服务稳定性,建议使用crontab 做守护

GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., [http://fsf.org/] 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {description} Copyright (C) 2018 phpy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. {signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.

简介

邮件&短信微服务项目 展开 收起
PHP
GPL-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/mickelfeng/msg.git
git@gitee.com:mickelfeng/msg.git
mickelfeng
msg
msg
master

搜索帮助