Beispiel #1
0
<?php

/**
* Clover Core Class For Web Request Executing
* Copyright 2015 EJSE
* Under MIT License
* Version 0.1 Updated on Dec 11 2015
*/
require __DIR__ . '/core/Clover.php';
date_default_timezone_set("Asia/Shanghai");
Clover::setRootPath(__DIR__);
Clover::start();
Beispiel #2
0
 /**
  * It is routed as CLOVER_ROOT/CloverInfoTest/sample2
  * It shows the usage of Clover Storage
  */
 function sample1()
 {
     var_dump(Clover::getStore('A'));
     Clover::setStore('A', 'aaa');
     var_dump(Clover::getStore('A'));
 }
Beispiel #3
0
 public function index()
 {
     Clover::display('CloverIndex.htm');
 }
Beispiel #4
0
 public static function displayWithJSON($json_object, $code = 200, $error = '')
 {
     header('Content-type: application/json');
     $json = array('code' => $code, 'result' => $json_object, 'error' => $error);
     $result = json_encode($json);
     echo $result;
     Clover::getLogger()->log("[RESPONSE] #" . Clover::$current_task_uuid . " " . $result);
     exit;
 }