1. Go to this page and download the library: Download francimedia/parse-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
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;
// Signup
$user = new ParseUser();
$user->setUsername("foo");
$user->setPassword("Q2w#4!o)df");
try {
$user->signUp();
} catch (ParseException $ex) {
// error in $ex->getMessage();
}
// Login
try {
$user = ParseUser::logIn("foo", "Q2w#4!o)df");
} catch(ParseException $ex) {
// error in $ex->getMessage();
}
// Current user
$user = ParseUser::getCurrentUser();
// Access only by the ParseUser in $user
$userACL = ParseACL::createACLWithUser($user);
// Access only by master key
$restrictedACL = new ParseACL();
// Set individual access rights
$acl = new ParseACL();
$acl->setPublicReadAccess(true);
$acl->setPublicWriteAccess(false);
$acl->setUserWriteAccess($user, true);
$acl->setRoleWriteAccessWithName("PHPFans", true);
$query = new ParseQuery("TestObject");
// Get a specific object:
$object = $query->get("anObjectId");
$query->limit(10); // default 100, max 1000
// All results:
$results = $query->find();
// Just the first result:
$first = $query->first();
// Process ALL (without limit) results with "each".
// Will throw if sort, skip, or limit is used.
$query->each(function($obj) {
echo $obj->getObjectId();
});