HPCloud-PHP  1.2.0
PHP bindings for HPCloud and OpenStack services.
 All Classes Namespaces Files Functions Variables Pages
Operations.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file
4  * Abstract operations class.
5  */
6 
7 namespace HPCloud\Services\DBaaS;
8 
9 /**
10  * Abstract class for DBaaS Operations groups.
11  *
12  * DBaaS operations have some structural similarities that
13  * can be shared between instance and snapshot operation
14  * groups. These are encapsulated here.
15  */
16 abstract class Operations {
17  protected $token;
18  protected $projectId;
19 
20  /**
21  * Generate the base headers needed by DBaaS requests.
22  */
23  protected function headers($merge = array()) {
24  return $merge + array(
25  'Accept' => 'application/json',
26  'Content-Type' => 'application/json',
27  'X-Auth-Token' => $this->token,
28  'x-Auth-Project-Id' => $this->projectId,
29  );
30  }
31 }