Esempio n. 1
0
 /**
  * @static
  * @return rest_Server
  */
 public static function instance()
 {
     if (self::$self == NULL) {
         self::$self = new self();
     }
     return self::$self;
 }
Esempio n. 2
0
 /**
  * Scaffold delete
  */
 protected function ScaffoldRemove()
 {
     $this->rest->method('POST');
     $parms = $this->getRequest()->getPost();
     $this->rest->paramsMustMap = array('primary');
     $this->rest->paramsMustValid($parms);
     $result = $this->db->delete($this->table_name, array($this->primary => $parms['primary']));
     if ($result) {
         $this->rest->success();
     }
     $this->rest->error();
 }
Esempio n. 3
0
 /**
  * 主要check流程
  * @param string $key
  */
 public function check($key = NULL)
 {
     self::getkey($key);
     $ready = $this->cache->get($this->key);
     if ($ready == FALSE) {
         $this->cache->set($this->key, array(time()));
         return;
     }
     $ready_ = $ready;
     if (self::checkCountAndTime($ready_)) {
         $this->rest->error(rest_Code::STATUS_ERROR_API_QUENCY_M);
     }
     unset($ready_);
     array_push($ready, time());
     $this->cache->set($this->key, $ready);
 }
Esempio n. 4
0
 function __construct()
 {
     $this->rest = rest_Server::instance();
 }