当前位置: 首页>>代码示例>>PHP>>正文


PHP Parse\ParseClient类代码示例

本文整理汇总了PHP中Parse\ParseClient的典型用法代码示例。如果您正苦于以下问题:PHP ParseClient类的具体用法?PHP ParseClient怎么用?PHP ParseClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ParseClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __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);
 }
开发者ID:gpaton,项目名称:parse-bundle,代码行数:14,代码来源:Push.php

示例2: 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');
 }
开发者ID:louk,项目名称:One-Nice-Thing,代码行数:7,代码来源:ParseTestHelper.php

示例3: __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);
 }
开发者ID:srleach,项目名称:pushr,代码行数:11,代码来源:ParsePushNotificationAdapter.php

示例4: __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'));
 }
开发者ID:anhvult911,项目名称:track,代码行数:7,代码来源:track.php

示例5: 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']);
 }
开发者ID:mkhuramj,项目名称:ToDo-Web,代码行数:7,代码来源:Module.php

示例6: inicializa

 /**
  * Inicializa la aplicacion de la base de datos de Parse
  */
 public static function inicializa()
 {
     try {
         ParseClient::initialize('ve3SsAciKVt8GwhmLDCzW9rQ6EkPj8ai3pWcp3Is', 'zt0dVKAQwyRTAOFkfFj5d9jzDWAH9fjaJsUR5fhD', 'QpnJBJkOEp3VmEbcaAX8r6HDixj2wCUNQ42e1c4N');
     } catch (ParseException $ex) {
     }
 }
开发者ID:sterben93,项目名称:casa,代码行数:10,代码来源:APIInmueble.php

示例7: send

 /**
  * Sends a push notification.
  *
  * @param array $data         The data of the push notification.    Valid fields
  *                            are:
  *                            channels - An Array of channels to push to.
  *                            push_time - A Date object for when to send the push.
  *                            expiration_time -    A Date object for when to expire
  *                            the push.
  *                            expiration_interval - The seconds from now to expire the push.
  *                            where - A ParseQuery over ParseInstallation that is used to match
  *                            a set of installations to push to.
  *                            data - The data to send as part of the push
  * @param bool  $useMasterKey Whether to use the Master Key for the request
  *
  * @throws \Exception, ParseException
  *
  * @return mixed
  */
 public static function send($data, $useMasterKey = false)
 {
     if (isset($data['expiration_time']) && isset($data['expiration_interval'])) {
         throw new Exception('Both expiration_time and expiration_interval can\'t be set.');
     }
     if (isset($data['where'])) {
         if ($data['where'] instanceof ParseQuery) {
             $where_options = $data['where']->_getOptions();
             if (!isset($where_options['where'])) {
                 $data['where'] = '{}';
             } else {
                 $dd = $data['where']->_getOptions();
                 $data['where'] = $dd['where'];
             }
         } else {
             throw new Exception('Where parameter for Parse Push must be of type ParseQuery');
         }
     }
     if (isset($data['push_time'])) {
         //Local push date format is different from iso format generally used in Parse
         //Schedule does not work if date format not correct
         $data['push_time'] = ParseClient::getPushDateFormat($data['push_time'], isset($data['local_time']));
     }
     if (isset($data['expiration_time'])) {
         $cc = ParseClient::_encode($data['expiration_time'], false);
         $data['expiration_time'] = $cc['iso'];
     }
     return ParseClient::_request('POST', 'push', null, json_encode(ParseClient::_encode($data, true)), $useMasterKey);
 }
开发者ID:vaibbhav,项目名称:parse_php5.3_sdk,代码行数:48,代码来源:ParsePush.php

示例8: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     ParseClient::_unsetStorage();
     session_start();
     ParseTestHelper::setUp();
     self::$parseStorage = ParseClient::getStorage();
 }
开发者ID:louk,项目名称:One-Nice-Thing,代码行数:7,代码来源:ParseSessionStorageTest.php

示例9: 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']));
 }
开发者ID:khangaikh,项目名称:golocal,代码行数:7,代码来源:ParseServiceProvider.php

示例10: __construct

 public function __construct()
 {
     $app_id = "id";
     $rest_key = "rest_key";
     $master_key = "master_key";
     ParseClient::initialize($app_id, $rest_key, $master_key);
 }
开发者ID:malimu,项目名称:baas,代码行数:7,代码来源:TodoController.php

示例11: 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);
 }
开发者ID:redenz,项目名称:Laravel-Parse,代码行数:14,代码来源:ParseServiceProvider.php

示例12: 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');
 }
开发者ID:ActiveWebsite,项目名称:BoojPressPlugins,代码行数:8,代码来源:Helper.php

示例13: 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])));
 }
开发者ID:netsti,项目名称:vaclases,代码行数:8,代码来源:Push.php

示例14: getCurrentSession

 /**
  * Retrieves the Session object for the currently logged in user.
  *
  * @param boolean $useMasterKey If the Master Key should be used to override security.
  *
  * @return ParseSession
  */
 public static function getCurrentSession($useMasterKey = false)
 {
     $token = ParseUser::getCurrentUser()->getSessionToken();
     $response = ParseClient::_request('GET', '/1/sessions/me', $token, null, $useMasterKey);
     $session = new ParseSession();
     $session->_mergeAfterFetch($response);
     $session->handleSaveResult();
     return $session;
 }
开发者ID:rcowick,项目名称:website,代码行数:16,代码来源:ParseSession.php

示例15: 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);
 }
开发者ID:vorenusCoA,项目名称:App_Asistencia,代码行数:9,代码来源:Connect.php


注:本文中的Parse\ParseClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。