@@ -61,13 +61,6 @@ final class ParseClient
61
61
*/
62
62
private static $ enableCurlExceptions ;
63
63
64
- /**
65
- * The account key.
66
- *
67
- * @var string
68
- */
69
- private static $ accountKey ;
70
-
71
64
/**
72
65
* The object for managing persistence.
73
66
*
@@ -132,8 +125,7 @@ public static function initialize(
132
125
$ app_id ,
133
126
$ rest_key ,
134
127
$ master_key ,
135
- $ enableCurlExceptions = true ,
136
- $ account_key = null
128
+ $ enableCurlExceptions = true
137
129
) {
138
130
if (!ParseObject::hasRegisteredSubclass ('_User ' )) {
139
131
ParseUser::registerSubclass ();
@@ -160,7 +152,6 @@ public static function initialize(
160
152
self ::$ restKey = $ rest_key ;
161
153
self ::$ masterKey = $ master_key ;
162
154
self ::$ enableCurlExceptions = $ enableCurlExceptions ;
163
- self ::$ accountKey = $ account_key ;
164
155
if (!static ::$ storage ) {
165
156
if (session_status () === PHP_SESSION_ACTIVE ) {
166
157
self ::setStorage (new ParseSessionStorage ());
@@ -484,7 +475,6 @@ private static function createRequestUrl($relativeUrl)
484
475
* @param null $sessionToken Session Token.
485
476
* @param null $data Data to provide with the request.
486
477
* @param bool $useMasterKey Whether to use the Master Key.
487
- * @param bool $appRequest App request to create or modify a application
488
478
* @param string $contentType The content type for this request, default is application/json
489
479
* @param bool $returnHeaders Allow to return response headers
490
480
*
@@ -498,7 +488,6 @@ public static function _request(
498
488
$ sessionToken = null ,
499
489
$ data = null ,
500
490
$ useMasterKey = false ,
501
- $ appRequest = false ,
502
491
$ contentType = 'application/json ' ,
503
492
$ returnHeaders = false
504
493
) {
@@ -511,37 +500,29 @@ public static function _request(
511
500
512
501
// verify the server url and mount path have been set
513
502
self ::assertServerInitialized ();
503
+ self ::assertParseInitialized ();
514
504
515
- if ($ appRequest ) {
516
- // ** 'app' requests are not available in open source parse-server
517
- self ::assertAppInitialized ();
518
-
519
- $ httpClient ->addRequestHeader ('X-Parse-Account-Key ' , self ::$ accountKey );
520
- } else {
521
- self ::assertParseInitialized ();
522
-
523
- // add appId & client version
524
- $ httpClient ->addRequestHeader ('X-Parse-Application-Id ' , self ::$ applicationId );
525
- $ httpClient ->addRequestHeader ('X-Parse-Client-Version ' , 'php ' . self ::VERSION_STRING );
505
+ // add appId & client version
506
+ $ httpClient ->addRequestHeader ('X-Parse-Application-Id ' , self ::$ applicationId );
507
+ $ httpClient ->addRequestHeader ('X-Parse-Client-Version ' , 'php ' . self ::VERSION_STRING );
526
508
527
509
528
- if ($ sessionToken ) {
529
- // add our current session token
530
- $ httpClient ->addRequestHeader ('X-Parse-Session-Token ' , $ sessionToken );
531
- }
510
+ if ($ sessionToken ) {
511
+ // add our current session token
512
+ $ httpClient ->addRequestHeader ('X-Parse-Session-Token ' , $ sessionToken );
513
+ }
532
514
533
- if ($ useMasterKey ) {
534
- // pass master key
535
- $ httpClient ->addRequestHeader ('X-Parse-Master-Key ' , self ::$ masterKey );
536
- } elseif (isset (self ::$ restKey )) {
537
- // pass REST key
538
- $ httpClient ->addRequestHeader ('X-Parse-REST-API-Key ' , self ::$ restKey );
539
- }
515
+ if ($ useMasterKey ) {
516
+ // pass master key
517
+ $ httpClient ->addRequestHeader ('X-Parse-Master-Key ' , self ::$ masterKey );
518
+ } elseif (isset (self ::$ restKey )) {
519
+ // pass REST key
520
+ $ httpClient ->addRequestHeader ('X-Parse-REST-API-Key ' , self ::$ restKey );
521
+ }
540
522
541
- if (self ::$ forceRevocableSession ) {
542
- // indicate we are using revocable sessions
543
- $ httpClient ->addRequestHeader ('X-Parse-Revocable-Session ' , '1 ' );
544
- }
523
+ if (self ::$ forceRevocableSession ) {
524
+ // indicate we are using revocable sessions
525
+ $ httpClient ->addRequestHeader ('X-Parse-Revocable-Session ' , '1 ' );
545
526
}
546
527
547
528
/*
@@ -713,22 +694,6 @@ private static function assertParseInitialized()
713
694
}
714
695
}
715
696
716
- /**
717
- * Asserts that the sdk has been initialized with a valid account key
718
- *
719
- * @throws Exception
720
- */
721
- private static function assertAppInitialized ()
722
- {
723
- if (self ::$ accountKey === null || empty (self ::$ accountKey )) {
724
- throw new Exception (
725
- 'You must call ParseClient::initialize(..., $accountKey) before making any app requests. ' .
726
- 'Your account key must not be null or empty. ' ,
727
- 109
728
- );
729
- }
730
- }
731
-
732
697
/**
733
698
* Get remote Parse API url.
734
699
*
0 commit comments