Jump to content

Oguzz13

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Oguzz13

  1. The server is our own VPS. We can make changes if possible. How can we be sure that the server runs that function or not?
  2. I've opened a freelancer job in the forum about this issue. If you believe that you can convert this code to work without waiting each other (implementing multi-threading or any other way..), please free to contact with me via PM or oguzhrsn@gmail.com Thanks.
  3. This is a part of my shopping card written in PHP which is designed to sell pdf's. And there is a wordpress plugin installed in another site, which stamps pdf's with customer details. The shopping card posts the customer info's to the plug-in for each pdf. In the "if statements" above it checks whether there is another pdf file or not. We sell multiple pdf's together. Althuogh all pdf's are sent to different plug-in's and has nothing to do with order, because of the code above, it waits the first pdf to be stamped (about 3-4 seconds) in the first plug-in and then moves to the next one. I need to stamp at least 8 pdf's like this and it makes about 25-30 seconds after a purchase, which is a little bit long. That's why I want to make these functions to work at the same time, so that all the pdf info's can be send to the plug-in's simultanously, and be stamped at total 3-4 seconds.. Instead of 25-30 seconds.. Because customer is redirected to the download page after a succesfull purchase.. 25-30 seconds waiting is a little long for a credit card purchase. The system runs in a Linux server and we can make necessary changes if there are any.
  4. I've found sth named "parallel threading" and "async php".. as far as I've understood they make the function to run in the background. How can I change the code above, so that each function starts and runs in the background without waiting another one to end?
  5. Hi, In the below code, each PdfGen2, 3, 4.. function starts only after the previous one ends.. And the result of the previous function comes in 3-4 seconds (it posts some info to a plugin and receives some info back), so it delays a lot when it comes to the 7th or 8th function. How can I make the functions to start at the same time and doesn't require to wait each other to finish their own functions. #Explanation.. This is where the code checks if there is more than 1 pdf. If there is, it sends it to different functions (PdfGen2, PdfGen3..) but the problem is it waits to previous function to be finished and return the necessary stamped new pdf's url. The new function only works after that and each time it takes 2-3 seconds to do that. if ($tarih_sql == true) { $urun_id = $db->VeriCek($Id, 'siparisler', 'urun_id'); $pdf_url = $ykd->PdfGen($Id); $urun_pdf_url2 = $db->VeriCek($urun_id, 'urunler', 'pdf_url2'); if ($urun_pdf_url2 != '') { $pdf_url2 = $ykd->PdfGen2($Id, '0', '2'); $pdf_url_sql .= ", pdf_url2='$pdf_url2'"; } $urun_pdf_url3 = $db->VeriCek($urun_id, 'urunler', 'pdf_url3'); if ($urun_pdf_url3 != '') { $pdf_url3 = $ykd->PdfGen3($Id, '0', '3'); $pdf_url_sql .= ", pdf_url3='$pdf_url3'"; } $urun_pdf_url4 = $db->VeriCek($urun_id, 'urunler', 'pdf_url4'); if ($urun_pdf_url4 != '') { $pdf_url4 = $ykd->PdfGen4($Id, '0', '4'); $pdf_url_sql .= ", pdf_url4='$pdf_url4'"; } $urun_pdf_url5 = $db->VeriCek($urun_id, 'urunler', 'pdf_url5'); if ($urun_pdf_url5 != '') { $pdf_url5 = $ykd->PdfGen5($Id, '0', '5'); $pdf_url_sql .= ", pdf_url5='$pdf_url5'"; } $urun_pdf_url6 = $db->VeriCek($urun_id, 'urunler', 'pdf_url6'); if ($urun_pdf_url6 != '') { $pdf_url6 = $ykd->PdfGen6($Id, '0', '6'); $pdf_url_sql .= ", pdf_url6='$pdf_url6'"; } $urun_pdf_url7 = $db->VeriCek($urun_id, 'urunler', 'pdf_url7'); if ($urun_pdf_url7 != '') { $pdf_url7 = $ykd->PdfGen7($Id, '0', '7'); $pdf_url_sql .= ", pdf_url7='$pdf_url7'"; } $urun_pdf_url8 = $db->VeriCek($urun_id, 'urunler', 'pdf_url8'); if ($urun_pdf_url8 != '') { $pdf_url8 = $ykd->PdfGen8($Id, '0', '8'); $pdf_url_sql .= ", pdf_url8='$pdf_url8'"; } $urun_pdf_url9 = $db->VeriCek($urun_id, 'urunler', 'pdf_url9'); if ($urun_pdf_url9 != '') { $pdf_url9 = $ykd->PdfGen9($Id, '0', '9'); $pdf_url_sql .= ", pdf_url9='$pdf_url9'"; } $urun_pdf_url10 = $db->VeriCek($urun_id, 'urunler', 'pdf_url10'); if ($urun_pdf_url10 != '') { $pdf_url10 = $ykd->PdfGen10($Id, '0', '10'); $pdf_url_sql .= ", pdf_url10='$pdf_url10'"; } $urun_pdf_url11 = $db->VeriCek($urun_id, 'urunler', 'pdf_url11'); if ($urun_pdf_url11 != '') { $pdf_url11 = $ykd->PdfGen11($Id, '0', '11'); $pdf_url_sql .= ", pdf_url11='$pdf_url11'"; } $urun_pdf_url12 = $db->VeriCek($urun_id, 'urunler', 'pdf_url12'); if ($urun_pdf_url12 != '') { $pdf_url12 = $ykd->PdfGen12($Id, '0', '12'); $pdf_url_sql .= ", pdf_url12='$pdf_url12'"; } $urun_pdf_url13 = $db->VeriCek($urun_id, 'urunler', 'pdf_url13'); if ($urun_pdf_url13 != '') { $pdf_url13 = $ykd->PdfGen13($Id, '0', '13'); $pdf_url_sql .= ", pdf_url13='$pdf_url13'"; } $guncelle = $db->Sorgu("Update siparisler Set pdf_url='$pdf_url' $pdf_url_sql Where id='$Id' Limit 1"); $eposta = $db->VeriCek($Id, 'siparisler', 'eposta'); $essiz_id = $db->VeriCek($Id, 'siparisler', 'essiz_id'); $urun_adi = $db->VeriCek($urun_id, 'urunler', 'baslik'); $destek_mail = $db->VeriCek($urun_id, 'urunler', 'destek_mail'); $indir_link = _SiteDomain_.'indir/'.$Id.'/'.$essiz_id.'/'; $mail_kime = $eposta; $mail_kimden = $destek_mail; $mail_konu = 'İndirme Bağlantınız'; $mail_mesaj = ' Alttaki Bağlantıya Tıklayıp Dosyanızı İndirebilirsiniz.<br /><br /> Bağlantı:<br /> <a href="'.$indir_link.'">'.$indir_link.'</a> <br /><br /> Bize '.$destek_mail.' mail adresinden ulaşabilirsiniz. <br /><br /> <b>'.$urun_adi.' Yönetimi</b> '; $mail->Gonder($mail_kime, $mail_konu, $mail_mesaj, $mail_kimden); }
  6. Jumpy09, I've sent you private message. Please take a look at it.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.