PageRenderTime 112ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/magmi/engines/magmi_utilityengine.php

https://bitbucket.org/jit_bec/shopifine
PHP | 84 lines | 49 code | 15 blank | 20 comment | 0 complexity | d0ca093690e95caea5864d2fd4321104 MD5 | raw file
Possible License(s): LGPL-3.0
  1. <?php
  2. /**
  3. * MAGENTO MASS IMPORTER CLASS
  4. *
  5. * version : 0.6
  6. * author : S.BRACQUEMONT aka dweeves
  7. * updated : 2010-10-09
  8. *
  9. */
  10. /* use external file for db helper */
  11. require_once("magmi_engine.php");
  12. require_once("magmi_pluginhelper.php");
  13. /* Magmi ProductImporter is now a Magmi_Engine instance */
  14. class Magmi_UtilityEngine extends Magmi_Engine
  15. {
  16. /**
  17. * constructor
  18. * @param string $conffile : configuration .ini filename
  19. */
  20. public function __construct()
  21. {
  22. }
  23. public function getEnabledPluginClasses($profile)
  24. {
  25. $clist=Magmi_PluginHelper::getInstance("main")->getPluginsInfo("utilities","class");
  26. return $clist;
  27. }
  28. public function getEngineInfo()
  29. {
  30. return array("name"=>"Magmi Utilities Engine","version"=>"1.0.1","author"=>"dweeves");
  31. }
  32. /**
  33. * load properties
  34. * @param string $conf : configuration .ini filename
  35. */
  36. public function getPluginFamilies()
  37. {
  38. return array("utilities");
  39. }
  40. public function engineInit($params)
  41. {
  42. $this->initPlugins(null);
  43. }
  44. public function engineRun($params)
  45. {
  46. $this->log("Magento Mass Importer by dweeves - version:".Magmi_Version::$version,"title");
  47. //initialize db connectivity
  48. Magmi_StateManager::setState("running");
  49. //force only one class to run
  50. $this->_pluginclasses=array("utilities"=>array($params["pluginclass"]));
  51. $this->createPlugins("__utilities__",$params);
  52. foreach($this->_activeplugins["utilities"] as $pinst)
  53. {
  54. try
  55. {
  56. $pinst->runUtility();
  57. }
  58. catch(Exception $e)
  59. {
  60. $this->logException($e);
  61. }
  62. }
  63. Magmi_StateManager::setState("idle");
  64. }
  65. public function onEngineException($e)
  66. {
  67. Magmi_StateManager::setState("idle");
  68. }
  69. }