Created
February 17, 2012 18:50
-
-
Save havvg/1854817 to your computer and use it in GitHub Desktop.
Example wrapped php-cctrl
This file contains 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('autoload.php.dist'); | |
$api = new Cloudcontrol\Api(); | |
$api | |
->setCredentials('[email protected]', 'yoursecretpasswd') | |
->setApplication('application') | |
->setDeployment('dep3as5l3') | |
; | |
$list = $api->getWorkersList(); | |
var_dump($list, $list[0]['wrk_id'], $list[0]->getWorkerId()); | |
$worker = $api->addWorker('app/console', 'list'); | |
var_dump($worker); | |
/* | |
object(Cloudcontrol\Entity\Worker)#8 (4) { | |
["workerId":protected]=> | |
string(11) "wrkvsms9vd2" | |
["command":protected]=> | |
string(11) "app/console" | |
["parameters":protected]=> | |
string(4) "list" | |
["createdAt":protected]=> | |
object(DateTime)#7 (3) { | |
["date"]=> | |
string(19) "2012-02-17 17:25:08" | |
["timezone_type"]=> | |
int(3) | |
["timezone"]=> | |
string(3) "UTC" | |
} | |
} | |
*/ | |
$api->removeWorker($worker->getWorkerId()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment