Skip to content

Instantly share code, notes, and snippets.

@nfabre
Created December 15, 2010 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfabre/742034 to your computer and use it in GitHub Desktop.
Save nfabre/742034 to your computer and use it in GitHub Desktop.
<?php
require_once "phing/Task.php";
class CreateTask extends Task {
private $username;
private $password;
private $details;
// ...
/**
* The main entry point
*
* @throws BuildException
*/
public function main() {
//...
// Validation des attributs
$this->validateProperties();
// Instanciation
$hostAccountSpec = new \Vmware\DataObject\Host\AccountSpec();
// Configuration de l'utilisateur avec les parametres de la tache
$hostAccountSpec->setId($this->getUsername());
$hostAccountSpec->setPassword($this->getPassword());
$hostAccountSpec->setDescription($this->getDetails());
// Creation de la requete SOAP
$soapMessage = array(
'_this' => new SoapVar($accountManager->{'_'}, XSD_STRING, $accountManager->type),
'user' => new SoapVar($hostAccountSpec,SOAP_ENC_OBJECT,'HostAccountSpec')
);
// Creation de l'utilisateur
$connection->createUser($soapMessage);
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment