コード例 #1
0
 public function __construct($purgeOld = false)
 {
     $this->config = MarketplaceWebService_Config::getConfig();
     $this->db = Db::getInstance(_PS_USE_SQL_SLAVE_);
     $this->id_affiliate = 1;
     //Amazon US
     $this->resetFeed();
     if ($purgeOld) {
         $files = glob('xmlfeeds/*');
         // get all file names
         foreach ($files as $file) {
             // iterate files
             if (is_file($file)) {
                 unlink($file);
             }
             // delete file
         }
         $this->db->ExecuteS("truncate table ps_affiliate_feed");
         $this->db->ExecuteS("truncate table ps_affiliate_subfeed");
         $this->db->ExecuteS("truncate table ps_affiliate_feed_product");
         $this->db->ExecuteS("truncate table ps_affiliate_subfeed_product");
         $this->db->ExecuteS("truncate table ps_affiliate_feed_product_info");
     }
 }
コード例 #2
0
 public function __construct()
 {
     $this->db = Db::getInstance(_PS_USE_SQL_SLAVE_);
     $this->mws_config = MarketplaceWebService_Config::getConfig();
     $this->config = array('ServiceURL' => $this->mws_config['url'], 'ProxyHost' => null, 'ProxyPort' => -1, 'MaxErrorRetry' => 3);
 }