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 public function importProcess() { Mage::log("-------------------..

Decoded Output download

<?php 
public function importProcess() { 
         
        Mage::log("-------------------- IMPORTATION PROCESS ---------------", null, "MassStockUpate.log"); 
         
        $this->initImport(); 
         
        $x40 = new Varien_Io_File(); 
        $x41 = $x40->getCleanPath(Mage::getBaseDir() . "/" . $this->getFilePath()); 
        $x40->streamOpen($x41, "r"); 
         
        Mage::log("--> File opened : " . $x41, null, "MassStockUpate.log"); 
         
        /** 
         *  
         * @var Mage_Core_Model_Resource $resource 
         */ 
        $resource = Mage::getSingleton("core/resource"); 
 
        $this->_tables["csi"] = Mage::getSingleton("core/resource")->getTableName("cataloginventory_stock_item"); 
        $this->_tables["aip"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory_product"); 
        $this->_tables["ai"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory"); 
         
        $x4a = $resource->getConnection("core_read")->fetchAll("SELECT MAX(id) AS INC FROM " . $this->_tables["aip"] . " ;"); 
        $this->_autoInc = $x4a[0]["INC"]; 
         
        Mage::log("--> Max increment found #" . $x4a[0]["INC"] . "(Advanced Inventory)", null, "MassStockUpate.log"); 
     
        $this->mapImportColumns(); 
         
        Mage::log("--> Preparing MySql queries", null, "MassStockUpate.log");  
         
        $x4f = $this->getSkuOffset() - 1; 
         
        $x50 = new Varien_Io_File(); 
        $x50->setAllowCreateFolders(true); 
         
        $x51 = "MassStockUpdate.tmp.sql"; 
         
        $x41 = $x40->getCleanPath(Mage::getBaseDir() . '/var/tmp'); 
         
        if(!$x50->fileExists($x41, false)) { 
             
            Mage::throwException(Mage::helper('massstockupdate')->__('Please create the specified folder "%s".', $x41)); 
        } 
         
        if(!$x50->isWriteable($x41)) { 
             
            Mage::throwException(Mage::helper('massstockupdate')->__('Please make sure that "%s" is writable by web-server.', $x41)); 
         
        } 
         
        $x50->open(['path' => 'var/tmp']); 
        $x50->streamOpen($x51, 'w'); 
         
        if ($this->getAutoSetTotal() == 2) { 
            $x50->streamWrite("ALTER TABLE `" . $this->_tables["ai"] . "` DROP FOREIGN KEY `CONST_advancedinventory_localstock_id`; 
"); 
        } 
        if ($this->getFileEnclosure() != "none") { 
             
            while (false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) { 
                $x54 = array_splice($x53, $x4f, 1); 
                array_unshift($x53, $x54[0]); 
                $this->x83($x53); 
                foreach ($this->_sql as $x49) { 
                    $x50->streamWrite(str_replace(array( 
                        "
", 
                        "  " 
                    ), array( 
                        " ", 
                        "" 
                    ), trim($x49)) . "
"); 
                } 
            } 
             
        } else { 
             
            while (false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator()))) { 
                $x54 = array_splice($x53, $x4f, 1); 
                array_unshift($x53, $x54[0]); 
                $this->x83($x53); 
                foreach ($this->_sql as $x49) { 
                    $x50->streamWrite(str_replace(array( 
                        "
", 
                        "  " 
                    ), array( 
                        " ", 
                        " " 
                    ), trim($x49)) . "
"); 
                } 
            } 
             
        } 
        Mage::log("--> File closed : " . $x41, null, "MassStockUpate.log"); 
        $x40->streamClose(); 
        if($this->getAutoSetTotal() == 2) { 
             
            $x50->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;"); 
         
        } 
         
        $x50->streamClose(); 
         
        if (count($this->_warnings)) { 
             
            Mage::getSingleton("core/session")->addError(implode("<br>", ($this->_warnings))); 
        } 
         
        if(Mage::getStoreConfig("massstockupdate/settings/report_debug")) { 
         
            Mage::getSingleton("core/session")->addWarning("Debug mode enabled.No data have been updated.<br>MassStockUpate.log file has been created (log files must be enabled in system > configuration > developer)."); 
         
            return; 
         
        } 
         
        $x55 = Mage::getSingleton("core/resource")->getConnection("core_write"); 
        $x55->beginTransaction(); 
         
        $error = false; 
         
        Mage::log("--> Executing MySql queries", null, "MassStockUpate.log"); 
         
        $x40 = new Varien_Io_File(); 
        $x40->streamOpen($x41 . $x51, "r"); 
         
        while(false !== ($x49 = $x40->streamRead(102400))) { 
             
            try { 
             
                $x55->exec($x49); 
             
            }catch(Mage_Core_Exception $x57) { 
                 
                Mage::log(" failed -->" . $x49, null, "MassStockUpate.log"); 
                $error = true; 
             
            }catch(Exception $x57) { 
                 
                Mage::log(" failed -->" . $x49, null, "MassStockUpate.log"); 
                Mage::log($x57->getMessage(), null, "MassStockUpate.log");  
                 
                $error = true; 
             
            } 
             
        } 
         
        if($error) { 
             
            Mage::log("--> MySql Rollback", null, "MassStockUpate.log"); 
             
            $x55->rollback(); 
             
            return false; 
             
        } 
         
        Mage::log("--> MySql Commit", null, "MassStockUpate.log"); 
        $x55->commit(); 
         
        $this->setImportedAt(Mage::getSingleton("core/date")->gmtDate("Y-m-d H:i:s"))->save(); 
         
        $x40->open(['path' => 'var/tmp']); 
        $x40->rm($x51); 
         
        return true; 
     
    } ?>

Did this file decode correctly?

Original Code

<?php
public function importProcess() {
        
        Mage::log("-------------------- IMPORTATION PROCESS ---------------", null, "MassStockUpate.log");
        
        $this->initImport();
        
        $x40 = new Varien_Io_File();
        $x41 = $x40->getCleanPath(Mage::getBaseDir() . "\57" . $this->getFilePath());
        $x40->streamOpen($x41, "r");
        
        Mage::log("--> File opened : " . $x41, null, "MassStockUpate.log");
        
        /**
         * 
         * @var Mage_Core_Model_Resource $resource
         */
        $resource = Mage::getSingleton("core/resource");

        $this->_tables["csi"] = Mage::getSingleton("core/resource")->getTableName("cataloginventory_stock_item");
        $this->_tables["aip"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory_product");
        $this->_tables["ai"] = Mage::getSingleton("core/resource")->getTableName("advancedinventory");
        
        $x4a = $resource->getConnection("core_read")->fetchAll("SELECT MAX(id) AS INC FROM " . $this->_tables["aip"] . " ;");
        $this->_autoInc = $x4a[0]["INC"];
        
        Mage::log("--> Max increment found #" . $x4a[0]["INC"] . "(Advanced Inventory)", null, "MassStockUpate.log");
    
        $this->mapImportColumns();
        
        Mage::log("--> Preparing MySql queries", null, "MassStockUpate.log"); 
        
        $x4f = $this->getSkuOffset() - 1;
        
        $x50 = new Varien_Io_File();
        $x50->setAllowCreateFolders(true);
        
        $x51 = "MassStockUpdate.tmp.sql";
        
        $x41 = $x40->getCleanPath(Mage::getBaseDir() . '/var/tmp');
        
        if(!$x50->fileExists($x41, false)) {
            
            Mage::throwException(Mage::helper('massstockupdate')->__('Please create the specified folder "%s".', $x41));
        }
        
        if(!$x50->isWriteable($x41)) {
            
            Mage::throwException(Mage::helper('massstockupdate')->__('Please make sure that "%s" is writable by web-server.', $x41));
        
        }
        
        $x50->open(['path' => 'var/tmp']);
        $x50->streamOpen($x51, 'w');
        
        if ($this->getAutoSetTotal() == 2) {
            $x50->streamWrite("AL\x54E\x52\x20\x54\x41\102\114\x45\40\x60" . $this->_tables["a\151"] . "\x60 D\122\x4f\x50\40\106\x4f\x52\105\x49\107N \x4b\105Y\40\x60C\117\116\x53\x54\x5f\141d\x76\x61\156\x63\x65\144\151\156\166\x65nt\157\x72\x79_\x6c\x6f\x63al\163\x74\157ck_\x69d\x60; \x0a");
        }
        if ($this->getFileEnclosure() != "n\x6f\156e") {
            
            while (false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator(), $this->getFileEnclosure()))) {
                $x54 = array_splice($x53, $x4f, 1);
                array_unshift($x53, $x54[0]);
                $this->x83($x53);
                foreach ($this->_sql as $x49) {
                    $x50->streamWrite(str_replace(array(
                        "\x0a",
                        "\40 "
                    ), array(
                        "\40",
                        ""
                    ), trim($x49)) . "\x0a");
                }
            }
            
        } else {
            
            while (false !== ($x53 = $x40->streamReadCsv($this->getFileSeparator()))) {
                $x54 = array_splice($x53, $x4f, 1);
                array_unshift($x53, $x54[0]);
                $this->x83($x53);
                foreach ($this->_sql as $x49) {
                    $x50->streamWrite(str_replace(array(
                        "\x0a",
                        "\40 "
                    ), array(
                        "\40",
                        "\40"
                    ), trim($x49)) . "\x0a");
                }
            }
            
        }
        Mage::log("\x2d-\x3e\40F\x69\154e\x20\x63\154\x6fs\145\x64\40\72 " . $x41, null, "MassStockUpate.log");
        $x40->streamClose();
        if($this->getAutoSetTotal() == 2) {
            
            $x50->streamWrite("\x41L\x54\105\x52\40\40\x54\x41B\114\105 \x60" . $this->_tables["a\151"] . "\x60\x20\x41\104\104 \103\117\116\123\124R\101INT \x60\x43ONST_\141\144\x76\x61nced\x69n\166en\x74\x6f\x72\171\137l\x6f\143al\x73\x74o\x63k_\x69\144\x60 F\117\122E\x49\107\x4e KEY (l\157\x63\141\154s\164\157c\153\137\x69\x64\x29\x20R\105FER\105N\x43\x45S\x20" . $this->_tables["a\x69\160"] . " \x28\151\144\51\x20\x4f\x4e \125\x50\x44A\x54\105 \103\101\x53\103\101\x44E\x20\x4fN \104E\114\x45T\105 \x43\x41S\x43\101DE\73");
        
        }
        
        $x50->streamClose();
        
        if (count($this->_warnings)) {
            
            Mage::getSingleton("c\157r\145\57\x73\x65s\163\151\x6f\156")->addError(implode("\74\142\x72\76", ($this->_warnings)));
        }
        
        if(Mage::getStoreConfig("m\x61sss\164o\x63\153u\x70d\141\x74\x65\x2fs\x65t\x74\x69n\x67s\x2f\x72\x65p\157\162\x74\x5f\144\x65\x62\165\147")) {
        
            Mage::getSingleton("c\157r\145\57\x73\x65s\163\151\x6f\156")->addWarning("\x44e\x62u\x67 \x6d\x6f\x64\x65 \145\x6e\x61\x62\x6c\145\144\56\x4e\x6f\40d\x61\x74a\x20h\x61ve\40be\145n \165pd\141t\x65d.\74\x62\x72\x3eM\141\x73\x73\123\164\x6f\143\153Up\141t\x65\x2e\154\157g\x20\x66il\145\40\x68\141\163\40\142e\145\x6e\x20c\162e\x61\164\x65d\40\x28\154\x6f\x67\40f\151\154\x65\163\x20m\x75s\x74\40\x62\145\x20e\x6e\141\x62le\x64\x20\x69\156\x20s\171\163\x74\145m \x3e\x20co\156fi\x67\x75\162\141\164i\157n\x20> dev\x65\154\x6f\x70e\162\x29\56");
        
            return;
        
        }
        
        $x55 = Mage::getSingleton("\143o\162\x65\x2f\x72es\157\165\x72ce")->getConnection("\143\157\162\x65\137\167\x72\151\164e");
        $x55->beginTransaction();
        
        $error = false;
        
        Mage::log("--> E\170e\x63uti\156g\x20\115\171\123\x71\154\x20\x71\x75e\162\151\145s", null, "MassStockUpate.log");
        
        $x40 = new Varien_Io_File();
        $x40->streamOpen($x41 . $x51, "\x72");
        
        while(false !== ($x49 = $x40->streamRead(102400))) {
            
            try {
            
                $x55->exec($x49);
            
            }catch(Mage_Core_Exception $x57) {
                
                Mage::log(" \146\141\151l\145\144\40\x2d-\x3e" . $x49, null, "MassStockUpate.log");
                $error = true;
            
            }catch(Exception $x57) {
                
                Mage::log(" \146\141\151l\145\144\40\x2d-\x3e" . $x49, null, "MassStockUpate.log");
                Mage::log($x57->getMessage(), null, "MassStockUpate.log"); 
                
                $error = true;
            
            }
            
        }
        
        if($error) {
            
            Mage::log("\55-\x3e MyS\x71\154\40\x52o\154l\142ack", null, "MassStockUpate.log");
            
            $x55->rollback();
            
            return false;
            
        }
        
        Mage::log("\55\x2d>\40M\171\x53ql\40C\x6f\x6d\x6d\151\x74", null, "MassStockUpate.log");
        $x55->commit();
        
        $this->setImportedAt(Mage::getSingleton("cor\x65/\144\141\164e")->gmtDate("\131-\155-d H:\x69:\163"))->save();
        
        $x40->open(['path' => 'var/tmp']);
        $x40->rm($x51);
        
        return true;
    
    }

Function Calls

None

Variables

None

Stats

MD5 18ed73a11e060c9fea50cf7f4ccbda5a
Eval Count 0
Decode Time 70 ms