function finalizeAggregateFeed() { //$content = ''; //file_put_contents($this->filename, $content, FILE_APPEND); global $pfcore; if ($this->shopID > 0) { $pfcore->shopID = $this->shopID; } PFeedActivityLog::updateFeedList('n/a', 'n/a', $this->file_name_short, $this->file_url, $this->providerName, $this->productCount); }
function getFeedData($category, $remote_category, $file_name, $saved_feed = null) { $this->logActivity('Initializing...'); global $message; global $pfcore; $x = new PLicense(); $this->loadAttributeUserMap(); if ($this->updateObject == null) { $this->initializeFeed($category, $remote_category); } else { $this->resumeFeed($category, $remote_category, $this->updateObject); } $this->logActivity('Loading paths...'); if (!$this->checkFolders()) { return; } $file_url = PFeedFolder::uploadFolder() . $this->providerName . '/' . $file_name . '.' . $this->fileformat; $file_path = PFeedFolder::uploadURL() . $this->providerName . '/' . $file_name . '.' . $this->fileformat; //Special (WordPress): where admin is https and site is http, path to wp-uploads works out incorrectly as https // we check the content_url() for https... if not present, patch the file_path if ($pfcore->cmsName == 'WordPress' && strpos($file_path, 'https://') !== false && strpos(content_url(), 'https') === false) { $file_path = str_replace('https://', 'http://', $file_path); } $this->file_path = $file_path; //Shipping and Taxation systems $this->shipping = new PShippingData($this); $this->taxData = new PTaxationData($this); $this->logActivity('Initializing categories...'); //Figure out what categories the user wants to export $this->categories = new PProductCategories($category); //Get the ProductList ready if ($this->productList == null) { $this->productList = new PProductList(); } //Initialize some useful data //(must occur before overrides) $this->current_category = str_replace(".and.", " & ", str_replace(".in.", " > ", $remote_category)); $this->initializeOverrides($saved_feed); //Reorder the rules usort($this->rules, 'sort_rule_func'); //Load relations into ProductList //Note: if relation exists, we don't overwrite foreach ($this->relatedData as $relatedData) { if (!isset($this->productList->relatedData[$relatedData[1]])) { $this->productList->relatedData[$relatedData[1]] = new PProductSupplementalData($relatedData[0]); } } //Trying to change max_execution_time will throw privilege errors on some installs //so it's been left as an option if ($this->timeout > 0) { ini_set('max_execution_time', $this->timeout); } //Add the space in pricestandard rules //if (strlen($this->currency) > 0) // $this->currency = ' '.$this->currency; //Create the Feed $this->logActivity('Creating feed data'); $this->filename = $file_url; if ($this->updateObject == null) { $this->createFeed($file_name, $file_path, $remote_category); } else { $this->continueFeed($category, $file_name, $file_path, $remote_category); } $this->logActivity('Updating Feed List'); if ($this->auto_update_feedlist) { PFeedActivityLog::updateFeedList($category, $remote_category, $file_name, $file_path, $this->providerName, $this->productCount); } if ($this->auto_free) { //Free the Attribute defaults for ($i = 0; $i < count($this->attributeDefaults); $i++) { unset($this->attributeDefaults[$i]); } //Free the Attribute Mapping Objects for ($i = 0; $i < count($this->attributeMappings); $i++) { unset($this->attributeMappings[$i]); } //De-allocate the overrides object to prevent chain dependency that made the core unload too early unset($this->feedOverrides); } if ($this->productCount == 0) { $this->message .= '<br>No products returned'; return; } $this->success = true; }
private static function updateFeedDataWe($id, $category, $remote_category, $file_name, $file_path, $providerName, $productCount) { PFeedActivityLog::updateFeedDataW($id, $category, $remote_category, $file_name, $file_path, $providerName, $productCount); }