public function Vcl::clone_last_active_version in Fastly 7.2
Creates and returns cloned version number.
Return value
bool
1 call to Vcl::clone_last_active_version()
- Vcl::execute in ./
fastly.vcl.inc - Main execute function, takes values inserted into constructor, builds requests and sends them via Fastly API.
File
- ./
fastly.vcl.inc, line 370
Class
- Vcl
- Class to control the VCL handling.
Code
public function clone_last_active_version() {
if (empty($this->_last_version_data)) {
return FALSE;
}
$version_number = $this->_last_version_data->number;
$uri = $this->_version_base_url . '/' . $version_number . '/clone';
$response = $this->_api
->makeRequest($uri, array(), "PUT", array());
$response_data = json_decode($response->data);
$cloned_version_number = isset($response_data->number) ? $response_data->number : FALSE;
$this->_last_cloned_version = $cloned_version_number;
return $cloned_version_number;
}