/**
  * 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());
         }
     }
 }
Exemple #2
0
 /**
  * Check whether the role is valid or not.
  *
  * @param ParseRole $role
  *
  * @throws \Exception
  */
 private static function validateRoleState($role)
 {
     if (!$role->getObjectId()) {
         throw new \Exception("Roles must be saved to the server before they can be used in an ACL.");
     }
 }