public function SiteClient::register in Lockr 7.2
Same name and namespace in other branches
- 7 src/Lockr/SiteClient.php \Lockr\SiteClient::register()
Registers the site with Lockr.
Parameters
string $email The email to register with.:
string $pass (optional) The password for authentication.:
string $name (optional) The site name.:
Throws
ServerException if the server is unavailable or returns an error.
ClientException if there was an unexpected client error.
File
- vendor/
lockr/ lockr-client/ src/ SiteClient.php, line 96
Class
- SiteClient
- API for site management operations.
Namespace
LockrCode
public function register($email, $pass = null, $name = null) {
$data = array(
'email' => $email,
'name' => $name,
);
if (null !== $pass) {
$auth = "{$email}:{$pass}";
}
else {
$auth = null;
}
$this->client
->post('/v1/site/register', $data, $auth);
}