3

I want to use Parse to save data.
I use ParseUser to save users.
Documentation here.

When I make this I have a ParseUser object :

    $user = new \Parse\ParseUser();
    $user->set("username", "my name");
    $user->set("password", "my pass");
    $user->set("email", "[email protected]");
    var_dump($user);
    exit();

But if I try to use signUp method.
Documentation here.

Like this :

        $user = new \Parse\ParseUser();
    $user->set("username", "my name");
    $user->set("password", "my pass");
    $user->set("email", "[email protected]");

    try {
        $user->signUp();
    } catch (\Parse\ParseException $ex) {
        echo $ex->getMessage();
    }

    exit();

I have this message :

object(__PHP_Incomplete_Class)#1 (11) { ["__PHP_Incomplete_Class_Name"]=> string(15) "Parse\ParseUser" ["_sessionToken":protec..... Fatal error: Cannot use object of type __PHP_Incomplete_Class as array in /var/www/myproject/vendor/parse/php-sdk/src/Parse/ParseUser.php on line 340

1 Answer 1

3

I find the error :

require './vendor/autoload.php';

must be BEFORE

if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.