本文整理汇总了PHP中Zend_Rest_Client::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Rest_Client::delete方法的具体用法?PHP Zend_Rest_Client::delete怎么用?PHP Zend_Rest_Client::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Rest_Client
的用法示例。
在下文中一共展示了Zend_Rest_Client::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
/**
Creating a new task, to be executed every 10 seconds
**/
$data = array('name' => "My Example Task #" . mktime(), 'schedule_method' => "every", 'schedule_when' => "10s", 'action' => array('action_class_name' => "Ruby", 'code' => 'puts "Hello World!"'));
$task1 = $rest->post('/tasks.xml', $data);
/**
Creating a new task with multiple actions, to be executed 5 minutes from now
**/
$data = array('name' => "Another Example Task #" . mktime(), 'schedule_method' => "in", 'schedule_when' => "5m", 'actions' => array(array('action_class_name' => "Ruby", 'code' => 'puts "Sending a message through Howlr..."'), array('action_class_name' => "Howlr", 'url' => "http://howlr.example.foo/messages.xml", 'subject' => "Testing", 'from' => "joe@example.foo", 'recipients' => "sally@example.foo", 'body' => "Just testing!", 'username' => "howlr", 'password' => "howl!")));
$task2 = $rest->post('/tasks.xml', $data);
/**
Retreiving a specific task by its ID
**/
$id = $task1->id;
$task = $rest->get("/tasks/{$id}.xml");
if ($task) {
// print the Task's name
echo $task->name;
// print the type of the first action in this task
//echo $task->{'task-actions'}->{'task-action'}[0]->{'action-class-name'};
} else {
echo "";
}
/**
Deleting the tasks we just created
**/
$id1 = $task1->id;
$rest->delete("/tasks/{$id1}.xml");
$id2 = $task2->id;
$rest->delete("/tasks/{$id2}.xml");