• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP finalize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中finalize函数的典型用法代码示例。如果您正苦于以下问题:PHP finalize函数的具体用法?PHP finalize怎么用?PHP finalize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了finalize函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: gravarPermissoes

function gravarPermissoes()
{
    include '../dao/ConnectionHolder.php';
    $idUsuario = $_POST["idUsuario"];
    if (!$idUsuario) {
        finalize("idUsuario não fornecido!");
    }
    $idList = $_POST["list"];
    if (!$idList) {
        finalize("Lista de permissões vazia!");
    }
    try {
        $connection = ConnectionHolder::getConnection();
        // PROBLEMA!!
        // O postgres não trabalha com o conceito de transação, commit e rollback,
        // ao invés disso, deve ser enviada uma query, sendo todo o script sql,
        // e será executado todo, ou nada.
        // Fonte: http://stackoverflow.com/questions/9704557/php-pgsql-driver-and-autocommit
        // Apaga as permissoes existentes para o usuário
        $query = "DELETE FROM permissoes WHERE idusuario = " . $idUsuario . "; ";
        // Insere as operações recebidas por POST
        foreach ($idList as $id) {
            $query .= "INSERT INTO permissoes (idoperacaomodulo, idusuario) " . "VALUES (" . $id . ", " . $idUsuario . "); ";
        }
        $resultSet = pg_query($connection, $query);
        if (!$resultSet) {
            finalize("Query error");
        }
        done();
    } catch (Exception $e) {
        finalize("Exception: " . $e->getMessage());
    }
}
开发者ID:RMCampos,项目名称:Projerp,代码行数:33,代码来源:gerenciarpermissoesAPI.php


示例2: getUsuarioPorId

function getUsuarioPorId()
{
    include '../dao/Usuarios.php';
    include '../dao/UsuariosDAO.php';
    $usuariosDAO = new UsuariosDAO();
    $idUsuario = $_POST["idUsuario"];
    $usuarios = $usuariosDAO->selectRegistro($idUsuario);
    if (!$usuarios) {
        finalize("Usuário não encontrado!");
    }
    $json['success'] = 1;
    $json['data'] = array("id" => $usuarios->getId(), "login" => $usuarios->getLogin(), "nome" => $usuarios->getNome(), "email" => $usuarios->getEmail(), "ativo" => $usuarios->isAtivo(), "senha" => $usuarios->getSenha());
    echo json_encode($json);
}
开发者ID:RMCampos,项目名称:Projerp,代码行数:14,代码来源:cadastrousuariosAPI.php


示例3: getCRMPorId

function getCRMPorId()
{
    include '../dao/Cliforn.php';
    include '../dao/ClifornDAO.php';
    $clifornDAO = new ClifornDAO();
    $id = $_POST["idCRM"];
    $cliforn = $clifornDAO->selectRegistro($id);
    if (!$cliforn) {
        finalize("Cliente/Fornecedor não encontrado!");
    }
    $json['success'] = 1;
    $json['data'] = array("id" => $cliforn->getId(), "tipo" => $cliforn->getTipo(), "nome" => $cliforn->getNome(), "sexo" => $cliforn->getSexo(), "datanascimento" => $cliforn->getDatanascimento(), "cpf" => $cliforn->getCpf(), "rg" => $cliforn->getRg(), "razaosocial" => $cliforn->getRazaosocial(), "fantasia" => $cliforn->getFantasia(), "cnpj" => $cliforn->getCnpj(), "ie" => $cliforn->getIe(), "ativo" => $cliforn->isAtivo());
    echo json_encode($json);
}
开发者ID:RMCampos,项目名称:Projerp,代码行数:14,代码来源:cadastrocrmAPI.php


示例4: verificarLogin

function verificarLogin()
{
    include '../dao/Usuarios.php';
    include '../dao/UsuariosDAO.php';
    $login = $_POST["login"];
    $senha = $_POST["senha"];
    $usuariosDAO = new UsuariosDAO();
    $usuarios = $usuariosDAO->selectRegistroPorLogin($login);
    if (!$usuarios) {
        finalize(NULL);
    }
    if (strcmp($usuarios->getSenha(), $senha) != 0) {
        finalize(NULL);
    }
    iniciarSessao($usuarios);
    done();
}
开发者ID:RMCampos,项目名称:Projerp,代码行数:17,代码来源:indexAPI.php


示例5: done_testing

