- remove the long desc of license.
This commit is contained in:
+36
-49
@@ -1,49 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* The control file of api of ZenTaoMS.
|
||||
*
|
||||
* ZenTaoMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ZenTaoMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @copyright Copyright 2009-2010 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package api
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class api extends control
|
||||
{
|
||||
/* 获得sessionid。*/
|
||||
public function getSessionID()
|
||||
{
|
||||
$this->session->set('rand', mt_rand(0, 10000));
|
||||
$this->view->sessionName = session_name();
|
||||
$this->view->sessionID = session_id();
|
||||
$this->view->rand = $this->session->rand;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 获得某一个model某一个方法的结果。params的传递方式:param1=value1,param2=value2。*/
|
||||
public function getModel($moduleName, $methodName, $params = '')
|
||||
{
|
||||
parse_str(str_replace(',', '&', $params), $params);
|
||||
$module = $this->loadModel($moduleName);
|
||||
$result = call_user_func_array(array(&$module, $methodName), $params);
|
||||
if(dao::isError()) die(json_encode(dao::getError()));
|
||||
$output['status'] = $result ? 'success' : 'fail';
|
||||
$output['data'] = json_encode($result);
|
||||
$output['md5'] = md5($output['data']);
|
||||
$this->output = json_encode($output);
|
||||
die($this->output);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* The control file of api of ZenTaoMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2010 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package api
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class api extends control
|
||||
{
|
||||
/* 获得sessionid。*/
|
||||
public function getSessionID()
|
||||
{
|
||||
$this->session->set('rand', mt_rand(0, 10000));
|
||||
$this->view->sessionName = session_name();
|
||||
$this->view->sessionID = session_id();
|
||||
$this->view->rand = $this->session->rand;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/* 获得某一个model某一个方法的结果。params的传递方式:param1=value1,param2=value2。*/
|
||||
public function getModel($moduleName, $methodName, $params = '')
|
||||
{
|
||||
parse_str(str_replace(',', '&', $params), $params);
|
||||
$module = $this->loadModel($moduleName);
|
||||
$result = call_user_func_array(array(&$module, $methodName), $params);
|
||||
if(dao::isError()) die(json_encode(dao::getError()));
|
||||
$output['status'] = $result ? 'success' : 'fail';
|
||||
$output['data'] = json_encode($result);
|
||||
$output['md5'] = md5($output['data']);
|
||||
$this->output = json_encode($output);
|
||||
die($this->output);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user