Storage.php 792 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: Storage.php 29263 2012-03-31 05:45:08Z yexinhao $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class Cloud_Service_Server_Storage extends Cloud_Service_Server_Restful {
  12. protected static $_instance;
  13. public static function getInstance() {
  14. if (!(self::$_instance instanceof self)) {
  15. self::$_instance = new self();
  16. }
  17. return self::$_instance;
  18. }
  19. public function onStorageSetConfig($data) {
  20. if ($data['xf_storage_enc_key']) {
  21. $insert = array(
  22. 'skey' => 'xf_storage_enc_key',
  23. 'svalue' => $data['xf_storage_enc_key'],
  24. );
  25. C::t('common_setting')->insert($insert, 0, 1);
  26. return true;
  27. }
  28. return false;
  29. }
  30. }