jimbo79 Posted May 21, 2015 Share Posted May 21, 2015 Hi, This is not my code but it is throwing a error when I call itParse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/magent74/public_html/part-site/Cron.php on line 54 here is the code <?phprequire_once(dirname(__FILE__) . "/../../../../../magmi/plugins/inc/magmi_datasource.php");require_once(dirname(__FILE__) . "/../../../../../magmi/integration/productimport_datapump.php");class Company_Magmi_Cron { public function magmiUpdate() { $items = array( "sku" => "", "qty" => ""); // build your own list of items to create/update $this->import($items); } private function import($items, $mode = 'create', $indexes = 'all') { if (count($items) > 0) { $dp = new Magmi_ProductImport_DataPump(); $dp->beginImportSession("test", $mode); foreach ($items as $item) { $dp->ingest($item); } $dp->endImportSession(); $this->reindex($indexes); } } private function reindex($string = 'all') { /** @var $indexer Mage_Index_Model_Indexer */ $indexer = Mage::getModel('index/indexer'); $processes = array(); if ($string == 'all') { $processes = $indexer->getProcessesCollection(); } else { $codes = explode(',', $string); foreach ($codes as $code) { $process = $indexer->getProcessByCode(trim($code)); if ($process) { $processes[] = $process; } } } /** @var $process Mage_Index_Model_Process */ foreach ($processes as $process) { $process->reindexEverything(); } } ?> would really love it if someone could help me out. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/296434-please-help-got-this-error/ Share on other sites More sharing options...
requinix Posted May 21, 2015 Share Posted May 21, 2015 Why it says a semicolon, I don't know, but you are missing the closing } on the class. Quote Link to comment https://forums.phpfreaks.com/topic/296434-please-help-got-this-error/#findComment-1512364 Share on other sites More sharing options...
jimbo79 Posted May 21, 2015 Author Share Posted May 21, 2015 Why it says a semicolon, I don't know, but you are missing the closing } on the class. Thanks for getting back can you point it out where I am missing this its is cracking me up Quote Link to comment https://forums.phpfreaks.com/topic/296434-please-help-got-this-error/#findComment-1512365 Share on other sites More sharing options...
requinix Posted May 21, 2015 Share Posted May 21, 2015 Follow along with the various {s and }s, see where the various functions and control structures (if, foreach, etc.) start and end, and eventually you'll realize you're "inside" the class and "outside" everything else and missing the final closing }. Looking at the indentation works too, as long as the code is properly indented (which that code is). Quote Link to comment https://forums.phpfreaks.com/topic/296434-please-help-got-this-error/#findComment-1512367 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.