/** * 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()); } } }
/** * 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 * @param boolean $enableCurlExceptions Enable or disable Parse curl exceptions * * @return null */ public static function initialize($app_id, $rest_key, $master_key, $enableCurlExceptions = true) { if (!ParseObject::hasRegisteredSubclass('_User')) { ParseUser::registerSubclass(); } if (!ParseObject::hasRegisteredSubclass('_Role')) { ParseRole::registerSubclass(); } ParseInstallation::registerSubclass(); ParseSession::registerSubclass(); self::$applicationId = $app_id; self::$restKey = $rest_key; self::$masterKey = $master_key; self::$enableCurlExceptions = $enableCurlExceptions; if (!static::$storage) { if (session_status() === PHP_SESSION_ACTIVE) { self::setStorage(new ParseSessionStorage()); } else { self::setStorage(new ParseMemoryStorage()); } } }