예제 #1
0
/**
 * PHP Script that Instantiates the Presswise Process
 *
 * @package Presswise
 * @author gWilli
 * @version 1.0
 * @name Controller Action
 * @copyright 2013
 * @uses Constants
*/
spl_autoload_register(function ($sClass) {
    $sClass = str_replace("_", DIRECTORY_SEPARATOR, $sClass);
    if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . $sClass . '.php')) {
        require_once __DIR__ . DIRECTORY_SEPARATOR . $sClass . '.php';
    }
});
// See if Process is Already Running
$pid = new Pid('/tmp', basename(__FILE__));
if (!$pid->already_running) {
    try {
        $oPresswiseProcess = new ProcessPresswise();
        $oPresswiseProcess->processSoap();
        PresswiseDb::getInstance()->updatePrintedOrders();
        if ($oPresswiseProcess->ordersProcessed() > 0) {
            PresswiseDb::getInstance()->logProcessResults($oPresswiseProcess->ordersProcessed(), $oPresswiseProcess->errorCount(), $oPresswiseProcess->getReport());
        }
    } catch (Exception $e) {
        PresswiseDb::logError($e);
    }
}
return 1;
예제 #2
0
 /**
  * Object Constructor
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     $this->_dbHandle = PresswiseDb::getInstance();
     $this->_orderArray = $this->_dbHandle->getOrders();
     $this->_reportXML = new DomDocument('1.0', 'ISO-8859-1');
     $this->_reportXML->formatOutput = TRUE;
     $this->_reportXML->preserveWhiteSpace = false;
     $xslt = $this->_reportXML->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="./presswise.xsl"');
     $this->_reportXML->appendChild($xslt);
 }