Skip to content

Commit fc121d9

Browse files
committed
Merge branch 'working'
Conflicts: lib/OpenCloud/Globals.php
2 parents 6eee9d0 + b3eff0b commit fc121d9

File tree

10 files changed

+181
-88
lines changed

10 files changed

+181
-88
lines changed

RELEASENOTES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ RELEASE NOTES
33

44
### Current branch: master
55

6-
### 1.5.5
6+
### 05/10/2013 Version 1.5.6
7+
* Support for DNS\Domain::CloneDomain() feature
8+
9+
### 05/07/2013 Version 1.5.5
710
* PSR-2 implementation (code formatting)
811
* issue #95 - attempt to fix default timezone to satisfy folks
912

docs/quickref.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ encouraged to contribute theirs).
2626
To use the **php-opencloud** library, use this `require()` statement in your
2727
script:
2828

29-
require '/path/to/php-opencloud.php';
29+
require '/path/to/lib/php-opencloud.php';
3030

3131
Once you've referenced the desired connection class, you can proceed
3232
to establish the connection. For OpenStack clouds, provide the

docs/userguide/index.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ In the .ZIP or .tar file in which you received the library, everything under
5252
the `lib/` directory should be installed in a location that is accessible. If you're not using a dependency manager like Composer, you will have to register the OpenCloud namespace for your app to use:
5353

5454
// Define the path to the library
55-
$libPath = '/path/to/php-opencloud';
56-
55+
$libPath = '/path/to/php-opencloud/lib';
56+
5757
// Include the autoloader
58-
require_once $libraryPath . '/Autoload.php';
59-
60-
// Register the root OpenCloud namespace
61-
$classLoader = new SplClassLoader('OpenCloud', $libraryPath . '/lib');
62-
$classLoader->register();
58+
require_once $libPath . '/php-opencloud.php';
6359

