I'm working on PHP with Rackspace API, this is what I have used here:
$file->setContent(fopen('sites/default/files/rackspace/' . $end_element, 'r+'));
$cdnUrl = $file->getPublicUrl();
print_r($cdnUrl);
And its returning me the below mentioned structure.
Guzzle\Http\Url Object
(
[scheme:protected] => http
[host:protected] => something.r2.cf3.rackcdn.com
[port:protected] =>
[username:protected] =>
[password:protected] =>
[path:protected] => /something-abc.jpg
[fragment:protected] =>
[query:protected] => Guzzle\Http\QueryString Object
(
[fieldSeparator:protected] => &
[valueSeparator:protected] => =
[urlEncode:protected] => RFC 3986
[aggregator:protected] =>
[data:protected] => Array
(
)
)
)
What I need here is something like this:
Guzzle\Http\Url Object
(
[scheme] => http
[host] => something.r2.cf3.rackcdn.com
[port] =>
[username] =>
[password] =>
[path] => /something-abc.jpg
[fragment] =>
[query] => Guzzle\Http\QueryString Object
(
[fieldSeparator] => &
[valueSeparator] => =
[urlEncode] => RFC 3986
[aggregator] =>
[data] => Array
(
)
)
)
So that at least I can use those objects, any suggestions?
It is a
Guzzle\Http\Url
object, and you will not be able to access its protected or private properties. The class is defined here, so you can use any of the public methods to access its state.You can also cast it to a string like so:
Or access other stuff:
The query is represented by another object,
Guzzle\Http\QueryString
:For more info on object visibility, please consult the official docs.