Dispatch.php
711 Bytes
<?php
/**
* Created by PhpStorm.
* User: Ziy
* Date: 14/8/30
* Time: 下午6:34
*/
include_once "Bootstrap.php";
register_shutdown_function('Test');
$amqp = new YHMIm_Relay();
$amqp->connect();
$amqp->exchange($config->exchangeName)
->setType(AMQP_EX_TYPE_TOPIC)
->setFlags(AMQP_DURABLE)
->declareExchange();
$queue = $amqp->queue($config->queueName);
$amqp->declareQueue();
$amqp->bind($config->exchangeName, $config->routeName);
$amqp->userRouteName($config->userRouteName);
$amqp->run();
$starttime = microtime(true);
function Test()
{
$starttime = microtime(true);
file_put_contents("/Data/code/test/log.txt","我是在最后写进来的,时间:$starttime"."/n", FILE_APPEND);
}