本文整理汇总了PHP中QuickBooks_Loader类的典型用法代码示例。如果您正苦于以下问题:PHP QuickBooks_Loader类的具体用法?PHP QuickBooks_Loader怎么用?PHP QuickBooks_Loader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QuickBooks_Loader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _mapFactory
protected function _mapFactory($map)
{
$class = 'QuickBooks_IPP_Cache_Mapper_' . ucfirst(strtolower($map));
$file = 'QuickBooks/IPP/Cache/Mapper/' . ucfirst(strtolower($map));
QuickBooks_Loader::load($file);
return new $class($map_dsn);
}
示例2: create
public static function create($encrypt)
{
$class = 'QuickBooks_Encryption_' . ucfirst(strtolower($encrypt));
$file = '/QuickBooks/Encryption/' . ucfirst(strtolower($encrypt)) . '.php';
QuickBooks_Loader::load($file);
return new $class();
}
示例3: _requestFactory
/**
* Create an instance of a request type object
*
* @param string $request
* @return QuickBooks_Request
*/
protected function _requestFactory($request)
{
$class = 'QuickBooks_WebConnector_Request_' . ucfirst(strtolower($request));
$file = '/QuickBooks/WebConnector/Request/' . ucfirst(strtolower($request)) . '.php';
// Make sure that class gets loaded
QuickBooks_Loader::load($file, false);
if (class_exists($class)) {
return new $class();
}
return false;
}
示例4: create
/**
* Create an instance of a driver class from a DSN connection string *or* a connection resource
*
* You can actually pass in *either* a DSN-style connection string OR an already connected database resource
* - mysql://user:pass@localhost:port/database
* - $var (Resource ID #XYZ, valid MySQL connection resource)
*
* @param mixed $dsn_or_conn A DSN-style connection string or a PHP resource
* @param array $config An array of configuration options for the driver
* @param array $hooks An array mapping hooks to user-defined hook functions to call
* @param integer $log_level
* @return object A class instance, a child class of QuickBooks_Driver
*/
public static function create($dsn_or_conn, $config = array(), $hooks = array(), $log_level = QUICKBOOKS_LOG_NORMAL)
{
static $instances = array();
if (!is_array($hooks)) {
$hooks = array();
}
// Do not serialize the $hooks because they might contain non-serializeable objects
$key = (string) $dsn_or_conn . serialize($config) . $log_level;
if (!isset($instances[$key])) {
if (is_resource($dsn_or_conn)) {
$scheme = current(explode(' ', get_resource_type($dsn_or_conn)));
} else {
$scheme = QuickBooks_Utilities::parseDSN($dsn_or_conn, array(), 'scheme');
}
if (false !== strpos($scheme, 'sql')) {
$scheme = 'Sql_' . ucfirst(strtolower($scheme));
} else {
$scheme = ucfirst(strtolower($scheme));
}
$class = 'QuickBooks_Driver_' . $scheme;
$file = '/QuickBooks/Driver/' . str_replace(' ', '/', ucwords(str_replace('_', ' ', strtolower($scheme)))) . '.php';
//print('class: ' . $class . "\n");
//print('file: ' . $file . "\n");
QuickBooks_Loader::load($file);
if (class_exists($class)) {
$Driver = new $class($dsn_or_conn, $config);
$Driver->registerHooks($hooks);
$Driver->setLogLevel($log_level);
/*
static $static = 0;
$static++;
print('Constructed new instance ' . $static . ' [' . $key . ']' . "\n");
mysql_query("INSERT INTO quickbooks_log ( msg, log_datetime ) VALUES ( 'Here is my " . $static . " key: " . $key . "', NOW() )");
//print_r($hooks);
*/
// @todo Ugh this is really ugly... maybe have $log_level passed in as a parameter? Not really a driver option at all?
//if (isset($config['log_level']))
//{
// $driver->setLogLevel($config['log_level']);
//}
$instances[$key] = $Driver;
} else {
$instances[$key] = null;
}
}
return $instances[$key];
}
示例5:
/**
* QuickBooks driver factory for database logging
*/
QuickBooks_Loader::load('/QuickBooks/Driver/Factory.php');
/**
* QuickBooks credit card class
*/
QuickBooks_Loader::load('/QuickBooks/Payments/CreditCard.php');
/**
* QuickBooks merchant service transaction class
*/
QuickBooks_Loader::load('/QuickBooks/Payments/Transaction.php');
/**
* Token class
*/
QuickBooks_Loader::load('/QuickBooks/Payments/Token.php');
/**
* QuickBooks Merchant Service implementation
*/
class Quickbooks_Payments
{
/**
* No error occurred
* @var integer
*/
const OK = QUICKBOOKS_ERROR_OK;
/**
* No error occurred
* @var integer
*/
const ERROR_OK = QUICKBOOKS_ERROR_OK;
示例6: _adapterFactory
/**
* Get an adapter class instance
*
* @param string $adapter
* @param string $wsdl
* @param array $soap_options
* @param integer $loglevel
* @return boolean
*/
protected function _adapterFactory($adapter, $wsdl, $soap_options, $loglevel)
{
$adapter = ucfirst(strtolower($adapter));
$file = '/QuickBooks/Adapter/Server/' . $adapter . '.php';
$class = 'QuickBooks_Adapter_Server_' . $adapter;
QuickBooks_Loader::load($file);
if (class_exists($class)) {
return new $class($wsdl, $soap_options);
}
return null;
}
示例7: prefix
*
* Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* @author Keith Palmer <keith@consolibyte.com>
* @license LICENSE.txt
*
* @package QuickBooks
*/
/**
*
*/
QuickBooks_Loader::load('/QuickBooks/Encryption/Factory.php');
/**
*
*
*/
abstract class QuickBooks_Encryption
{
/**
*
*
*
*/
public function prefix($str)
{
return '{' . strlen(get_class($this)) . ':' . strtolower(get_class($this)) . '}' . $str;
}
示例8: __construct
* Copyright (c) {2010-04-16} {Keith Palmer / ConsoliBYTE, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* @author Keith Palmer <keith@consolibyte.com>
* @license LICENSE.txt
*
* @package QuickBooks
* @subpackage Client
*/
/**
* QuickBooks request base class
*/
QuickBooks_Loader::load('/QuickBooks/WebConnector/Request.php');
/**
*
*
*
*/
class QuickBooks_WebConnector_Request_ConnectionError extends QuickBooks_WebConnector_Request
{
public $ticket;
public $hresult;
public $message;
public function __construct($ticket = null, $hresult = null, $message = null)
{
$this->ticket = $ticket;
$this->hresult = $hresult;
$this->message = $message;
示例9: __construct
<?php
/**
*
*
* @package QuickBooks
* @subpackage Object
*/
/**
*
*/
QuickBooks_Loader::load('/QuickBooks/QBXML/Object.php');
/**
*
*/
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/SalesReceipt.php');
/**
*
*
*/
class QuickBooks_QBXML_Object_SalesReceipt_DiscountLine extends QuickBooks_QBXML_Object
{
/**
* Create a new QuickBooks SalesReceipt SalesReceiptLine object
*
* @param array $arr
*/
public function __construct($arr = array())
{
parent::__construct($arr);
}
示例10:
* - QuickBooks HTTP Bridges
* - QuickBooks Foxycart integrator (relaying)
*
*
* @todo Documentation?
*
* @license LICENSE.txt
* @author Keith Palmer <keith@ConsoliBYTE.com>
*
* @package QuickBooks
* @subpackage HTTP
*/
/**
* QuickBooks utilities class
*/
QuickBooks_Loader::load('/QuickBooks/Utilities.php');
define('QUICKBOOKS_HTTP_ERROR_OK', QUICKBOOKS_ERROR_OK);
define('QUICKBOOKS_HTTP_ERROR_CERTIFICATE', 1);
define('QUICKBOOKS_HTTP_ERROR_UNSUPPORTED', 2);
define('QUICKBOOKS_HTTP_METHOD_GET', 'GET');
define('QUICKBOOKS_HTTP_METHOD_POST', 'POST');
define('QUICKBOOKS_HTTP_METHOD_HEAD', 'HEAD');
class QuickBooks_HTTP
{
const HTTP_400 = 400;
const HTTP_401 = 401;
const HTTP_500 = 500;
protected $_url;
protected $_request_headers;
protected $_body;
protected $_post;
示例11: __construct
* Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* @author Keith Palmer <keith@consolibyte.com>
* @license LICENSE.txt
*
* @package QuickBooks
* @subpackage Adapter
*/
/**
*
*/
QuickBooks_Loader::load('/QuickBooks/Adapter/Server.php');
/**
*
*/
class QuickBooks_Adapter_Server_PHP implements QuickBooks_Adapter_Server
{
protected $_server;
public function __construct($wsdl, $soap_options)
{
$this->_server = new SoapServer($wsdl, $soap_options);
}
public function handle($raw_http_input)
{
return $this->_server->handle($raw_http_input);
}
public function setClass($class, $dsn_or_conn, $map, $onerror, $hooks, $log_level, $raw_http_input, $handler_options, $driver_options, $callback_options)
示例12: __construct
* QuickBooks ReceivePayment object container
*
* @author Keith Palmer <keith@consolibyte.com>
* @license LICENSE.txt
*
* @package QuickBooks
* @subpackage Object
*/
/**
* Base object class
*/
QuickBooks_Loader::load('/QuickBooks/QBXML/Object.php');
/**
* Dependency class (applied payment)
*/
QuickBooks_Loader::load('/QuickBooks/QBXML/Object/BillPaymentCheck/AppliedToTxn.php');
/**
* QuickBooks ReceivePayment object
*/
class QuickBooks_QBXML_Object_BillPaymentCheck extends QuickBooks_QBXML_Object
{
/**
* Create a new QuickBooks_Object_ReceivePayment object
*
* @param array $arr
*/
public function __construct($arr = array())
{
parent::__construct($arr);
}
/**
示例13:
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* This class represents a transaction returned by the QuickBooks Merchant
* Service web gateway.
*
* @package QuickBooks
* @subpackage MerchantService
*/
/**
* QuickBooks MerchantService transaction processor
*/
QuickBooks_Loader::load('/QuickBooks/MerchantService.php');
/**
* XML parser class
*/
QuickBooks_Loader::load('/QuickBooks/XML/Parser.php');
/**
* QuickBooks Merchant Service transaction class
*/
class QuickBooks_MerchantService_Transaction
{
/**
* The type of transaction (QUICKBOOKS_MERCHANTSERVICE_CHARGE, etc.)
* @var string
*/
protected $_type;
/**
* The transaction ID
* @var string
*/
protected $_transID;
示例14: _ChildObjectsToXML
protected static function _ChildObjectsToXML($type, $action, $children, $parentPath = '')
{
$Driver = QuickBooks_Driver_Singleton::getInstance();
$nodes = array();
$file = '/QuickBooks/QBXML/Schema/Object/' . QuickBooks_Utilities::actionToRequest($action) . '.php';
$class = 'QuickBooks_QBXML_Schema_Object_' . QuickBooks_Utilities::actionToRequest($action);
QuickBooks_Loader::load($file);
$schema_object = new $class();
$usePath = '';
if ($parentPath != '') {
$usePath .= $parentPath . ' ';
}
foreach ($children as $child) {
// Figure out which LinkedTxn method should be used...
if (strpos($child['table'], "linkedtxn") !== false) {
if (stripos($action, "add") !== false) {
$part = preg_replace("/add/i", "", $action);
$part .= "LineAdd";
} else {
if (stripos($action, 'mod') !== false) {
$part = preg_replace("/mod/i", "", $action);
$part .= "LineMod";
}
}
if ($schema_object->exists($usePath . 'LinkToTxnID')) {
$Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
$nodes[count($nodes)] = $Node;
continue;
} else {
if ($schema_object->exists($action . ' ' . $part . ' ' . 'LinkToTxn')) {
$Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
$nodes[count($nodes)] = $Node;
continue;
} else {
if ($schema_object->exists($usePath . 'LinkedTxn')) {
$Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
$nodes[count($nodes)] = $Node;
continue;
} else {
if ($schema_object->exists($action . ' ' . $part . ' ' . 'LinkedTxn')) {
$Node = new QuickBooks_XML_Node("LinkToTxnID", $child['data']->get("ToTxnID"));
$nodes[count($nodes)] = $Node;
continue;
} else {
if ($schema_object->exists($usePath . 'ApplyCheckToTxnAdd')) {
$Node = new QuickBooks_XML_Node("ApplyCheckToTxnAdd");
$Node->setChildDataAt($Node->name() . ' ' . 'TxnID', $child['data']->get("ToTxnID"));
$Node->setChildDataAt($Node->name() . ' ' . 'Amount', $child['data']->get("ToTxnID"));
$nodes[count($nodes)] = $Node;
continue;
} else {
if ($schema_object->exists($usePath . 'ApplyCheckToTxnMod')) {
$Node = new QuickBooks_XML_Node("ApplyCheckToTxnMod");
$Node->setChildDataAt($Node->name() . ' ' . 'TxnID', $child['data']->get("ToTxnID"));
$Node->setChildDataAt($Node->name() . ' ' . 'Amount', $child['data']->get("ToTxnID"));
$nodes[count($nodes)] = $Node;
continue;
} else {
continue;
}
}
}
}
}
}
} else {
if (strpos($child['table'], "dataext") !== false) {
continue;
}
}
$map = '';
$others = array();
QuickBooks_SQL_Schema::mapToSchema($child['table'] . '.*', QUICKBOOKS_SQL_SCHEMA_MAP_TO_XML, $map, $others);
$map = str_replace(' *', '', $map);
$explode = explode(' ', $map);
$first = trim(current($explode));
$map = trim(implode(' ', array_slice($explode, 1)));
if (stripos($action, 'add') !== false) {
$map = str_replace('Ret', 'Add', $map);
} else {
$map = str_replace('Ret', 'Mod', $map);
}
// Journal entries have an unusual JournalEntryMod syntax. Instead of
// the typical CreditLineMod and DebitLineMod entries, they instead
// have just a single combined entry, JournalLineMod.
if ($action == QUICKBOOKS_MOD_JOURNALENTRY) {
if ($child['table'] == 'journalentry_journaldebitline' or $child['table'] == 'journalentry_journalcreditline') {
$map = 'JournalLineMod';
}
}
$Node = new QuickBooks_XML_Node($map);
/*
$retArr[$index]["table"] = $table;
$retArr[$index]["data"] = QuickBooks_SQL_Object($table, null, $arr);
$retArr[$index]["children"]
*/
foreach ($child['data']->asArray() as $field => $value) {
$map = '';
$others = array();
QuickBooks_SQL_Schema::mapToSchema($child['table'] . '.' . $field, QUICKBOOKS_SQL_SCHEMA_MAP_TO_XML, $map, $others);
//.........这里部分代码省略.........
示例15:
/**
* Encryption/decryption classes
*/
QuickBooks_Loader::load('/QuickBooks/Encryption/Factory.php');
}
if (QUICKBOOKS_FRAMEWORK_CONSTANTS != QUICKBOOKS_FRAMEWORKS) {
/**
* Functions for calling callback functions
*/
QuickBooks_Loader::load('/QuickBooks/Callbacks.php');
}
if (QUICKBOOKS_FRAMEWORK_MISCELLANEOUS & QUICKBOOKS_FRAMEWORKS) {
/**
* Utilities for ensuring values fit into qbXML fields
*/
QuickBooks_Loader::load('/QuickBooks/Cast.php');
}
if (QUICKBOOKS_FRAMEWORK_MERCHANTSERVICE & QUICKBOOKS_FRAMEWORKS) {
/**
* QuickBooks Merchant Service support
*/
QuickBooks_Loader::load('/QuickBooks/MerchantService.php');
}
if (QUICKBOOKS_FRAMEWORK_WEBCONNECTOR & QUICKBOOKS_FRAMEWORKS) {
// Other servers
QuickBooks_Loader::import('/QuickBooks/WebConnector/Server');
}
if (QUICKBOOKS_FRAMEWORK_QBXML & QUICKBOOKS_FRAMEWORKS) {
// Objects for the API
QuickBooks_Loader::import('/QuickBooks/QBXML/Object');
}