foreach (explode(';', $contents) as $sql) { if (!trim($sql)) { continue; } mysql_query($sql) or die(trigger_error(mysql_error())); } } else { die('Could not locate "./example.sql" to create the demo SQL schema!'); } // Create the database tables QuickBooks_Utilities::initialize($dsn); // Add the default authentication username/password QuickBooks_Utilities::createUser($dsn, $user, $pass); } // Initialize the queue QuickBooks_Queue_Singleton::initialize($dsn); // Create a new server and tell it to handle the requests // __construct($dsn_or_conn, $map, $errmap = array(), $hooks = array(), $log_level = QUICKBOOKS_LOG_NORMAL, $soap = QUICKBOOKS_SOAPSERVER_PHP, $wsdl = QUICKBOOKS_WSDL, $soap_options = array(), $handler_options = array(), $driver_options = array(), $callback_options = array() $Server = new QuickBooks_Server($dsn, $map, $errmap, $hooks, $log_level, $soapserver, QUICKBOOKS_WSDL, $soap_options, $handler_options, $driver_options, $callback_options); $response = $Server->handle(TRUE, TRUE); // If you wanted, you could do something with $response here for debugging $fp = fopen('/vservers/horsdoeuvres/htdocs/qbwc/qb_xml.xml', 'a+'); fwrite($fp, $response); fclose($fp); /** * Login success hook - perform an action when a user logs in via the Web Connector * * */ function _quickbooks_hook_loginsuccess($requestID, $user, $hook, &$err, $hook_data, $callback_config) {
/** * Get the instance of the queueing class * * @return QuickBooks_Queue */ public static function getInstance() { return QuickBooks_Queue_Singleton::initialize(null, null, null, false); }