Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php class Wyomind_Massstockupdate_Model_Import extends Mage_Core_Model_Abstract { ..

Decoded Output download

<?php 
 
class Wyomind_Massstockupdate_Model_Import extends Mage_Core_Model_Abstract 
{ 
 
    public $_warnings = array(); 
    public $_notices = array(); 
    public $_sql = array(); 
    public $_columns = array(); 
    public $_products = array(); 
    public $_stocks = array(); 
    public $_autoInc = 0; 
    public $_tables = array(); 
    public $_total = false; 
    public $_is_in_stock = false; 
    public $x32 = false; 
    public $_output = array(); 
    public $x33 = array(); 
 
    public function _construct() 
    { 
        $x65 = "stristr"; 
        $x66 = "is_readable"; 
        $x67 = "log"; 
        $x68 = "trim"; 
        $x69 = "json_decode"; 
        $x6a = "in_array"; 
        $x6b = "array_splice"; 
        $x6c = "array_unshift"; 
        $x6d = "str_replace"; 
        $x6e = "count"; 
        $x6f = "implode"; 
        $x70 = "is_numeric"; 
        $x71 = "array_push"; 
        $x72 = "strtolower"; 
        $x73 = "strstr"; 
        $x74 = "explode"; 
        $x75 = "addslashes"; 
        $x76 = "time"; 
        parent::_construct(); 
        $this->_init("massstockupdate/import"); 
    } 
 
    protected function _beforeSave() 
    { 
        $x65 = "stristr"; 
        $x66 = "is_readable"; 
        $x67 = "log"; 
        $x68 = "trim"; 
        $x69 = "json_decode"; 
        $x6a = "in_array"; 
        $x6b = "array_splice"; 
        $x6c = "array_unshift"; 
        $x6d = "str_replace"; 
        $x6e = "count"; 
        $x6f = "implode"; 
        $x70 = "is_numeric"; 
        $x71 = "array_push"; 
        $x72 = "strtolower"; 
        $x73 = "strstr"; 
        $x74 = "explode"; 
        $x75 = "addslashes"; 
        $x76 = "time"; 
        $x34 = new Varien_Io_File(); 
        $x35 = $x34->getCleanPath(Mage::getBaseDir() . "/" . $this->getFilePath()); 
        if (!$x34->fileExists($x35, false)) { 
            Mage::throwException(Mage::helper("massstockupdate")->__("Wrong file path. '%s' is not a file.", $x35)); 
        } if ($x65($this->getFilePath(), ".csv") < 0) { 
            Mage::throwException(Mage::helper("massstockupdate")->__("Wrong file. '%s' is not a csv file.", $x35)); 
        } if (!$x66($x35)) { 
            Mage::throwException(Mage::helper("massstockupdate")->__("Please make sure that '%s' is readable by web-server.", $x35)); 
        } return parent::_beforeSave(); 
    } 
 
    public function x77() 
    { 
        $x65 = "stristr"; 
        $x66 = "is_readable"; 
        $x67 = "log"; 
        $x68 = "trim"; 
        $x69 = "json_decode"; 
        $x6a = "in_array"; 
        $x6b = "array_splice"; 
        $x6c = "array_unshift"; 
        $x6d = "str_replace"; 
        $x6e = "count"; 
        $x6f = "implode"; 
        $x70 = "is_numeric"; 
        $x71 = "array_push"; 
        $x72 = "strtolower"; 
        $x73 = "strstr"; 
        $x74 = "explode"; 
        $x75 = "addslashes"; 
        $x76 = "time"; 
        $this->_warnings = array(); 
        $this->_notices = array(); 
        $this->_sql = array(); 
        $this->_columns = array(); 
        $this->_products = array(); 
        $this->_stocks = array(); 
        $this->_autoInc = 0; 
        $this->_tables = array(); 
        $this->_total = false; 
        $this->_output = array(); 
    } 
 
    public function importProcess() 
    { 
        $x65 = "stristr"; 
        $x66 = "is_readable"; 
        $x67 = "log"; 
        $x68 = "trim"; 
        $x69 = "json_decode"; 
        $x6a = "in_array"; 
        $x6b = "array_splice"; 
        $x6c = "array_unshift"; 
        $x6d = "str_replace"; 
        $x6e = "count"; 
        $x6f = "implode"; 
        $x70 = "is_numeric"; 
        $x71 = "array_push"; 
        $x72 = "strtolower"; 
        $x73 = "strstr"; 
        $x74 = "explode"; 
        $x75 = "addslashes"; 
        $x76 = "time"; 
        Mage::$x67("-------------------- IMPORTATION PROCESS ---------------", null, "MassStockUpate.log"); 
        $this->x77(); 
        $x34 = new Varien_Io_File(); 
        $x35 = $x34->getCleanPath(Mage::getBaseDir() . "/" . $this->getFilePath()); 
        $x34->streamOpen($x35, "r"); 
        Mage::$x67("--> File opened : " . $x35, null, "MassStockUpate.log"); 
        $x36 = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect("sku"); 
        foreach ($x36 as $x37) { 
            $this->_products[$x68($x37->getSku())] = $x37->getId(); 
        }; 
        Mage::$x67("--> Products collected", null, "MassStockUpate.log"); 
        if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) { 
            $x38 = Mage::getModel("advancedinventory/advancedinventoryproduct")->getCollection(); 
            foreach ($x38 as $x39) { 
                $this->_stocks[$x39->getProductId()] = $x39->getId(); 
            }; 
            Mage::$x67("--> Local stocks collected (Advanced Inventory)", null, "MassStockUpate.log"); 
        } $x3a = array("ac" => "activation_code", "ak" => "activation_key", "bu" => "base_url", "md" => "md5", "th" => "this", "dm" => "_demo", "ext" => "msi", "ver" => "3.5.0"); 
        $x3b = Mage::getSingleton("core/resource"); 
        $x3c = $x3b->getConnection("core_read"); 
        $this->_tables["csi"] = Mage::getSingleton("core/resource")->getTableName("cata$x67inventory_stock_item"); 
        if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) { 
            $this->_tables["aip"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory_product"); 
            $this->_tables["ai"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory"); 
            $x3d = "SELECT MAX(id) AS INC FROM " . $this->_tables["aip"] . " ;"; 
            $x3e = $x3c->fetchAll($x3d); 
            $this->_autoInc = $x3e[0]["INC"]; 
            Mage::$x67("--> Max increment found #" . $x3e[0]["INC"] . "(Advanced Inventory)", null, "MassStockUpate.log"); 
        } $x3f = array("activation_key" => Mage::getStoreConfig("massstockupdate/license/activation_key"), "activation_code" => Mage::getStoreConfig("massstockupdate/license/activation_code"), "base_url" => Mage::getStoreConfig("web/secure/base_url"),); 
        $x40 = $x69($this->getMapping()); 
        foreach ($x40->columns as $x41 => $x42) { 
            if (!$x6a($x42->id, array("not-used", "total", "is_in_stock", "manage_local_stock"))) { 
                $this->_columns[] = $x42->id; 
            } elseif ($x6a($x42->id, array("total"))) { 
                $this->_columns[] = "total"; 
                $this->_total = $x41 + 1; 
            } elseif ($x6a($x42->id, array("is_in_stock"))) { 
                $this->_columns[] = "is_in_stock"; 
                $this->_is_in_stock = $x41 + 1; 
            } elseif ($x6a($x42->id, array("manage_local_stock"))) { 
                $this->_columns[] = "manage_local_stock"; 
                $this->_manage_local_stock = $x41 + 1; 
            } else { 
                $this->_columns[] = false; 
            } 
        } Mage::$x67("--> Column mapping analyzed", null, "MassStockUpate.log"); 
        if ($x3f[$x3a["ac"]] != $x3a["md"]($x3a["md"]($x3f[$x3a["ak"]]) . $x3a["md"]($x3f[$x3a["bu"]]) . $x3a["md"]($x3a["ext"]) . $x3a["md"]($x3a["ver"]))) { 
            $$x3a["ext"] = "valid"; 
            $$x3a["th"]->$x3a["dm"] = true; 
        } else { 
            $$x3a["th"]->$x3a["dm"] = false; 
            $$x3a["ext"] = "valid"; 
        } if (!isset($$x3a["ext"]) || $$x3a["th"]->$x3a["dm"]) { 
            $$x3a["th"]->$x3a["dm"] = true; 
            return $$x3a["th"]; 
        } Mage::$x67("--> Preparing MySql queries", null, "MassStockUpate.log"); 
        $x43 = $this->getSkuOffset() - 1; 
        $x44 = new Varien_Io_File(); 
        $x44->setAllowCreateFolders(true); 
        $x45 = Mage::getStoreConfig("massstockupdate/settings/sql_file"); 
        $x46 = Mage::getStoreConfig("massstockupdate/settings/sql_dir"); 
        $x35 = $x34->getCleanPath(Mage::getBaseDir() . '/' . $x46); 
        if (!$x44->fileExists($x35, false)) { 
            Mage::throwException(Mage::helper('massstockupdate')->__('Please create the specified folder "%s".', $x35)); 
        } if (!$x44->isWriteable($x35)) { 
            Mage::throwException(Mage::helper('massstockupdate')->__('Please make sure that "%s" is writable by web-server.', $x35)); 
        } $x44->open(array('path' => $x46)); 
        $x44->streamOpen($x45, 'w'); 
        if ($this->getAutoSetTotal() == 2) { 
            $x44->streamWrite("ALTER TABLE `" . $this->_tables["ai"] . "` DROP FOREIGN KEY `CONST_advancedinventory_localstock_id`;
"); 
        } if ($this->getFileEnclosure() != "none") { 
            while (false !== ($x47 = $x34->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) { 
                $x48 = $x6b($x47, $x43, 1); 
                $x6c($x47, $x48[0]); 
                $this->x78($x47); 
                foreach ($this->_sql as $x3d) { 
                    $x44->streamWrite($x6d(array("
", "  "), array(" ", ""), $x68($x3d)) . "
"); 
                } 
            } 
        } else { 
            while (false !== ($x47 = $x34->streamReadCsv($this->getFileSeparator()))) { 
                $x48 = $x6b($x47, $x43, 1); 
                $x6c($x47, $x48[0]); 
                $this->x78($x47); 
                foreach ($this->_sql as $x3d) { 
                    $x44->streamWrite($x6d(array("
", "  "), array(" ", " "), $x68($x3d)) . "
"); 
                } 
            } 
        } Mage::$x67("--> File closed : " . $x35 . $x45, null, "MassStockUpate.log"); 
        $x34->streamClose(); 
        if ($this->getAutoSetTotal() == 2) { 
            $x44->streamWrite("ALTER  TABLE `" . $this->_tables["ai"] . "` ADD CONSTRAINT `CONST_advancedinventory_localstock_id` FOREIGN KEY (localstock_id) REFERENCES " . $this->_tables["aip"] . " (id) ON UPDATE CASCADE ON DELETE CASCADE;"); 
        } $x44->streamClose(); 
        if ($x6e($this->_warnings)) 
            Mage::getSingleton("core/session")->addError($x6f("<br>", ($this->_warnings))); 
        if (Mage::getStoreConfig("massstockupdate/settings/sh_mode")) { 
            return true; 
        } $x49 = Mage::getSingleton("core/resource")->getConnection("core_write"); 
        $x49->beginTransaction(); 
        $x4a = true; 
        Mage::$x67("--> Executing MySql queries", null, "MassStockUpate.log"); 
        $x34 = new Varien_Io_File(); 
        $x34->open(array('path' => $x46)); 
        $x34->streamOpen($x45, 'r'); 
        while (false !== ($x3d = $x34->streamRead(102400))) { 
            try { 
                $x49->exec($x3d); 
            } catch (Mage_Core_Exception $x4b) { 
                Mage::$x67(" failed -->" . $x3d, null, "MassStockUpate.log"); 
                $x4a = false; 
            } catch (Exception $x4b) { 
                Mage::$x67(" failed -->" . $x3d, null, "MassStockUpate.log"); 
                Mage::getSingleton("core/session")->addError($x4b->getMessage()); 
                $x4a = false; 
            } 
        } if (!$x4a) { 
            Mage::$x67("--> MySql Rollback", null, "MassStockUpate.log"); 
            Mage::getSingleton("core/session")->addError(Mage::helper("massstockupdate")->__("Error while processing. Rollback happened.")); 
            $x49->rollback(); 
            return false; 
        } else { 
            Mage::$x67("--> MySql Commit", null, "MassStockUpate.log"); 
            $x49->commit(); 
            $this->setImportedAt(Mage::getSingleton("core/date")->gmtDate("Y-m-d H:i:s")); 
            $this->save(); 
            $x4c = Mage::getSingleton('index/indexer')->getProcessByCode('cataloginventory_stock'); 
            $x4c->reindexAll(); 
            Mage::$x67("--> Stock re-indexed", null, "MassStockUpate.log"); 
            $x34->open(array('path' => $x46)); 
            $x34->rm($x45); 
            return true; 
        } 
    } 
 
    private function x78($x4d) 
    { 
        $x65 = "stristr"; 
        $x66 = "is_readable"; 
        $x67 = "log"; 
        $x68 = "trim"; 
        $x69 = "json_decode"; 
        $x6a = "in_array"; 
        $x6b = "array_splice"; 
        $x6c = "array_unshift"; 
        $x6d = "str_replace"; 
        $x6e = "count"; 
        $x6f = "implode"; 
        $x70 = "is_numeric"; 
        $x71 = "array_push"; 
        $x72 = "strtolower"; 
        $x73 = "strstr"; 
        $x74 = "explode"; 
        $x75 = "addslashes"; 
        $x76 = "time"; 
        $this->_sql = array(); 
        foreach ($x4d as $x4e => $x4f) 
            $x4d[$x4e] = $x68($x4f); 
        if ($this->getUseCustomRules()) { 
            $x50 = $this->getCustomRules(); 
            eval($x6d('$C[', '$x4d[', $x50)); 
        } $x51 = array(); 
        $x52 = array(); 
        if (isset($this->_products[$x4d[0]])) { 
            $x53 = $this->_products[$x4d[0]]; 
            if (isset($this->_stocks[$x53])) { 
                $x54 = $this->_stocks[$x53]; 
            } else { 
                $this->_autoInc++; 
                $x54 = $this->_autoInc; 
            } $x51["ID"] = $x53; 
            $x55 = true; 
            $x51["status"] = $x55; 
            $x51["total"] = 0; 
            $x51["in_stock"] = null; 
            $x56 = 0; 
            foreach ($x4d as $x41 => $x57) { 
                if (isset($this->_columns[$x41 - 1]) && $x41 > 0) { 
                    if (!$this->_total) { 
                        if ($x70($x57) && $x55) { 
                            if ($this->_columns[$x41 - 1] != "total" && $this->_columns[$x41 - 1] != "is_in_stock" && ($this->_columns[$x41 - 1] == "used" || $x70($this->_columns[$x41 - 1]))) 
                                $x51["total"]+=$x57; 
                            $x55 = true; 
                        } 
                    } else { 
                        if ($this->_total && $this->_columns[$x41 - 1] == "total") { 
                            $x51["total"] = $x57; 
                            if ($x70($x57)) 
                                $x55 = true; 
                            else 
                                $x55 = false; 
                        } 
                    } if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory") && $x55) { 
                        if ($x70($x57) && $x70($this->_columns[$x41 - 1])) { 
                            $x58 = " REPLACE INTO `" . $this->_tables["ai"] . "` (`id`, `localstock_id`,`place_id`,`quantity_in_stock`,`product_id`,`backorder_allowed`,`use_config_setting_for_backorders`) values(
                                    IF((SELECT count(`id`) FROM `" . $this->_tables["ai"] . "` AS a WHERE `place_id`=" . $this->_columns[$x41 - 1] . " AND  `product_id`=" . $x53 . ")=1,(SELECT `id` FROM " . $this->_tables["ai"] . " AS a WHERE `place_id`=" . $this->_columns[$x41 - 1] . " AND `product_id`=" . $x53 . "),NULL) ,$x54," . $this->_columns[$x41 - 1] . ",$x57,$x53,(SELECT `backorder_allowed` FROM `" . $this->_tables["ai"] . "` AS `b` WHERE `place_id`=" . $this->_columns[$x41 - 1] . " AND `product_id`=" . $x53 . "),IFNULL((SELECT `use_config_setting_for_backorders` FROM `" . $this->_tables["ai"] . "` AS `c` WHERE `place_id`=" . $this->_columns[$x41 - 1] . " AND `product_id`=" . $x53 . "),1));"; 
                            $x71($this->_sql, $x58); 
                            $x52[] = "-IFNULL((SELECT `quantity_in_stock` FROM `" . $this->_tables["ai"] . "` WHERE `place_id`=" . $this->_columns[$x41 - 1] . " AND  `product_id`=" . $x53 . " ),0)"; 
                        } 
                    } if (!$this->getAutoSetInstock()) { 
                        if ($this->_is_in_stock && $this->_columns[$x41 - 1] == "is_in_stock") { 
                            if ($x6a($x72($x57), array("1", "true", "yes", "on", "in stock", "instock", "available"))) 
                                $x51["in_stock"] = true; 
                            else 
                                $x51["in_stock"] = false; 
                        } 
                    } else { 
                        if ($x51["total"] > 0) 
                            $x51["in_stock"] = true; 
                        else 
                            $x51["in_stock"] = false; 
                    } if ($this->_manage_local_stock && $this->_columns[$x41 - 1] == "manage_local_stock") { 
                        if ($x6a($x72($x57), array("1", "true", "yes", "on", "in stock", "instock", "available"))) 
                            $x51["manage_local_stock"] = 1; 
                        else 
                            $x51["manage_local_stock"] = 0; 
                    } else { 
                        $x51["manage_local_stock"] = 1; 
                    } if ($x73($this->_columns[$x41 - 1], "attribute")) { 
                        $x59 = ($x74('-', $this->_columns[$x41 - 1])); 
                        $x5a = Mage::getSingleton("core/resource")->getTableName("catalog_product_entity_" . $x59[3]); 
                        $x58 = "UPDATE `$x5a` SET `value`='" . $x75($x57) . "' WHERE `entity_id`='" . $x53 . "' AND `attribute_id`='" . $x59[2] . "'; "; 
                        $x71($this->_sql, $x58); 
                    } $x51[$x56]["value"] = $x57; 
                    $x51[$x56]["code"] = $this->_columns[$x41 - 1]; 
                    $x56++; 
                } 
            }; 
            $x51["status"] = $x55; 
            $x5b = $x51["total"]; 
            if ($this->getAutoSetTotal() == 2) { 
                if ($x6e($x52)) 
                    $x5b = "(SELECT (IFNULL(SUM(`quantity_in_stock`),0)" . $x6f('', $x52) . "+$x5b) FROM " . $this->_tables["ai"] . " WHERE `product_id`=$x53)"; 
                else { 
                    $x55 = false; 
                } 
            } $x5c = $x51["in_stock"]; 
            if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) { 
                if ($x55) { 
                    $x58 = "REPLACE INTO `" . $this->_tables["aip"] . "` values($x54,$x53," . $x51["manage_local_stock"] . ",$x5b); "; 
                    $x6c($this->_sql, $x58); 
                } 
            } if (($x55)) { 
                if ($x5c === true || $x5c === false) { 
                    $x5d = ", `is_in_stock`"; 
                    $x5e = ($x5c) ? ',1' : ',0'; 
                    if ($this->getAutoSetTotal() == 2) { 
                        $x5e = " , IF ($x5b>0,1,0)"; 
                    } 
                } else { 
                    $x5d = null; 
                    $x5e = null; 
                } $x58 = "REPLACE INTO `" . $this->_tables["csi"] . "` (`item_id`,`product_id`,`qty`,`stock_id` $x5d) VALUES ( IF((SELECT COUNT(`item_id`) FROM `" . $this->_tables["csi"] . "` as `csi` WHERE `product_id`=$x53)=1, (SELECT `item_id` FROM `" . $this->_tables["csi"] . "` as `csi` WHERE `product_id`=$x53),NULL) ,$x53,$x5b,1 $x5e); "; 
                $x6c($this->_sql, $x58); 
            } if ($x55) 
                $this->_notices[] = "SKU <i>$x4d[0]</i> has been updated"; 
            else { 
                Mage::$x67("* Product #" . $x4d[0] . " has been ignored due to some non consistent data.", null, "MassStockUpate.log"); 
                $this->_warnings[] = "SKU <i>$x4d[0]</i> has been ignored due to some non consistent data."; 
            } $this->_output[] = $x51; 
        } else { 
            Mage::$x67("* Product #" . $x4d[0] . " doesn't exist. Product has been ignored.", null, "MassStockUpate.log"); 
            $this->_warnings[] = "SKU <i>$x4d[0]</i> doesn't exist. Product has been ignored."; 
        } 
    } 
 
    function backup() 
    { 
        $x65 = "stristr"; 
        $x66 = "is_readable"; 
        $x67 = "log"; 
        $x68 = "trim"; 
        $x69 = "json_decode"; 
        $x6a = "in_array"; 
        $x6b = "array_splice"; 
        $x6c = "array_unshift"; 
        $x6d = "str_replace"; 
        $x6e = "count"; 
        $x6f = "implode"; 
        $x70 = "is_numeric"; 
        $x71 = "array_push"; 
        $x72 = "strtolower"; 
        $x73 = "strstr"; 
        $x74 = "explode"; 
        $x75 = "addslashes"; 
        $x76 = "time"; 
        $x3d = array(); 
        $x5f = array(); 
        $x60 = array(); 
        $x3b = Mage::getSingleton("core/resource"); 
        $x3c = $x3b->getConnection("core_read"); 
        $this->_tables["csi"] = Mage::getSingleton("core/resource")->getTableName("cata$x67inventory_stock_item"); 
        $this->_tables["cpe"] = Mage::getSingleton("core/resource")->getTableName("catalog_product_entity"); 
        $x71($x3d, "LEFT JOIN `" . $this->_tables["cpe"] . "` AS `cpe` ON `cpe`.`entity_id`=`csi`.`product_id`"); 
        if (Mage::helper("core")->isModuleEnabled("Wyomind_Advancedinventory")) { 
            $x5f[] = null; 
            $x60[] = null; 
            $this->_tables["ai"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory"); 
            $x61 = Mage::getModel("pointofsale/pointofsale")->getPlaces(); 
            foreach ($x61 as $x37) { 
                $x71($x3d, "LEFT JOIN `" . $this->_tables["ai"] . "` AS `ai_" . $x37->getPlaceId() . "` ON `ai_" . $x37->getPlaceId() . "`.`product_id`=`cpe`.`entity_id` AND `ai_" . $x37->getPlaceId() . "`.`place_id`=" . $x37->getPlaceId() . ""); 
                $x5f[] = "ai_" . $x37->getPlaceId() . ".`quantity_in_stock` AS `ai_stock_" . $x37->getPlaceId() . "`"; 
            } 
        } $x6c($x3d, "SELECT  `cpe`.`sku` " . $x6f(', ', $x5f) . ", `csi`.`qty`,`csi`.`is_in_stock` FROM `" . $this->_tables["csi"] . "` AS `csi`"); 
        $x71($x3d, "WHERE `sku` IS NOT NULL " . $x6f(" AND ", $x60) . ""); 
        Mage::$x67("-------------------- BACKUP PROCESS --------------------", null, "MassStockUpate.log"); 
        Mage::$x67("---> MySql request : " . $x6f(' ', $x3d), null, "MassStockUpate.log"); 
        $x4d = $x3c->fetchAll($x6f(" ", $x3d)); 
        $x34 = new Varien_Io_File(); 
        $x34->setAllowCreateFolders(true); 
        $x62 = Mage::getStoreConfig("massstockupdate/settings/backup_file") . "-" . $x76() . ".csv"; 
        $x63 = Mage::getStoreConfig("massstockupdate/settings/backup_dir"); 
        $x34->open(array("path" => Mage::getBaseDir() . "/" . $x63)); 
        if ($x34->fileExists($x62) && !$x34->isWriteable($x62)) { 
            Mage::throwException(Mage::helper("ordersexporttool")->__("File '%s' cannot be saved. Please, make sure the directory %s' is writeable by web server.", $x62, $this->getPath())); 
        } $x34->streamOpen($x62, "w"); 
        foreach ($x4d as $x64) { 
            $x34->streamWriteCsv($x64, ";"); 
        } $x34->streamClose(); 
        Mage::getSingleton("core/session")->addSuccess(Mage::helper("massstockupdate")->__("Backup created :   '%s'.", $x63 . $x62)); 
        Mage::$x67("---> DONE : " . $x63 . $x62, null, "MassStockUpate.log"); 
        return; 
    } 
 
} 
 
; 
 ?>

Did this file decode correctly?

Original Code

<?php

class Wyomind_Massstockupdate_Model_Import extends Mage_Core_Model_Abstract
{

    public $_warnings = array();
    public $_notices = array();
    public $_sql = array();
    public $_columns = array();
    public $_products = array();
    public $_stocks = array();
    public $_autoInc = 0;
    public $_tables = array();
    public $_total = false;
    public $_is_in_stock = false;
    public $x32 = false;
    public $_output = array();
    public $x33 = array();

    public function _construct()
    {
        $x65 = "s\164\162\x69\x73\x74\162";
        $x66 = "i\163_read\141b\x6ce";
        $x67 = "\x6c\x6fg";
        $x68 = "\x74\162i\x6d";
        $x69 = "\x6as\x6f\156_\144\145\143od\145";
        $x6a = "\x69\x6e\137\141\x72\162\x61y";
        $x6b = "\x61r\162\141\171_\163\160\x6ci\x63\x65";
        $x6c = "\x61r\162ay_\165\x6es\x68if\164";
        $x6d = "\163\x74\162_\162\145p\x6c\x61\143\145";
        $x6e = "c\x6fun\x74";
        $x6f = "\x69\x6d\160\x6co\x64e";
        $x70 = "is\x5f\156um\x65\162\x69\143";
        $x71 = "a\x72r\141\x79\x5f\160\165\163\150";
        $x72 = "\163\164\162\164olow\145\x72";
        $x73 = "\163\x74\x72str";
        $x74 = "ex\160\x6c\157\144\x65";
        $x75 = "\141d\x64\163\154\141\x73h\x65\163";
        $x76 = "\164i\155\x65";
        parent::_construct();
        $this->_init("mas\163s\164o\143k\165pda\x74\x65/\x69\x6d\160ort");
    }

    protected function _beforeSave()
    {
        $x65 = "s\x74ris\x74\x72";
        $x66 = "\151s\x5f\x72e\141\x64\x61b\x6ce";
        $x67 = "\154\157\x67";
        $x68 = "tr\x69m";
        $x69 = "\x6as\157n\x5fd\145\143o\144\x65";
        $x6a = "i\156_a\162r\141y";
        $x6b = "\x61r\162\141\171\x5fsp\x6ci\x63\x65";
        $x6c = "ar\162\141\x79\137u\156\x73\x68ift";
        $x6d = "\163t\x72\137\x72\x65\160\x6ca\x63e";
        $x6e = "co\165\x6et";
        $x6f = "i\x6d\160\154ode";
        $x70 = "\x69s\137\x6e\x75\x6d\x65ric";
        $x71 = "\x61\x72\x72\x61y\x5fpu\x73h";
        $x72 = "str\164\157\x6co\x77er";
        $x73 = "st\162\163t\162";
        $x74 = "\145x\160\154o\144\145";
        $x75 = "ad\144\x73\154\x61\x73\150\x65\x73";
        $x76 = "\164i\155\145";
        $x34 = new Varien_Io_File();
        $x35 = $x34->getCleanPath(Mage::getBaseDir() . "\57" . $this->getFilePath());
        if (!$x34->fileExists($x35, false)) {
            Mage::throwException(Mage::helper("\155\141ss\163\x74\157\x63k\x75\x70\144\x61\164\145")->__("\127\162o\156\x67 f\151\154\x65\40\x70a\164h\56 \47\x25\163'\40\x69\x73\40\156\x6ft\40\141\40\x66i\154e\x2e", $x35));
        } if ($x65($this->getFilePath(), "\x2e\143\163v") < 0) {
            Mage::throwException(Mage::helper("\155\141ss\163\x74\157\x63k\x75\x70\144\x61\164\145")->__("W\162\x6fng \x66\x69le\x2e \x27%\x73'\40\x69s n\157t\x20a cs\166 f\151\x6ce\56", $x35));
        } if (!$x66($x35)) {
            Mage::throwException(Mage::helper("\155\141ss\163\x74\157\x63k\x75\x70\144\x61\164\145")->__("\120\x6ce\141\x73e\x20\x6d\141k\x65\x20\163\165\x72e\40t\150\x61\x74\x20'\x25\163\x27\40\x69s\x20\162\145\141\x64abl\x65\x20\142y\x20\167\x65b-\x73\145\162v\145r.", $x35));
        } return parent::_beforeSave();
    }

    public function x77()
    {
        $x65 = "s\164\x72\151\163t\x72";
        $x66 = "\x69s_\162e\141\x64\141b\154\x65";
        $x67 = "\154\x6f\x67";
        $x68 = "\x74\162\151\155";
        $x69 = "\152\163o\x6e_\144\x65\143\157d\x65";
        $x6a = "\x69n\x5f\x61rra\x79";
        $x6b = "a\x72r\141\171\137\163pli\x63\x65";
        $x6c = "\141r\x72ay\137u\156\x73\150\151\146\164";
        $x6d = "s\164\x72\137\x72\x65\160\154\x61\x63\x65";
        $x6e = "c\157u\156\164";
        $x6f = "\x69mpl\x6f\144e";
        $x70 = "i\163\x5fnu\155\x65\x72\151c";
        $x71 = "\141\x72\x72a\171\137\x70\165sh";
        $x72 = "\x73\164\162\164o\154\157w\145\x72";
        $x73 = "\163\164\162\163\x74\x72";
        $x74 = "\x65\170\160\154\x6fd\145";
        $x75 = "\x61d\x64sl\141\163he\x73";
        $x76 = "\x74\x69me";
        $this->_warnings = array();
        $this->_notices = array();
        $this->_sql = array();
        $this->_columns = array();
        $this->_products = array();
        $this->_stocks = array();
        $this->_autoInc = 0;
        $this->_tables = array();
        $this->_total = false;
        $this->_output = array();
    }

    public function importProcess()
    {
        $x65 = "s\164\x72ist\x72";
        $x66 = "\x69s\137\162\145\x61d\141\x62\x6ce";
        $x67 = "l\x6f\147";
        $x68 = "tri\155";
        $x69 = "\152son_\144\145\x63o\144\x65";
        $x6a = "\151n\x5f\141\x72\162a\x79";
        $x6b = "\141\162\162a\x79\x5f\x73\160\x6ci\143\145";
        $x6c = "\141\x72\x72\141y_\x75\x6es\150\x69\x66\x74";
        $x6d = "\163t\162\x5f\162e\160l\x61\x63\x65";
        $x6e = "\143\157\165\156\x74";
        $x6f = "i\x6dp\x6c\x6f\x64\x65";
        $x70 = "\x69\163\x5fnu\155\x65\x72ic";
        $x71 = "\141r\162\141\171\x5f\160u\163\x68";
        $x72 = "\x73t\162\x74o\154\x6fwe\162";
        $x73 = "s\x74r\x73tr";
        $x74 = "\145xp\154o\144\145";
        $x75 = "\x61dd\163\154\141s\150\145\163";
        $x76 = "\x74i\x6de";
        Mage::$x67("\x2d\x2d\55\55-\55\x2d--\55\55\x2d\55\x2d\x2d\55\x2d\55\55\55\x20I\x4d\x50O\122T\101\x54\111\117\116\40\x50R\117C\x45\x53S\40--\x2d-\x2d\55\x2d----\55\x2d-\55", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        $this->x77();
        $x34 = new Varien_Io_File();
        $x35 = $x34->getCleanPath(Mage::getBaseDir() . "\57" . $this->getFilePath());
        $x34->streamOpen($x35, "\x72");
        Mage::$x67("\55\x2d\x3e\x20\x46\x69\x6ce\x20\x6f\x70e\156\x65d :\x20" . $x35, null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        $x36 = Mage::getModel("ca\x74al\157\147\57\160\162\x6f\x64\165c\164")->getCollection()->addAttributeToSelect("sk\165");
        foreach ($x36 as $x37) {
            $this->_products[$x68($x37->getSku())] = $x37->getId();
        };
        Mage::$x67("\x2d\x2d>\40\120\x72\157duc\164s\40\x63\157l\x6c\145\x63ted", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        if (Mage::helper("\143o\162\x65")->isModuleEnabled("\x57\x79\x6f\x6d\151\x6e\x64\x5fA\x64\166an\143\x65\144\151\x6e\x76\145\x6e\x74o\x72y")) {
            $x38 = Mage::getModel("ad\x76a\156\143e\144\151\x6eve\x6e\x74o\x72\171\57\x61\x64v\141n\x63\145\x64\151n\x76\145\156t\157ryp\x72\157\x64u\143\x74")->getCollection();
            foreach ($x38 as $x39) {
                $this->_stocks[$x39->getProductId()] = $x39->getId();
            };
            Mage::$x67("-\55\x3e\40L\157\x63\x61l st\x6f\143k\163\x20coll\x65\143\164\x65d\x20\x28\101\144\x76\141\x6e\143e\x64\x20\x49\x6eve\x6e\164\x6f\162\171\51", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        } $x3a = array("\141\143" => "a\143ti\166a\164i\x6f\x6e\x5f\x63\157d\145", "a\153" => "\141c\164\x69v\141\164\x69\x6f\x6e_ke\x79", "b\x75" => "\x62ase\137u\x72\154", "m\x64" => "\x6dd\65", "\164\x68" => "\x74hi\163", "\144\x6d" => "\x5f\x64e\x6d\x6f", "\145\x78t" => "ms\x69", "ve\x72" => "\63.\65\x2e0");
        $x3b = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65");
        $x3c = $x3b->getConnection("c\157\162e\137r\145\141d");
        $this->_tables["\x63\163\x69"] = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("c\141\164a$x67\x69\x6e\166e\x6et\x6fr\x79_s\164\x6f\x63\153_\151\164\x65m");
        if (Mage::helper("\143o\162\x65")->isModuleEnabled("\x57\x79\x6f\x6d\151\x6e\x64\x5fA\x64\166an\143\x65\144\151\x6e\x76\145\x6e\x74o\x72y")) {
            $this->_tables["\x61\x69\x70"] = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("\141d\x76\141n\x63\145\144\x69\156\166\145\156\x74\157\162\171_\x70\x72\157\144uc\164");
            $this->_tables["\141\x69"] = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("a\x64v\x61\x6e\x63\145d\x69n\x76\145\156\x74\157r\171");
            $x3d = "\123\105\114E\103T \x4d\101\130\x28id\51 \x41\x53 \111\116\103\x20\106\122\117\x4d " . $this->_tables["\x61\x69\x70"] . " \73";
            $x3e = $x3c->fetchAll($x3d);
            $this->_autoInc = $x3e[0]["\111\116\x43"];
            Mage::$x67("-\x2d> M\x61\x78\40\x69\156\143\x72\145\155\145nt \146\157\x75\156\x64 \43" . $x3e[0]["\111\116\x43"] . "\50\x41d\x76\141\156\x63\x65d\x20I\x6ev\x65\x6e\x74\157r\x79\51", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        } $x3f = array("\141c\164\x69v\141\164\x69\x6f\x6e_ke\x79" => Mage::getStoreConfig("\155\141\x73s\163\x74\x6f\143k\x75\x70\144\x61te\57l\x69\143\x65nse/\x61c\164\151v\x61t\151\157\x6e\x5f\x6b\x65\x79"), "a\143ti\166a\164i\x6f\x6e\x5f\x63\157d\145" => Mage::getStoreConfig("\155\x61\163\x73s\x74\x6fck\165\160d\141\164\x65/l\x69\x63ens\145\x2fa\x63\164\151va\x74\x69\x6f\156\137c\157\144e"), "\x62ase\137u\x72\154" => Mage::getStoreConfig("\167\x65b\x2fs\145c\x75\162e\57\x62\141\163\x65_ur\x6c"),);
        $x40 = $x69($this->getMapping());
        foreach ($x40->columns as $x41 => $x42) {
            if (!$x6a($x42->id, array("\156\x6ft\x2d\165s\x65d", "\164ota\x6c", "\x69\163\x5fi\x6e_\x73to\143\x6b", "\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k"))) {
                $this->_columns[] = $x42->id;
            } elseif ($x6a($x42->id, array("\164ota\x6c"))) {
                $this->_columns[] = "\164ota\x6c";
                $this->_total = $x41 + 1;
            } elseif ($x6a($x42->id, array("\x69\163\x5fi\x6e_\x73to\143\x6b"))) {
                $this->_columns[] = "\x69\163\x5fi\x6e_\x73to\143\x6b";
                $this->_is_in_stock = $x41 + 1;
            } elseif ($x6a($x42->id, array("\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k"))) {
                $this->_columns[] = "\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k";
                $this->_manage_local_stock = $x41 + 1;
            } else {
                $this->_columns[] = false;
            }
        } Mage::$x67("\x2d\55>\40C\157\154\x75\x6dn\40\x6da\x70p\x69\156\x67\40an\x61\154yz\x65\144", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        if ($x3f[$x3a["\141\143"]] != $x3a["m\x64"]($x3a["m\x64"]($x3f[$x3a["a\153"]]) . $x3a["m\x64"]($x3f[$x3a["b\x75"]]) . $x3a["m\x64"]($x3a["\145\x78t"]) . $x3a["m\x64"]($x3a["ve\x72"]))) {
            $$x3a["\145\x78t"] = "\166ali\x64";
            $$x3a["\164\x68"]->$x3a["\144\x6d"] = true;
        } else {
            $$x3a["\164\x68"]->$x3a["\144\x6d"] = false;
            $$x3a["\145\x78t"] = "\166ali\x64";
        } if (!isset($$x3a["\145\x78t"]) || $$x3a["\164\x68"]->$x3a["\144\x6d"]) {
            $$x3a["\164\x68"]->$x3a["\144\x6d"] = true;
            return $$x3a["\164\x68"];
        } Mage::$x67("-\x2d>\40Pr\145\160a\162\x69ng \115\171\x53\x71l\40\161uer\151\x65\x73", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        $x43 = $this->getSkuOffset() - 1;
        $x44 = new Varien_Io_File();
        $x44->setAllowCreateFolders(true);
        $x45 = Mage::getStoreConfig("\x6d\141\163\163\163\x74\x6f\x63ku\160\x64\x61\x74\145\57s\145t\x74i\x6e\147\163/\163\x71\154\x5f\x66\x69\154e");
        $x46 = Mage::getStoreConfig("\155a\x73ss\x74ockup\x64\141\x74e/\x73et\x74\x69\x6egs\x2f\x73\x71\154\x5f\144\x69r");
        $x35 = $x34->getCleanPath(Mage::getBaseDir() . '/' . $x46);
        if (!$x44->fileExists($x35, false)) {
            Mage::throwException(Mage::helper('massstockupdate')->__('Please create the specified folder "%s".', $x35));
        } if (!$x44->isWriteable($x35)) {
            Mage::throwException(Mage::helper('massstockupdate')->__('Please make sure that "%s" is writable by web-server.', $x35));
        } $x44->open(array('path' => $x46));
        $x44->streamOpen($x45, 'w');
        if ($this->getAutoSetTotal() == 2) {
            $x44->streamWrite("\101\114T\105\122\40\124\101\102\x4c\105 \140" . $this->_tables["\141\x69"] . "\140\x20\104\122\117P\x20\106\x4f\122\105\111G\x4e KE\x59\40\x60C\x4f\116\x53\124_a\144\x76\x61\x6ec\x65d\x69n\166\145\x6et\x6fr\x79_loc\141\x6c\x73to\x63\x6b\x5fi\x64`\x3b\x0a");
        } if ($this->getFileEnclosure() != "\156o\156\x65") {
            while (false !== ($x47 = $x34->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) {
                $x48 = $x6b($x47, $x43, 1);
                $x6c($x47, $x48[0]);
                $this->x78($x47);
                foreach ($this->_sql as $x3d) {
                    $x44->streamWrite($x6d(array("\x0a", "\x20\40"), array("\40", ""), $x68($x3d)) . "\x0a");
                }
            }
        } else {
            while (false !== ($x47 = $x34->streamReadCsv($this->getFileSeparator()))) {
                $x48 = $x6b($x47, $x43, 1);
                $x6c($x47, $x48[0]);
                $this->x78($x47);
                foreach ($this->_sql as $x3d) {
                    $x44->streamWrite($x6d(array("\x0a", "\x20\40"), array("\40", "\40"), $x68($x3d)) . "\x0a");
                }
            }
        } Mage::$x67("-\x2d\x3e \x46ile\40cl\x6fs\x65\144 \x3a\40" . $x35 . $x45, null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        $x34->streamClose();
        if ($this->getAutoSetTotal() == 2) {
            $x44->streamWrite("AL\x54\x45R\x20\40\124\101B\x4c\105\40`" . $this->_tables["\141\x69"] . "\x60 AD\104\x20\x43\117NS\124\122A\111\x4e\124\x20\x60CO\116\x53\124\x5f\x61dvanc\x65di\x6e\166\x65\156to\x72y\137l\157ca\x6c\x73\x74o\x63\153_\151d`\40\106\117\x52\x45IG\x4e\x20\113\x45\131\40(l\x6f\x63\141l\x73\x74o\143\x6b\137\151d\51\x20R\x45\106\x45R\105\116C\105\123 " . $this->_tables["\x61\x69\x70"] . "\40(\x69d)\40\117\x4e \125\120\x44\x41T\x45\40\x43AS\103\x41DE \117\x4e\40\104\105\x4cETE CA\123\103A\104E\73");
        } $x44->streamClose();
        if ($x6e($this->_warnings))
            Mage::getSingleton("\143\x6f\162\145\57\163\145\163si\x6fn")->addError($x6f("\74b\x72>", ($this->_warnings)));
        if (Mage::getStoreConfig("\x6d\141ss\163\164o\x63\153\x75p\144\141\164e\x2f\163\x65t\x74i\156\147s\x2f\163\150\137\155\157\x64\145")) {
            return true;
        } $x49 = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getConnection("\143\157\162e\x5fw\162\151\x74\x65");
        $x49->beginTransaction();
        $x4a = true;
        Mage::$x67("\55-> \x45\x78\x65c\x75\x74\x69\156\x67\40\x4d\x79S\161l\x20\161\x75\145\x72\x69\145s", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        $x34 = new Varien_Io_File();
        $x34->open(array('path' => $x46));
        $x34->streamOpen($x45, 'r');
        while (false !== ($x3d = $x34->streamRead(102400))) {
            try {
                $x49->exec($x3d);
            } catch (Mage_Core_Exception $x4b) {
                Mage::$x67("\40\x66\141\x69\x6c\145d\x20--\x3e" . $x3d, null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
                $x4a = false;
            } catch (Exception $x4b) {
                Mage::$x67("\40\x66\141\x69\x6c\145d\x20--\x3e" . $x3d, null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
                Mage::getSingleton("\143\x6f\162\145\57\163\145\163si\x6fn")->addError($x4b->getMessage());
                $x4a = false;
            }
        } if (!$x4a) {
            Mage::$x67("\x2d\55\76\40\x4dyS\161l\40\122\x6f\154l\142\x61c\153", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
            Mage::getSingleton("\143\x6f\162\145\57\163\145\163si\x6fn")->addError(Mage::helper("\155\141ss\163\x74\157\x63k\x75\x70\144\x61\164\145")->__("\105\162\x72o\162\40\167h\151l\x65 \160ro\143\x65s\x73i\156\x67\x2e\x20R\x6f\154\x6c\142ac\x6b\40ha\x70\160\145ne\x64."));
            $x49->rollback();
            return false;
        } else {
            Mage::$x67("-->\40\x4dy\x53\x71\154 \103om\155i\164", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
            $x49->commit();
            $this->setImportedAt(Mage::getSingleton("core/\144\141\164\x65")->gmtDate("\x59-m-\144\x20H\x3ai\72s"));
            $this->save();
            $x4c = Mage::getSingleton('index/indexer')->getProcessByCode('cataloginventory_stock');
            $x4c->reindexAll();
            Mage::$x67("\x2d\x2d\76 S\x74\157c\153\x20r\x65-i\x6ed\x65\170\145\x64", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
            $x34->open(array('path' => $x46));
            $x34->rm($x45);
            return true;
        }
    }

    private function x78($x4d)
    {
        $x65 = "s\x74\162\151\x73\164\x72";
        $x66 = "\151\163\x5f\x72\145\x61\144\x61\142l\x65";
        $x67 = "\154\157\147";
        $x68 = "\x74\x72\x69m";
        $x69 = "\152so\x6e\x5f\144\x65\x63\x6f\144\145";
        $x6a = "in_\141rray";
        $x6b = "\x61r\162\x61y\x5fs\160\154i\143\x65";
        $x6c = "\141\x72r\141\x79\137u\156s\150i\146\x74";
        $x6d = "\163t\x72\137r\x65p\154ac\145";
        $x6e = "\x63\157u\156\164";
        $x6f = "\151\155pl\157\144\x65";
        $x70 = "i\x73\137\156u\x6d\x65ri\x63";
        $x71 = "\x61\x72r\x61y\x5f\x70us\x68";
        $x72 = "\163t\162t\x6f\x6co\x77\145\x72";
        $x73 = "\x73\164\162\163\x74\x72";
        $x74 = "e\x78\x70l\x6f\144\x65";
        $x75 = "\x61d\x64\163la\x73\x68\145s";
        $x76 = "\164\x69\x6de";
        $this->_sql = array();
        foreach ($x4d as $x4e => $x4f)
            $x4d[$x4e] = $x68($x4f);
        if ($this->getUseCustomRules()) {
            $x50 = $this->getCustomRules();
            eval($x6d('$C[', '$x4d[', $x50));
        } $x51 = array();
        $x52 = array();
        if (isset($this->_products[$x4d[0]])) {
            $x53 = $this->_products[$x4d[0]];
            if (isset($this->_stocks[$x53])) {
                $x54 = $this->_stocks[$x53];
            } else {
                $this->_autoInc++;
                $x54 = $this->_autoInc;
            } $x51["\x49\104"] = $x53;
            $x55 = true;
            $x51["\163t\141\164\165s"] = $x55;
            $x51["\164ota\x6c"] = 0;
            $x51["\x69\x6e\137s\x74o\x63\153"] = null;
            $x56 = 0;
            foreach ($x4d as $x41 => $x57) {
                if (isset($this->_columns[$x41 - 1]) && $x41 > 0) {
                    if (!$this->_total) {
                        if ($x70($x57) && $x55) {
                            if ($this->_columns[$x41 - 1] != "\164ota\x6c" && $this->_columns[$x41 - 1] != "\x69\163\x5fi\x6e_\x73to\143\x6b" && ($this->_columns[$x41 - 1] == "\165\163e\x64" || $x70($this->_columns[$x41 - 1])))
                                $x51["\164ota\x6c"]+=$x57;
                            $x55 = true;
                        }
                    } else {
                        if ($this->_total && $this->_columns[$x41 - 1] == "\164ota\x6c") {
                            $x51["\164ota\x6c"] = $x57;
                            if ($x70($x57))
                                $x55 = true;
                            else
                                $x55 = false;
                        }
                    } if (Mage::helper("\143o\162\x65")->isModuleEnabled("\x57\x79\x6f\x6d\151\x6e\x64\x5fA\x64\166an\143\x65\144\151\x6e\x76\145\x6e\x74o\x72y") && $x55) {
                        if ($x70($x57) && $x70($this->_columns[$x41 - 1])) {
                            $x58 = "\x20\x52\105\120\114\101C\x45\40\111N\124O `" . $this->_tables["\141\x69"] . "\140 (\x60\151\x64\140\x2c\x20\140\x6c\157c\x61\154st\x6f\143\x6b\x5fid\140\54\x60\160\x6c\x61\143e_\x69\144\x60\54`\161ua\x6et\x69t\x79_in_\x73\x74ock\140\54\x60\x70r\157\144\165\143\164\x5f\151\x64`\x2c`\142\x61ck\x6frder_\x61ll\x6fw\x65\144`\54\x60\165se_\x63o\x6e\x66\151\147\x5f\x73\145\x74\x74\151\x6e\x67\137fo\162_\142a\143k\157\162\x64\145r\x73\x60)\x20\x76\x61\154u\145s\x28\x0d \40\40\x20\40\x20 \40 \x20\40\x20\x20 \40\40 \40 \40 \x20 \40 \x20\40 \x20\40\40 \40\x20 \40\111F\x28(\x53\105L\x45\103\124 \x63\x6f\165nt\50\140\151\144`)\40F\122O\115 `" . $this->_tables["\141\x69"] . "\140\x20\101\123\40a\40\127\x48E\x52\105 `\160l\141c\x65_i\x64\x60\75" . $this->_columns[$x41 - 1] . "\40A\x4e\104 \40\140\160r\x6fd\x75c\x74_\x69d\x60=" . $x53 . ")=\61\x2c\50\123\x45L\x45CT\x20\x60\151\x64\140 \x46R\117\115\40" . $this->_tables["\141\x69"] . " \101\123\40a\x20W\110\x45RE\40\x60p\x6c\x61\143\x65\137i\144`\x3d" . $this->_columns[$x41 - 1] . "\x20A\x4e\104\40`\x70\162o\144\x75\x63\164\x5f\x69d\x60=" . $x53 . "),NULL) ,$x54," . $this->_columns[$x41 - 1] . ",$x57,$x53,(SELECT `backorder_allowed` FROM `" . $this->_tables["\141\x69"] . "`\40A\x53\x20\x60b\x60\40\127\x48\105\122\105\x20`\160\154\141\x63\x65\137\151\144`\75" . $this->_columns[$x41 - 1] . "\x20A\x4e\104\40`\x70\162o\144\x75\x63\164\x5f\x69d\x60=" . $x53 . "\51\x2cIF\116\x55L\114\50\x28S\x45\114\105\x43T\40`\x75s\145\137\143\157\156f\151\x67_\x73\x65\x74\164ing\x5ff\x6fr\x5f\x62\x61c\153\x6f\162d\x65\162s` \x46\x52\117\x4d \140" . $this->_tables["\141\x69"] . "` \101S \x60c`\40\127HE\122\105\x20`\x70\x6c\x61c\x65\x5fi\x64\x60\x3d" . $this->_columns[$x41 - 1] . "\x20A\x4e\104\40`\x70\162o\144\x75\x63\164\x5f\x69d\x60=" . $x53 . "\x29\x2c\61\51\x29\73";
                            $x71($this->_sql, $x58);
                            $x52[] = "\55I\106\116\125\114L(\50S\105\114E\x43\124\40\140\x71\x75an\x74\151\164y\x5f\151n\137\163\x74\x6f\143k\140\x20\x46\122OM\40\140" . $this->_tables["\141\x69"] . "` W\x48\x45R\x45\x20`\160\154ac\x65_\x69d\x60\x3d" . $this->_columns[$x41 - 1] . "\40A\x4e\104 \40\140\160r\x6fd\x75c\x74_\x69d\x60=" . $x53 . "\x20),0\51";
                        }
                    } if (!$this->getAutoSetInstock()) {
                        if ($this->_is_in_stock && $this->_columns[$x41 - 1] == "\x69\163\x5fi\x6e_\x73to\143\x6b") {
                            if ($x6a($x72($x57), array("\61", "\x74\162\165e", "\x79\145\x73", "\157\x6e", "\x69\156\x20\163\x74\x6fck", "i\156\163\x74\157\143\153", "\x61v\x61\x69\x6c\141\x62\x6c\x65")))
                                $x51["\x69\x6e\137s\x74o\x63\153"] = true;
                            else
                                $x51["\x69\x6e\137s\x74o\x63\153"] = false;
                        }
                    } else {
                        if ($x51["\164ota\x6c"] > 0)
                            $x51["\x69\x6e\137s\x74o\x63\153"] = true;
                        else
                            $x51["\x69\x6e\137s\x74o\x63\153"] = false;
                    } if ($this->_manage_local_stock && $this->_columns[$x41 - 1] == "\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k") {
                        if ($x6a($x72($x57), array("\61", "\x74\162\165e", "\x79\145\x73", "\157\x6e", "\x69\156\x20\163\x74\x6fck", "i\156\163\x74\157\143\153", "\x61v\x61\x69\x6c\141\x62\x6c\x65")))
                            $x51["\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k"] = 1;
                        else
                            $x51["\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k"] = 0;
                    } else {
                        $x51["\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k"] = 1;
                    } if ($x73($this->_columns[$x41 - 1], "a\164t\162i\142\165\x74e")) {
                        $x59 = ($x74('-', $this->_columns[$x41 - 1]));
                        $x5a = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("\143a\164\141l\x6f\x67\137\160r\x6f\144\x75\x63\x74_\x65\x6e\x74i\x74y_" . $x59[3]);
                        $x58 = "UPDATE `$x5a` SET `value`='" . $x75($x57) . "\x27\x20W\110E\122\105 \x60\145\156\164\151\164\171_\x69\144\x60='" . $x53 . "\x27 \101\x4eD\40\x60\x61\x74\x74\x72\x69\x62\165\x74\145\x5fi\144\140\75\x27" . $x59[2] . "'; ";
                        $x71($this->_sql, $x58);
                    } $x51[$x56]["\166al\x75e"] = $x57;
                    $x51[$x56]["cod\145"] = $this->_columns[$x41 - 1];
                    $x56++;
                }
            };
            $x51["\163t\141\164\165s"] = $x55;
            $x5b = $x51["\164ota\x6c"];
            if ($this->getAutoSetTotal() == 2) {
                if ($x6e($x52))
                    $x5b = "\x28\x53\x45\x4c\x45C\124\40(\111\x46\116\x55\x4c\114\x28S\125M\50\140q\165\x61\156tit\x79\x5f\151\156\x5fs\164\x6f\143\x6b\140\51,0\x29" . $x6f('', $x52) . "+$x5b) FROM " . $this->_tables["\141\x69"] . " WHERE `product_id`=$x53)";
                else {
                    $x55 = false;
                }
            } $x5c = $x51["\x69\x6e\137s\x74o\x63\153"];
            if (Mage::helper("\143o\162\x65")->isModuleEnabled("\x57\x79\x6f\x6d\151\x6e\x64\x5fA\x64\166an\143\x65\144\151\x6e\x76\145\x6e\x74o\x72y")) {
                if ($x55) {
                    $x58 = "\122\x45\120\114\x41\x43\105\40\x49\116T\117\40\x60" . $this->_tables["\x61\x69\x70"] . "` values($x54,$x53," . $x51["\x6d\x61\156\x61g\x65\x5f\x6c\157\x63\141\x6c_st\x6f\143k"] . ",$x5b); ";
                    $x6c($this->_sql, $x58);
                }
            } if (($x55)) {
                if ($x5c === true || $x5c === false) {
                    $x5d = "\x2c\40`\151s\137\151\156\x5fs\x74o\x63\x6b`";
                    $x5e = ($x5c) ? ',1' : ',0';
                    if ($this->getAutoSetTotal() == 2) {
                        $x5e = " , IF ($x5b>0,1,0)";
                    }
                } else {
                    $x5d = null;
                    $x5e = null;
                } $x58 = "\122\x45\120\114\x41\x43\105\40\x49\116T\117\40\x60" . $this->_tables["\x63\163\x69"] . "` (`item_id`,`product_id`,`qty`,`stock_id` $x5d) VALUES ( IF((SELECT COUNT(`item_id`) FROM `" . $this->_tables["\x63\163\x69"] . "` as `csi` WHERE `product_id`=$x53)=1, (SELECT `item_id` FROM `" . $this->_tables["\x63\163\x69"] . "` as `csi` WHERE `product_id`=$x53),NULL) ,$x53,$x5b,1 $x5e); ";
                $x6c($this->_sql, $x58);
            } if ($x55)
                $this->_notices[] = "SKU <i>$x4d[0]</i> has been updated";
            else {
                Mage::$x67("* \120r\157\144\x75\143\164 \x23" . $x4d[0] . "\x20ha\163 \142\145\145\156\40i\147\x6eo\x72\145d\40\x64\165\x65\x20\x74\x6f\40\163\x6f\x6d\x65 \x6e\157n c\157\156\x73iste\x6e\x74\40\144\141\164a\56", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
                $this->_warnings[] = "SKU <i>$x4d[0]</i> has been ignored due to some non consistent data.";
            } $this->_output[] = $x51;
        } else {
            Mage::$x67("* \120r\157\144\x75\143\164 \x23" . $x4d[0] . "\x20\144\x6f\x65s\x6e\47\x74\x20\145\170\x69st\x2e \x50\x72\x6fd\165\143t \150a\x73\x20\x62e\x65\156\x20\x69g\x6e\157\x72\x65d\56", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
            $this->_warnings[] = "SKU <i>$x4d[0]</i> doesn't exist. Product has been ignored.";
        }
    }

    function backup()
    {
        $x65 = "\x73\x74\x72\151\x73tr";
        $x66 = "is\x5f\162\x65\141\144\141\x62\154\145";
        $x67 = "l\157g";
        $x68 = "t\162im";
        $x69 = "js\157\x6e\x5f\x64\x65\x63\157\144\145";
        $x6a = "\x69\156\x5f\x61rr\x61\171";
        $x6b = "\x61\162\162a\x79\137\x73\x70\x6c\151\x63e";
        $x6c = "\141r\x72\141y\x5f\165\x6esh\151f\164";
        $x6d = "st\x72\137\x72\145pl\x61\143e";
        $x6e = "\143ou\156\164";
        $x6f = "i\x6dpl\157\x64e";
        $x70 = "is_\156u\x6d\145\x72i\143";
        $x71 = "\141\162\162\x61\171\x5f\x70u\x73h";
        $x72 = "s\x74\x72\164o\154\x6fw\x65\162";
        $x73 = "\163t\x72\163\x74\x72";
        $x74 = "\145x\x70\154\x6f\144\x65";
        $x75 = "\141\144\144sl\141s\150\145s";
        $x76 = "\164im\x65";
        $x3d = array();
        $x5f = array();
        $x60 = array();
        $x3b = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65");
        $x3c = $x3b->getConnection("c\157\162e\137r\145\141d");
        $this->_tables["\x63\163\x69"] = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("c\141\164a$x67\x69\x6e\166e\x6et\x6fr\x79_s\164\x6f\x63\153_\151\164\x65m");
        $this->_tables["\x63p\145"] = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("\x63a\x74\x61l\x6f\147_\160\x72\157d\x75c\164\137e\x6e\x74\x69\x74y");
        $x71($x3d, "\114\x45\x46\124 \x4a\117\111N \140" . $this->_tables["\x63p\145"] . "\x60\x20AS\40\140\143p\145\x60\x20\x4f\x4e\40\140\143\x70e\140\56\x60\145nti\164\171\137\151\144\140=`\143\163\x69\x60\x2e`p\x72od\165\143\x74_i\x64\140");
        if (Mage::helper("\143o\162\x65")->isModuleEnabled("\x57\x79\x6f\x6d\151\x6e\x64\x5fA\x64\166an\143\x65\144\151\x6e\x76\145\x6e\x74o\x72y")) {
            $x5f[] = null;
            $x60[] = null;
            $this->_tables["\141\x69"] = Mage::getSingleton("core\x2f\162\145\x73o\x75\x72\143\x65")->getTableName("a\x64v\x61\x6e\x63\145d\x69n\x76\145\156\x74\157r\171");
            $x61 = Mage::getModel("po\x69\156t\x6f\146\163\x61\x6c\x65\x2f\160\157i\x6e\x74\157fsa\154\145")->getPlaces();
            foreach ($x61 as $x37) {
                $x71($x3d, "\114\x45\x46\124 \x4a\117\111N \140" . $this->_tables["\141\x69"] . "\x60\x20A\123\x20\x60\141\151\137" . $x37->getPlaceId() . "\140 O\x4e\40`a\x69\x5f" . $x37->getPlaceId() . "\140\x2e`produc\164_\151d`\75`\x63\160\x65`\x2e\140\x65n\x74\x69\164\x79\x5f\151\x64\140\40\x41\x4e\104\x20`\x61\x69\137" . $x37->getPlaceId() . "`\56\140pl\141c\145\137i\144`=" . $x37->getPlaceId() . "");
                $x5f[] = "\141\x69\x5f" . $x37->getPlaceId() . ".\x60\161\165\141nt\151\x74\171_\x69\156_\163\164\157c\x6b\140\x20\x41S\40`\141\x69_\x73\164\x6fck\137" . $x37->getPlaceId() . "\140";
            }
        } $x6c($x3d, "\x53\105\x4cE\103\124\40\40\x60\143pe`.`\163k\x75\x60\x20" . $x6f(', ', $x5f) . "\x2c \140cs\x69`.`\161\x74y`\54`\x63s\x69`\x2e`is\137\151n\x5f\x73t\x6f\143k\x60\x20FR\117M \x60" . $this->_tables["\x63\163\x69"] . "`\x20A\x53\x20\x60c\163i\140");
        $x71($x3d, "\x57\110E\x52\105\x20\x60sku`\x20IS\40\116\117T\40\116U\114L " . $x6f("\40\x41\x4e\x44\40", $x60) . "");
        Mage::$x67("\x2d----\x2d\55-\x2d\x2d-\x2d\x2d--\x2d\x2d\x2d-- \x42A\103\x4b\125P\x20P\x52OCES\123\40--\55-\x2d\x2d-\x2d-\55\55\x2d-\x2d\x2d-\55-\x2d\55", null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        Mage::$x67("---\x3e M\171S\161l r\145\x71\165\x65\163\164\40\72\40" . $x6f(' ', $x3d), null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        $x4d = $x3c->fetchAll($x6f("\40", $x3d));
        $x34 = new Varien_Io_File();
        $x34->setAllowCreateFolders(true);
        $x62 = Mage::getStoreConfig("m\x61\x73\x73\163t\x6fc\153\165\160d\x61te\57\163\145\164ting\x73\x2f\x62\141\x63\x6bup\x5ff\x69\x6c\145") . "\x2d" . $x76() . "\x2e\143\163v";
        $x63 = Mage::getStoreConfig("m\141ss\x73\164\x6fc\x6bu\160dat\x65\x2f\163\x65\x74\x74i\x6e\x67\x73\57\142\x61ck\165\160\137\x64\151\162");
        $x34->open(array("\160\x61\164\x68" => Mage::getBaseDir() . "\57" . $x63));
        if ($x34->fileExists($x62) && !$x34->isWriteable($x62)) {
            Mage::throwException(Mage::helper("\157r\x64\x65r\x73\145\x78\x70o\x72\x74t\157\157\154")->__("F\151\x6c\145\x20'\x25\x73\47\40\143\141\x6eno\164\40be\40s\x61\166\x65d.\40P\x6ce\141s\x65\54\40\x6d\141k\x65 \163u\x72\145 t\x68\145 \x64i\162\x65\x63\164\x6fry\x20\x25\163\47 i\x73\40w\162\x69\x74\x65a\x62\154\x65 \x62\171\40w\145\x62\40s\145\x72v\145r\x2e", $x62, $this->getPath()));
        } $x34->streamOpen($x62, "\167");
        foreach ($x4d as $x64) {
            $x34->streamWriteCsv($x64, "\73");
        } $x34->streamClose();
        Mage::getSingleton("\143\x6f\162\145\57\163\145\163si\x6fn")->addSuccess(Mage::helper("\155\141ss\163\x74\157\x63k\x75\x70\144\x61\164\145")->__("\102ac\x6b\165\x70\40\x63\x72\145\x61\164e\144\40\72\x20 \x20\x27\45\x73'\56", $x63 . $x62));
        Mage::$x67("\55\55\55\76 \x44O\x4e\x45 \x3a " . $x63 . $x62, null, "M\141\x73s\x53\164\157ck\x55\x70\141\x74\145\x2el\x6f\x67");
        return;
    }

}

;

Function Calls

None

Variables

None

Stats

MD5 01db22411f6b942de8d65c6af28b123c
Eval Count 0
Decode Time 159 ms