forked from parse-community/parse-php-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParseApp.php
More file actions
103 lines (93 loc) · 2.33 KB
/
Copy pathParseApp.php
File metadata and controls
103 lines (93 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
namespace Parse;
class ParseApp
{
public static $APP_NAME = 'appName';
public static $CLIENT_CLASS_CREATION_ENABLED = 'clientClassCreationEnabled';
public static $CLIENT_PUSH_ENABLED = 'clientPushEnabled';
public static $REQUIRE_REVOCABLE_SESSION = 'requireRevocableSessions';
public static $REVOKE_SESSION_ON_PASSWORD_CHANGE = 'revokeSessionOnPasswordChange';
/**
* To fetch the keys and settings for all of the apps that you are a collaborator on.
*
* @throws ParseException
*
* @return array Containing the keys and settings for your apps.
*/
public static function fetchApps()
{
$result = ParseClient::_request(
'GET',
'apps',
null,
null,
false,
true
);
return $result['results'];
}
/**
* To fetch the keys and settings of a single app.
*
* @param string $application_id
*
* @throws ParseException
*
* @return array Containing the keys and settings for your app.
*/
public static function fetchApp($application_id)
{
$result = ParseClient::_request(
'GET',
'apps/'.$application_id,
null,
null,
false,
true
);
return $result;
}
/**
* Create a new app, that is owned by your account. The only required field for creating an app is the app name.
*
* @param array $data
*
* @throws ParseException
*
* @return array
*/
public static function createApp(array $data)
{
$result = ParseClient::_request(
'POST',
'apps',
null,
json_encode($data),
false,
true
);
return $result;
}
/**
* You can change your app's name, as well as change your app's settings.
*
* @param string $application_id
* @param array $data
*
* @throws ParseException
*
* @return array
*/
public static function updateApp($application_id, array $data)
{
$result = ParseClient::_request(
'PUT',
'apps/'.$application_id,
null,
json_encode($data),
false,
true
);
return $result;
}
}