本文整理汇总了PHP中Parse\ParseClient::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP ParseClient::initialize方法的具体用法?PHP ParseClient::initialize怎么用?PHP ParseClient::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse\ParseClient
的用法示例。
在下文中一共展示了ParseClient::initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construct our adapter by gleaning the keys from the ENV params.
* These can be set in the .env file, or set as environment vars on a production server.
*/
public function __construct()
{
$app_id = env('PARSE_APP_APID');
$rest_key = env('PARSE_APP_REST');
$master_key = env('PARSE_APP_MAST');
ParseClient::initialize($app_id, $rest_key, $master_key);
}
示例2: __construct
/**
* Initialize Push with needed Parse keys
*
* @param $appId
* @param $restKey
* @param $masterKey
*/
public function __construct($appId, $restKey, $masterKey)
{
$this->appId = $appId;
$this->restKey = $restKey;
$this->masterKey = $masterKey;
ParseClient::initialize($appId, $restKey, $masterKey);
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->load->database();
// Init parse: app_id, rest_key, master_key
ParseClient::initialize($this->config->item('app_id'), $this->config->item('rest_key'), $this->config->item('master_key'));
}
示例4: setUp
public static function setUp()
{
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
date_default_timezone_set('UTC');
ParseClient::initialize('app-id-here', 'rest-api-key-here', 'master-key-here');
}
示例5: inicializa
/**
* Inicializa la aplicacion de la base de datos de Parse
*/
public static function inicializa()
{
try {
ParseClient::initialize('ve3SsAciKVt8GwhmLDCzW9rQ6EkPj8ai3pWcp3Is', 'zt0dVKAQwyRTAOFkfFj5d9jzDWAH9fjaJsUR5fhD', 'QpnJBJkOEp3VmEbcaAX8r6HDixj2wCUNQ42e1c4N');
} catch (ParseException $ex) {
}
}
示例6: onBootstrap
public function onBootstrap(MvcEvent $e)
{
//parse uses a global client, and needs the session to be started
$config = $e->getApplication()->getServiceManager()->get('config');
session_start();
ParseClient::initialize($config['parse']['app_id'], $config['parse']['rest_key'], $config['parse']['master_key']);
}
示例7: testQuery
public function testQuery()
{
$app_id = "XASVlMZE1IVe3zCDpHT5mzhTiEd3su7IWM68Uepa";
$rest_key = "zBwmJIkcOE1dvX3GUIpJT5ebLOhhPhn1NmsdWC6e";
$master_key = "0zNVL0uJnxUiU9r1Ogvii7vLW8tOASIyS5j5HK4G";
ParseClient::$HOST_NAME = "http://localhost/parse/public/";
ParseClient::initialize($app_id, $rest_key, $master_key);
\App\Test::truncate();
$response = $this->generalQuery();
$this->assertArrayHasKey("results", $response);
$this->assertEmpty($response["results"]);
$this->objects = factory(\App\Test::class, 50)->create();
$response = $this->generalQuery();
$this->assertArrayHasKey("results", $response);
$this->assertEquals(50, count($response["results"]));
$response = $this->firstQuery();
$this->assertArrayHasKey("results", $response);
$this->assertEquals(1, count($response["results"]));
$response = $this->equalToQuery();
$this->assertArrayHasKey("results", $response);
$this->assertEquals(1, count($response["results"]));
$response = $this->notEqualToQuery();
$this->assertArrayHasKey("results", $response);
$this->assertEquals(49, count($response["results"]));
$response = $this->limitQuery();
$this->assertArrayHasKey("results", $response);
$this->assertEquals(10, count($response["results"]));
}
示例8: 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']));
}
示例9: __construct
public function __construct()
{
$app_id = "id";
$rest_key = "rest_key";
$master_key = "master_key";
ParseClient::initialize($app_id, $rest_key, $master_key);
}
示例10: setupParse
/**
* Setup parse.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*
* @return void
*/
protected function setupParse(Application $app)
{
$app_id = env('PARSE_APP_ID');
$rest_key = env('PARSE_REST_KEY');
$master_key = env('PARSE_MASTER_KEY');
ParseClient::initialize($app_id, $rest_key, $master_key);
}
示例11: setUp
public static function setUp()
{
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
date_default_timezone_set('UTC');
ParseClient::initialize('app-id-here', 'rest-api-key-here', 'master-key-here', true, 'account-key-here');
ParseClient::setServerURL('http://localhost:1337/parse');
}
示例12: email
public static function email($type, $email, $title = "")
{
ParseClient::initialize(self::$app_id, self::$rest_key, self::$master_key);
$alert = ["Nuevas validaciones disponibles", "Tiene un nuevo evento disponible", "Nuevas encuestas disponibles", "Tiene un nuevo mensaje"];
$query = ParseInstallation::query();
$query->equalTo("email", $email);
ParsePush::send(array("where" => $query, "data" => array("title" => "VaClases", "alert" => ($title ? $title . " - " : "") . $alert[$type])));
}
示例13: connect_to_db
public function connect_to_db()
{
//almacenamos en variables los datos obtenidos desde la clase Config
$app_id = Config::appId;
$rest_key = Config::restKey;
$master_key = Config::masterKey;
//establecemos la conexión a la DB
$connection = ParseClient::initialize($app_id, $rest_key, $master_key);
}
示例14: setUp
public static function setUp()
{
$app_id = "8PYzxLlTqztkDEBCx3oDH6m6CqXYRpb4QTCWuuMw";
$rest_key = "VUEHy9GWuE9SJdCn8wvScoWAMYWun6PbpzqP8KAh";
$master_key = "WOyCyOO7gXaMs2wCqgwmBsWDxo8R7CIPhDH9baOM";
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
date_default_timezone_set('UTC');
ParseClient::initialize($app_id, $rest_key, $master_key);
}
示例15: 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']));
}