function done_testing()
{
    global $t;
    $funcs = get_defined_functions();
    $initialize = false;
    $finalize = false;
    if (in_array('initialize', $funcs['user'])) {
        $initialize = true;
    }
    if (in_array('finalize', $funcs['user'])) {
        $finalize = true;
    }
    if (in_array('build', $funcs['user'])) {
        build($t);
    }
    foreach ($funcs['user'] as $func) {
        # 予約された function
        if (in_array($func, array('build', 'destroy', 'initialize', 'finalize', 'done_testing'))) {
            continue;
        }
        # _function( ) は skip
        if (preg_match('/^_/', $func)) {
            continue;
        }
        if ($initialize) {
            initialize($t);
        }
        try {
            $t->diag("in function '{$func}'");
            $func($t);
        } catch (Exception $e) {
            $t->diag($e->getMessage() . " at {$func}( )");
            $t->fail();
        }
        if ($finalize) {
            finalize($t);
        }
    }
    if (in_array('destroy', $funcs['user'])) {
        destroy($t);
    }
}
开发者ID:hatyuki,项目名称:php-ClassTrigger,代码行数:42,代码来源:setup.php


示例6: buscarPermissoesCRM

function buscarPermissoesCRM()
{
    include '../dao/Operacaomodulos.php';
    include '../dao/OperacaomodulosDAO.php';
    include '../dao/Permissoes.php';
    include '../dao/PermissoesDAO.php';
    $operacaomodulosDAO = new OperacaomodulosDAO();
    $permissoesDAO = new PermissoesDAO();
    // Buscar as operações do módulo id=2 (CRM)
    $operacoesList = $operacaomodulosDAO->selectListaRegistrosPorModulo(1);
    if (!$operacoesList) {
        finalize(NULL);
    }
    $list['success'] = 1;
    $list['data'] = array();
    foreach ($operacoesList as $op) {
        $permissoes = $permissoesDAO->selectRegistro($op->getIdoperacaomodulo(), $_SESSION["id"]);
        if (!$permissoes) {
            continue;
        }
        $list['data'][] = $op->getDescricao();
    }
    echo json_encode($list);
}
开发者ID:RMCampos,项目名称:Projerp,代码行数:24,代码来源:gerenciarcrmAPI.php


示例7: array

<?php

/* config.js */
$params->PageBgColor = $params->PageBgColor ? $params->PageBgColor : "#d7d7d7";
$slideshow_css = '$CssPath$style.css';
$thumbs = (object) array('margin' => 3, 'padding' => 4);
array_push($files, (object) array('src' => 'backgnd/' . $params->TemplateName . '/bullet.png'));
array_push($files, (object) array('src' => 'backgnd/' . $params->TemplateName . '/arrows.png'));
array_push($files, (object) array('src' => 'backgnd/' . $params->TemplateName . '/play.png'));
array_push($files, (object) array('src' => 'backgnd/' . $params->TemplateName . '/pause.png'));
if ($params->ShowTooltips) {
    $params->ThumbWidthHalf = round($params->ThumbWidth / 2);
    array_push($files, (object) array('src' => 'backgnd/' . $params->TemplateName . '/triangle-' . $params->TooltipPos . '.png', 'dest' => '$ImgPath$triangle.png'));
    array_push($files, (object) array('src' => 'backgnd/' . $params->TemplateName . '/style-tooltip.css', 'dest' => $slideshow_css, 'filters' => array('params')));
}
// call this function at the end of each template
finalize();
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:17,代码来源:config.php


示例8: array

<?php

$json['data'] = array();
if (!isset($_POST) || !isset($_POST["operacao"])) {
    finalize("Access denied!");
}
session_start();
if (isset($_SESSION["id"])) {
    DEFINE("ID_USUARIO", $_SESSION["id"]);
}
function finalize($message)
{
    if (!$message) {
        $message = "No message suplied!";
    }
    $json['success'] = 0;
    $json['message'] = $message;
    echo json_encode($json);
    exit;
}
function done()
{
    $json['success'] = 1;
    $json['data'] = array();
    echo json_encode($json);
    exit;
}
function iniciarSessao($usuarios)
{
    $_SESSION['id'] = $usuarios->getId();
    $_SESSION['login'] = $usuarios->getLogin();
开发者ID:RMCampos,项目名称:Projerp,代码行数:31,代码来源:baseAPI.php



注:本文中的finalize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP finalize_page函数代码示例发布时间:2022-05-15
下一篇:
PHP finalizar函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap