PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/app/code/core/Mage/GoogleBase/sql/googlebase_setup/mysql4-upgrade-0.1.1-0.1.2.php

https://gitlab.com/blingbang2016/shop
PHP | 43 lines | 14 code | 3 blank | 26 comment | 0 complexity | e94099eedd81ce5f48dbeb10adbcc391 MD5 | raw file
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magento.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magento.com for more information.
  20. *
  21. * @category Mage
  22. * @package Mage_GoogleBase
  23. * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26. /* @var $installer Mage_Core_Model_Resource_Setup */
  27. $installer = $this;
  28. // encrypt google base passwords
  29. $select = $installer->getConnection()->select()
  30. ->from($installer->getTable('core/config_data'))
  31. ->where('path LIKE ?', 'google/googlebase/password');
  32. foreach ($installer->getConnection()->fetchAll($select) as $row) {
  33. $bind = array(
  34. 'value' => Mage::helper('core')->encrypt($row['value'])
  35. );
  36. $where = array(
  37. 'config_id=?' => $row['config_id']
  38. );
  39. $installer->getConnection()->update($installer->getTable('core/config_data'), $bind, $where);
  40. }