UserOperator.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: bingone
  5. * Date: 16/1/20
  6. * Time: 上午10:11
  7. */
  8. //namespace Yunpian\lib;
  9. require_once 'HttpUtil.php';
  10. class UserOperator
  11. {
  12. public $apikey;
  13. public $api_secret;
  14. public $yunpian_config;
  15. public function __construct($apikey=null,$api_secret=null)
  16. {
  17. $this->yunpian_config = $GLOBALS['YUNPIAN_CONFIG'];
  18. if($api_secret == null)
  19. $this->api_secret = $this->yunpian_config['API_SECRET'];
  20. else
  21. $this->api_secret = $apikey;
  22. if($apikey == null)
  23. $this->apikey = $this->yunpian_config['APIKEY'];
  24. else
  25. $this->apikey = $api_secret;
  26. }
  27. public function encrypt(&$data){
  28. }
  29. public function get($data=array()){
  30. $data['apikey'] = $this->apikey;
  31. return HttpUtil::PostCURL($this->yunpian_config['URI_GET_USER_INFO'],$data);
  32. }
  33. public function set($data=array()){
  34. $data['apikey'] = $this->apikey;
  35. return HttpUtil::PostCURL($this->yunpian_config['URI_SET_USER_INFO'],$data);
  36. }
  37. }
  38. ?>