Пример #1
0
 /**
  * Initialize application key and settings
  *
  * @param string $appId        Application ID
  * @param string $appKey       Application key
  * @param string $appMasterKey Application master key
  */
 public static function initialize($appId, $appKey, $appMasterKey)
 {
     self::$appId = $appId;
     self::$appKey = $appKey;
     self::$appMasterKey = $appMasterKey;
     self::$defaultHeaders = array('X-LC-Id' => self::$appId, 'Content-Type' => 'application/json;charset=utf-8', 'User-Agent' => self::getVersionString());
     // Use session storage by default
     if (!self::$storage) {
         self::$storage = new SessionStorage();
     }
     // register LeanUser for object storage
     LeanUser::registerClass();
 }
Пример #2
0
 /**
  * Initialize application credentials
  *
  * @param string $appId        Application ID
  * @param string $appKey       Application key
  * @param string $appMasterKey Application master key
  *
  * @return void
  */
 public static function initialize($appId, $appKey, $appMasterKey)
 {
     self::$appId = $appId;
     self::$appKey = $appKey;
     self::$appMasterKey = $appMasterKey;
     self::$default_headers = array('X-LC-Id' => self::$appId, 'Content-Type' => 'application/json;charset=utf-8', 'User-Agent' => 'LeanCloud PHP SDK ' . self::$versionString);
 }