installer.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup OpenCV OpenCV integration
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxOpencvInstaller extends BxDolStudioInstaller
  12. {
  13. function __construct($aConfig)
  14. {
  15. parent::__construct($aConfig);
  16. }
  17. public function install($aParams, $bAutoEnable = false)
  18. {
  19. $aResult = parent::install($aParams, $bAutoEnable);
  20. if ($aResult['result']) {
  21. if ($this->oDb->isTableExists('bx_persons_data') && !$this->oDb->isFieldExists('bx_persons_data', 'obfuscate_faces'))
  22. $this->oDb->query("ALTER TABLE `bx_persons_data` ADD `obfuscate_faces` TINYINT NOT NULL DEFAULT '0'");
  23. if ($this->oDb->isTableExists('bx_organizations_data') && !$this->oDb->isFieldExists('bx_organizations_data', 'obfuscate_faces'))
  24. $this->oDb->query("ALTER TABLE `bx_organizations_data` ADD `obfuscate_faces` TINYINT NOT NULL DEFAULT '0'");
  25. }
  26. return $aResult;
  27. }
  28. public function uninstall($aParams, $bAutoDisable = false)
  29. {
  30. $aResult = parent::uninstall($aParams, $bAutoDisable);
  31. if ($aResult['result']) {
  32. if ($this->oDb->isTableExists('bx_persons_data') && $this->oDb->isFieldExists('bx_persons_data', 'obfuscate_faces'))
  33. $this->oDb->query("ALTER TABLE `bx_persons_data` DROP `obfuscate_faces`");
  34. if ($this->oDb->isTableExists('bx_organizations_data') && $this->oDb->isFieldExists('bx_organizations_data', 'obfuscate_faces'))
  35. $this->oDb->query("ALTER TABLE `bx_organizations_data` DROP `obfuscate_faces`");
  36. }
  37. return $aResult;
  38. }
  39. }
  40. /** @} */