示例#1
0
 /**
  * Returns an instance of Class_Currency
  * @static
  * @access public
  * @return Class_User Provides a fluent interface
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#2
0
 /**
  * Sets Number of Pages Contained Within the Order PDF.  The Functions Looks
  * Up the SKU in the multi_page_sku Database Table, if Present, Downloads the PDF
  * and Gets the Page Count.  If the SKU is Not in the Table, Defaults to 1.
  *
  *  @access private
  *  @return void
  */
 private function _setPageCount()
 {
     $this->_orderArray['pageCount'] = 1;
     if (PresswiseDB::getInstance()->isMultiImageSku($this->_orderArray['productID']) === true) {
         file_put_contents(PDF_TMP_DIR . DIRECTORY_SEPARATOR . PDF_CURRENT_PDF, file_get_contents($this->_orderArray['fileF']));
         $p = PDF_new();
         PDF_set_parameter($p, 'errorpolicy', 'return');
         PDF_set_parameter($p, 'SearchPath', PDF_TMP_DIR);
         $doc = PDF_open_pdi_document($p, PDF_CURRENT_PDF, 'requiredmode=minimum');
         if ($doc == 0) {
             $this->isErrors = true;
             $this->_errors = 'Error Counting Pages: ' . PDF_get_errmsg($p);
         } else {
             $this->_orderArray['pageCount'] = PDF_pcos_get_number($p, $doc, 'length:pages');
         }
     }
 }