<?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();
/** * 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')); }
public function index() { Clover::display('CloverIndex.htm'); }
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; }