本文整理汇总了PHP中Parse\ParseClient::setStorage方法的典型用法代码示例。如果您正苦于以下问题:PHP ParseClient::setStorage方法的具体用法?PHP ParseClient::setStorage怎么用?PHP ParseClient::setStorage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse\ParseClient
的用法示例。
在下文中一共展示了ParseClient::setStorage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootParseClient
private function bootParseClient()
{
$config = $this->app['config']->get('parse');
// Init the parse client
ParseClient::initialize($config['app_id'], $config['rest_key'], $config['master_key']);
ParseClient::setStorage(new ParseSessionStorage($this->app['session']));
}
示例2: __construct
public function __construct()
{
$appId = '**************';
$restApiKey = '**************';
$masterKey = '**************';
// initialize parse
ParseClient::initialize($appId, $restApiKey, $masterKey);
// set session storage
ParseClient::setStorage(new ParseSessionStorage());
}
示例3: setupParse
/**
* Setup parse.
*
* @return void
*/
protected function setupParse()
{
$config = $this->app->config->get('parse');
ParseClient::setStorage(new SessionStorage());
ParseClient::initialize($config['app_id'], $config['rest_key'], $config['master_key']);
ParseClient::setServerURL($config['server_url'], $config['mount_path']);
Auth::provider('parse', function ($app, array $config) {
return new UserProvider($config['model']);
});
Auth::provider('parse-facebook', function ($app, array $config) {
return new FacebookUserProvider($config['model']);
});
Auth::provider('parse-any', function ($app, array $config) {
return new AnyUserProvider($config['model']);
});
}
示例4: ParseSessionStorage
<?php
require 'vendor/autoload.php';
use Parse\ParseClient;
use Parse\ParseUser;
use Parse\ParseSessionStorage;
use Parse\ParseQuery;
use Parse\ParseObject;
ParseClient::initialize('bYE5q8xvJEiV2A2mtf0fgbQR8olNMQ2wfr05WYco', 'wZ5XfUCgQBZzFfQOwhWzP14W1fHfe6aj4qS76u0h', '3e8xtmuzrlpgAHNq7ho5Pe5tL9HrQFEgtJD2YVvQ');
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
ParseClient::setStorage(new ParseSessionStorage());
$currentUser = ParseUser::getCurrentUser();
$doubtsCourseQuery = new ParseQuery("doubtCourse");
$doubtsCourseQuery->equalTo("User", $currentUser);
$doubtsCourseQuery->equalTo("CourseName", $_GET["course"]);
echo $_GET["course"];
$doubtsCourse = $doubtsCourseQuery->find();
foreach ($doubtsCourse as $doubts) {
$doubts->fetch();
$doubts = $doubts->get("Doubts");
foreach ($doubts as $doubt) {
$doubt->set("Seen", 1);
$doubt->save();
}
}
示例5: bootParseClient
private function bootParseClient()
{
$config = $this->app['config']->get('parse');
// Init the parse client
ParseClient::initialize($config['app_id'], $config['rest_key'], $config['master_key']);
if (empty($config['server_url']) != true && empty($config['mount_path'] != true)) {
ParseClient::setServerURL($config['server_url'], $config['mount_path']);
}
ParseClient::setStorage(new ParseSessionStorage($this->app['session']));
}
示例6: __construct
public function __construct()
{
session_start();
ParseClient::initialize('QPFTtheMPSYYm4mOuVXme3Ta49DE0l2jFIyT3zzI', 'eKqJ5BZrp1N9jafT28JphRlvVKO05Az1aNWLN5XU', 'PNKKkWglhjvgYQnpIiShd37kL7t7nhbVMS7Swhpa');
ParseClient::setStorage(new ParseSessionStorage());
}
示例7: user_login
<?php
require 'js/parse/autoload.php';
require_once "common.php";
use Parse\ParseException;
use Parse\ParseUser;
use Parse\ParseSessionStorage;
use Parse\ParseClient;
$app_id = 'rVPT2Mws2ylIGYxH7pkxKsX0z0ORWDOoJebHe95f';
$rest_key = 'ULNpwIX1AfnGHEP0cRX6brWDVTjyzeLJnQCYx5uZ';
$master_key = 'Utp1QsroqE73YyXN42IgLubUhKe97XKqj5ciJ8iA';
ParseClient::initialize($app_id, $rest_key, $master_key);
$storage = new ParseSessionStorage();
ParseClient::setStorage($storage);
echo user_login($_POST['username'], $_POST['password']);