本文整理汇总了PHP中Parse\ParseClient::setServerURL方法的典型用法代码示例。如果您正苦于以下问题:PHP ParseClient::setServerURL方法的具体用法?PHP ParseClient::setServerURL怎么用?PHP ParseClient::setServerURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parse\ParseClient
的用法示例。
在下文中一共展示了ParseClient::setServerURL方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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']);
});
}
示例3: array
}
}
$file_name_array = array();
ParseClient::setServerURL($source_url);
foreach ($results_src as $object) {
$id = $object->getObjectId();
$file = $object->get("image");
$name = $file->getName();
$url = $file->getURL();
// Download the contents:
$contents = $file->getData();
$p = strrpos($name, "-");
$short_name = substr($name, $p + 1);
$image_path = "c/" . $short_name;
array_push($file_name_array, $short_name);
file_put_contents($image_path, $contents);
echo $id . ":" . $short_name . "\n";
}
ParseClient::setServerURL($dest_url);
for ($i = 0; $i < count($results_dst); $i++) {
$obj = $results_dst[$i];
$file_name = $file_name_array[$i];
$file_image = ParseFile::createFromFile("c/" . $file_name, "{$file_name}");
try {
$obj->set("image", $file_image);
$obj->save();
echo "Wrote " . $file_name . ".\n";
} catch (\Parse\ParseException $e) {
print $e;
}
}
示例4: 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']));
}
示例5:
<?php
require 'vendor/autoload.php';
use Parse\ParseObject;
use Parse\ParseQuery;
use Parse\ParseACL;
use Parse\ParsePush;
use Parse\ParseUser;
use Parse\ParseInstallation;
use Parse\ParseException;
use Parse\ParseAnalytics;
use Parse\ParseFile;
use Parse\ParseCloud;
use Parse\ParseClient;
ParseClient::initialize('54321', '', '54321');
ParseClient::setServerURL('https://liketochiku-parse-server.herokuapp.com/parse');
$obj = ParseObject::create("Ad");
$obj->set("title", "Hello");
$obj->save();
示例6: isset
$text_param4 = isset($_POST["text_param4"]) ? $_POST["text_param4"] : "";
$text_param5 = isset($_POST["text_param5"]) ? $_POST["text_param5"] : "";
$text_param6 = isset($_POST["text_param6"]) ? $_POST["text_param6"] : "";
$text_param7 = isset($_POST["text_param7"]) ? $_POST["text_param7"] : "";
$text_param8 = isset($_POST["text_param8"]) ? $_POST["text_param8"] : "";
$file_param1 = isset($_POST["file_param1"]) ? $_POST["file_param1"] : "";
$file_param2 = isset($_POST["file_param2"]) ? $_POST["file_param2"] : "";
$file_param1_uploaded_path = isset($_POST["file_param1_uploaded_path"]) ? $_POST["file_param1_uploaded_path"] : "";
$file_param2_uploaded_path = isset($_POST["file_param2_uploaded_path"]) ? $_POST["file_param2_uploaded_path"] : "";
require '../../vendor/autoload.php';
date_default_timezone_set('Asia/Tokyo');
use Parse\ParseClient;
use Parse\ParseObject;
use Parse\ParseFile;
ParseClient::initialize('rLfiUPlbIE5orN0Al07gpotnvIpqwTUpoQlkhjO0', 'LnIgqdYSz8krs6iKBdH5XtGqglkyjzuSEHTnNbEC', 'jtNDkVGTpaVeregAuvlTYOUCErbKnSMgE7F6x9Fo');
ParseClient::setServerURL('https://vivabelgianbeer-server.herokuapp.com', 'parse');
$obj = ParseObject::create("Quiz");
$obj->set("title", $text_param1);
$obj->set("difficulty", $text_param2);
$obj->set("quiz", $text_param3);
$file1 = ParseFile::createFromFile($file_param1_uploaded_path, basename($file_param1_uploaded_path));
$obj->set("quiz_image", $file1);
$obj->set("choice1", $text_param4);
$obj->set("choice2", $text_param5);
$obj->set("choice3", $text_param6);
$obj->set("answer", $text_param7);
$file2 = ParseFile::createFromFile($file_param2_uploaded_path, basename($file_param2_uploaded_path));
$obj->set("answer_image", $file2);
$obj->set("description", $text_param8);
$obj->save();
$upload_success = true;
示例7:
<?php
require 'vendor/autoload.php';
use Parse\ParseObject;
use Parse\ParseQuery;
use Parse\ParseACL;
use Parse\ParsePush;
use Parse\ParseUser;
use Parse\ParseInstallation;
use Parse\ParseException;
use Parse\ParseAnalytics;
use Parse\ParseFile;
use Parse\ParseCloud;
use Parse\ParseClient;
ParseClient::initialize('2X6FE9u8wLZ4wHqwQf7OGa80OEShe5AUgdV5dq25', 'kU7l5Tf5lQ50hEoVbnuXrdy7bcnQ8NQmDZTyIXVf', '8Rfi7dgFEOdgFu2hyzP0hrQoV2mer1vfQnTa6yh5');
ParseClient::setServerURL('https://api.parse.com/1');
$obj = ParseObject::create("Ad");
$obj->set("title", "Hello");
$obj->save();
示例8: getenv
<?php
use Parse\ParseClient;
$autoloader = (require __DIR__ . '/../vendor/autoload.php');
$autoloader->addPsr4('Parziphal\\Parse\\Test\\', __DIR__);
$autoloader->addPsr4('Parziphal\\Parse\\', __DIR__ . '/../src', true);
$appId = getenv('parseAppId');
$masterKey = getenv('parseMasterKey');
$serverUrl = getenv('parseServerUrl');
$mountPath = getenv('parseMountPath');
ParseClient::initialize($appId, null, $masterKey);
ParseClient::setServerURL($serverUrl, $mountPath);