本文整理汇总了PHP中Lazybug\Framework\V函数的典型用法代码示例。如果您正苦于以下问题:PHP V函数的具体用法?PHP V怎么用?PHP V使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了V函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: act
public function act()
{
if (!$this->check_param('itemid, moduleid, spaceid, casename, sendtype, contenttype')) {
LF\V('Json.Base')->init(Const_Code::CASE_PARAM_ERROR, '用例传递参数错误');
return;
}
$item_id = (int) Request::get_param('itemid', 'post');
$case_name = trim(Request::get_param('casename', 'post'));
if (LF\M('Case')->check_name_exists($item_id, $case_name)) {
LF\V('Json.Base')->init(Const_Code::ADD_CASE_EXISTS, '用例名称重复');
return;
}
LF\M('Case')->insert();
$case = LF\M('Case')->get_by_name($item_id, $case_name);
$case_id = (int) $case['id'];
if (!$case_id) {
LF\V('Json.Base')->init(Const_Code::ADD_CASE_FAIL, '用例添加失败');
return;
}
$item = LF\M('Item')->get_by_id($item_id);
$_POST['caseid'] = $case_id;
$_POST['stepname'] = '调用: ' . $item['name'] . '->' . $case_name;
$_POST['steptype'] = '接口调用';
$_POST['stepcommand'] = 'self';
$_POST['stepvalue'] = $case_id;
$_POST['stepsequence'] = 1;
LF\M('Step')->insert();
LF\V('Json.Base')->init(Const_Code::SUCCESS, $case_id);
}
示例2: act
public function act()
{
$user_num = LF\M('User')->get_count();
$view = LF\V('Html.User.Index');
$view->add_data('page_num', ceil((int) $user_num['count'] / 10));
$view->init('User.Index');
}
示例3: act
public function act()
{
if (!$this->check_param('username, password, issave')) {
LF\V('Json.Base')->init(Const_Code::LOGIN_PARAM_ERROR, '登录传递参数错误');
return;
}
$username = trim(Request::get_param('username', 'post'));
$password = trim(Request::get_param('password', 'post'));
$is_save = (int) Request::get_param('issave', 'post');
$time = time();
$seckey = LF\lb_read_system('seckey');
$user_id = (int) LF\M('User')->check_password($username, md5($username . $password));
if (!$user_id) {
LF\V('Json.Base')->init(Const_Code::LOGIN_FAIL, '帐号验证失败');
return;
}
$user = LF\M('User')->get_by_id($user_id);
$expire_time = $is_save ? 86400 * 30 : 0;
Cookie::set_cookie('userid', $user_id, $expire_time);
Cookie::set_cookie('username', $user['name'], $expire_time);
Cookie::set_cookie('userrole', $user['role'], $expire_time);
Cookie::set_cookie('time', $time, $expire_time);
Cookie::set_cookie('secstr', md5($user_id . '$' . $user['name'] . '$' . $user['role'] . '$' . $time . '$' . $seckey), $expire_time);
LF\V('Json.Base')->init(Const_Code::SUCCESS, '帐号验证通过');
}
示例4: act
public function act()
{
if (!$this->check_param('userid, username, userrole')) {
LF\V('Json.Base')->init(Const_Code::USER_PARAM_ERROR, '用户传递参数错误');
return;
}
$user_id = (int) Request::get_param('userid', 'post');
$user_name = trim(Request::get_param('username', 'post'));
$user_password = trim(Request::get_param('userpassword', 'post'));
if (!preg_match('/^\\w+$/', $user_name)) {
LF\V('Json.Base')->init(Const_Code::USER_FORMAT_ERROR, '用户名称格式错误');
return;
}
if (LF\M('User')->check_name_update($user_id, $user_name)) {
LF\V('Json.Base')->init(Const_Code::UPDATE_USER_EXISTS, '用户名称重复');
return;
}
if ($user_password) {
$_POST['userpassword'] = md5($user_name . $user_password);
} else {
unset($_POST['userpassword']);
}
unset($_POST['username']);
$result = LF\M('User')->where('id=' . $user_id)->update();
if (is_null($result)) {
LF\V('Json.Base')->init(Const_Code::UPDATE_USER_FAIL, '用户更新失败');
return;
}
LF\V('Json.Base')->init(Const_Code::SUCCESS, '用户更新成功');
}
示例5: act
public function act()
{
if (!$this->check_param('oldpassword, newpassword')) {
LF\V('Json.Base')->init(Const_Code::USER_PARAM_ERROR, '用户传递参数错误');
return;
}
$old_password = trim(Request::get_param('oldpassword', 'post'));
$new_password = trim(Request::get_param('newpassword', 'post'));
$user_id = (int) $_COOKIE['userid'];
$user_name = $_COOKIE['username'];
$old_password = md5($user_name . $old_password);
$new_password = md5($user_name . $new_password);
$user = LF\M('User')->get_by_id($user_id);
if ($old_password !== $user['passwd']) {
LF\V('Json.Base')->init(Const_Code::USER_CHECK_ERROR, '用户密码校验失败');
return;
}
$_POST['userpassword'] = $new_password;
$result = LF\M('User')->where('id=' . $user_id)->update();
if (is_null($result)) {
LF\V('Json.Base')->init(Const_Code::UPDATE_USER_FAIL, '用户密码更新失败');
return;
}
LF\V('Json.Base')->init(Const_Code::SUCCESS, '用户密码更新成功');
}
示例6: check_api_auth
public function check_api_auth()
{
if (!$this->check_auth()) {
LF\V('Json.Base')->init(Const_Code::AUTH, '授权限制');
exit;
}
}
示例7: act
public function act()
{
if (!$this->check_param('guid')) {
return;
}
$guid = trim(Request::get_param('guid', 'post'));
LF\V('Xml.Base')->init('summary', LF\M('History')->get_by_guid($guid));
}
示例8: act
public function act()
{
$case_id = (int) Request::get_param('caseid', 'post');
$case = LF\M('Case')->get_by_id($case_id);
if (!$case) {
LF\V('Xml.Base')->init('step', array());
return;
}
$_POST['resultname'] = $case['name'];
LF\M('Result')->insert();
LF\V('Xml.Base')->init('step', LF\M('Step')->get_by_case($case_id));
}
示例9: act
public function act()
{
$task_id = (int) Request::get_param('taskid', 'post');
$space_id = (int) Request::get_param('spaceid', 'post');
$module_id = (int) Request::get_param('moduleid', 'post');
if ($module_id) {
$item_list = LF\M('Item')->get_by_module($module_id, 0, 0);
} else {
$item_list = LF\M('Item')->get_by_space($space_id, 0, 0);
}
LF\M('Job')->set_total($task_id, count($item_list));
LF\V('Xml.Base')->init('item', $item_list);
}
示例10: act
public function act()
{
if (!$this->check_param('smtpserver, smtpport')) {
LF\V('Json.Base')->init(Const_Code::SYSTEM_PARAM_ERROR, '系统传递参数错误');
return;
}
$result = LF\M('System')->update();
if (is_null($result)) {
LF\V('Json.Base')->init(Const_Code::UPDATE_SYSTEM_FAIL, '系统更新失败');
return;
}
LF\V('Json.Base')->init(Const_Code::SUCCESS, '系统更新成功');
}
示例11: act
public function act()
{
if (!$this->check_param('caseid')) {
LF\V('Json.Base')->init(Const_Code::CASE_PARAM_ERROR, '用例传递参数错误');
return;
}
$case_id = (int) Request::get_param('caseid', 'post');
LF\M('Case')->remove($case_id);
$case = LF\M('Case')->get_by_id($case_id);
if ($case) {
LF\V('Json.Base')->init(Const_Code::DELETE_CASE_FAIL, '用例删除失败');
return;
}
LF\V('Json.Base')->init(Const_Code::SUCCESS, '用例删除成功');
}
示例12: act
public function act()
{
if (!$this->check_param('taskid, taskhang')) {
LF\V('Json.Base')->init(Const_Code::TASK_PARAM_ERROR, '任务传递参数错误');
return;
}
$task_id = (int) Request::get_param('taskid', 'post');
$task_hang = (int) Request::get_param('taskhang', 'post');
$result = LF\M('Task')->set_hang($task_id, $task_hang);
if (is_null($result)) {
LF\V('Json.Base')->init(Const_Code::UPDATE_TASK_FAIL, '任务更新失败');
return;
}
LF\V('Json.Base')->init(Const_Code::SUCCESS, '任务更新成功');
}
示例13: act
public function act()
{
try {
$user = LF\M('User');
} catch (Exception $e) {
Response::set_header_location('/index.php/database');
exit;
}
if (!function_exists('curl_init')) {
Response::set_header_location('/index.php/module?name=php-curl');
exit;
}
$view = LF\V('Html.Public.Login');
$view->init('Public.Login');
}
示例14: act
public function act()
{
$item_id = (int) Request::get_param('itemid', 'post');
$task_id = (int) Request::get_param('taskid', 'post');
$level = (int) Request::get_param('level', 'post');
LF\M('Job')->increase_current($task_id);
$item = LF\M('Item')->get_by_id($item_id);
if (!$item) {
LF\V('Xml.Base')->init('case', array());
return;
}
$_POST['resultname'] = $item['name'];
LF\M('Result')->insert();
LF\V('Xml.Base')->init('case', LF\M('Case')->get_by_level($item_id, $level));
}