6460
Once the OpenCloud namespace is registered, you will be able to access all functionality by referencing the class's namespace (in full PSR-0 compliance). For more information about namespaces, check out [PHP's documentation](http://php.net/manual/en/language.namespaces.php).
6561

@@ -94,11 +90,11 @@ Other Available Documentation
9490

9591
The *php-opencloud API Reference* is auto-generated documentation on the entire
9692
php-opencloud library. Because it is auto-generated, it is kept in sync with the
97-
actual underlying source code (unlike this document, which must be manually
98-
edited).
93+
actual underlying source code (unlike this document, which must be manually
94+
edited).
9995
[@TODO provide links to internal and online versions]
10096

101-
The *php-opencloud Quick Reference* is a simplified reference, providing API
97+
The *php-opencloud Quick Reference* is a simplified reference, providing API
10298
descriptions and syntax for the core features of the library. It is found in
10399
various formats:
104100

lib/OpenCloud/AbstractClass/Service.php

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
*
2727
* @author Glen Campbell <[email protected]>
2828
*/
29-
abstract class Service extends \OpenCloud\Base\Base
29+
abstract class Service extends \OpenCloud\Base\Base
3030
{
3131

3232
private $conn;
3333
private $service_type;
3434
private $service_name;
35-
private $service_region;
35+
private $service_region;
3636
private $service_url;
37-
37+
3838
protected $_namespaces = array();
3939

4040
/**
@@ -54,10 +54,10 @@ abstract class Service extends \OpenCloud\Base\Base
5454
* (e.g., "publicURL")
5555
*/
5656
public function __construct(
57-
OpenStack $conn,
58-
$type,
59-
$name,
60-
$region,
57+
OpenStack $conn,
58+
$type,
59+
$name,
60+
$region,
6161
$urltype = RAXSDK_URL_PUBLIC
6262
) {
6363
$this->conn = $conn;
@@ -77,11 +77,11 @@ public function __construct(
7777
public function Url($resource = '', array $param = array())
7878
{
7979
$baseurl = $this->service_url;
80-
80+
8181
if ($resource) {
8282
$baseurl = Lang::noslash($baseurl).'/'.$resource;
8383
}
84-
84+
8585
if (!empty($param)) {
8686
$baseurl .= '?'.$this->MakeQueryString($param);
8787
}
@@ -95,7 +95,7 @@ public function Url($resource = '', array $param = array())
9595
* @api
9696
* @return array of objects
9797
*/
98-
public function Extensions()
98+
public function Extensions()
9999
{
100100
$ext = $this->GetMetaUrl('extensions');
101101

@@ -112,10 +112,10 @@ public function Extensions()
112112
* @api
113113
* @return array of limits
114114
*/
115-
public function Limits()
115+
public function Limits()
116116
{
117117
$lim = $this->GetMetaUrl('limits');
118-
118+
119119
if (is_object($lim)) {
120120
return $lim->limits;
121121
} else {
@@ -137,10 +137,14 @@ public function Limits()
137137
* @param string $body An optional body for POST/PUT requests
138138
* @return \OpenCloud\HttpResult
139139
*/
140-
public function Request($url, $method = 'GET', array $headers = array() ,$body = null)
140+
public function Request(
141+
$url,
142+
$method = 'GET',
143+
array $headers = array(),
144+
$body = null)
141145
{
142146
$headers['X-Auth-Token'] = $this->conn->Token();
143-
147+
144148
if ($tenant = $this->conn->Tenant()) {
145149
$headers['X-Auth-Project-Id'] = $tenant;
146150
}
@@ -158,7 +162,7 @@ public function Request($url, $method = 'GET', array $headers = array() ,$body =
158162
* query strings
159163
* @return \OpenCloud\Collection
160164
*/
161-
public function Collection($class, $url = null, $parent = null, array $parm = array())
165+
public function Collection($class, $url = null, $parent = null, array $parm = array())
162166
{
163167
// set the element name
164168
$collection = $class::JsonCollectionName();
@@ -229,7 +233,7 @@ public function Collection($class, $url = null, $parent = null, array $parm = ar
229233
} elseif (isset($obj->$collection)) {
230234
if (!$element) {
231235
$coll_obj = new Collection($parent, $class, $obj->$collection);
232-
} else {
236+
} else {
233237
// handle element levels
234238
$arr = array();
235239
foreach($obj->$collection as $index => $item) {
@@ -256,7 +260,7 @@ public function Collection($class, $url = null, $parent = null, array $parm = ar
256260
* @api
257261
* @return string
258262
*/
259-
public function Region()
263+
public function Region()
260264
{
261265
return $this->service_region;
262266
}
@@ -269,7 +273,7 @@ public function Region()
269273
* @api
270274
* @return string
271275
*/
272-
public function Name()
276+
public function Name()
273277
{
274278
return $this->service_name;
275279
}
@@ -279,7 +283,7 @@ public function Name()
279283
*
280284
* @return array
281285
*/
282-
public function namespaces()
286+
public function namespaces()
283287
{
284288
if (!isset($this->_namespaces)) {
285289
return array();
@@ -308,7 +312,7 @@ public function namespaces()
308312
* @param string $urltype The URL type; defaults to "publicURL"
309313
* @return string The URL of the service
310314
*/
311-
private function get_endpoint($type, $name, $region, $urltype = 'publicURL')
315+
private function get_endpoint($type, $name, $region, $urltype = 'publicURL')
312316
{
313317
$found = 0;
314318
$catalog = $this->conn->serviceCatalog();
@@ -354,7 +358,7 @@ private function get_endpoint($type, $name, $region, $urltype = 'publicURL')
354358
* at the beginning or end
355359
* @return \stdClass object
356360
*/
357-
private function GetMetaUrl($resource)
361+
private function GetMetaUrl($resource)
358362
{
359363
$urlbase = $this->get_endpoint(
360364
$this->service_type,
@@ -380,15 +384,15 @@ private function GetMetaUrl($resource)
380384
if ($response->HttpStatus() >= 300) {
381385
throw new Exceptions\HttpError(sprintf(
382386
Lang::translate('Error accessing [%s] - status [%d], response [%s]'),
383-
$urlbase,
384-
$response->HttpStatus(),
387+
$urlbase,
388+
$response->HttpStatus(),
385389
$response->HttpBody()
386390
));
387391
}
388392

389393
// we're good; proceed
390394
$obj = json_decode($response->HttpBody());
391-
395+
392396
if ($this->CheckJsonError()) {
393397
return false;
394398
}

lib/OpenCloud/DNS/AsyncResponse.php

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@
1919
* The AsyncResponse class encapsulates the data returned by a Cloud DNS
2020
* asynchronous response.
2121
*/
22-
class AsyncResponse extends PersistentObject
22+
class AsyncResponse extends PersistentObject
2323
{
2424

2525
public $jobId;
26-
public $callbackUrl;
26+
public $callbackUrl;
2727
public $status;
2828
public $requestUrl;
2929
public $verb;
3030
public $request;
3131
public $response;
3232
public $error;
33+
public $domains;
3334

3435
protected static $json_name = false;
3536

@@ -40,7 +41,7 @@ class AsyncResponse extends PersistentObject
4041
* @param \OpenCloud\Service $service the calling service
4142
* @param string $json the json response from the initial request
4243
*/
43-
public function __construct(AbstractService $service, $json = null)
44+
public function __construct(AbstractService $service, $json = null)
4445
{
4546
if (!$json) {
4647
return;
@@ -61,7 +62,7 @@ public function __construct(AbstractService $service, $json = null)
6162
*
6263
* @return string
6364
*/
64-
public function Url($subresource = null, $qstr = array())
65+
public function Url($subresource = null, $qstr = array())
6566
{
6667
return $this->callbackUrl . '?showDetails=True';
6768
}
@@ -71,32 +72,32 @@ public function Url($subresource = null, $qstr = array())
7172
*
7273
* @return string
7374
*/
74-
public function Name()
75+
public function Name()
7576
{
7677
return $this->jobId;
7778
}
7879

7980
/**
8081
* overrides for methods
8182
*/
82-
public function Create($parm = array())
83-
{
84-
return $this->NoCreate();
83+
public function Create($parm = array())
84+
{
85+
return $this->NoCreate();
8586
}
8687

87-
public function Update($parm = array())
88-
{
89-
return $this->NoUpdate();
88+
public function Update($parm = array())
89+
{
90+
return $this->NoUpdate();
9091
}
9192

92-
public function Delete()
93-
{
94-
return $this->NoDelete();
93+
public function Delete()
94+
{
95+
return $this->NoDelete();
9596
}
9697

97-
public function PrimaryKeyField()
98-
{
99-
return 'jobId';
98+
public function PrimaryKeyField()
99+
{
100+
return 'jobId';
100101
}
101102

102-
}
103+
}

0 commit comments

Comments
 (0)