Changeset 42 for trunk/lib/MCVE.inc.php


Ignore:
Timestamp:
Dec 18, 2005 12:16:03 AM (18 years ago)
Author:
scdev
Message:

detabbed all files ;P

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/MCVE.inc.php

    r41 r42  
    1919    var $connected = false;
    2020    var $conn;
    21    
     21
    2222    function MCVE($username, $password)
    2323    {
     
    2828        }
    2929        if ('' == $username || '' == $password) {
    30             App::logMsg(sprintf('Empty username or password provided.', null), LOG_ERR, __FILE__, __LINE__);
     30            App::logMsg(sprintf('Empty username or password provided.', null), LOG_ERR, __FILE__, __LINE__);
    3131        }
    3232        $this->username = $username;
     
    3939            return true;
    4040        }
    41        
     41
    4242        // Initialize SSL structures and definitions.
    4343        MCVE_InitEngine($ca_bundle_file);
    44        
     44
    4545        // Allocate Connection Structures
    4646        $this->conn = MCVE_InitConn();
    47        
     47
    4848        // Set Connection Method and Locations
    4949        switch ($this->connect_method) {
     
    6969            App::logMsg('Connection method not defined.', LOG_ERR, __FILE__, __LINE__);
    7070        }
    71        
     71
    7272        // Put connection into non-blocking mode, meaning that the client must
    7373        // loop waiting for the transaction to complete. You should always specify
     
    7878            return false;
    7979        }
    80        
     80
    8181        // Maximum of 30s per transaction allowed. Timeout occurs on server-end, not client-end
    8282        if (!MCVE_SetTimeout($this->conn, $this->timeout)) {
     
    8484            return false;
    8585        }
    86        
     86
    8787        // Connect to MCVE, if there's an error, print the exact reason for connection failure
    8888        if (!MCVE_Connect($this->conn)) {
     
    9191            return false;
    9292        }
    93        
     93
    9494        $this->connected = true;
    9595    }
    96    
     96
    9797    function beginTrans()
    9898    {
     
    103103        return $tid;
    104104    }
    105    
     105
    106106    function transParam($tid, $key, $var1, $var2=null)
    107107    {
     
    111111            return MCVE_TransParam($this->conn, $tid, $key, $var1, $var2);
    112112        }
    113        
     113
    114114    }
    115    
     115
    116116    function sendTrans($tid, $type='', $hide_msg=false)
    117117    {
     
    121121            return false;
    122122        }
    123        
    124         // Perform actual communication with MCVE engine. 
     123
     124        // Perform actual communication with MCVE engine.
    125125        // If blocking method is used, loop until transaction is complete
    126126        if ($this->blocking != 1) {
     
    130130            }
    131131        }
    132        
     132
    133133        $ret_status = MCVE_ReturnStatus($this->conn, $tid);
    134134        $ret_code = MCVE_ReturnCode($this->conn, $tid);
    135135        $ret_text = mcve_text_code($ret_code);
    136136        $verbiage = MCVE_TransactionText($this->conn, $tid);
    137    
     137
    138138        // Check to see if transaction was successful or not using a strict success/fail function
    139139        if ($ret_status == MCVE_FAIL) {
     
    144144                App::raiseMsg(sprintf(_("MCVE %s success: %s %s"), $type, $ret_text, ('' == $verbiage ? '' : '(' . trim($verbiage) . ')')), MSG_SUCCESS, __FILE__, __LINE__);
    145145            }
    146             App::logMsg(sprintf(_("MCVE success details. Auth: %s; Batch: %s; Item: %s; TTID: %s; AVS: %s; CV: %s."), 
     146            App::logMsg(sprintf(_("MCVE success details. Auth: %s; Batch: %s; Item: %s; TTID: %s; AVS: %s; CV: %s."),
    147147                MCVE_TransactionAuth($this->conn, $tid),
    148148                MCVE_TransactionBatch($this->conn, $tid),
     
    158158        }
    159159    }
    160    
     160
    161161    function disconnect($tid)
    162162    {
     
    165165            // MCVE_DestroyConn though
    166166            MCVE_DeleteTrans($this->conn, $tid);
    167            
     167
    168168            // Clean up and close MCVE.
    169169            MCVE_DestroyConn($this->conn);
    170170            MCVE_DestroyEngine();
    171            
     171
    172172            $this->connected = false;
    173173        }
Note: See TracChangeset for help on using the changeset viewer.