<?php

include '../config.php';
include '../../lib/pusher/Pusher.php';
include '../../lib/pusher/functions.php';
$name = $_POST['my_name'];
$name = sanitize($name, 50);
$tech = $_POST['favourite_technology'];
$tech = sanitize($tech, 50);
$pusher = get_pusher();
$data = array('name' => $name, 'tech' => $tech);
save_user_info($data);
set_stage('wait');
$pusher->trigger(PRESENTATION_CHANNEL_NAME, 'introduction', $data);
$user_data = get_user_data();
header('Content-Type: application/javascript');
echo json_encode($user_data);
Exemple #2
0
<?php

//设置时区
date_default_timezone_set('Asia/Shanghai');
ini_set('display_errors', 1);
include "config.php";
include "cls_curl.php";
include "db.php";
include "cache.php";
include "worker.php";
include "user.php";
//$data = get_user_info("yangzetao");
//echo '<pre>';print_r($data);echo '</pre>';
//exit;
$w = new worker();
$w->count = 8;
$w->is_once = true;
$count = 100000;
// 每个进程循环多少次
$w->on_worker_start = function ($worker) use($count) {
    //$progress_id = posix_getpid();
    for ($i = 0; $i < $count; $i++) {
        save_user_info($worker);
    }
};
$w->run();