/**
  * Parse\Client::initialize, must be called before using Parse features.
  *
  * @param string $app_id     Parse Application ID
  * @param string $rest_key   Parse REST API Key
  * @param string $master_key Parse Master Key
  *
  * @return null
  */
 public static function initialize($app_id, $rest_key, $master_key)
 {
     ParseUser::registerSubclass();
     ParseRole::registerSubclass();
     ParseInstallation::registerSubclass();
     self::$applicationId = $app_id;
     self::$restKey = $rest_key;
     self::$masterKey = $master_key;
     if (!static::$storage) {
         if (session_status() === PHP_SESSION_ACTIVE) {
             self::setStorage(new ParseSessionStorage());
         } else {
             self::setStorage(new ParseMemoryStorage());
         }
     }
 }
示例#2
0
        } else {
            $member = new Member();
        }
        foreach ($m as $k => $v) {
            $member->{$k} = $v;
        }
        $member->status = 'inactive';
        $member->url = '';
        $member->legacyId = new MongoInt32($m['id']);
        $member->roleId = Prefs::getRoleId('Merchant');
        $member->save();
    }
});
Route::get('parsetest', function () {
    ParseClient::initialize('lNz2h3vr3eJK9QMAKOLSaIvETaQWsbFJ8Em32TIw', '8QQoPiTZTkqSMkYLQQxHiaKBXO6Jq7iD2dCJjGUz', '2bKlPqYIKMpW1rJOdpBXQ8pf7cMXxGaFKrCXMr19');
    $query = ParseInstallation::query();
    //$query = new ParseInstallationQuery();
    $results = $query->find('*');
    foreach ($results as $r) {
        $p = Parsedevice::where('objectId', '=', $r->getObjectId())->first();
        if ($p) {
        } else {
            $p = new Parsedevice();
            $p->objectId = $r->getObjectId();
            $p->createdAt = $r->getCreatedAt();
        }
        $p->JEXDeviceId = $r->get('JEXDeviceId');
        $p->appIdentifier = $r->get('appIdentifier');
        $p->appName = $r->get('appName');
        $p->appVersion = $r->get('appVersion');
        $p->deviceBrand = $r->get('deviceBrand');