예제 #1
0
 public static function getInstance()
 {
     if (null == self::$instance) {
         self::$instance = new TrackingUtils();
     }
     return self::$instance;
 }
예제 #2
0
 public function __construct()
 {
     $this->user = User::getInstance();
     $this->session = Session::getInstance();
     $this->trackingUtils = TrackingUtils::getInstance();
     $this->user->auth('*****@*****.**', 'tenant');
 }
예제 #3
0
파일: index.php 프로젝트: vberzsin/2014
    $utils = Utils::getInstance();
    $trackUtils = TrackingUtils::getInstance();
    $json = $utils->iJsonDoc($app->request()->post('json'), 255);
    $track = ['user_id' => $json->user_id, 'phone_id' => $json->phone_id, 'event' => $json->event, 'target' => $json->target, 'description' => $json->description];
    $res = $trackUtils->addTrack($track);
    $err = $res == false ? '' : $session->flushError();
    $res = $res == false ? 'false' : $res;
    $res = ['req' => 'trckrj', 'res' => $res, 'err' => $err];
    print json_encode($res);
    header('Content-Type: application/json');
    return;
});
$app->post('/trckr/', function () use($app) {
    $session = Session::getInstance();
    $utils = Utils::getInstance();
    $trackUtils = TrackingUtils::getInstance();
    $uid = $utils->iStr($app->request()->post('user_id'), 64);
    $pid = $utils->iStr($app->request()->post('phone_id'), 64);
    $event = $utils->iStr($app->request()->post('event'), 256);
    $target = $utils->iStr($app->request()->post('target'), 256);
    $description = $utils->iStr($app->request()->post('description'), 256);
    $track = ['user_id' => $uid, 'phone_id' => $pid, 'event' => $event, 'target' => $target, 'description' => $description];
    $res = $trackUtils->addTrack($track);
    $err = false == $res ? '' : $session->flushError();
    $res = false == $res ? 'false' : $res;
    $res = ['req' => 'trackr', 'res' => $res, 'err' => $err];
    print json_encode($res);
    header('Content-Type: application/json');
    return;
});
$app->get('/social/', function () use($app) {