myrddinwylt Posted July 12, 2010 Share Posted July 12, 2010 The following code returns this error: Parse error: syntax error, unexpected T_UNSET in C:\server\websites\127.0.0.1\htdocs-ssl\cdrdownloader\includes\invoice.class.php on line 41 <?php require_once './includes/tcpdf/config/lang/eng.php'; require_once './includes/tcpdf/tcpdf.php'; require_once './includes/tcpdf_invoice_lib.php'; class invoices { private $numbers = array(); private $pdf = null; private $billaddr = null; private $customers = array(); private $customers_currentid = null; public $cdr = array(); private $invoiceid = null; private $invoicedate = array(); private $invoiceperiod = array(); private $clients = array(); private $batch = array(); private $mysql = array(); private $conn = null; private $invoice_output_path = "securefiles"; function __construct($mysql,$files) { $this->mysql = $mysql; $this->files = $files; $date = date('mdy'); // $date = '2009-10-01'; $this->batch = array('lastmonthpayments'=>date('Y-m',strtotime ( '-2 month' , strtotime ( $date ) )) . '-01', 'lastmonth'=>date('Y-m',strtotime ( '-1 month' , strtotime ( $date ) )), 'lastmonthstart'=>date('Y-m',strtotime ( '-1 month' , strtotime ( $date ) )) . '-01', 'lastmonthend' => date('Y-m-j',strtotime('-1 day', strtotime(date('Y-m',strtotime ( $date )) . '-01'))),'thismonth'=>date('Y-m',strtotime($date)) . '-01','thismonthlate'=>date('Y-m',strtotime($date)) . '-20'); $this->invoiceperiod = array($this->batch['lastmonthstart'],$this->batch['lastmonthend']); $this->connect(); } function newInvoice() { if(isset($this->pdf)) { unset($this->pdf); } if(isset($this->cdr)) { unset($this->cdr); } $this->pdf = new Invoice(); $this->cdr = null; } ?> Since setting $this->pdf to NULL doesn't free it's used memory space, and "unset()" is returning an error..... ummm.... what the hell am i supposed to do XD. This is driving me insane. TCPDF has a huge memory leak, but I really don't have a choice in using it, so I need to implement some garbage cleanup freeing it's memory space prior to moving on to the next record. Any suggestions that will work ? Thanks. Quote Link to comment Share on other sites More sharing options...
myrddinwylt Posted July 12, 2010 Author Share Posted July 12, 2010 Had to modify inside TCPDF libraries as well for some strange reason. After doing that, this magically began working o.0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.