Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common')
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php301
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php320
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php7
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php16
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php5
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php21
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php22
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php73
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php21
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php140
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php38
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php220
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php134
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php92
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php140
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php939
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php308
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php23
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php27
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php140
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php489
-rw-r--r--apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php18
121 files changed, 3989 insertions, 0 deletions
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php
new file mode 100644
index 00000000000..f80c9320e2a
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Base.php
@@ -0,0 +1,301 @@
+<?php
+/**
+ * @copyright 2012-2013 Rackspace Hosting, Inc.
+ * See COPYING for licensing information
+ * @package phpOpenCloud
+ * @version 1.0
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
+ */
+
+namespace OpenCloud\Common;
+
+use OpenCloud\Common\Lang;
+use OpenCloud\Common\Exceptions\AttributeError;
+use OpenCloud\Common\Exceptions\JsonError;
+use OpenCloud\Common\Exceptions\UrlError;
+
+/**
+ * The root class for all other objects used or defined by this SDK.
+ *
+ * It contains common code for error handling as well as service functions that
+ * are useful. Because it is an abstract class, it cannot be called directly,
+ * and it has no publicly-visible properties.
+ */
+abstract class Base
+{
+
+ private $http_headers = array();
+ private $_errors = array();
+
+ /**
+ * Debug status.
+ *
+ * @var LoggerInterface
+ * @access private
+ */
+ private $logger;
+
+ /**
+ * Sets the Logger object.
+ *
+ * @param \OpenCloud\Common\Log\LoggerInterface $logger
+ */
+ public function setLogger(Log\LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
+
+ /**
+ * Returns the Logger object.
+ *
+ * @return \OpenCloud\Common\Log\AbstractLogger
+ */
+ public function getLogger()
+ {
+ if (null === $this->logger) {
+ $this->setLogger(new Log\Logger);
+ }
+ return $this->logger;
+ }
+
+ /**
+ * Returns the URL of the service/object
+ *
+ * The assumption is that nearly all objects will have a URL; at this
+ * base level, it simply throws an exception to enforce the idea that
+ * subclasses need to define this method.
+ *
+ * @throws UrlError
+ */
+ public function url($subresource = '')
+ {
+ throw new UrlError(Lang::translate(
+ 'URL method must be overridden in class definition'
+ ));
+ }
+
+/**
+ * Populates the current object based on an unknown data type.
+ *
+ * @param array|object|string|integer $info
+ * @throws Exceptions\InvalidArgumentError
+ */
+ public function populate($info, $setObjects = true)
+ {
+ if (is_string($info) || is_integer($info)) {
+
+ // If the data type represents an ID, the primary key is set
+ // and we retrieve the full resource from the API
+ $this->{$this->primaryKeyField()} = (string) $info;
+ $this->refresh($info);
+
+ } elseif (is_object($info) || is_array($info)) {
+
+ foreach($info as $key => $value) {
+
+ if ($key == 'metadata' || $key == 'meta') {
+
+ if (empty($this->metadata) || !$this->metadata instanceof Metadata) {
+ $this->metadata = new Metadata;
+ }
+
+ // Metadata
+ $this->$key->setArray($value);
+
+ } elseif (!empty($this->associatedResources[$key]) && $setObjects === true) {
+
+ // Associated resource
+ try {
+ $resource = $this->service()->resource($this->associatedResources[$key], $value);
+ $resource->setParent($this);
+ $this->$key = $resource;
+ } catch (Exception\ServiceException $e) {}
+
+ } elseif (!empty($this->associatedCollections[$key]) && $setObjects === true) {
+
+ // Associated collection
+ try {
+ $this->$key = $this->service()->resourceList($this->associatedCollections[$key], null, $this);
+ } catch (Exception\ServiceException $e) {}
+
+ } else {
+
+ // Normal key/value pair
+ $this->$key = $value;
+ }
+ }
+ } elseif (null !== $info) {
+ throw new Exceptions\InvalidArgumentError(sprintf(
+ Lang::translate('Argument for [%s] must be string or object'),
+ get_class()
+ ));
+ }
+ }
+
+ /**
+ * Sets extended attributes on an object and validates them
+ *
+ * This function is provided to ensure that attributes cannot
+ * arbitrarily added to an object. If this function is called, it
+ * means that the attribute is not defined on the object, and thus
+ * an exception is thrown.
+ *
+ * @codeCoverageIgnore
+ *
+ * @param string $property the name of the attribute
+ * @param mixed $value the value of the attribute
+ * @return void
+ */
+ public function __set($property, $value)
+ {
+ $this->setProperty($property, $value);
+ }
+
+ /**
+ * Sets an extended (unrecognized) property on the current object
+ *
+ * If RAXSDK_STRICT_PROPERTY_CHECKS is TRUE, then the prefix of the
+ * property name must appear in the $prefixes array, or else an
+ * exception is thrown.
+ *
+ * @param string $property the property name
+ * @param mixed $value the value of the property
+ * @param array $prefixes optional list of supported prefixes
+ * @throws \OpenCloud\AttributeError if strict checks are on and
+ * the property prefix is not in the list of prefixes.
+ */
+ public function setProperty($property, $value, array $prefixes = array())
+ {
+ // if strict checks are off, go ahead and set it
+ if (!RAXSDK_STRICT_PROPERTY_CHECKS
+ || $this->checkAttributePrefix($property, $prefixes)
+ ) {
+ $this->$property = $value;
+ } else {
+ // if that fails, then throw the exception
+ throw new AttributeError(sprintf(
+ Lang::translate('Unrecognized attribute [%s] for [%s]'),
+ $property,
+ get_class($this)
+ ));
+ }
+ }
+
+ /**
+ * Converts an array of key/value pairs into a single query string
+ *
+ * For example, array('A'=>1,'B'=>2) would become 'A=1&B=2'.
+ *
+ * @param array $arr array of key/value pairs
+ * @return string
+ */
+ public function makeQueryString($array)
+ {
+ $queryString = '';
+
+ foreach($array as $key => $value) {
+ if ($queryString) {
+ $queryString .= '&';
+ }
+ $queryString .= urlencode($key) . '=' . urlencode($this->to_string($value));
+ }
+
+ return $queryString;
+ }
+
+ /**
+ * Checks the most recent JSON operation for errors
+ *
+ * This function should be called after any `json_*()` function call.
+ * This ensures that nasty JSON errors are detected and the proper
+ * exception thrown.
+ *
+ * Example:
+ * `$obj = json_decode($string);`
+ * `if (check_json_error()) do something ...`
+ *
+ * @return boolean TRUE if an error occurred, FALSE if none
+ * @throws JsonError
+ *
+ * @codeCoverageIgnore
+ */
+ public function checkJsonError()
+ {
+ switch (json_last_error()) {
+ case JSON_ERROR_NONE:
+ return;
+ case JSON_ERROR_DEPTH:
+ $jsonError = 'JSON error: The maximum stack depth has been exceeded';
+ break;
+ case JSON_ERROR_STATE_MISMATCH:
+ $jsonError = 'JSON error: Invalid or malformed JSON';
+ break;
+ case JSON_ERROR_CTRL_CHAR:
+ $jsonError = 'JSON error: Control character error, possibly incorrectly encoded';
+ break;
+ case JSON_ERROR_SYNTAX:
+ $jsonError = 'JSON error: Syntax error';
+ break;
+ case JSON_ERROR_UTF8:
+ $jsonError = 'JSON error: Malformed UTF-8 characters, possibly incorrectly encoded';
+ break;
+ default:
+ $jsonError = 'Unexpected JSON error';
+ break;
+ }
+
+ if (isset($jsonError)) {
+ throw new JsonError(Lang::translate($jsonError));
+ }
+ }
+
+ /**
+ * Returns a class that implements the HttpRequest interface.
+ *
+ * This can be stubbed out for unit testing and avoid making live calls.
+ */
+ public function getHttpRequestObject($url, $method = 'GET', array $options = array())
+ {
+ return new Request\Curl($url, $method, $options);
+ }
+
+ /**
+ * Checks the attribute $property and only permits it if the prefix is
+ * in the specified $prefixes array
+ *
+ * This is to support extension namespaces in some services.
+ *
+ * @param string $property the name of the attribute
+ * @param array $prefixes a list of prefixes
+ * @return boolean TRUE if valid; FALSE if not
+ */
+ private function checkAttributePrefix($property, array $prefixes = array())
+ {
+ $prefix = strstr($property, ':', true);
+
+ if (in_array($prefix, $prefixes)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Converts a value to an HTTP-displayable string form
+ *
+ * @param mixed $x a value to convert
+ * @return string
+ */
+ private function to_string($x)
+ {
+ if (is_bool($x) && $x) {
+ return 'True';
+ } elseif (is_bool($x)) {
+ return 'False';
+ } else {
+ return (string) $x;
+ }
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php
new file mode 100644
index 00000000000..e1bf80376e0
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Collection.php
@@ -0,0 +1,320 @@
+<?php
+
+namespace OpenCloud\Common;
+
+/**
+ * Provides an abstraction for working with ordered sets of objects
+ *
+ * Collection objects are used whenever there are multiples; for example,
+ * multiple objects in a container, or multiple servers in a service.
+ *
+ * @since 1.0
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
+ */
+class Collection extends Base
+{
+
+ private $service;
+ private $itemclass;
+ private $itemlist = array();
+ private $pointer = 0;
+ private $sortkey;
+ private $next_page_class;
+ private $next_page_callback;
+ private $next_page_url;
+
+ /**
+ * A Collection is an array of objects
+ *
+ * Some assumptions:
+ * * The `Collection` class assumes that there exists on its service
+ * a factory method with the same name of the class. For example, if
+ * you create a Collection of class `Foobar`, it will attempt to call
+ * the method `parent::Foobar()` to create instances of that class.
+ * * It assumes that the factory method can take an array of values, and
+ * it passes that to the method.
+ *
+ * @param Service $service - the service associated with the collection
+ * @param string $itemclass - the Class of each item in the collection
+ * (assumed to be the name of the factory method)
+ * @param array $arr - the input array
+ */
+ public function __construct($service, $itemclass, $array)
+ {
+ $this->service = $service;
+
+ $this->getLogger()->info(
+ 'Collection:service={class}, class={itemClass}, array={array}',
+ array(
+ 'class' => get_class($service),
+ 'itemClass' => $itemclass,
+ 'array' => print_r($array, true)
+ )
+ );
+
+ $this->next_page_class = $itemclass;
+
+ if (false !== ($classNamePos = strrpos($itemclass, '\\'))) {
+ $this->itemclass = substr($itemclass, $classNamePos + 1);
+ } else {
+ $this->itemclass = $itemclass;
+ }
+
+ if (!is_array($array)) {
+ throw new Exceptions\CollectionError(
+ Lang::translate('Cannot create a Collection without an array')
+ );
+ }
+
+ // save the array of items
+ $this->setItemList($array);
+ }
+
+ /**
+ * Set the entire data array.
+ *
+ * @param array $array
+ */
+ public function setItemList(array $array)
+ {
+ $this->itemlist = $array;
+ }
+
+ /**
+ * Retrieve the entire data array.
+ *
+ * @return array
+ */
+ public function getItemList()
+ {
+ return $this->itemlist;
+ }
+
+ /**
+ * Returns the number of items in the collection
+ *
+ * For most services, this is the total number of items. If the Collection
+ * is paginated, however, this only returns the count of items in the
+ * current page of data.
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->itemlist);
+ }
+
+ /**
+ * Pseudonym for count()
+ *
+ * @codeCoverageIgnore
+ */
+ public function size()
+ {
+ return $this->count();
+ }
+
+ /**
+ * Retrieves the service associated with the Collection
+ *
+ * @return Service
+ */
+ public function service()
+ {
+ return $this->service;
+ }
+
+ /**
+ * Resets the pointer to the beginning, but does NOT return the first item
+ *
+ * @api
+ * @return void
+ */
+ public function reset()
+ {
+ $this->pointer = 0;
+ }
+
+ /**
+ * Resets the collection pointer back to the first item in the page
+ * and returns it
+ *
+ * This is useful if you're only interested in the first item in the page.
+ *
+ * @api
+ * @return Base the first item in the set
+ */
+ public function first()
+ {
+ $this->reset();
+ return $this->next();
+ }
+
+ /**
+ * Returns the next item in the page
+ *
+ * @api
+ * @return Base the next item or FALSE if at the end of the page
+ */
+ public function next()
+ {
+ if ($this->pointer >= $this->count()) {
+ return false;
+ }
+
+ $service = $this->service();
+
+ if (method_exists($service, $this->itemclass)) {
+ return $service->{$this->itemclass}($this->itemlist[$this->pointer++]);
+ } elseif (method_exists($service, 'resource')) {
+ return $service->resource($this->itemclass, $this->itemlist[$this->pointer++]);
+ }
+ // @codeCoverageIgnoreStart
+ return false;
+ // @codeCoverageIgnoreEnd
+ }
+
+ /**
+ * sorts the collection on a specified key
+ *
+ * Note: only top-level keys can be used as the sort key. Note that this
+ * only sorts the data in the current page of the Collection (for
+ * multi-page data).
+ *
+ * @api
+ * @param string $keyname the name of the field to use as the sort key
+ * @return void
+ */
+ public function sort($keyname = 'id')
+ {
+ $this->sortkey = $keyname;
+ usort($this->itemlist, array($this, 'sortCompare'));
+ }
+
+ /**
+ * selects only specified items from the Collection
+ *
+ * This provides a simple form of filtering on Collections. For each item
+ * in the collection, it calls the callback function, passing it the item.
+ * If the callback returns `TRUE`, then the item is retained; if it returns
+ * `FALSE`, then the item is deleted from the collection.
+ *
+ * Note that this should not supersede server-side filtering; the
+ * `Collection::Select()` method requires that *all* of the data for the
+ * Collection be retrieved from the server before the filtering is
+ * performed; this can be very inefficient, especially for large data
+ * sets. This method is mostly useful on smaller-sized sets.
+ *
+ * Example:
+ * <code>
+ * $services = $connection->ServiceList();
+ * $services->Select(function($item){ return $item->region=='ORD';});
+ * // now the $services Collection only has items from the ORD region
+ * </code>
+ *
+ * `Select()` is *destructive*; that is, it actually removes entries from
+ * the collection. For example, if you use `Select()` to find items with
+ * the ID > 10, then use it again to find items that are <= 10, it will
+ * return an empty list.
+ *
+ * @api
+ * @param callable $testfunc a callback function that is passed each item
+ * in turn. Note that `Select()` performs an explicit test for
+ * `FALSE`, so functions like `strpos()` need to be cast into a
+ * boolean value (and not just return the integer).
+ * @returns void
+ * @throws DomainError if callback doesn't return a boolean value
+ */
+ public function select($testfunc)
+ {
+ foreach ($this->getItemList() as $index => $item) {
+ $test = call_user_func($testfunc, $item);
+ if (!is_bool($test)) {
+ throw new Exceptions\DomainError(
+ Lang::translate('Callback function for Collection::Select() did not return boolean')
+ );
+ }
+ if ($test === false) {
+ unset($this->itemlist[$index]);
+ }
+ }
+ }
+
+ /**
+ * returns the Collection object for the next page of results, or
+ * FALSE if there are no more pages
+ *
+ * Generally, the structure for a multi-page collection will look like
+ * this:
+ *
+ * $coll = $obj->Collection();
+ * do {
+ * while($item = $coll->Next()) {
+ * // do something with the item
+ * }
+ * } while ($coll = $coll->NextPage());
+ *
+ * @api
+ * @return Collection if there are more pages of results, otherwise FALSE
+ */
+ public function nextPage()
+ {
+ if (isset($this->next_page_url)) {
+ return call_user_func(
+ $this->next_page_callback,
+ $this->next_page_class,
+ $this->next_page_url
+ );
+ }
+ // @codeCoverageIgnoreStart
+ return false;
+ // @codeCoverageIgnoreEnd
+ }
+
+ /**
+ * for paginated collection, sets the callback function and URL for
+ * the next page
+ *
+ * The callback function should have the signature:
+ *
+ * function Whatever($class, $url, $parent)
+ *
+ * and the `$url` should be the URL of the next page of results
+ *
+ * @param callable $callback the name of the function (or array of
+ * object, function name)
+ * @param string $url the URL of the next page of results
+ * @return void
+ */
+ public function setNextPageCallback($callback, $url)
+ {
+ $this->next_page_callback = $callback;
+ $this->next_page_url = $url;
+ }
+
+ /**
+ * Compares two values of sort keys
+ */
+ private function sortCompare($a, $b)
+ {
+ $key = $this->sortkey;
+
+ // handle strings with strcmp()
+ if (is_string($a->$key)) {
+ return strcmp($a->$key, $b->$key);
+ }
+
+ // handle others with logical comparisons
+ if ($a->$key == $b->$key) {
+ return 0;
+ }
+
+ if ($a->$key < $b->$key) {
+ return -1;
+ } else {
+ return 1;
+ }
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php
new file mode 100644
index 00000000000..cbbacff38bd
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class AsyncError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php
new file mode 100644
index 00000000000..dc7b2d7e3a7
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncHttpError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class AsyncHttpError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php
new file mode 100644
index 00000000000..bba5f09f64f
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AsyncTimeoutError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class AsyncTimeoutError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php
new file mode 100644
index 00000000000..7d09ceb0147
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AttributeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class AttributeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php
new file mode 100644
index 00000000000..091e4602ec0
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/AuthenticationError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class AuthenticationError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php
new file mode 100644
index 00000000000..0bc967adf67
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/BaseException.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class BaseException extends \Exception
+{
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php
new file mode 100644
index 00000000000..0f972e9c5c7
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CdnError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php
new file mode 100644
index 00000000000..f1e2722f158
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnHttpError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CdnHttpError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php
new file mode 100644
index 00000000000..853b17c7127
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnNotAvailableError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CdnNotAvailableError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php
new file mode 100644
index 00000000000..b4364f93467
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CdnTtlError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CdnTtlError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php
new file mode 100644
index 00000000000..9d5030403f6
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CollectionError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CollectionError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php
new file mode 100644
index 00000000000..afc8119bd5a
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ContainerCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php
new file mode 100644
index 00000000000..c212bfbaffd
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ContainerDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php
new file mode 100644
index 00000000000..c9716fef075
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ContainerError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php
new file mode 100644
index 00000000000..e0b9592835e
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNameError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ContainerNameError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php
new file mode 100644
index 00000000000..e987449d444
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotEmptyError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ContainerNotEmptyError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php
new file mode 100644
index 00000000000..2e700dbe039
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ContainerNotFoundError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ContainerNotFoundError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php
new file mode 100644
index 00000000000..bb2030373fb
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php
new file mode 100644
index 00000000000..8aa651a76d9
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CreateUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CreateUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php
new file mode 100644
index 00000000000..2769edaf378
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/CredentialError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class CredentialError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php
new file mode 100644
index 00000000000..eb19198c2fe
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DatabaseCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php
new file mode 100644
index 00000000000..41f397529fe
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DatabaseDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php
new file mode 100644
index 00000000000..04a7fb9e835
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseListError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DatabaseListError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php
new file mode 100644
index 00000000000..17a987a03b0
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseNameError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DatabaseNameError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php
new file mode 100644
index 00000000000..c891c173787
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DatabaseUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DatabaseUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php
new file mode 100644
index 00000000000..27c4b2a4894
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php
new file mode 100644
index 00000000000..d501e3594b6
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DocumentError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DocumentError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php
new file mode 100644
index 00000000000..b4eac2ae1d3
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/DomainError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class DomainError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php
new file mode 100644
index 00000000000..c7863c09b01
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EmptyResponseError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class EmptyResponseError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php
new file mode 100644
index 00000000000..a686a6456e9
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/EndpointError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class EndpointError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php
new file mode 100644
index 00000000000..469dc27e76c
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/FlavorError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class FlavorError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php
new file mode 100644
index 00000000000..1b54b8a8253
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php
new file mode 100644
index 00000000000..a5c64780516
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpForbiddenError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpForbiddenError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php
new file mode 100644
index 00000000000..243e8df64fd
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpOverLimitError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpOverLimitError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php
new file mode 100644
index 00000000000..78345840bba
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpRetryError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpRetryError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php
new file mode 100644
index 00000000000..81bc9dda608
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpTimeoutError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpTimeoutError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php
new file mode 100644
index 00000000000..9b1edb20333
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUnauthorizedError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpUnauthorizedError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php
new file mode 100644
index 00000000000..fa2af82c564
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/HttpUrlError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class HttpUrlError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php
new file mode 100644
index 00000000000..df816336c6c
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IOError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class IOError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php
new file mode 100644
index 00000000000..398b9f3fd85
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/IdRequiredError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class IdRequiredError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php
new file mode 100644
index 00000000000..3b846a7551f
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ImageError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ImageError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php
new file mode 100644
index 00000000000..65caa154497
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InstanceCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php
new file mode 100644
index 00000000000..e4c6fdb7f57
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InstanceDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php
new file mode 100644
index 00000000000..48152824862
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InstanceError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php
new file mode 100644
index 00000000000..e8a074eb9bf
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceFlavorError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InstanceFlavorError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php
new file mode 100644
index 00000000000..4bc94797b3f
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceNotFound.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InstanceNotFound extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php
new file mode 100644
index 00000000000..b15f3426013
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InstanceUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InstanceUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php
new file mode 100644
index 00000000000..a655f11a731
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidArgumentError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InvalidArgumentError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php
new file mode 100644
index 00000000000..f329c748957
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIdTypeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InvalidIdTypeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php
new file mode 100644
index 00000000000..370d8f650de
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidIpTypeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InvalidIpTypeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php
new file mode 100644
index 00000000000..f13986ffc94
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidParameterError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InvalidParameterError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php
new file mode 100644
index 00000000000..0266d8f22bd
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/InvalidRequestError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class InvalidRequestError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php
new file mode 100644
index 00000000000..96f9102ed37
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/JsonError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class JsonError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php
new file mode 100644
index 00000000000..a5bdad705f4
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/LoggingException.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @copyright Copyright 2012-2013 Rackspace US, Inc.
+ See COPYING for licensing information.
+ * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
+ * @version 1.5.9
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
+ */
+
+namespace OpenCloud\Common\Exceptions;
+
+use Exception;
+
+class LoggingException extends Exception
+{
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php
new file mode 100644
index 00000000000..a119397392f
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php
new file mode 100644
index 00000000000..4acd879afe9
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php
new file mode 100644
index 00000000000..65f94975a44
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php
new file mode 100644
index 00000000000..a7a74ca9e13
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataJsonError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataJsonError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php
new file mode 100644
index 00000000000..606f6d95874
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataKeyError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataKeyError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php
new file mode 100644
index 00000000000..271e69010a7
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataPrefixError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataPrefixError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php
new file mode 100644
index 00000000000..49db43d6f70
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MetadataUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MetadataUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php
new file mode 100644
index 00000000000..75b4f926995
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MisMatchedChecksumError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MisMatchedChecksumError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php
new file mode 100644
index 00000000000..0dd5b8ee737
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/MissingValueError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class MissingValueError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php
new file mode 100644
index 00000000000..6918120a56c
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NameError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NameError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php
new file mode 100644
index 00000000000..a0c7640ffe8
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NetworkCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php
new file mode 100644
index 00000000000..0e2922babe2
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NetworkDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php
new file mode 100644
index 00000000000..4b30806c1bc
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NetworkError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php
new file mode 100644
index 00000000000..f55f09d8ec2
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NetworkUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php
new file mode 100644
index 00000000000..666ec50482b
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NetworkUrlError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NetworkUrlError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php
new file mode 100644
index 00000000000..59a33088163
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoContentTypeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NoContentTypeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php
new file mode 100644
index 00000000000..2d56f5fcd0d
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/NoNameError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class NoNameError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php
new file mode 100644
index 00000000000..9d7391823e8
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjFetchError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ObjFetchError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php
new file mode 100644
index 00000000000..ef7b3b39220
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectCopyError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ObjectCopyError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php
new file mode 100644
index 00000000000..ea667ad25f6
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ObjectError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ObjectError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php
new file mode 100644
index 00000000000..9ee6ab37fd9
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RebuildError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class RebuildError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php
new file mode 100644
index 00000000000..718ce98574c
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/RecordTypeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class RecordTypeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php
new file mode 100644
index 00000000000..d4ad6453281
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerActionError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerActionError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php
new file mode 100644
index 00000000000..69904111c61
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php
new file mode 100644
index 00000000000..94a1adc4f0b
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php
new file mode 100644
index 00000000000..19fbcbd279c
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerImageScheduleError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerImageScheduleError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php
new file mode 100644
index 00000000000..3e737c28614
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerIpsError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerIpsError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php
new file mode 100644
index 00000000000..c10e67d645d
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerJsonError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerJsonError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php
new file mode 100644
index 00000000000..d9d7b370808
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php
new file mode 100644
index 00000000000..ba0308d04e7
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServerUrlError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServerUrlError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php
new file mode 100644
index 00000000000..7ce52c846a4
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/ServiceValueError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class ServiceValueError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php
new file mode 100644
index 00000000000..14d7614a9ee
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/SnapshotError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class SnapshotError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php
new file mode 100644
index 00000000000..61f4647d1b3
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/TempUrlMethodError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class TempUrlMethodError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php
new file mode 100644
index 00000000000..2b0772530fc
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UnknownError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php
new file mode 100644
index 00000000000..704ee28c052
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnknownParameterError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UnknownParameterError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php
new file mode 100644
index 00000000000..396d451e131
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnrecognizedServiceError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UnrecognizedServiceError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php
new file mode 100644
index 00000000000..5ff5ae89c73
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedExtensionError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UnsupportedExtensionError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php
new file mode 100644
index 00000000000..6d9143a1d91
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedFeatureExtension.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UnsupportedFeatureExtension extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php
new file mode 100644
index 00000000000..060733ad5b5
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UnsupportedVersionError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UnsupportedVersionError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php
new file mode 100644
index 00000000000..23f0dbb6aa7
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php
new file mode 100644
index 00000000000..6c4d9ab69aa
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UrlError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UrlError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php
new file mode 100644
index 00000000000..f87ee0d2fc9
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserCreateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UserCreateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php
new file mode 100644
index 00000000000..3196289aafc
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserDeleteError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UserDeleteError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php
new file mode 100644
index 00000000000..7d287ae0ecf
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserListError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UserListError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php
new file mode 100644
index 00000000000..51902f8e93c
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserNameError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UserNameError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php
new file mode 100644
index 00000000000..403b53420d0
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/UserUpdateError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class UserUpdateError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php
new file mode 100644
index 00000000000..c19c4c2009d
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class VolumeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php
new file mode 100644
index 00000000000..a9cc1e3f64b
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Exceptions/VolumeTypeError.php
@@ -0,0 +1,5 @@
+<?php
+
+namespace OpenCloud\Common\Exceptions;
+
+class VolumeTypeError extends \Exception {}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php
new file mode 100644
index 00000000000..b2c480d71b5
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Role.php
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * PHP OpenCloud library.
+ *
+ * @author Jamie Hannaford <jamie@limetree.org>
+ * @version 2.0.0
+ * @copyright Copyright 2012-2013 Rackspace US, Inc.
+ * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
+ */
+
+/**
+ * Description of Role
+ *
+ * @link
+ *
+ * @codeCoverageIgnore
+ */
+class Role
+{
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php
new file mode 100644
index 00000000000..62783613c2f
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/Tenant.php
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * PHP OpenCloud library.
+ *
+ * @author Jamie Hannaford <jamie@limetree.org>
+ * @version 2.0.0
+ * @copyright Copyright 2012-2013 Rackspace US, Inc.
+ * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
+ */
+
+/**
+ * Description of Tenant
+ *
+ * @link
+ *
+ * @codeCoverageIgnore
+ */
+class Tenant
+{
+
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php
new file mode 100644
index 00000000000..9e3862d1750
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Identity/User.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * @copyright 2012-2013 Rackspace Hosting, Inc.
+ * See COPYING for licensing information
+ * @package phpOpenCloud
+ * @version 1.5.9
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.co.uk>
+ */
+
+/**
+ * Represents a sub-user in Keystone.
+ *
+ * @link http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/User_Calls.html
+ *
+ * @codeCoverageIgnore
+ */
+class User extends PersistentObject
+{
+
+ public static function factory($info)
+ {
+ $user = new self;
+ }
+
+ /**
+ * Return detailed information about a specific user, by either user name or user ID.
+ * @param int|string $info
+ */
+ public function get($info)
+ {
+ if (is_integer($info)) {
+
+ } elseif (is_string($info)) {
+
+ } else {
+ throw new Exception\IdentityException(sprintf(
+ 'A string-based username or an integer-based user ID is valid'
+ ));
+ }
+ }
+
+ public function create()
+ {
+
+ }
+
+ public function update()
+ {
+
+ }
+
+ public function delete()
+ {
+
+ }
+
+ public function listAllCredentials()
+ {
+
+ }
+
+ public function getCredentials()
+ {
+
+ }
+
+ public function resetApiKey()
+ {
+
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php
new file mode 100644
index 00000000000..7bb12859734
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Lang.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace OpenCloud\Common;
+
+class Lang
+{
+
+ public static function translate($word = null)
+ {
+ return $word;
+ }
+
+ public static function noslash($str)
+ {
+ while ($str && (substr($str, -1) == '/')) {
+ $str = substr($str, 0, strlen($str) - 1);
+ }
+ return $str;
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php
new file mode 100644
index 00000000000..c7aea7f8767
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/AbstractLogger.php
@@ -0,0 +1,140 @@
+<?php
+
+// Copyright (c) 2012 PHP Framework Interoperability Group
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace OpenCloud\Common\Log;
+
+/**
+ * This is a simple Logger implementation that other Loggers can inherit from.
+ *
+ * It simply delegates all log-level-specific methods to the `log` method to
+ * reduce boilerplate code that a simple Logger that does the same thing with
+ * messages regardless of the error level has to implement.
+ */
+abstract class AbstractLogger implements LoggerInterface
+{
+ /**
+ * System is unusable.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function emergency($message, array $context = array())
+ {
+ $this->log(LogLevel::EMERGENCY, $message, $context);
+ }
+
+ /**
+ * Action must be taken immediately.
+ *
+ * Example: Entire website down, database unavailable, etc. This should
+ * trigger the SMS alerts and wake you up.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function alert($message, array $context = array())
+ {
+ $this->log(LogLevel::ALERT, $message, $context);
+ }
+
+ /**
+ * Critical conditions.
+ *
+ * Example: Application component unavailable, unexpected exception.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function critical($message, array $context = array())
+ {
+ $this->log(LogLevel::CRITICAL, $message, $context);
+ }
+
+ /**
+ * Runtime errors that do not require immediate action but should typically
+ * be logged and monitored.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function error($message, array $context = array())
+ {
+ $this->log(LogLevel::ERROR, $message, $context);
+ }
+
+ /**
+ * Exceptional occurrences that are not errors.
+ *
+ * Example: Use of deprecated APIs, poor use of an API, undesirable things
+ * that are not necessarily wrong.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function warning($message, array $context = array())
+ {
+ $this->log(LogLevel::WARNING, $message, $context);
+ }
+
+ /**
+ * Normal but significant events.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function notice($message, array $context = array())
+ {
+ $this->log(LogLevel::NOTICE, $message, $context);
+ }
+
+ /**
+ * Interesting events.
+ *
+ * Example: User logs in, SQL logs.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function info($message, array $context = array())
+ {
+ $this->log(LogLevel::INFO, $message, $context);
+ }
+
+ /**
+ * Detailed debug information.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function debug($message, array $context = array())
+ {
+ $this->log(LogLevel::DEBUG, $message, $context);
+ }
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php
new file mode 100644
index 00000000000..64b0169b507
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LogLevel.php
@@ -0,0 +1,38 @@
+<?php
+
+// Copyright (c) 2012 PHP Framework Interoperability Group
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace OpenCloud\Common\Log;
+
+/**
+ * Describes log levels
+ */
+class LogLevel
+{
+ const EMERGENCY = 'emergency';
+ const ALERT = 'alert';
+ const CRITICAL = 'critical';
+ const ERROR = 'error';
+ const WARNING = 'warning';
+ const NOTICE = 'notice';
+ const INFO = 'info';
+ const DEBUG = 'debug';
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php
new file mode 100644
index 00000000000..e11d3fbb7ca
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/Logger.php
@@ -0,0 +1,220 @@
+<?php
+/**
+ * @copyright Copyright 2012-2013 Rackspace US, Inc.
+ See COPYING for licensing information.
+ * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
+ * @version 1.5.9
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
+ */
+
+namespace OpenCloud\Common\Log;
+
+use OpenCloud\Common\Exceptions\LoggingException;
+
+/**
+ * Basic logger for OpenCloud which extends FIG's PSR-3 standard logger.
+ *
+ * @link https://github.com/php-fig/log
+ */
+class Logger extends AbstractLogger
+{
+ /**
+ * Is this debug class enabled or not?
+ *
+ * @var bool
+ */
+ private $enabled = false;
+
+ /**
+ * These are the levels which will always be outputted - regardless of
+ * user-imposed settings.
+ *
+ * @var array
+ */
+ private $urgentLevels = array(
+ LogLevel::EMERGENCY,
+ LogLevel::ALERT,
+ LogLevel::CRITICAL
+ );
+
+ /**
+ * Logging options.
+ *
+ * @var array
+ */
+ private $options = array(
+ 'outputToFile' => false,
+ 'logFile' => null,
+ 'dateFormat' => 'd/m/y H:I',
+ 'delimeter' => ' - '
+ );
+
+ /**
+ * Determines whether a log level needs to be outputted.
+ *
+ * @param string $logLevel
+ * @return bool
+ */
+ private function outputIsUrgent($logLevel)
+ {
+ return in_array($logLevel, $this->urgentLevels);
+ }
+
+ /**
+ * Interpolates context values into the message placeholders.
+ *
+ * @param string $message
+ * @param array $context
+ * @return type
+ */
+ private function interpolate($message, array $context = array())
+ {
+ // build a replacement array with braces around the context keys
+ $replace = array();
+ foreach ($context as $key => $val) {
+ $replace['{' . $key . '}'] = $val;
+ }
+
+ // interpolate replacement values into the message and return
+ return strtr($message, $replace);
+ }
+
+ /**
+ * Enable or disable the debug class.
+ *
+ * @param bool $enabled
+ * @return self
+ */
+ public function setEnabled($enabled)
+ {
+ $this->enabled = $enabled;
+ return $this;
+ }
+
+ /**
+ * Is the debug class enabled?
+ *
+ * @return bool
+ */
+ public function getEnabled()
+ {
+ return $this->enabled;
+ }
+
+ /**
+ * Set an array of options.
+ *
+ * @param array $options
+ */
+ public function setOptions(array $options = array())
+ {
+ foreach ($options as $key => $value) {
+ $this->setOption($key, $value);
+ }
+ }
+
+ /**
+ * Get all options.
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->options;
+ }
+
+ /**
+ * Set an individual option.
+ *
+ * @param string $key
+ * @param string $value
+ */
+ public function setOption($key, $value)
+ {
+ if ($this->optionExists($key)) {
+ $this->options[$key] = $value;
+ }
+ }
+
+ /**
+ * Get an individual option.
+ *
+ * @param string $key
+ * @return string|null
+ */
+ public function getOption($key)
+ {
+ if ($this->optionExists($key)) {
+ return $this->options[$key];
+ }
+ }
+
+ /**
+ * Check whether an individual option exists.
+ *
+ * @param string $key
+ * @return bool
+ */
+ private function optionExists($key)
+ {
+ return array_key_exists($key, $this->getOptions());
+ }
+
+ /**
+ * Outputs a log message if necessary.
+ *
+ * @param string $logLevel
+ * @param string $message
+ * @param string $context
+ */
+ public function log($level, $message, array $context = array())
+ {
+ if ($this->outputIsUrgent($level)
+ || $this->getEnabled() === true
+ || RAXSDK_DEBUG === true
+ ) {
+ $this->dispatch($message, $context);
+ }
+ }
+
+ /**
+ * Used to format the line outputted in the log file.
+ *
+ * @param string $string
+ * @return string
+ */
+ private function formatFileLine($string)
+ {
+ $format = $this->getOption('dateFormat') . $this->getOption('delimeter');
+ return date($format) . $string;
+ }
+
+ /**
+ * Dispatch a log output message.
+ *
+ * @param string $message
+ * @param array $context
+ * @throws LoggingException
+ */
+ private function dispatch($message, $context)
+ {
+ $output = $this->interpolate($message, $context) . PHP_EOL;
+
+ if ($this->getOption('outputToFile') === true) {
+ $file = $this->getOption('logFile');
+
+ if (!is_writable($file)) {
+ throw new LoggingException(
+ 'The log file either does not exist or is not writeable'
+ );
+ }
+
+ // Output to file
+ file_put_contents($file, $this->formatFileLine($output));
+ } else {
+
+ echo $output;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php
new file mode 100644
index 00000000000..daef1b04dad
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Log/LoggerInterface.php
@@ -0,0 +1,134 @@
+<?php
+
+// Copyright (c) 2012 PHP Framework Interoperability Group
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+namespace OpenCloud\Common\Log;
+
+/**
+ * Describes a logger instance
+ *
+ * The message MUST be a string or object implementing __toString().
+ *
+ * The message MAY contain placeholders in the form: {foo} where foo
+ * will be replaced by the context data in key "foo".
+ *
+ * The context array can contain arbitrary data, the only assumption that
+ * can be made by implementors is that if an Exception instance is given
+ * to produce a stack trace, it MUST be in a key named "exception".
+ *
+ * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
+ * for the full interface specification.
+ */
+interface LoggerInterface
+{
+ /**
+ * System is unusable.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function emergency($message, array $context = array());
+
+ /**
+ * Action must be taken immediately.
+ *
+ * Example: Entire website down, database unavailable, etc. This should
+ * trigger the SMS alerts and wake you up.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function alert($message, array $context = array());
+
+ /**
+ * Critical conditions.
+ *
+ * Example: Application component unavailable, unexpected exception.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function critical($message, array $context = array());
+
+ /**
+ * Runtime errors that do not require immediate action but should typically
+ * be logged and monitored.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function error($message, array $context = array());
+
+ /**
+ * Exceptional occurrences that are not errors.
+ *
+ * Example: Use of deprecated APIs, poor use of an API, undesirable things
+ * that are not necessarily wrong.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function warning($message, array $context = array());
+
+ /**
+ * Normal but significant events.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function notice($message, array $context = array());
+
+ /**
+ * Interesting events.
+ *
+ * Example: User logs in, SQL logs.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function info($message, array $context = array());
+
+ /**
+ * Detailed debug information.
+ *
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function debug($message, array $context = array());
+
+ /**
+ * Logs with an arbitrary level.
+ *
+ * @param mixed $level
+ * @param string $message
+ * @param array $context
+ * @return null
+ */
+ public function log($level, $message, array $context = array());
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php
new file mode 100644
index 00000000000..be6903e897e
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Metadata.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * A metadata object, used by other components in Compute and Object Storage
+ *
+ * @copyright 2012-2013 Rackspace Hosting, Inc.
+ * See COPYING for licensing information
+ *
+ * @package phpOpenCloud
+ * @version 1.0
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ */
+
+namespace OpenCloud\Common;
+
+/**
+ * The Metadata class represents either Server or Image metadata
+ *
+ * @api
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ */
+class Metadata extends Base
+{
+
+ // array holding the names of keys that were set
+ private $_keylist = array();
+
+ /**
+ * This setter overrides the base one, since the metadata key can be
+ * anything
+ *
+ * @param string $key
+ * @param string $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ // set the value and track the keys
+ if (!in_array($key, $this->_keylist)) {
+ $this->_keylist[] = $key;
+ }
+
+ $this->$key = $value;
+ }
+
+ /**
+ * Returns the list of keys defined
+ *
+ * @return array
+ */
+ public function Keylist()
+ {
+ return $this->_keylist;
+ }
+
+ /**
+ * Sets metadata values from an array, with optional prefix
+ *
+ * If $prefix is provided, then only array keys that match the prefix
+ * are set as metadata values, and $prefix is stripped from the key name.
+ *
+ * @param array $values an array of key/value pairs to set
+ * @param string $prefix if provided, a prefix that is used to identify
+ * metadata values. For example, you can set values from headers
+ * for a Container by using $prefix='X-Container-Meta-'.
+ * @return void
+ */
+ public function setArray($values, $prefix = null)
+ {
+ if (empty($values)) {
+ return false;
+ }
+
+ foreach ($values as $key => $value) {
+ if ($prefix) {
+ if (strpos($key, $prefix) === 0) {
+ $name = substr($key, strlen($prefix));
+ $this->getLogger()->info(
+ Lang::translate('Setting [{name}] to [{value}]'),
+ array(
+ 'name' => $name,
+ 'value' => $value
+ )
+ );
+ $this->$name = $value;
+ }
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php
new file mode 100644
index 00000000000..fe4dcccc73f
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Nova.php
@@ -0,0 +1,140 @@
+<?php
+
+/**
+ * An abstract class that defines shared components for products that use
+ * OpenStack Nova
+ *
+ * @copyright 2012-2013 Rackspace Hosting, Inc.
+ * See COPYING for licensing information
+ *
+ * @package phpOpenCloud
+ * @version 1.0
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ */
+
+namespace OpenCloud\Common;
+
+use OpenCloud\OpenStack;
+use OpenCloud\Common\Lang;
+use OpenCloud\Compute\Flavor;
+
+/**
+ * Nova is an abstraction layer for the OpenStack compute service.
+ *
+ * Nova is used as a basis for several products, including Compute services
+ * as well as Rackspace's Cloud Databases. This class is, in essence, a vehicle
+ * for sharing common code between those other classes.
+ */
+abstract class Nova extends Service
+{
+
+ private $_url;
+
+ /**
+ * Called when creating a new Compute service object
+ *
+ * _NOTE_ that the order of parameters for this is *different* from the
+ * parent Service class. This is because the earlier parameters are the
+ * ones that most typically change, whereas the later ones are not
+ * modified as often.
+ *
+ * @param \OpenCloud\Identity $conn - a connection object
+ * @param string $serviceRegion - identifies the region of this Compute
+ * service
+ * @param string $urltype - identifies the URL type ("publicURL",
+ * "privateURL")
+ * @param string $serviceName - identifies the name of the service in the
+ * catalog
+ */
+ public function __construct(
+ OpenStack $conn,
+ $serviceType,
+ $serviceName,
+ $serviceRegion,
+ $urltype
+ ) {
+ parent::__construct(
+ $conn,
+ $serviceType,
+ $serviceName,
+ $serviceRegion,
+ $urltype
+ );
+
+ $this->_url = Lang::noslash(parent::Url());
+
+ $this->getLogger()->info(Lang::translate('Initializing Nova...'));
+ }
+
+ /**
+ * Returns a flavor from the service
+ *
+ * This is a factory method and should generally be called instead of
+ * creating a Flavor object directly.
+ *
+ * @api
+ * @param string $id - if supplied, the Flavor identified by this is
+ * retrieved
+ * @return Compute\Flavor object
+ */
+ public function Flavor($id = null)
+ {
+ return new Flavor($this, $id);
+ }
+
+ /**
+ * Returns a list of Flavor objects
+ *
+ * This is a factory method and should generally be called instead of
+ * creating a FlavorList object directly.
+ *
+ * @api
+ * @param boolean $details - if TRUE (the default), returns full details.
+ * Set to FALSE to retrieve minimal details and possibly improve
+ * performance.
+ * @param array $filter - optional key/value pairs for creating query
+ * strings
+ * @return Collection (or FALSE on an error)
+ */
+ public function FlavorList($details = true, array $filter = array())
+ {
+ if ($details) {
+ $url = $this->Url(Flavor::ResourceName().'/detail', $filter);
+ } else {
+ $url = $this->Url(Flavor::ResourceName(), $filter);
+ }
+ return $this->Collection('\OpenCloud\Compute\Flavor', $url);
+ }
+
+ /**
+ * Gets a request from an HTTP source and ensures that the
+ * content type is always "application/json"
+ *
+ * This is a simple subclass of the parent::Request() method that ensures
+ * that all Compute requests use application/json as the Content-Type:
+ *
+ * @param string $url - the URL of the request
+ * @param string $method - the HTTP method ("GET" by default)
+ * @param array $headers - an associative array of headers to pass to
+ * the request
+ * @param string $body - optional body for POST or PUT requests
+ * @return \Rackspace\HttpResult object
+ */
+ public function Request($url, $method = 'GET', array $headers = array(), $body = null)
+ {
+ $headers['Content-Type'] = RAXSDK_CONTENT_TYPE_JSON;
+ return parent::Request($url, $method, $headers, $body);
+ }
+
+ /**
+ * Loads the available namespaces from the /extensions resource
+ */
+ protected function load_namespaces()
+ {
+ $ext = $this->Extensions();
+ foreach($ext as $obj) {
+ $this->_namespaces[] = $obj->alias;
+ }
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php
new file mode 100644
index 00000000000..0257526d709
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/PersistentObject.php
@@ -0,0 +1,939 @@
+<?php
+/**
+ * An abstraction that defines persistent objects associated with a service
+ *
+ * @copyright 2012-2013 Rackspace Hosting, Inc.
+ * See COPYING for licensing information
+ *
+ * @package phpOpenCloud
+ * @version 1.0
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
+ */
+
+namespace OpenCloud\Common;
+
+/**
+ * Represents an object that can be retrieved, created, updated and deleted.
+ *
+ * This class abstracts much of the common functionality between:
+ *
+ * * Nova servers;
+ * * Swift containers and objects;
+ * * DBAAS instances;
+ * * Cinder volumes;
+ * * and various other objects that:
+ * * have a URL;
+ * * can be created, updated, deleted, or retrieved;
+ * * use a standard JSON format with a top-level element followed by
+ * a child object with attributes.
+ *
+ * In general, you can create a persistent object class by subclassing this
+ * class and defining some protected, static variables:
+ *
+ * * $url_resource - the sub-resource value in the URL of the parent. For
+ * example, if the parent URL is `http://something/parent`, then setting this
+ * value to "another" would result in a URL for the persistent object of
+ * `http://something/parent/another`.
+ *
+ * * $json_name - the top-level JSON object name. For example, if the
+ * persistent object is represented by `{"foo": {"attr":value, ...}}`, then
+ * set $json_name to "foo".
+ *
+ * * $json_collection_name - optional; this value is the name of a collection
+ * of the persistent objects. If not provided, it defaults to `json_name`
+ * with an appended "s" (e.g., if `json_name` is "foo", then
+ * `json_collection_name` would be "foos"). Set this value if the collection
+ * name doesn't follow this pattern.
+ *
+ * * $json_collection_element - the common pattern for a collection is:
+ * `{"collection": [{"attr":"value",...}, {"attr":"value",...}, ...]}`
+ * That is, each element of the array is a \stdClass object containing the
+ * object's attributes. In rare instances, the objects in the array
+ * are named, and `json_collection_element` contains the name of the
+ * collection objects. For example, in this JSON response:
+ * `{"allowedDomain":[{"allowedDomain":{"name":"foo"}}]}`,
+ * `json_collection_element` would be set to "allowedDomain".
+ *
+ * The PersistentObject class supports the standard CRUD methods; if these are
+ * not needed (i.e. not supported by the service), the subclass should redefine
+ * these to call the `noCreate`, `noUpdate`, or `noDelete` methods, which will
+ * trigger an appropriate exception. For example, if an object cannot be created:
+ *
+ * function create($params = array())
+ * {
+ * $this->noCreate();
+ * }
+ */
+abstract class PersistentObject extends Base
+{
+
+ private $service;
+
+ private $parent;
+
+ protected $id;
+
+ /**
+ * Retrieves the instance from persistent storage
+ *
+ * @param mixed $service The service object for this resource
+ * @param mixed $info The ID or array/object of data
+ */
+ public function __construct($service = null, $info = null)
+ {
+ if ($service instanceof Service) {
+ $this->setService($service);
+ }
+
+ if (property_exists($this, 'metadata')) {
+ $this->metadata = new Metadata;
+ }
+
+ $this->populate($info);
+ }
+
+ /**
+ * Validates properties that have a namespace: prefix
+ *
+ * If the property prefix: appears in the list of supported extension
+ * namespaces, then the property is applied to the object. Otherwise,
+ * an exception is thrown.
+ *
+ * @param string $name the name of the property
+ * @param mixed $value the property's value
+ * @return void
+ * @throws AttributeError
+ */
+ public function __set($name, $value)
+ {
+ $this->setProperty($name, $value, $this->getService()->namespaces());
+ }
+
+ /**
+ * Sets the service associated with this resource object.
+ *
+ * @param \OpenCloud\Common\Service $service
+ */
+ public function setService(Service $service)
+ {
+ $this->service = $service;
+ return $this;
+ }
+
+ /**
+ * Returns the service object for this resource; required for making
+ * requests, etc. because it has direct access to the Connection.
+ *
+ * @return \OpenCloud\Common\Service
+ */
+ public function getService()
+ {
+ if (null === $this->service) {
+ throw new Exceptions\ServiceValueError(
+ 'No service defined'
+ );
+ }
+ return $this->service;
+ }
+
+ /**
+ * Legacy shortcut to getService
+ *
+ * @return \OpenCloud\Common\Service
+ */
+ public function service()
+ {
+ return $this->getService();
+ }
+
+ /**
+ * Set the parent object for this resource.
+ *
+ * @param \OpenCloud\Common\PersistentObject $parent
+ */
+ public function setParent(PersistentObject $parent)
+ {
+ $this->parent = $parent;
+ return $this;
+ }
+
+ /**
+ * Returns the parent.
+ *
+ * @return \OpenCloud\Common\PersistentObject
+ */
+ public function getParent()
+ {
+ if (null === $this->parent) {
+ $this->parent = $this->getService();
+ }
+ return $this->parent;
+ }
+
+ /**
+ * Legacy shortcut to getParent
+ *
+ * @return \OpenCloud\Common\PersistentObject
+ */
+ public function parent()
+ {
+ return $this->getParent();
+ }
+
+
+
+
+ /**
+ * API OPERATIONS (CRUD & CUSTOM)
+ */
+
+ /**
+ * Creates a new object
+ *
+ * @api
+ * @param array $params array of values to set when creating the object
+ * @return HttpResponse
+ * @throws VolumeCreateError if HTTP status is not Success
+ */
+ public function create($params = array())
+ {
+ // set parameters
+ if (!empty($params)) {
+ $this->populate($params, false);
+ }
+
+ // debug
+ $this->getLogger()->info('{class}::Create({name})', array(
+ 'class' => get_class($this),
+ 'name' => $this->Name()
+ ));
+
+ // construct the JSON
+ $object = $this->createJson();
+ $json = json_encode($object);
+ $this->checkJsonError();
+
+ $this->getLogger()->info('{class}::Create JSON [{json}]', array(
+ 'class' => get_class($this),
+ 'json' => $json
+ ));
+
+ // send the request
+ $response = $this->getService()->request(
+ $this->createUrl(),
+ 'POST',
+ array('Content-Type' => 'application/json'),
+ $json
+ );
+
+ // check the return code
+ // @codeCoverageIgnoreStart
+ if ($response->httpStatus() > 204) {
+ throw new Exceptions\CreateError(sprintf(
+ Lang::translate('Error creating [%s] [%s], status [%d] response [%s]'),
+ get_class($this),
+ $this->Name(),
+ $response->HttpStatus(),
+ $response->HttpBody()
+ ));
+ }
+
+ if ($response->HttpStatus() == "201" && ($location = $response->Header('Location'))) {
+ // follow Location header
+ $this->refresh(null, $location);
+ } else {
+ // set values from response
+ $object = json_decode($response->httpBody());
+
+ if (!$this->checkJsonError()) {
+ $top = $this->jsonName();
+ if (isset($object->$top)) {
+ $this->populate($object->$top);
+ }
+ }
+ }
+ // @codeCoverageIgnoreEnd
+
+ return $response;
+ }
+
+ /**
+ * Updates an existing object
+ *
+ * @api
+ * @param array $params array of values to set when updating the object
+ * @return HttpResponse
+ * @throws VolumeCreateError if HTTP status is not Success
+ */
+ public function update($params = array())
+ {
+ // set parameters
+ if (!empty($params)) {
+ $this->populate($params);
+ }
+
+ // debug
+ $this->getLogger()->info('{class}::Update({name})', array(
+ 'class' => get_class($this),
+ 'name' => $this->Name()
+ ));
+
+ // construct the JSON
+ $obj = $this->updateJson($params);
+ $json = json_encode($obj);
+
+ $this->checkJsonError();
+
+ $this->getLogger()->info('{class}::Update JSON [{json}]', array(
+ 'class' => get_class($this),
+ 'json' => $json
+ ));
+
+ // send the request
+ $response = $this->getService()->Request(
+ $this->url(),
+ 'PUT',
+ array(),
+ $json
+ );
+
+ // check the return code
+ // @codeCoverageIgnoreStart
+ if ($response->HttpStatus() > 204) {
+ throw new Exceptions\UpdateError(sprintf(
+ Lang::translate('Error updating [%s] with [%s], status [%d] response [%s]'),
+ get_class($this),
+ $json,
+ $response->HttpStatus(),
+ $response->HttpBody()
+ ));
+ }
+ // @codeCoverageIgnoreEnd
+
+ return $response;
+ }
+
+ /**
+ * Deletes an object
+ *
+ * @api
+ * @return HttpResponse
+ * @throws DeleteError if HTTP status is not Success
+ */
+ public function delete()
+ {
+ $this->getLogger()->info('{class}::Delete()', array('class' => get_class($this)));
+
+ // send the request
+ $response = $this->getService()->request($this->url(), 'DELETE');
+
+ // check the return code
+ // @codeCoverageIgnoreStart
+ if ($response->HttpStatus() > 204) {
+ throw new Exceptions\DeleteError(sprintf(
+ Lang::translate('Error deleting [%s] [%s], status [%d] response [%s]'),
+ get_class(),
+ $this->Name(),
+ $response->HttpStatus(),
+ $response->HttpBody()
+ ));
+ }
+ // @codeCoverageIgnoreEnd
+
+ return $response;
+ }
+
+ /**
+ * Returns an object for the Create() method JSON
+ * Must be overridden in a child class.
+ *
+ * @throws CreateError if not overridden
+ */
+ protected function createJson()
+ {
+ throw new Exceptions\CreateError(sprintf(
+ Lang::translate('[%s] CreateJson() must be overridden'),
+ get_class($this)
+ ));
+ }
+
+ /**
+ * Returns an object for the Update() method JSON
+ * Must be overridden in a child class.
+ *
+ * @throws UpdateError if not overridden
+ */
+ protected function updateJson($params = array())
+ {
+ throw new Exceptions\UpdateError(sprintf(
+ Lang::translate('[%s] UpdateJson() must be overridden'),
+ get_class($this)
+ ));
+ }
+
+ /**
+ * throws a CreateError for subclasses that don't support Create
+ *
+ * @throws CreateError
+ */
+ protected function noCreate()
+ {
+ throw new Exceptions\CreateError(sprintf(
+ Lang::translate('[%s] does not support Create()'),
+ get_class()
+ ));
+ }
+
+ /**
+ * throws a DeleteError for subclasses that don't support Delete
+ *
+ * @throws DeleteError
+ */
+ protected function noDelete()
+ {
+ throw new Exceptions\DeleteError(sprintf(
+ Lang::translate('[%s] does not support Delete()'),
+ get_class()
+ ));
+ }
+
+ /**
+ * throws a UpdateError for subclasses that don't support Update
+ *
+ * @throws UpdateError
+ */
+ protected function noUpdate()
+ {
+ throw new Exceptions\UpdateError(sprintf(
+ Lang::translate('[%s] does not support Update()'),
+ get_class()
+ ));
+ }
+
+ /**
+ * Returns the default URL of the object
+ *
+ * This may have to be overridden in subclasses.
+ *
+ * @param string $subresource optional sub-resource string
+ * @param array $qstr optional k/v pairs for query strings
+ * @return string
+ * @throws UrlError if URL is not defined
+ */
+ public function url($subresource = null, $queryString = array())
+ {
+ // find the primary key attribute name
+ $primaryKey = $this->primaryKeyField();
+
+ // first, see if we have a [self] link
+ $url = $this->findLink('self');
+
+ /**
+ * Next, check to see if we have an ID
+ * Note that we use Parent() instead of Service(), since the parent
+ * object might not be a service.
+ */
+ if (!$url && $this->$primaryKey) {
+ $url = Lang::noslash($this->getParent()->url($this->resourceName())) . '/' . $this->$primaryKey;
+ }
+
+ // add the subresource
+ if ($url) {
+ $url .= $subresource ? "/$subresource" : '';
+ if (count($queryString)) {
+ $url .= '?' . $this->makeQueryString($queryString);
+ }
+ return $url;
+ }
+
+ // otherwise, we don't have a URL yet
+ throw new Exceptions\UrlError(sprintf(
+ Lang::translate('%s does not have a URL yet'),
+ get_class($this)
+ ));
+ }
+
+ /**
+ * Waits for the server/instance status to change
+ *
+ * This function repeatedly polls the system for a change in server
+ * status. Once the status reaches the `$terminal` value (or 'ERROR'),
+ * then the function returns.
+ *
+ * The polling interval is set by the constant RAXSDK_POLL_INTERVAL.
+ *
+ * The function will automatically terminate after RAXSDK_SERVER_MAXTIMEOUT
+ * seconds elapse.
+ *
+ * @api
+ * @param string $terminal the terminal state to wait for
+ * @param integer $timeout the max time (in seconds) to wait
+ * @param callable $callback a callback function that is invoked with
+ * each repetition of the polling sequence. This can be used, for
+ * example, to update a status display or to permit other operations
+ * to continue
+ * @return void
+ */
+ public function waitFor(
+ $terminal = 'ACTIVE',
+ $timeout = RAXSDK_SERVER_MAXTIMEOUT,
+ $callback = NULL,
+ $sleep = RAXSDK_POLL_INTERVAL
+ ) {
+ // find the primary key field
+ $primaryKey = $this->PrimaryKeyField();
+
+ // save stats
+ $startTime = time();
+
+ $states = array('ERROR', $terminal);
+
+ while (true) {
+
+ $this->refresh($this->$primaryKey);
+
+ if ($callback) {
+ call_user_func($callback, $this);
+ }
+
+ if (in_array($this->status(), $states) || (time() - $startTime) > $timeout) {
+ return;
+ }
+ // @codeCoverageIgnoreStart
+ sleep($sleep);
+ }
+ }
+ // @codeCoverageIgnoreEnd
+
+ /**
+ * Refreshes the object from the origin (useful when the server is
+ * changing states)
+ *
+ * @return void
+ * @throws IdRequiredError
+ */
+ public function refresh($id = null, $url = null)
+ {
+ $primaryKey = $this->PrimaryKeyField();
+
+ if (!$url) {
+ if ($id === null) {
+ $id = $this->$primaryKey;
+ }
+
+ if (!$id) {
+ throw new Exceptions\IdRequiredError(sprintf(
+ Lang::translate('%s has no ID; cannot be refreshed'),
+ get_class())
+ );
+ }
+
+ // retrieve it
+ $this->getLogger()->info(Lang::translate('{class} id [{id}]'), array(
+ 'class' => get_class($this),
+ 'id' => $id
+ ));
+
+ $this->$primaryKey = $id;
+ $url = $this->url();
+ }
+
+ // reset status, if available
+ if (property_exists($this, 'status')) {
+ $this->status = null;
+ }
+
+ // perform a GET on the URL
+ $response = $this->getService()->Request($url);
+
+ // check status codes
+ // @codeCoverageIgnoreStart
+ if ($response->HttpStatus() == 404) {
+ throw new Exceptions\InstanceNotFound(
+ sprintf(Lang::translate('%s [%s] not found [%s]'),
+ get_class($this),
+ $this->$primaryKey,
+ $url
+ ));
+ }
+
+ if ($response->HttpStatus() >= 300) {
+ throw new Exceptions\UnknownError(
+ sprintf(Lang::translate('Unexpected %s error [%d] [%s]'),
+ get_class($this),
+ $response->HttpStatus(),
+ $response->HttpBody()
+ ));
+ }
+
+ // check for empty response
+ if (!$response->HttpBody()) {
+ throw new Exceptions\EmptyResponseError(
+ sprintf(Lang::translate('%s::Refresh() unexpected empty response, URL [%s]'),
+ get_class($this),
+ $url
+ ));
+ }
+
+ // we're ok, reload the response
+ if ($json = $response->HttpBody()) {
+
+ $this->getLogger()->info('refresh() JSON [{json}]', array('json' => $json));
+
+ $response = json_decode($json);
+
+ if ($this->CheckJsonError()) {
+ throw new Exceptions\ServerJsonError(sprintf(
+ Lang::translate('JSON parse error on %s refresh'),
+ get_class($this)
+ ));
+ }
+
+ $top = $this->JsonName();
+
+ if ($top && isset($response->$top)) {
+ $content = $response->$top;
+ } else {
+ $content = $response;
+ }
+
+ $this->populate($content);
+
+ }
+ // @codeCoverageIgnoreEnd
+ }
+
+
+ /**
+ * OBJECT INFORMATION
+ */
+
+ /**
+ * Returns the displayable name of the object
+ *
+ * Can be overridden by child objects; *must* be overridden by child
+ * objects if the object does not have a `name` attribute defined.
+ *
+ * @api
+ * @return string
+ * @throws NameError if attribute 'name' is not defined
+ */
+ public function name()
+ {
+ if (property_exists($this, 'name')) {
+ return $this->name;
+ } else {
+ throw new Exceptions\NameError(sprintf(
+ Lang::translate('Name attribute does not exist for [%s]'),
+ get_class($this)
+ ));
+ }
+ }
+
+ /**
+ * Sends the json string to the /action resource
+ *
+ * This is used for many purposes, such as rebooting the server,
+ * setting the root password, creating images, etc.
+ * Since it can only be used on a live server, it checks for a valid ID.
+ *
+ * @param $object - this will be encoded as json, and we handle all the JSON
+ * error-checking in one place
+ * @throws ServerIdError if server ID is not defined
+ * @throws ServerActionError on other errors
+ * @returns boolean; TRUE if successful, FALSE otherwise
+ */
+ protected function action($object)
+ {
+ $primaryKey = $this->primaryKeyField();
+
+ if (!$this->$primaryKey) {
+ throw new Exceptions\IdRequiredError(sprintf(
+ Lang::translate('%s is not defined'),
+ get_class($this)
+ ));
+ }
+
+ if (!is_object($object)) {
+ throw new Exceptions\ServerActionError(sprintf(
+ Lang::translate('%s::Action() requires an object as its parameter'),
+ get_class($this)
+ ));
+ }
+
+ // convert the object to json
+ $json = json_encode($object);
+ $this->getLogger()->info('JSON [{string}]', array('json' => $json));
+
+ $this->checkJsonError();
+
+ // debug - save the request
+ $this->getLogger()->info(Lang::translate('{class}::action [{json}]'), array(
+ 'class' => get_class($this),
+ 'json' => $json
+ ));
+
+ // get the URL for the POST message
+ $url = $this->url('action');
+
+ // POST the message
+ $response = $this->getService()->request($url, 'POST', array(), $json);
+
+ // @codeCoverageIgnoreStart
+ if (!is_object($response)) {
+ throw new Exceptions\HttpError(sprintf(
+ Lang::translate('Invalid response for %s::Action() request'),
+ get_class($this)
+ ));
+ }
+
+ // check for errors
+ if ($response->HttpStatus() >= 300) {
+ throw new Exceptions\ServerActionError(sprintf(
+ Lang::translate('%s::Action() [%s] failed; response [%s]'),
+ get_class($this),
+ $url,
+ $response->HttpBody()
+ ));
+ }
+ // @codeCoverageIgnoreStart
+
+ return $response;
+ }
+
+ /**
+ * Execute a custom resource request.
+ *
+ * @param string $path
+ * @param string $method
+ * @param string|array|object $body
+ * @return boolean
+ * @throws Exceptions\InvalidArgumentError
+ * @throws Exceptions\HttpError
+ * @throws Exceptions\ServerActionError
+ */
+ public function customAction($url, $method = 'GET', $body = null)
+ {
+ if (is_string($body) && (json_decode($body) === null)) {
+ throw new Exceptions\InvalidArgumentError(
+ 'Please provide either a well-formed JSON string, or an object '
+ . 'for JSON serialization'
+ );
+ } else {
+ $body = json_encode($body);
+ }
+
+ // POST the message
+ $response = $this->service()->request($url, $method, array(), $body);
+
+ if (!is_object($response)) {
+ throw new Exceptions\HttpError(sprintf(
+ Lang::translate('Invalid response for %s::customAction() request'),
+ get_class($this)
+ ));
+ }
+
+ // check for errors
+ // @codeCoverageIgnoreStart
+ if ($response->HttpStatus() >= 300) {
+ throw new Exceptions\ServerActionError(sprintf(
+ Lang::translate('%s::customAction() [%s] failed; response [%s]'),
+ get_class($this),
+ $url,
+ $response->HttpBody()
+ ));
+ }
+ // @codeCoverageIgnoreEnd
+
+ $object = json_decode($response->httpBody());
+
+ $this->checkJsonError();
+
+ return $object;
+ }
+
+ /**
+ * returns the object's status or `N/A` if not available
+ *
+ * @api
+ * @return string
+ */
+ public function status()
+ {
+ return (isset($this->status)) ? $this->status : 'N/A';
+ }
+
+ /**
+ * returns the object's identifier
+ *
+ * Can be overridden by a child class if the identifier is not in the
+ * `$id` property. Use of this function permits the `$id` attribute to
+ * be protected or private to prevent unauthorized overwriting for
+ * security.
+ *
+ * @api
+ * @return string
+ */
+ public function id()
+ {
+ return $this->id;
+ }
+
+ /**
+ * checks for `$alias` in extensions and throws an error if not present
+ *
+ * @throws UnsupportedExtensionError
+ */
+ public function checkExtension($alias)
+ {
+ if (!in_array($alias, $this->getService()->namespaces())) {
+ throw new Exceptions\UnsupportedExtensionError(sprintf(
+ Lang::translate('Extension [%s] is not installed'),
+ $alias
+ ));
+ }
+
+ return true;
+ }
+
+ /**
+ * returns the region associated with the object
+ *
+ * navigates to the parent service to determine the region.
+ *
+ * @api
+ */
+ public function region()
+ {
+ return $this->getService()->Region();
+ }
+
+ /**
+ * Since each server can have multiple links, this returns the desired one
+ *
+ * @param string $type - 'self' is most common; use 'bookmark' for
+ * the version-independent one
+ * @return string the URL from the links block
+ */
+ public function findLink($type = 'self')
+ {
+ if (empty($this->links)) {
+ return false;
+ }
+
+ foreach ($this->links as $link) {
+ if ($link->rel == $type) {
+ return $link->href;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * returns the URL used for Create
+ *
+ * @return string
+ */
+ protected function createUrl()
+ {
+ return $this->getParent()->Url($this->ResourceName());
+ }
+
+ /**
+ * Returns the primary key field for the object
+ *
+ * The primary key is usually 'id', but this function is provided so that
+ * (in rare cases where it is not 'id'), it can be overridden.
+ *
+ * @return string
+ */
+ protected function primaryKeyField()
+ {
+ return 'id';
+ }
+
+ /**
+ * Returns the top-level document identifier for the returned response
+ * JSON document; must be overridden in child classes
+ *
+ * For example, a server document is (JSON) `{"server": ...}` and an
+ * Instance document is `{"instance": ...}` - this function must return
+ * the top level document name (either "server" or "instance", in
+ * these examples).
+ *
+ * @throws DocumentError if not overridden
+ */
+ public static function jsonName()
+ {
+ if (isset(static::$json_name)) {
+ return static::$json_name;
+ }
+
+ throw new Exceptions\DocumentError(sprintf(
+ Lang::translate('No JSON object defined for class [%s] in JsonName()'),
+ get_class()
+ ));
+ }
+
+ /**
+ * returns the collection JSON element name
+ *
+ * When an object is returned in a collection, it usually has a top-level
+ * object that is an array holding child objects of the object types.
+ * This static function returns the name of the top-level element. Usually,
+ * that top-level element is simply the JSON name of the resource.'s';
+ * however, it can be overridden by specifying the $json_collection_name
+ * attribute.
+ *
+ * @return string
+ */
+ public static function jsonCollectionName()
+ {
+ if (isset(static::$json_collection_name)) {
+ return static::$json_collection_name;
+ } else {
+ return static::$json_name . 's';
+ }
+ }
+
+ /**
+ * returns the JSON name for each element in a collection
+ *
+ * Usually, elements in a collection are anonymous; this function, however,
+ * provides for an element level name:
+ *
+ * `{ "collection" : [ { "element" : ... } ] }`
+ *
+ * @return string
+ */
+ public static function jsonCollectionElement()
+ {
+ if (isset(static::$json_collection_element)) {
+ return static::$json_collection_element;
+ }
+ }
+
+ /**
+ * Returns the resource name for the URL of the object; must be overridden
+ * in child classes
+ *
+ * For example, a server is `/servers/`, a database instance is
+ * `/instances/`. Must be overridden in child classes.
+ *
+ * @throws UrlError
+ */
+ public static function resourceName()
+ {
+ if (isset(static::$url_resource)) {
+ return static::$url_resource;
+ }
+
+ throw new Exceptions\UrlError(sprintf(
+ Lang::translate('No URL resource defined for class [%s] in ResourceName()'),
+ get_class()
+ ));
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php
new file mode 100644
index 00000000000..bb829afc5f6
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Curl.php
@@ -0,0 +1,308 @@
+<?php
+
+namespace OpenCloud\Common\Request;
+
+use OpenCloud\Common\Base;
+use OpenCloud\Common\Lang;
+use OpenCloud\Common\Exceptions\HttpRetryError;
+use OpenCloud\Common\Exceptions\HttpUrlError;
+use OpenCloud\Common\Exceptions\HttpTimeoutError;
+use OpenCloud\Common\Exceptions\HttpError;
+
+/**
+ * The CurlRequest class is a simple wrapper to CURL functions. Not only does
+ * this permit stubbing of the interface as described under the HttpRequest
+ * interface, it could potentially allow us to replace the interface methods
+ * with other function calls in the future.
+ *
+ * @api
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ */
+class Curl extends Base implements HttpRequestInterface
+{
+
+ private $url;
+ private $method;
+ private $handle;
+ private $retries = 0;
+ private $headers = array();
+ private $returnheaders = array();
+
+ /**
+ * Initializes the CURL handle and HTTP method
+ *
+ * The constructor also sets a number of default values for options.
+ *
+ * @param string $url the URL to connect to
+ * @param string $method the HTTP method (default "GET")
+ * @param array $options optional hashed array of options => value pairs
+ */
+ public function __construct($url, $method = 'GET', array $options = array())
+ {
+ $this->url = $url;
+ $this->method = $method;
+ $this->handle = curl_init($url);
+
+ // set our options
+ $this->setOption(CURLOPT_CUSTOMREQUEST, $method);
+
+ foreach($options as $opt => $value) {
+ $this->getLogger()->info(Lang::translate('Setting option {key}={val}'), array(
+ 'key' => $opt,
+ 'val' => $value
+ ));
+ $this->setOption($opt, $value);
+ }
+
+ // @codeCoverageIgnoreStart
+ if (RAXSDK_SSL_VERIFYHOST != 2) {
+ $this->getLogger()->warning("WARNING: RAXSDK_SSL_VERIFYHOST has reduced security, value [{value}]", array(
+ 'value' => RAXSDK_SSL_VERIFYHOST
+ ));
+ }
+
+ if (RAXSDK_SSL_VERIFYPEER !== true) {
+ $this->getLogger()->warning("WARNING: RAXSDK_SSL_VERIFYPEER has reduced security");
+ }
+ // @codeCoverageIgnoreEnd
+
+ $this->setOption(CURLOPT_SSL_VERIFYHOST, RAXSDK_SSL_VERIFYHOST);
+ $this->setOption(CURLOPT_SSL_VERIFYPEER, RAXSDK_SSL_VERIFYPEER);
+
+ if (defined('RAXSDK_CACERTPEM') && file_exists(RAXSDK_CACERTPEM)) {
+ $this->setOption(CURLOPT_CAINFO, RAXSDK_CACERTPEM);
+ }
+
+ // curl code [18]
+ // message [transfer closed with x bytes remaining to read]
+ if ($method === 'HEAD') {
+ $this->setOption(CURLOPT_NOBODY, true);
+ }
+
+ // follow redirects
+ $this->setOption(CURLOPT_FOLLOWLOCATION, true);
+
+ // don't return the headers in the request
+ $this->setOption(CURLOPT_HEADER, false);
+
+ // retrieve headers via callback
+ $this->setOption(CURLOPT_HEADERFUNCTION, array($this, '_get_header_cb'));
+
+ // return the entire request on curl_exec()
+ $this->setOption(CURLOPT_RETURNTRANSFER, true);
+
+ // set default timeouts
+ $this->setConnectTimeout(RAXSDK_CONNECTTIMEOUT);
+ $this->setHttpTimeout(RAXSDK_TIMEOUT);
+ }
+
+ /**
+ * Sets a CURL option
+ *
+ * @param const $name - a CURL named constant; e.g. CURLOPT_TIMEOUT
+ * @param mixed $value - the value for the option
+ */
+ public function setOption($name, $value)
+ {
+ return curl_setopt($this->handle, $name, $value);
+ }
+
+ /**
+ * Explicit method for setting the connect timeout
+ *
+ * The connect timeout is the time it takes for the initial connection
+ * request to be established. It is different than the HTTP timeout, which
+ * is the time for the entire request to be serviced.
+ *
+ * @param integer $value The connection timeout in seconds.
+ * Use 0 to wait indefinitely (NOT recommended)
+ */
+ public function setConnectTimeout($value)
+ {
+ $this->setOption(CURLOPT_CONNECTTIMEOUT, $value);
+ }
+
+ /**
+ * Explicit method for setting the HTTP timeout
+ *
+ * The HTTP timeout is the time it takes for the HTTP request to be
+ * serviced. This value is usually larger than the connect timeout
+ * value.
+ *
+ * @param integer $value - the number of seconds to wait before timing out
+ * the HTTP request.
+ */
+ public function setHttpTimeout($value)
+ {
+ $this->setOption(CURLOPT_TIMEOUT, $value);
+ }
+
+ /**
+ * Sets the number of retries
+ *
+ * If you set this to a non-zero value, then it will repeat the request
+ * up to that number.
+ */
+ public function setRetries($value)
+ {
+ $this->retries = $value;
+ }
+
+ /**
+ * Simplified method for setting lots of headers at once
+ *
+ * This method takes an associative array of header/value pairs and calls
+ * the setheader() method on each of them.
+ *
+ * @param array $arr an associative array of headers
+ */
+ public function setheaders($array)
+ {
+ if (!is_array($array)) {
+ throw new HttpError(Lang::translate(
+ 'Value passed to CurlRequest::setheaders() must be array'
+ ));
+ }
+
+ foreach ($array as $name => $value) {
+ $this->setHeader($name, $value);
+ }
+ }
+
+ /**
+ * Sets a single header
+ *
+ * For example, to set the content type to JSON:
+ * `$request->SetHeader('Content-Type','application/json');`
+ *
+ * @param string $name The name of the header
+ * @param mixed $value The value of the header
+ */
+ public function setHeader($name, $value)
+ {
+ $this->headers[$name] = $value;
+ }
+
+ /**
+ * Executes the current request
+ *
+ * This method actually performs the request using the values set
+ * previously. It throws a OpenCloud\HttpError exception on
+ * any CURL error.
+ *
+ * @return OpenCloud\HttpResponse
+ * @throws OpenCloud\HttpError
+ *
+ * @codeCoverageIgnore
+ */
+ public function execute()
+ {
+ // set all the headers
+ $headarr = array();
+
+ foreach ($this->headers as $name => $value) {
+ $headarr[] = $name.': '.$value;
+ }
+
+ $this->setOption(CURLOPT_HTTPHEADER, $headarr);
+
+ // set up to retry if necessary
+ $try_counter = 0;
+
+ do {
+ $data = curl_exec($this->handle);
+ if (curl_errno($this->handle) && ($try_counter<$this->retries)) {
+ $this->getLogger()->info(Lang::translate('Curl error [%d]; retrying [%s]'), array(
+ 'error' => curl_errno($this->handle),
+ 'url' => $this->url
+ ));
+ }
+
+ } while((++$try_counter <= $this->retries) && (curl_errno($this->handle) != 0));
+
+ // log retries error
+ if ($this->retries && curl_errno($this->handle)) {
+ throw new HttpRetryError(sprintf(
+ Lang::translate('No more retries available, last error [%d]'),
+ curl_errno($this->handle)
+ ));
+ }
+
+ // check for CURL errors
+ switch(curl_errno($this->handle)) {
+ case 0:
+ // everything's ok
+ break;
+ case 3:
+ throw new HttpUrlError(sprintf(Lang::translate('Malformed URL [%s]'), $this->url));
+ break;
+ case 28:
+ // timeout
+ throw new HttpTimeoutError(Lang::translate('Operation timed out; check RAXSDK_TIMEOUT value'));
+ break;
+ default:
+ throw new HttpError(sprintf(
+ Lang::translate('HTTP error on [%s], curl code [%d] message [%s]'),
+ $this->url,
+ curl_errno($this->handle),
+ curl_error($this->handle)
+ ));
+ }
+
+ // otherwise, return the HttpResponse
+ return new Response\Http($this, $data);
+ }
+
+ /**
+ * returns an array of information about the request
+ */
+ public function info()
+ {
+ return curl_getinfo($this->handle);
+ }
+
+ /**
+ * returns the most recent CURL error number
+ */
+ public function errno()
+ {
+ return curl_errno($this->handle);
+ }
+
+ /**
+ * returns the most recent CURL error string
+ */
+ public function error()
+ {
+ return curl_error($this->handle);
+ }
+
+ /**
+ * Closes the HTTP request
+ */
+ public function close()
+ {
+ return curl_close($this->handle);
+ }
+
+ /**
+ * Returns the headers as an array
+ */
+ public function returnHeaders()
+ {
+ return $this->returnheaders;
+ }
+
+ /**
+ * This is a callback method used to handle the returned HTTP headers
+ *
+ * @param mixed $ch a CURL handle
+ * @param string $header the header string in its entirety
+ */
+ public function _get_header_cb($ch, $header)
+ {
+ $this->returnheaders[] = $header;
+ return strlen($header);
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php
new file mode 100644
index 00000000000..cbe3b5412a1
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/HttpRequestInterface.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace OpenCloud\Common\Request;
+
+/**
+ * The HttpRequest interface defines methods for wrapping CURL; this allows
+ * those methods to be stubbed out for unit testing, thus allowing us to
+ * test without actually making live calls.
+ */
+interface HttpRequestInterface
+{
+
+ public function SetOption($name, $value);
+
+ public function setheaders($arr);
+
+ public function SetHeader($header, $value);
+
+ public function Execute();
+
+ public function close();
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php
new file mode 100644
index 00000000000..0c79adcef3a
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Blank.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace OpenCloud\Common\Request\Response;
+
+class Blank extends Http
+{
+ public $errno;
+ public $error;
+ public $info;
+ public $body;
+ public $headers = array();
+ public $status = 200;
+ public $rawdata;
+
+ public function __construct(array $values = array())
+ {
+ foreach($values as $name => $value) {
+ $this->$name = $value;
+ }
+ }
+
+ public function httpStatus()
+ {
+ return $this->status;
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php
new file mode 100644
index 00000000000..a7cb9e96346
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Request/Response/Http.php
@@ -0,0 +1,140 @@
+<?php
+
+namespace OpenCloud\Common\Request\Response;
+
+use OpenCloud\Common\Base;
+
+/**
+ * The HttpResponse returns an object with status information, separated
+ * headers, and any response body necessary.
+ *
+ * @api
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ */
+
+class Http extends Base
+{
+
+ private $errno;
+ private $error;
+ private $info = array();
+ protected $body;
+ protected $headers = array();
+
+ /**
+ * The constructor parses everything necessary
+ */
+ public function __construct($request, $data)
+ {
+ // save the raw data (who knows? we might need it)
+ $this->setBody($data);
+
+ // and split each line into name: value pairs
+ foreach($request->returnHeaders() as $line) {
+ if (preg_match('/^([^:]+):\s+(.+?)\s*$/', $line, $matches)) {
+ $this->headers[$matches[1]] = $matches[2];
+ } else {
+ $this->headers[$line] = trim($line);
+ }
+ }
+
+ // @codeCoverageIgnoreStart
+ if (isset($this->headers['Cache-Control'])) {
+ $this->getLogger()->info('Cache-Control: {header}', array(
+ 'headers' => $this->headers['Cache-Control']
+ ));
+ }
+ if (isset($this->headers['Expires'])) {
+ $this->getLogger()->info('Expires: {header}', array(
+ 'headers' => $this->headers['Expires']
+ ));
+ }
+ // @codeCoverageIgnoreEnd
+
+ // set some other data
+ $this->info = $request->info();
+ $this->errno = $request->errno();
+ $this->error = $request->error();
+ }
+
+ /**
+ * Returns the full body of the request
+ *
+ * @return string
+ */
+ public function httpBody()
+ {
+ return $this->body;
+ }
+
+ /**
+ * Sets the body.
+ *
+ * @param string $body
+ */
+ public function setBody($body)
+ {
+ $this->body = $body;
+ }
+
+ /**
+ * Returns an array of headers
+ *
+ * @return associative array('header'=>value)
+ */
+ public function headers()
+ {
+ return $this->headers;
+ }
+
+ /**
+ * Returns a single header
+ *
+ * @return string with the value of the requested header, or NULL
+ */
+ public function header($name)
+ {
+ return isset($this->headers[$name]) ? $this->headers[$name] : null;
+ }
+
+ /**
+ * Returns an array of information
+ *
+ * @return array
+ */
+ public function info()
+ {
+ return $this->info;
+ }
+
+ /**
+ * Returns the most recent error number
+ *
+ * @return integer
+ */
+ public function errno()
+ {
+ return $this->errno;
+ }
+
+ /**
+ * Returns the most recent error message
+ *
+ * @return string
+ */
+ public function error()
+ {
+ return $this->error;
+ }
+
+ /**
+ * Returns the HTTP status code
+ *
+ * @return integer
+ */
+ public function httpStatus()
+ {
+ return $this->info['http_code'];
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php
new file mode 100644
index 00000000000..5b3aa729a97
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/Service.php
@@ -0,0 +1,489 @@
+<?php
+/**
+ * PHP OpenCloud library.
+ *
+ * @copyright Copyright 2013 Rackspace US, Inc. See COPYING for licensing information.
+ * @license https://www.apache.org/licenses/LICENSE-2.0 Apache 2.0
+ * @version 1.6.0
+ * @author Jamie Hannaford <jamie.hannaford@rackspace.com>
+ */
+
+namespace OpenCloud\Common;
+
+use OpenCloud\Common\Base;
+use OpenCloud\Common\Lang;
+use OpenCloud\OpenStack;
+use OpenCloud\Common\Exceptions;
+
+/**
+ * This class defines a cloud service; a relationship between a specific OpenStack
+ * and a provided service, represented by a URL in the service catalog.
+ *
+ * Because Service is an abstract class, it cannot be called directly. Provider
+ * services such as Rackspace Cloud Servers or OpenStack Swift are each
+ * subclassed from Service.
+ *
+ * @author Glen Campbell <glen.campbell@rackspace.com>
+ */
+
+abstract class Service extends Base
+{
+
+ protected $conn;
+ private $service_type;
+ private $service_name;
+ private $service_region;
+ private $service_url;
+
+ protected $_namespaces = array();
+
+ /**
+ * Creates a service on the specified connection
+ *
+ * Usage: `$x = new Service($conn, $type, $name, $region, $urltype);`
+ * The service's URL is defined in the OpenStack's serviceCatalog; it
+ * uses the $type, $name, $region, and $urltype to find the proper URL
+ * and set it. If it cannot find a URL in the service catalog that matches
+ * the criteria, then an exception is thrown.
+ *
+ * @param OpenStack $conn - a Connection object
+ * @param string $type - the service type (e.g., "compute")
+ * @param string $name - the service name (e.g., "cloudServersOpenStack")
+ * @param string $region - the region (e.g., "ORD")
+ * @param string $urltype - the specified URL from the catalog
+ * (e.g., "publicURL")
+ */
+ public function __construct(
+ OpenStack $conn,
+ $type,
+ $name,
+ $region,
+ $urltype = RAXSDK_URL_PUBLIC,
+ $customServiceUrl = null
+ ) {
+ $this->setConnection($conn);
+ $this->service_type = $type;
+ $this->service_name = $name;
+ $this->service_region = $region;
+ $this->service_url = $customServiceUrl ?: $this->getEndpoint($type, $name, $region, $urltype);
+ }
+
+ /**
+ * Set this service's connection.
+ *
+ * @param type $connection
+ */
+ public function setConnection($connection)
+ {
+ $this->conn = $connection;
+ }
+
+ /**
+ * Get this service's connection.
+ *
+ * @return type
+ */
+ public function getConnection()
+ {
+ return $this->conn;
+ }
+
+ /**
+ * Returns the URL for the Service
+ *
+ * @param string $resource optional sub-resource
+ * @param array $query optional k/v pairs for query strings
+ * @return string
+ */
+ public function url($resource = '', array $param = array())
+ {
+ $baseurl = $this->service_url;
+
+ // use strlen instead of boolean test because '0' is a valid name
+ if (strlen($resource) > 0) {
+ $baseurl = Lang::noslash($baseurl).'/'.$resource;
+ }
+
+ if (!empty($param)) {
+ $baseurl .= '?'.$this->MakeQueryString($param);
+ }
+
+ return $baseurl;
+ }
+
+ /**
+ * Returns the /extensions for the service
+ *
+ * @api
+ * @return array of objects
+ */
+ public function extensions()
+ {
+ $ext = $this->getMetaUrl('extensions');
+ return (is_object($ext) && isset($ext->extensions)) ? $ext->extensions : array();
+ }
+
+ /**
+ * Returns the /limits for the service
+ *
+ * @api
+ * @return array of limits
+ */
+ public function limits()
+ {
+ $limits = $this->getMetaUrl('limits');
+ return (is_object($limits)) ? $limits->limits : array();
+ }
+
+ /**
+ * Performs an authenticated request
+ *
+ * This method handles the addition of authentication headers to each
+ * request. It always adds the X-Auth-Token: header and will add the
+ * X-Auth-Project-Id: header if there is a tenant defined on the
+ * connection.
+ *
+ * @param string $url The URL of the request
+ * @param string $method The HTTP method (defaults to "GET")
+ * @param array $headers An associative array of headers
+ * @param string $body An optional body for POST/PUT requests
+ * @return \OpenCloud\HttpResult
+ */
+ public function request(
+ $url,
+ $method = 'GET',
+ array $headers = array(),
+ $body = null
+ ) {
+
+ $headers['X-Auth-Token'] = $this->conn->Token();
+
+ if ($tenant = $this->conn->Tenant()) {
+ $headers['X-Auth-Project-Id'] = $tenant;
+ }
+
+ return $this->conn->request($url, $method, $headers, $body);
+ }
+
+ /**
+ * returns a collection of objects
+ *
+ * @param string $class the class of objects to fetch
+ * @param string $url (optional) the URL to retrieve
+ * @param mixed $parent (optional) the parent service/object
+ * @return OpenCloud\Common\Collection
+ */
+ public function collection($class, $url = null, $parent = null)
+ {
+ // Set the element names
+ $collectionName = $class::JsonCollectionName();
+ $elementName = $class::JsonCollectionElement();
+
+ // Set the parent if empty
+ if (!$parent) {
+ $parent = $this;
+ }
+
+ // Set the URL if empty
+ if (!$url) {
+ $url = $parent->url($class::ResourceName());
+ }
+
+ // Save debug info
+ $this->getLogger()->info(
+ '{class}:Collection({url}, {collectionClass}, {collectionName})',
+ array(
+ 'class' => get_class($this),
+ 'url' => $url,
+ 'collectionClass' => $class,
+ 'collectionName' => $collectionName
+ )
+ );
+
+ // Fetch the list
+ $response = $this->request($url);
+
+ $this->getLogger()->info('Response {status} [{body}]', array(
+ 'status' => $response->httpStatus(),
+ 'body' => $response->httpBody()
+ ));
+
+ // Check return code
+ if ($response->httpStatus() > 204) {
+ throw new Exceptions\CollectionError(sprintf(
+ Lang::translate('Unable to retrieve [%s] list from [%s], status [%d] response [%s]'),
+ $class,
+ $url,
+ $response->httpStatus(),
+ $response->httpBody()
+ ));
+ }
+
+ // Handle empty response
+ if (strlen($response->httpBody()) == 0) {
+ return new Collection($parent, $class, array());
+ }
+
+ // Parse the return
+ $object = json_decode($response->httpBody());
+ $this->checkJsonError();
+
+ // See if there's a "next" link
+ // Note: not sure if the current API offers links as top-level structures;
+ // might have to refactor to allow $nextPageUrl as method argument
+ // @codeCoverageIgnoreStart
+ if (isset($object->links) && is_array($object->links)) {
+ foreach($object->links as $link) {
+ if (isset($link->rel) && $link->rel == 'next') {
+ if (isset($link->href)) {
+ $nextPageUrl = $link->href;
+ } else {
+ $this->getLogger()->warning(
+ 'Unexpected [links] found with no [href]'
+ );
+ }
+ }
+ }
+ }
+ // @codeCoverageIgnoreEnd
+
+ // How should we populate the collection?
+ $data = array();
+
+ if (!$collectionName) {
+ // No element name, just a plain object
+ // @codeCoverageIgnoreStart
+ $data = $object;
+ // @codeCoverageIgnoreEnd
+ } elseif (isset($object->$collectionName)) {
+ if (!$elementName) {
+ // The object has a top-level collection name only
+ $data = $object->$collectionName;
+ } else {
+ // The object has element levels which need to be iterated over
+ $data = array();
+ foreach($object->$collectionName as $item) {
+ $subValues = $item->$elementName;
+ unset($item->$elementName);
+ $data[] = array_merge((array)$item, (array)$subValues);
+ }
+ }
+ }
+
+ $collectionObject = new Collection($parent, $class, $data);
+
+ // if there's a $nextPageUrl, then we need to establish a callback
+ // @codeCoverageIgnoreStart
+ if (!empty($nextPageUrl)) {
+ $collectionObject->setNextPageCallback(array($this, 'Collection'), $nextPageUrl);
+ }
+ // @codeCoverageIgnoreEnd
+
+ return $collectionObject;
+ }
+
+ /**
+ * returns the Region associated with the service
+ *
+ * @api
+ * @return string
+ */
+ public function region()
+ {
+ return $this->service_region;
+ }
+
+ /**
+ * returns the serviceName associated with the service
+ *
+ * This is used by DNS for PTR record lookups
+ *
+ * @api
+ * @return string
+ */
+ public function name()
+ {
+ return $this->service_name;
+ }
+
+ /**
+ * Returns a list of supported namespaces
+ *
+ * @return array
+ */
+ public function namespaces()
+ {
+ return (isset($this->_namespaces) && is_array($this->_namespaces)) ? $this->_namespaces : array();
+ }
+
+ /**
+ * Given a service type, name, and region, return the url
+ *
+ * This function ensures that services are represented by an entry in the
+ * service catalog, and NOT by an arbitrarily-constructed URL.
+ *
+ * Note that it will always return the first match found in the
+ * service catalog (there *should* be only one, but you never know...)
+ *
+ * @param string $type The OpenStack service type ("compute" or
+ * "object-store", for example
+ * @param string $name The name of the service in the service catlog
+ * @param string $region The region of the service
+ * @param string $urltype The URL type; defaults to "publicURL"
+ * @return string The URL of the service
+ */
+ private function getEndpoint($type, $name, $region, $urltype = 'publicURL')
+ {
+ $catalog = $this->getConnection()->serviceCatalog();
+
+ // Search each service to find The One
+ foreach ($catalog as $service) {
+ // Find the service by comparing the type ("compute") and name ("openstack")
+ if (!strcasecmp($service->type, $type) && !strcasecmp($service->name, $name)) {
+ foreach($service->endpoints as $endpoint) {
+ // Only set the URL if:
+ // a. It is a regionless service (i.e. no region key set)
+ // b. The region matches the one we want
+ if (isset($endpoint->$urltype) &&
+ (!isset($endpoint->region) || !strcasecmp($endpoint->region, $region))
+ ) {
+ $url = $endpoint->$urltype;
+ }
+ }
+ }
+ }
+
+ // error if not found
+ if (empty($url)) {
+ throw new Exceptions\EndpointError(sprintf(
+ 'No endpoints for service type [%s], name [%s], region [%s] and urlType [%s]',
+ $type,
+ $name,
+ $region,
+ $urltype
+ ));
+ }
+
+ return $url;
+ }
+
+ /**
+ * Constructs a specified URL from the subresource
+ *
+ * Given a subresource (e.g., "extensions"), this constructs the proper
+ * URL and retrieves the resource.
+ *
+ * @param string $resource The resource requested; should NOT have slashes
+ * at the beginning or end
+ * @return \stdClass object
+ */
+ private function getMetaUrl($resource)
+ {
+ $urlBase = $this->getEndpoint(
+ $this->service_type,
+ $this->service_name,
+ $this->service_region,
+ RAXSDK_URL_PUBLIC
+ );
+
+ $url = Lang::noslash($urlBase) . '/' . $resource;
+
+ $response = $this->request($url);
+
+ // check for NOT FOUND response
+ if ($response->httpStatus() == 404) {
+ return array();
+ }
+
+ // @codeCoverageIgnoreStart
+ if ($response->httpStatus() >= 300) {
+ throw new Exceptions\HttpError(sprintf(
+ Lang::translate('Error accessing [%s] - status [%d], response [%s]'),
+ $urlBase,
+ $response->httpStatus(),
+ $response->httpBody()
+ ));
+ }
+ // @codeCoverageIgnoreEnd
+
+ // we're good; proceed
+ $object = json_decode($response->httpBody());
+
+ $this->checkJsonError();
+
+ return $object;
+ }
+
+ /**
+ * Get all associated resources for this service.
+ *
+ * @access public
+ * @return void
+ */
+ public function getResources()
+ {
+ return $this->resources;
+ }
+
+ /**
+ * Internal method for accessing child namespace from parent scope.
+ *
+ * @return type
+ */
+ protected function getCurrentNamespace()
+ {
+ $namespace = get_class($this);
+ return substr($namespace, 0, strrpos($namespace, '\\'));
+ }
+
+ /**
+ * Resolves fully-qualified classname for associated local resource.
+ *
+ * @param string $resourceName
+ * @return string
+ */
+ protected function resolveResourceClass($resourceName)
+ {
+ $className = substr_count($resourceName, '\\')
+ ? $resourceName
+ : $this->getCurrentNamespace() . '\\Resource\\' . ucfirst($resourceName);
+
+ if (!class_exists($className)) {
+ throw new Exceptions\UnrecognizedServiceError(sprintf(
+ '%s resource does not exist, please try one of the following: %s',
+ $resourceName,
+ implode(', ', $this->getResources())
+ ));
+ }
+
+ return $className;
+ }
+
+ /**
+ * Factory method for instantiating resource objects.
+ *
+ * @access public
+ * @param string $resourceName
+ * @param mixed $info (default: null)
+ * @return object
+ */
+ public function resource($resourceName, $info = null)
+ {
+ $className = $this->resolveResourceClass($resourceName);
+ return new $className($this, $info);
+ }
+
+ /**
+ * Factory method for instantiate a resource collection.
+ *
+ * @param string $resourceName
+ * @param string|null $url
+ * @return Collection
+ */
+ public function resourceList($resourceName, $url = null, $service = null)
+ {
+ $className = $this->resolveResourceClass($resourceName);
+ return $this->collection($className, $url, $service);
+ }
+
+}
diff --git a/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php
new file mode 100644
index 00000000000..3e20bcbc7b9
--- /dev/null
+++ b/apps/files_external/3rdparty/php-opencloud/lib/OpenCloud/Common/ServiceCatalogItem.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace OpenCloud\Common;
+
+/**
+ * Holds information on a single service from the Service Catalog
+ */
+class ServiceCatalogItem
+{
+
+ public function __construct($info = array())
+ {
+ foreach($info as $key => $value) {
+ $this->$key = $value;
+ }
+ }
+
+}