Created
December 15, 2010 14:54
-
-
Save nfabre/742034 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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