# tp框架的安装配置流程
1.下载安装tp5
2.下载 web-msg-sender 放在 vendor 里面
3. cd 运行到 vendor下面 直接 启动
4.`php start.php start` 运行 启动 即可
5. 然后再 index 下面的进行 配置 推送代码
6. 下面是index模块消息推送的代码
`
public function index()
{
$to_uid = "";
// 推送的url地址,使用自己的服务器地址
$push_api_url = "http://164.155.68.170:2121";
$post_data = array(
"type" => "publish",
"content" => "这个是推送的测试数据"
);
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $push_api_url );
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );
curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Expect:"));
$return = curl_exec ( $ch );
curl_close ( $ch );
var_export($return);
}
public function demo()
{
echo 5665;
}
}
`