You are here

public function Vcl::get_last_version in Fastly 7.2

Fetch last service version.

Return value

bool|int

1 call to Vcl::get_last_version()
Vcl::__construct in ./fastly.vcl.inc
Sets data to be processed, sets Credentials VclHandler constructor.

File

./fastly.vcl.inc, line 349

Class

Vcl
Class to control the VCL handling.

Code

public function get_last_version() {
  $uri = $this->_version_base_url;
  $response = $this->_api
    ->makeRequest($uri, array(), "GET", $this->_headers_get);
  $response_data = json_decode($response->data);
  $this->_next_cloned_version_num = count($response_data) + 1;
  foreach ($response_data as $key => $version_data) {
    if ($version_data->active) {
      return $version_data;
    }
  }
  return FALSE;
}