diff --git a/.gitignore b/.gitignore index 43f33783e3..43f3cab912 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,13 @@ !/apps/files_versions !/apps/user_ldap !/apps/user_webdavauth +/apps/files_external/3rdparty/irodsphp/PHPUnitTest +/apps/files_external/3rdparty/irodsphp/web +/apps/files_external/3rdparty/irodsphp/prods/test +/apps/files_external/3rdparty/irodsphp/prods/tutorials +/apps/files_external/3rdparty/irodsphp/prods/test* + + # ignore themes except the README /themes/* diff --git a/3rdparty b/3rdparty index 2176267239..25e8568d41 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 217626723957161191572ea50172a3943c30696d +Subproject commit 25e8568d41a9b9a6d1662ccf33058822a890e7f5 diff --git a/README b/README deleted file mode 100644 index 5f5d190cb0..0000000000 --- a/README +++ /dev/null @@ -1,20 +0,0 @@ -ownCloud gives you freedom and control over your own data. -A personal cloud which runs on your own server. - -http://ownCloud.org - -Installation instructions: http://doc.owncloud.org/server/5.0/developer_manual/app/gettingstarted.html -Contribution Guidelines: http://owncloud.org/dev/contribute/ - -Source code: https://github.com/owncloud -Mailing list: https://mail.kde.org/mailman/listinfo/owncloud -IRC channel: https://webchat.freenode.net/?channels=owncloud -Diaspora: https://joindiaspora.com/u/owncloud -Identi.ca: https://identi.ca/owncloud - -Important notice on translations: -Please submit translations via Transifex: -https://www.transifex.com/projects/p/owncloud/ - -For more detailed information about translations: -http://owncloud.org/dev/translation/ diff --git a/README.md b/README.md new file mode 100644 index 0000000000..ca7b04a925 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# ownCloud + +[ownCloud](http://ownCloud.org) gives you freedom and control over your own data. +A personal cloud which runs on your own server. + +### Build Status on [Jenkins CI](https://ci.owncloud.org/) +Git master: [![Build Status](https://ci.owncloud.org/buildStatus/icon?job=ownCloud-Server%28master%29)](https://ci.owncloud.org/job/ownCloud-Server%28master%29/) + +### Installation instructions +http://doc.owncloud.org/server/5.0/developer_manual/app/gettingstarted.html + +### Contribution Guidelines +http://owncloud.org/dev/contribute/ + +### Get in touch +* [Forum](http://forum.owncloud.org) +* [Mailing list](https://mail.kde.org/mailman/listinfo/owncloud) +* [IRC channel](https://webchat.freenode.net/?channels=owncloud) +* [Twitter](https://twitter.com/ownClouders) + +### Important notice on translations +Please submit translations via Transifex: +https://www.transifex.com/projects/p/owncloud/ + +For more detailed information about translations: +http://owncloud.org/dev/translation/ diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php index 0706d4e782..5b32b6db9b 100644 --- a/apps/files/ajax/scan.php +++ b/apps/files/ajax/scan.php @@ -16,72 +16,56 @@ if (isset($_GET['users'])) { } $eventSource = new OC_EventSource(); -ScanListener::$eventSource = $eventSource; -ScanListener::$view = \OC\Files\Filesystem::getView(); - -OC_Hook::connect('\OC\Files\Cache\Scanner', 'scan_folder', 'ScanListener', 'folder'); -OC_Hook::connect('\OC\Files\Cache\Scanner', 'scan_file', 'ScanListener', 'file'); +$listener = new ScanListener($eventSource); foreach ($users as $user) { $eventSource->send('user', $user); - OC_Util::tearDownFS(); - OC_Util::setupFS($user); - - $absolutePath = \OC\Files\Filesystem::getView()->getAbsolutePath($dir); - - $mountPoints = \OC\Files\Filesystem::getMountPoints($absolutePath); - $mountPoints[] = \OC\Files\Filesystem::getMountPoint($absolutePath); - $mountPoints = array_reverse($mountPoints); //start with the mount point of $dir - - foreach ($mountPoints as $mountPoint) { - $storage = \OC\Files\Filesystem::getStorage($mountPoint); - if ($storage) { - ScanListener::$mountPoints[$storage->getId()] = $mountPoint; - $scanner = $storage->getScanner(); - if ($force) { - $scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG); - } else { - $scanner->backgroundScan(); - } - } + $scanner = new \OC\Files\Utils\Scanner($user); + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', array($listener, 'file')); + $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', array($listener, 'folder')); + if ($force) { + $scanner->scan($dir); + } else { + $scanner->backgroundScan($dir); } } -$eventSource->send('done', ScanListener::$fileCount); +$eventSource->send('done', $listener->getCount()); $eventSource->close(); class ScanListener { - static public $fileCount = 0; - static public $lastCount = 0; - - /** - * @var \OC\Files\View $view - */ - static public $view; - - /** - * @var array $mountPoints map storage ids to mountpoints - */ - static public $mountPoints = array(); + private $fileCount = 0; + private $lastCount = 0; /** * @var \OC_EventSource event source to pass events to */ - static public $eventSource; + private $eventSource; - static function folder($params) { - $internalPath = $params['path']; - $mountPoint = self::$mountPoints[$params['storage']]; - $path = self::$view->getRelativePath($mountPoint . $internalPath); - self::$eventSource->send('folder', $path); + /** + * @param \OC_EventSource $eventSource + */ + public function __construct($eventSource) { + $this->eventSource = $eventSource; } - static function file() { - self::$fileCount++; - if (self::$fileCount > self::$lastCount + 20) { //send a count update every 20 files - self::$lastCount = self::$fileCount; - self::$eventSource->send('count', self::$fileCount); + /** + * @param string $path + */ + public function folder($path) { + $this->eventSource->send('folder', $path); + } + + public function file() { + $this->fileCount++; + if ($this->fileCount > $this->lastCount + 20) { //send a count update every 20 files + $this->lastCount = $this->fileCount; + $this->eventSource->send('count', $this->fileCount); } } + + public function getCount() { + return $this->fileCount; + } } diff --git a/apps/files/index.php b/apps/files/index.php index 2338cf439e..2f00539150 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -121,6 +121,10 @@ if ($needUpgrade) { // information about storage capacities $storageInfo=OC_Helper::getStorageInfo(); $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir); + $publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes'); + if (OC_App::isEnabled('files_encryption')) { + $publicUploadEnabled = 'no'; + } OCP\Util::addscript('files', 'fileactions'); OCP\Util::addscript('files', 'files'); @@ -138,5 +142,6 @@ if ($needUpgrade) { $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']); $tmpl->assign('isPublic', false); + $tmpl->assign('publicUploadEnabled', $publicUploadEnabled); $tmpl->printPage(); } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index cf3ce2e508..04a9fb9164 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -47,7 +47,7 @@ var FileList={ //size column if(size!=t('files', 'Pending')){ - simpleSize=simpleFileSize(size); + simpleSize = humanFileSize(size); }else{ simpleSize=t('files', 'Pending'); } @@ -55,7 +55,6 @@ var FileList={ var lastModifiedTime = Math.round(lastModified.getTime() / 1000); td = $('
@@ -77,7 +77,7 @@ | -t( 'Size' )); ?> | +t('Size')); ?> |
t( 'Modified' )); ?>
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 9886b42e42..9db27eb9b2 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -7,8 +7,7 @@
+ $dir = \OCP\Util::encodePath($crumb["dir"]); ?>
svg"
data-dir=''>
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index 502ddd329b..0c7d693669 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -9,7 +9,6 @@ $totalsize = 0; ?>
} else {
$totalfiles++;
}
- $simple_file_size = OCP\simple_file_size($file['size']);
// the bigger the file, the darker the shade of grey; megabytes*2
$simple_size_color = intval(160-$file['size']/(1024*1024)*2);
if($simple_size_color<0) $simple_size_color = 0;
@@ -17,10 +16,8 @@ $totalsize = 0; ?>
// the older the file, the brighter the shade of grey; days*14
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14);
if($relative_date_color>160) $relative_date_color = 160;
- $name = rawurlencode($file['name']);
- $name = str_replace('%2F', '/', $name);
- $directory = rawurlencode($file['directory']);
- $directory = str_replace('%2F', '/', $directory); ?>
+ $name = \OCP\Util::encodePath($file['name']);
+ $directory = \OCP\Util::encodePath($file['directory']); ?>
-
+
|
} ?>
|
-
+
|
|
+ * var_export($response->getLinks());
+ * array(
+ * array(
+ * 'url' => 'http:/.../front.jpeg',
+ * 'rel' => 'back',
+ * 'type' => 'image/jpeg',
+ * )
+ * )
+ *
+ *
+ * @return array
+ */
+ public function getLinks()
+ {
+ $links = $this->parseParams();
+
+ foreach ($links as &$link) {
+ $key = key($link);
+ unset($link[$key]);
+ $link['url'] = trim($key, '<> ');
+ }
+
+ return $links;
+ }
+}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/MessageInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/MessageInterface.php
new file mode 100644
index 0000000000..62bcd43913
--- /dev/null
+++ b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/MessageInterface.php
@@ -0,0 +1,102 @@
+fieldName = $fieldName;
+ $this->setFilename($filename);
+ $this->contentType = $contentType ?: $this->guessContentType();
+ }
+
+ public function setFieldName($name)
+ {
+ $this->fieldName = $name;
+
+ return $this;
+ }
+
+ public function getFieldName()
+ {
+ return $this->fieldName;
+ }
+
+ public function setFilename($filename)
+ {
+ // Remove leading @ symbol
+ if (strpos($filename, '@') === 0) {
+ $filename = substr($filename, 1);
+ }
+
+ if (!is_readable($filename)) {
+ throw new InvalidArgumentException("Unable to open {$filename} for reading");
+ }
+
+ $this->filename = $filename;
+
+ return $this;
+ }
+
+ public function getFilename()
+ {
+ return $this->filename;
+ }
+
+ public function setContentType($type)
+ {
+ $this->contentType = $type;
+
+ return $this;
+ }
+
+ public function getContentType()
+ {
+ return $this->contentType;
+ }
+
+ public function getCurlValue()
+ {
+ // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
+ // See: https://wiki.php.net/rfc/curl-file-upload
+ if (function_exists('curl_file_create')) {
+ return curl_file_create($this->filename, $this->contentType, basename($this->filename));
+ }
+
+ // Use the old style if using an older version of PHP
+ $value = "@{$this->filename};filename=" . basename($this->filename);
+ if ($this->contentType) {
+ $value .= ';type=' . $this->contentType;
+ }
+
+ return $value;
+ }
+
+ /**
+ * @deprecated
+ * @codeCoverageIgnore
+ */
+ public function getCurlString()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use getCurlValue()');
+ return $this->getCurlValue();
+ }
+
+ /**
+ * Determine the Content-Type of the file
+ */
+ protected function guessContentType()
+ {
+ return Mimetypes::getInstance()->fromFilename($this->filename) ?: 'application/octet-stream';
+ }
+}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/PostFileInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/PostFileInterface.php
new file mode 100644
index 0000000000..99dc706946
--- /dev/null
+++ b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/PostFileInterface.php
@@ -0,0 +1,67 @@
+method = strtoupper($method);
+ $this->curlOptions = new Collection();
+ $this->setUrl($url);
+
+ if ($headers) {
+ // Special handling for multi-value headers
+ foreach ($headers as $key => $value) {
+ // Deal with collisions with Host and Authorization
+ if ($key == 'host' || $key == 'Host') {
+ $this->setHeader($key, $value);
+ } elseif ($value instanceof HeaderInterface) {
+ $this->addHeader($key, $value);
+ } else {
+ foreach ((array) $value as $v) {
+ $this->addHeader($key, $v);
+ }
+ }
+ }
+ }
+
+ $this->setState(self::STATE_NEW);
+ }
+
+ public function __clone()
+ {
+ if ($this->eventDispatcher) {
+ $this->eventDispatcher = clone $this->eventDispatcher;
+ }
+ $this->curlOptions = clone $this->curlOptions;
+ $this->params = clone $this->params;
+ $this->url = clone $this->url;
+ $this->response = $this->responseBody = null;
+ $this->headers = clone $this->headers;
+
+ $this->setState(RequestInterface::STATE_NEW);
+ $this->dispatch('request.clone', array('request' => $this));
+ }
+
+ /**
+ * Get the HTTP request as a string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getRawHeaders() . "\r\n\r\n";
+ }
+
+ /**
+ * Default method that will throw exceptions if an unsuccessful response is received.
+ *
+ * @param Event $event Received
+ * @throws BadResponseException if the response is not successful
+ */
+ public static function onRequestError(Event $event)
+ {
+ $e = BadResponseException::factory($event['request'], $event['response']);
+ $event['request']->setState(self::STATE_ERROR, array('exception' => $e) + $event->toArray());
+ throw $e;
+ }
+
+ public function setClient(ClientInterface $client)
+ {
+ $this->client = $client;
+
+ return $this;
+ }
+
+ public function getClient()
+ {
+ return $this->client;
+ }
+
+ public function getRawHeaders()
+ {
+ $protocolVersion = $this->protocolVersion ?: '1.1';
+
+ return trim($this->method . ' ' . $this->getResource()) . ' '
+ . strtoupper(str_replace('https', 'http', $this->url->getScheme()))
+ . '/' . $protocolVersion . "\r\n" . implode("\r\n", $this->getHeaderLines());
+ }
+
+ public function setUrl($url)
+ {
+ if ($url instanceof Url) {
+ $this->url = $url;
+ } else {
+ $this->url = Url::factory($url);
+ }
+
+ // Update the port and host header
+ $this->setPort($this->url->getPort());
+
+ if ($this->url->getUsername() || $this->url->getPassword()) {
+ $this->setAuth($this->url->getUsername(), $this->url->getPassword());
+ // Remove the auth info from the URL
+ $this->url->setUsername(null);
+ $this->url->setPassword(null);
+ }
+
+ return $this;
+ }
+
+ public function send()
+ {
+ if (!$this->client) {
+ throw new RuntimeException('A client must be set on the request');
+ }
+
+ return $this->client->send($this);
+ }
+
+ public function getResponse()
+ {
+ return $this->response;
+ }
+
+ public function getQuery($asString = false)
+ {
+ return $asString
+ ? (string) $this->url->getQuery()
+ : $this->url->getQuery();
+ }
+
+ public function getMethod()
+ {
+ return $this->method;
+ }
+
+ public function getScheme()
+ {
+ return $this->url->getScheme();
+ }
+
+ public function setScheme($scheme)
+ {
+ $this->url->setScheme($scheme);
+
+ return $this;
+ }
+
+ public function getHost()
+ {
+ return $this->url->getHost();
+ }
+
+ public function setHost($host)
+ {
+ $this->url->setHost($host);
+ $this->setPort($this->url->getPort());
+
+ return $this;
+ }
+
+ public function getProtocolVersion()
+ {
+ return $this->protocolVersion;
+ }
+
+ public function setProtocolVersion($protocol)
+ {
+ $this->protocolVersion = $protocol;
+
+ return $this;
+ }
+
+ public function getPath()
+ {
+ return '/' . ltrim($this->url->getPath(), '/');
+ }
+
+ public function setPath($path)
+ {
+ $this->url->setPath($path);
+
+ return $this;
+ }
+
+ public function getPort()
+ {
+ return $this->url->getPort();
+ }
+
+ public function setPort($port)
+ {
+ $this->url->setPort($port);
+
+ // Include the port in the Host header if it is not the default port for the scheme of the URL
+ $scheme = $this->url->getScheme();
+ if (($scheme == 'http' && $port != 80) || ($scheme == 'https' && $port != 443)) {
+ $this->headers['host'] = $this->headerFactory->createHeader('Host', $this->url->getHost() . ':' . $port);
+ } else {
+ $this->headers['host'] = $this->headerFactory->createHeader('Host', $this->url->getHost());
+ }
+
+ return $this;
+ }
+
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ public function setAuth($user, $password = '', $scheme = CURLAUTH_BASIC)
+ {
+ static $authMap = array(
+ 'basic' => CURLAUTH_BASIC,
+ 'digest' => CURLAUTH_DIGEST,
+ 'ntlm' => CURLAUTH_NTLM,
+ 'any' => CURLAUTH_ANY
+ );
+
+ // If we got false or null, disable authentication
+ if (!$user) {
+ $this->password = $this->username = null;
+ $this->removeHeader('Authorization');
+ $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH);
+ return $this;
+ }
+
+ if (!is_numeric($scheme)) {
+ $scheme = strtolower($scheme);
+ if (!isset($authMap[$scheme])) {
+ throw new InvalidArgumentException($scheme . ' is not a valid authentication type');
+ }
+ $scheme = $authMap[$scheme];
+ }
+
+ $this->username = $user;
+ $this->password = $password;
+
+ // Bypass CURL when using basic auth to promote connection reuse
+ if ($scheme == CURLAUTH_BASIC) {
+ $this->getCurlOptions()->remove(CURLOPT_HTTPAUTH);
+ $this->setHeader('Authorization', 'Basic ' . base64_encode($this->username . ':' . $this->password));
+ } else {
+ $this->getCurlOptions()
+ ->set(CURLOPT_HTTPAUTH, $scheme)
+ ->set(CURLOPT_USERPWD, $this->username . ':' . $this->password);
+ }
+
+ return $this;
+ }
+
+ public function getResource()
+ {
+ $resource = $this->getPath();
+ if ($query = (string) $this->url->getQuery()) {
+ $resource .= '?' . $query;
+ }
+
+ return $resource;
+ }
+
+ public function getUrl($asObject = false)
+ {
+ return $asObject ? clone $this->url : (string) $this->url;
+ }
+
+ public function getState()
+ {
+ return $this->state;
+ }
+
+ public function setState($state, array $context = array())
+ {
+ $oldState = $this->state;
+ $this->state = $state;
+
+ switch ($state) {
+ case self::STATE_NEW:
+ $this->response = null;
+ break;
+ case self::STATE_TRANSFER:
+ if ($oldState !== $state) {
+ // Fix Content-Length and Transfer-Encoding collisions
+ if ($this->hasHeader('Transfer-Encoding') && $this->hasHeader('Content-Length')) {
+ $this->removeHeader('Transfer-Encoding');
+ }
+ $this->dispatch('request.before_send', array('request' => $this));
+ }
+ break;
+ case self::STATE_COMPLETE:
+ if ($oldState !== $state) {
+ $this->processResponse($context);
+ $this->responseBody = null;
+ }
+ break;
+ case self::STATE_ERROR:
+ if (isset($context['exception'])) {
+ $this->dispatch('request.exception', array(
+ 'request' => $this,
+ 'response' => isset($context['response']) ? $context['response'] : $this->response,
+ 'exception' => isset($context['exception']) ? $context['exception'] : null
+ ));
+ }
+ }
+
+ return $this->state;
+ }
+
+ public function getCurlOptions()
+ {
+ return $this->curlOptions;
+ }
+
+ public function startResponse(Response $response)
+ {
+ $this->state = self::STATE_TRANSFER;
+ $response->setEffectiveUrl((string) $this->getUrl());
+ $this->response = $response;
+
+ return $this;
+ }
+
+ public function setResponse(Response $response, $queued = false)
+ {
+ $response->setEffectiveUrl((string) $this->url);
+
+ if ($queued) {
+ $ed = $this->getEventDispatcher();
+ $ed->addListener('request.before_send', $f = function ($e) use ($response, &$f, $ed) {
+ $e['request']->setResponse($response);
+ $ed->removeListener('request.before_send', $f);
+ }, -9999);
+ } else {
+ $this->response = $response;
+ // If a specific response body is specified, then use it instead of the response's body
+ if ($this->responseBody && !$this->responseBody->getCustomData('default') && !$response->isRedirect()) {
+ $this->getResponseBody()->write((string) $this->response->getBody());
+ } else {
+ $this->responseBody = $this->response->getBody();
+ }
+ $this->setState(self::STATE_COMPLETE);
+ }
+
+ return $this;
+ }
+
+ public function setResponseBody($body)
+ {
+ // Attempt to open a file for writing if a string was passed
+ if (is_string($body)) {
+ // @codeCoverageIgnoreStart
+ if (!($body = fopen($body, 'w+'))) {
+ throw new InvalidArgumentException('Could not open ' . $body . ' for writing');
+ }
+ // @codeCoverageIgnoreEnd
+ }
+
+ $this->responseBody = EntityBody::factory($body);
+
+ return $this;
+ }
+
+ public function getResponseBody()
+ {
+ if ($this->responseBody === null) {
+ $this->responseBody = EntityBody::factory()->setCustomData('default', true);
+ }
+
+ return $this->responseBody;
+ }
+
+ /**
+ * Determine if the response body is repeatable (readable + seekable)
+ *
+ * @return bool
+ * @deprecated Use getResponseBody()->isSeekable()
+ * @codeCoverageIgnore
+ */
+ public function isResponseBodyRepeatable()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use $request->getResponseBody()->isRepeatable()');
+ return !$this->responseBody ? true : $this->responseBody->isRepeatable();
+ }
+
+ public function getCookies()
+ {
+ if ($cookie = $this->getHeader('Cookie')) {
+ $data = ParserRegistry::getInstance()->getParser('cookie')->parseCookie($cookie);
+ return $data['cookies'];
+ }
+
+ return array();
+ }
+
+ public function getCookie($name)
+ {
+ $cookies = $this->getCookies();
+
+ return isset($cookies[$name]) ? $cookies[$name] : null;
+ }
+
+ public function addCookie($name, $value)
+ {
+ if (!$this->hasHeader('Cookie')) {
+ $this->setHeader('Cookie', "{$name}={$value}");
+ } else {
+ $this->getHeader('Cookie')->add("{$name}={$value}");
+ }
+
+ // Always use semicolons to separate multiple cookie headers
+ $this->getHeader('Cookie')->setGlue(';');
+
+ return $this;
+ }
+
+ public function removeCookie($name)
+ {
+ if ($cookie = $this->getHeader('Cookie')) {
+ foreach ($cookie as $cookieValue) {
+ if (strpos($cookieValue, $name . '=') === 0) {
+ $cookie->removeValue($cookieValue);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher)
+ {
+ $this->eventDispatcher = $eventDispatcher;
+ $this->eventDispatcher->addListener('request.error', array(__CLASS__, 'onRequestError'), -255);
+
+ return $this;
+ }
+
+ public function getEventDispatcher()
+ {
+ if (!$this->eventDispatcher) {
+ $this->setEventDispatcher(new EventDispatcher());
+ }
+
+ return $this->eventDispatcher;
+ }
+
+ public function dispatch($eventName, array $context = array())
+ {
+ $context['request'] = $this;
+ $this->getEventDispatcher()->dispatch($eventName, new Event($context));
+ }
+
+ public function addSubscriber(EventSubscriberInterface $subscriber)
+ {
+ $this->getEventDispatcher()->addSubscriber($subscriber);
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ * Adds a check for Host header changes
+ */
+ public function addHeader($header, $value)
+ {
+ parent::addHeader($header, $value);
+
+ if ($header == 'host' || $header == 'Host') {
+ $this->setHost((string) $this->getHeader('Host'));
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get an array containing the request and response for event notifications
+ *
+ * @return array
+ */
+ protected function getEventArray()
+ {
+ return array(
+ 'request' => $this,
+ 'response' => $this->response
+ );
+ }
+
+ /**
+ * Process a received response
+ *
+ * @param array $context Contextual information
+ * @throws RequestException|BadResponseException on unsuccessful responses
+ */
+ protected function processResponse(array $context = array())
+ {
+ if (!$this->response) {
+ // If no response, then processResponse shouldn't have been called
+ $e = new RequestException('Error completing request');
+ $e->setRequest($this);
+ throw $e;
+ }
+
+ $this->state = self::STATE_COMPLETE;
+
+ // A request was sent, but we don't know if we'll send more or if the final response will be successful
+ $this->dispatch('request.sent', $this->getEventArray() + $context);
+
+ // Some response processors will remove the response or reset the state (example: ExponentialBackoffPlugin)
+ if ($this->state == RequestInterface::STATE_COMPLETE) {
+
+ // The request completed, so the HTTP transaction is complete
+ $this->dispatch('request.complete', $this->getEventArray());
+
+ // If the response is bad, allow listeners to modify it or throw exceptions. You can change the response by
+ // modifying the Event object in your listeners or calling setResponse() on the request
+ if ($this->response->isError()) {
+ $event = new Event($this->getEventArray());
+ $this->getEventDispatcher()->dispatch('request.error', $event);
+ // Allow events of request.error to quietly change the response
+ if ($event['response'] !== $this->response) {
+ $this->response = $event['response'];
+ }
+ }
+
+ // If a successful response was received, dispatch an event
+ if ($this->response->isSuccessful()) {
+ $this->dispatch('request.success', $this->getEventArray());
+ }
+ }
+ }
+
+ /**
+ * @deprecated Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy
+ * @codeCoverageIgnore
+ */
+ public function canCache()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use Guzzle\Plugin\Cache\DefaultCanCacheStrategy.');
+ if (class_exists('Guzzle\Plugin\Cache\DefaultCanCacheStrategy')) {
+ $canCache = new \Guzzle\Plugin\Cache\DefaultCanCacheStrategy();
+ return $canCache->canCacheRequest($this);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @deprecated Use the history plugin (not emitting a warning as this is built-into the RedirectPlugin for now)
+ * @codeCoverageIgnore
+ */
+ public function setIsRedirect($isRedirect)
+ {
+ $this->isRedirect = $isRedirect;
+
+ return $this;
+ }
+
+ /**
+ * @deprecated Use the history plugin
+ * @codeCoverageIgnore
+ */
+ public function isRedirect()
+ {
+ Version::warn(__METHOD__ . ' is deprecated. Use the HistoryPlugin to track this.');
+ return $this->isRedirect;
+ }
+}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/RequestFactory.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/RequestFactory.php
new file mode 100644
index 0000000000..f14d0879c3
--- /dev/null
+++ b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/RequestFactory.php
@@ -0,0 +1,336 @@
+methods = array_flip(get_class_methods(__CLASS__));
+ }
+
+ public function fromMessage($message)
+ {
+ $parsed = ParserRegistry::getInstance()->getParser('message')->parseRequest($message);
+
+ if (!$parsed) {
+ return false;
+ }
+
+ $request = $this->fromParts($parsed['method'], $parsed['request_url'],
+ $parsed['headers'], $parsed['body'], $parsed['protocol'],
+ $parsed['version']);
+
+ // EntityEnclosingRequest adds an "Expect: 100-Continue" header when using a raw request body for PUT or POST
+ // requests. This factory method should accurately reflect the message, so here we are removing the Expect
+ // header if one was not supplied in the message.
+ if (!isset($parsed['headers']['Expect']) && !isset($parsed['headers']['expect'])) {
+ $request->removeHeader('Expect');
+ }
+
+ return $request;
+ }
+
+ public function fromParts(
+ $method,
+ array $urlParts,
+ $headers = null,
+ $body = null,
+ $protocol = 'HTTP',
+ $protocolVersion = '1.1'
+ ) {
+ return $this->create($method, Url::buildUrl($urlParts), $headers, $body)
+ ->setProtocolVersion($protocolVersion);
+ }
+
+ public function create($method, $url, $headers = null, $body = null, array $options = array())
+ {
+ $method = strtoupper($method);
+
+ if ($method == 'GET' || $method == 'HEAD' || $method == 'TRACE' || $method == 'OPTIONS') {
+ // Handle non-entity-enclosing request methods
+ $request = new $this->requestClass($method, $url, $headers);
+ if ($body) {
+ // The body is where the response body will be stored
+ $type = gettype($body);
+ if ($type == 'string' || $type == 'resource' || $type == 'object') {
+ $request->setResponseBody($body);
+ }
+ }
+ } else {
+ // Create an entity enclosing request by default
+ $request = new $this->entityEnclosingRequestClass($method, $url, $headers);
+ if ($body) {
+ // Add POST fields and files to an entity enclosing request if an array is used
+ if (is_array($body) || $body instanceof Collection) {
+ // Normalize PHP style cURL uploads with a leading '@' symbol
+ foreach ($body as $key => $value) {
+ if (is_string($value) && substr($value, 0, 1) == '@') {
+ $request->addPostFile($key, $value);
+ unset($body[$key]);
+ }
+ }
+ // Add the fields if they are still present and not all files
+ $request->addPostFields($body);
+ } else {
+ // Add a raw entity body body to the request
+ $request->setBody($body, (string) $request->getHeader('Content-Type'));
+ if ((string) $request->getHeader('Transfer-Encoding') == 'chunked') {
+ $request->removeHeader('Content-Length');
+ }
+ }
+ }
+ }
+
+ if ($options) {
+ $this->applyOptions($request, $options);
+ }
+
+ return $request;
+ }
+
+ /**
+ * Clone a request while changing the method. Emulates the behavior of
+ * {@see Guzzle\Http\Message\Request::clone}, but can change the HTTP method.
+ *
+ * @param RequestInterface $request Request to clone
+ * @param string $method Method to set
+ *
+ * @return RequestInterface
+ */
+ public function cloneRequestWithMethod(RequestInterface $request, $method)
+ {
+ // Create the request with the same client if possible
+ if ($client = $request->getClient()) {
+ $cloned = $request->getClient()->createRequest($method, $request->getUrl(), $request->getHeaders());
+ } else {
+ $cloned = $this->create($method, $request->getUrl(), $request->getHeaders());
+ }
+
+ $cloned->getCurlOptions()->replace($request->getCurlOptions()->toArray());
+ $cloned->setEventDispatcher(clone $request->getEventDispatcher());
+ // Ensure that that the Content-Length header is not copied if changing to GET or HEAD
+ if (!($cloned instanceof EntityEnclosingRequestInterface)) {
+ $cloned->removeHeader('Content-Length');
+ } elseif ($request instanceof EntityEnclosingRequestInterface) {
+ $cloned->setBody($request->getBody());
+ }
+ $cloned->getParams()->replace($request->getParams()->toArray());
+ $cloned->dispatch('request.clone', array('request' => $cloned));
+
+ return $cloned;
+ }
+
+ public function applyOptions(RequestInterface $request, array $options = array(), $flags = self::OPTIONS_NONE)
+ {
+ // Iterate over each key value pair and attempt to apply a config using function visitors
+ foreach ($options as $key => $value) {
+ $method = "visit_{$key}";
+ if (isset($this->methods[$method])) {
+ $this->{$method}($request, $value, $flags);
+ }
+ }
+ }
+
+ protected function visit_headers(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('headers value must be an array');
+ }
+
+ if ($flags & self::OPTIONS_AS_DEFAULTS) {
+ // Merge headers in but do not overwrite existing values
+ foreach ($value as $key => $header) {
+ if (!$request->hasHeader($key)) {
+ $request->setHeader($key, $header);
+ }
+ }
+ } else {
+ $request->addHeaders($value);
+ }
+ }
+
+ protected function visit_body(RequestInterface $request, $value, $flags)
+ {
+ if ($request instanceof EntityEnclosingRequestInterface) {
+ $request->setBody($value);
+ } else {
+ throw new InvalidArgumentException('Attempting to set a body on a non-entity-enclosing request');
+ }
+ }
+
+ protected function visit_allow_redirects(RequestInterface $request, $value, $flags)
+ {
+ if ($value === false) {
+ $request->getParams()->set(RedirectPlugin::DISABLE, true);
+ }
+ }
+
+ protected function visit_auth(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('auth value must be an array');
+ }
+
+ $request->setAuth($value[0], isset($value[1]) ? $value[1] : null, isset($value[2]) ? $value[2] : 'basic');
+ }
+
+ protected function visit_query(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('query value must be an array');
+ }
+
+ if ($flags & self::OPTIONS_AS_DEFAULTS) {
+ // Merge query string values in but do not overwrite existing values
+ $query = $request->getQuery();
+ $query->overwriteWith(array_diff_key($value, $query->toArray()));
+ } else {
+ $request->getQuery()->overwriteWith($value);
+ }
+ }
+
+ protected function visit_cookies(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('cookies value must be an array');
+ }
+
+ foreach ($value as $name => $v) {
+ $request->addCookie($name, $v);
+ }
+ }
+
+ protected function visit_events(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('events value must be an array');
+ }
+
+ foreach ($value as $name => $method) {
+ if (is_array($method)) {
+ $request->getEventDispatcher()->addListener($name, $method[0], $method[1]);
+ } else {
+ $request->getEventDispatcher()->addListener($name, $method);
+ }
+ }
+ }
+
+ protected function visit_plugins(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('plugins value must be an array');
+ }
+
+ foreach ($value as $plugin) {
+ $request->addSubscriber($plugin);
+ }
+ }
+
+ protected function visit_exceptions(RequestInterface $request, $value, $flags)
+ {
+ if ($value === false || $value === 0) {
+ $dispatcher = $request->getEventDispatcher();
+ foreach ($dispatcher->getListeners('request.error') as $listener) {
+ if ($listener[0] == 'Guzzle\Http\Message\Request' && $listener[1] = 'onRequestError') {
+ $dispatcher->removeListener('request.error', $listener);
+ break;
+ }
+ }
+ }
+ }
+
+ protected function visit_save_to(RequestInterface $request, $value, $flags)
+ {
+ $request->setResponseBody($value);
+ }
+
+ protected function visit_params(RequestInterface $request, $value, $flags)
+ {
+ if (!is_array($value)) {
+ throw new InvalidArgumentException('params value must be an array');
+ }
+
+ $request->getParams()->overwriteWith($value);
+ }
+
+ protected function visit_timeout(RequestInterface $request, $value, $flags)
+ {
+ $request->getCurlOptions()->set(CURLOPT_TIMEOUT_MS, $value * 1000);
+ }
+
+ protected function visit_connect_timeout(RequestInterface $request, $value, $flags)
+ {
+ $request->getCurlOptions()->set(CURLOPT_CONNECTTIMEOUT_MS, $value * 1000);
+ }
+
+ protected function visit_debug(RequestInterface $request, $value, $flags)
+ {
+ if (class_exists('Guzzle\Plugin\Log\LogPlugin')) {
+ $request->addSubscriber(LogPlugin::getDebugPlugin());
+ } else {
+ // @codeCoverageIgnoreStart
+ $request->getCurlOptions()->set(CURLOPT_VERBOSE, true);
+ // @codeCoverageIgnoreEnd
+ }
+ }
+
+ protected function visit_verify(RequestInterface $request, $value, $flags)
+ {
+ $curl = $request->getCurlOptions();
+ if ($value === true || is_string($value)) {
+ $curl[CURLOPT_SSL_VERIFYHOST] = 2;
+ $curl[CURLOPT_SSL_VERIFYPEER] = true;
+ if ($value !== true) {
+ $curl[CURLOPT_CAINFO] = $value;
+ }
+ } elseif ($value === false) {
+ unset($curl[CURLOPT_CAINFO]);
+ $curl[CURLOPT_SSL_VERIFYHOST] = 0;
+ $curl[CURLOPT_SSL_VERIFYPEER] = false;
+ }
+ }
+
+ protected function visit_proxy(RequestInterface $request, $value, $flags)
+ {
+ $request->getCurlOptions()->set(CURLOPT_PROXY, $value, $flags);
+ }
+}
diff --git a/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/RequestFactoryInterface.php b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/RequestFactoryInterface.php
new file mode 100644
index 0000000000..5f31b5060b
--- /dev/null
+++ b/apps/files_external/3rdparty/aws-sdk-php/Guzzle/Http/Message/RequestFactoryInterface.php
@@ -0,0 +1,99 @@
+ 'Continue',
+ 101 => 'Switching Protocols',
+ 102 => 'Processing',
+ 200 => 'OK',
+ 201 => 'Created',
+ 202 => 'Accepted',
+ 203 => 'Non-Authoritative Information',
+ 204 => 'No Content',
+ 205 => 'Reset Content',
+ 206 => 'Partial Content',
+ 207 => 'Multi-Status',
+ 208 => 'Already Reported',
+ 226 => 'IM Used',
+ 300 => 'Multiple Choices',
+ 301 => 'Moved Permanently',
+ 302 => 'Found',
+ 303 => 'See Other',
+ 304 => 'Not Modified',
+ 305 => 'Use Proxy',
+ 307 => 'Temporary Redirect',
+ 308 => 'Permanent Redirect',
+ 400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Timeout',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Long',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Requested Range Not Satisfiable',
+ 417 => 'Expectation Failed',
+ 422 => 'Unprocessable Entity',
+ 423 => 'Locked',
+ 424 => 'Failed Dependency',
+ 425 => 'Reserved for WebDAV advanced collections expired proposal',
+ 426 => 'Upgrade required',
+ 428 => 'Precondition Required',
+ 429 => 'Too Many Requests',
+ 431 => 'Request Header Fields Too Large',
+ 500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Timeout',
+ 505 => 'HTTP Version Not Supported',
+ 506 => 'Variant Also Negotiates (Experimental)',
+ 507 => 'Insufficient Storage',
+ 508 => 'Loop Detected',
+ 510 => 'Not Extended',
+ 511 => 'Network Authentication Required',
+ );
+
+ /** @var EntityBodyInterface The response body */
+ protected $body;
+
+ /** @var string The reason phrase of the response (human readable code) */
+ protected $reasonPhrase;
+
+ /** @var string The status code of the response */
+ protected $statusCode;
+
+ /** @var array Information about the request */
+ protected $info = array();
+
+ /** @var string The effective URL that returned this response */
+ protected $effectiveUrl;
+
+ /** @var array Cacheable response codes (see RFC 2616:13.4) */
+ protected static $cacheResponseCodes = array(200, 203, 206, 300, 301, 410);
+
+ /**
+ * Create a new Response based on a raw response message
+ *
+ * @param string $message Response message
+ *
+ * @return self|bool Returns false on error
+ */
+ public static function fromMessage($message)
+ {
+ $data = ParserRegistry::getInstance()->getParser('message')->parseResponse($message);
+ if (!$data) {
+ return false;
+ }
+
+ $response = new static($data['code'], $data['headers'], $data['body']);
+ $response->setProtocol($data['protocol'], $data['version'])
+ ->setStatus($data['code'], $data['reason_phrase']);
+
+ // Set the appropriate Content-Length if the one set is inaccurate (e.g. setting to X)
+ $contentLength = (string) $response->getHeader('Content-Length');
+ $actualLength = strlen($data['body']);
+ if (strlen($data['body']) > 0 && $contentLength != $actualLength) {
+ $response->setHeader('Content-Length', $actualLength);
+ }
+
+ return $response;
+ }
+
+ /**
+ * Construct the response
+ *
+ * @param string $statusCode The response status code (e.g. 200, 404, etc)
+ * @param ToArrayInterface|array $headers The response headers
+ * @param string|resource|EntityBodyInterface $body The body of the response
+ *
+ * @throws BadResponseException if an invalid response code is given
+ */
+ public function __construct($statusCode, $headers = null, $body = null)
+ {
+ parent::__construct();
+ $this->setStatus($statusCode);
+ $this->body = EntityBody::factory($body !== null ? $body : '');
+
+ if ($headers) {
+ if (is_array($headers)) {
+ $this->setHeaders($headers);
+ } elseif ($headers instanceof ToArrayInterface) {
+ $this->setHeaders($headers->toArray());
+ } else {
+ throw new BadResponseException('Invalid headers argument received');
+ }
+ }
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getMessage();
+ }
+
+ public function serialize()
+ {
+ return json_encode(array(
+ 'status' => $this->statusCode,
+ 'body' => (string) $this->body,
+ 'headers' => $this->headers->toArray()
+ ));
+ }
+
+ public function unserialize($serialize)
+ {
+ $data = json_decode($serialize, true);
+ $this->__construct($data['status'], $data['headers'], $data['body']);
+ }
+
+ /**
+ * Get the response entity body
+ *
+ * @param bool $asString Set to TRUE to return a string of the body rather than a full body object
+ *
+ * @return EntityBodyInterface|string
+ */
+ public function getBody($asString = false)
+ {
+ return $asString ? (string) $this->body : $this->body;
+ }
+
+ /**
+ * Set the response entity body
+ *
+ * @param EntityBodyInterface|string $body Body to set
+ *
+ * @return self
+ */
+ public function setBody($body)
+ {
+ $this->body = EntityBody::factory($body);
+
+ return $this;
+ }
+
+ /**
+ * Set the protocol and protocol version of the response
+ *
+ * @param string $protocol Response protocol
+ * @param string $version Protocol version
+ *
+ * @return self
+ */
+ public function setProtocol($protocol, $version)
+ {
+ $this->protocol = $protocol;
+ $this->protocolVersion = $version;
+
+ return $this;
+ }
+
+ /**
+ * Get the protocol used for the response (e.g. HTTP)
+ *
+ * @return string
+ */
+ public function getProtocol()
+ {
+ return $this->protocol;
+ }
+
+ /**
+ * Get the HTTP protocol version
+ *
+ * @return string
+ */
+ public function getProtocolVersion()
+ {
+ return $this->protocolVersion;
+ }
+
+ /**
+ * Get a cURL transfer information
+ *
+ * @param string $key A single statistic to check
+ *
+ * @return array|string|null Returns all stats if no key is set, a single stat if a key is set, or null if a key
+ * is set and not found
+ * @link http://www.php.net/manual/en/function.curl-getinfo.php
+ */
+ public function getInfo($key = null)
+ {
+ if ($key === null) {
+ return $this->info;
+ } elseif (array_key_exists($key, $this->info)) {
+ return $this->info[$key];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Set the transfer information
+ *
+ * @param array $info Array of cURL transfer stats
+ *
+ * @return self
+ */
+ public function setInfo(array $info)
+ {
+ $this->info = $info;
+
+ return $this;
+ }
+
+ /**
+ * Set the response status
+ *
+ * @param int $statusCode Response status code to set
+ * @param string $reasonPhrase Response reason phrase
+ *
+ * @return self
+ * @throws BadResponseException when an invalid response code is received
+ */
+ public function setStatus($statusCode, $reasonPhrase = '')
+ {
+ $this->statusCode = (int) $statusCode;
+
+ if (!$reasonPhrase && isset(self::$statusTexts[$this->statusCode])) {
+ $this->reasonPhrase = self::$statusTexts[$this->statusCode];
+ } else {
+ $this->reasonPhrase = $reasonPhrase;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get the response status code
+ *
+ * @return integer
+ */
+ public function getStatusCode()
+ {
+ return $this->statusCode;
+ }
+
+ /**
+ * Get the entire response as a string
+ *
+ * @return string
+ */
+ public function getMessage()
+ {
+ $message = $this->getRawHeaders();
+
+ // Only include the body in the message if the size is < 2MB
+ $size = $this->body->getSize();
+ if ($size < 2097152) {
+ $message .= (string) $this->body;
+ }
+
+ return $message;
+ }
+
+ /**
+ * Get the the raw message headers as a string
+ *
+ * @return string
+ */
+ public function getRawHeaders()
+ {
+ $headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . "\r\n";
+ $lines = $this->getHeaderLines();
+ if (!empty($lines)) {
+ $headers .= implode("\r\n", $lines) . "\r\n";
+ }
+
+ return $headers . "\r\n";
+ }
+
+ /**
+ * Get the response reason phrase- a human readable version of the numeric
+ * status code
+ *
+ * @return string
+ */
+ public function getReasonPhrase()
+ {
+ return $this->reasonPhrase;
+ }
+
+ /**
+ * Get the Accept-Ranges HTTP header
+ *
+ * @return string Returns what partial content range types this server supports.
+ */
+ public function getAcceptRanges()
+ {
+ return (string) $this->getHeader('Accept-Ranges');
+ }
+
+ /**
+ * Calculate the age of the response
+ *
+ * @return integer
+ */
+ public function calculateAge()
+ {
+ $age = $this->getHeader('Age');
+
+ if ($age === null && $this->getDate()) {
+ $age = time() - strtotime($this->getDate());
+ }
+
+ return $age === null ? null : (int) (string) $age;
+ }
+
+ /**
+ * Get the Age HTTP header
+ *
+ * @return integer|null Returns the age the object has been in a proxy cache in seconds.
+ */
+ public function getAge()
+ {
+ return (string) $this->getHeader('Age');
+ }
+
+ /**
+ * Get the Allow HTTP header
+ *
+ * @return string|null Returns valid actions for a specified resource. To be used for a 405 Method not allowed.
+ */
+ public function getAllow()
+ {
+ return (string) $this->getHeader('Allow');
+ }
+
+ /**
+ * Check if an HTTP method is allowed by checking the Allow response header
+ *
+ * @param string $method Method to check
+ *
+ * @return bool
+ */
+ public function isMethodAllowed($method)
+ {
+ $allow = $this->getHeader('Allow');
+ if ($allow) {
+ foreach (explode(',', $allow) as $allowable) {
+ if (!strcasecmp(trim($allowable), $method)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the Cache-Control HTTP header
+ *
+ * @return string
+ */
+ public function getCacheControl()
+ {
+ return (string) $this->getHeader('Cache-Control');
+ }
+
+ /**
+ * Get the Connection HTTP header
+ *
+ * @return string
+ */
+ public function getConnection()
+ {
+ return (string) $this->getHeader('Connection');
+ }
+
+ /**
+ * Get the Content-Encoding HTTP header
+ *
+ * @return string|null
+ */
+ public function getContentEncoding()
+ {
+ return (string) $this->getHeader('Content-Encoding');
+ }
+
+ /**
+ * Get the Content-Language HTTP header
+ *
+ * @return string|null Returns the language the content is in.
+ */
+ public function getContentLanguage()
+ {
+ return (string) $this->getHeader('Content-Language');
+ }
+
+ /**
+ * Get the Content-Length HTTP header
+ *
+ * @return integer Returns the length of the response body in bytes
+ */
+ public function getContentLength()
+ {
+ return (int) (string) $this->getHeader('Content-Length');
+ }
+
+ /**
+ * Get the Content-Location HTTP header
+ *
+ * @return string|null Returns an alternate location for the returned data (e.g /index.htm)
+ */
+ public function getContentLocation()
+ {
+ return (string) $this->getHeader('Content-Location');
+ }
+
+ /**
+ * Get the Content-Disposition HTTP header
+ *
+ * @return string|null Returns the Content-Disposition header
+ */
+ public function getContentDisposition()
+ {
+ return (string) $this->getHeader('Content-Disposition');
+ }
+
+ /**
+ * Get the Content-MD5 HTTP header
+ *
+ * @return string|null Returns a Base64-encoded binary MD5 sum of the content of the response.
+ */
+ public function getContentMd5()
+ {
+ return (string) $this->getHeader('Content-MD5');
+ }
+
+ /**
+ * Get the Content-Range HTTP header
+ *
+ * @return string Returns where in a full body message this partial message belongs (e.g. bytes 21010-47021/47022).
+ */
+ public function getContentRange()
+ {
+ return (string) $this->getHeader('Content-Range');
+ }
+
+ /**
+ * Get the Content-Type HTTP header
+ *
+ * @return string Returns the mime type of this content.
+ */
+ public function getContentType()
+ {
+ return (string) $this->getHeader('Content-Type');
+ }
+
+ /**
+ * Checks if the Content-Type is of a certain type. This is useful if the
+ * Content-Type header contains charset information and you need to know if
+ * the Content-Type matches a particular type.
+ *
+ * @param string $type Content type to check against
+ *
+ * @return bool
+ */
+ public function isContentType($type)
+ {
+ return stripos($this->getHeader('Content-Type'), $type) !== false;
+ }
+
+ /**
+ * Get the Date HTTP header
+ *
+ * @return string|null Returns the date and time that the message was sent.
+ */
+ public function getDate()
+ {
+ return (string) $this->getHeader('Date');
+ }
+
+ /**
+ * Get the ETag HTTP header
+ *
+ * @return string|null Returns an identifier for a specific version of a resource, often a Message digest.
+ */
+ public function getEtag()
+ {
+ return (string) $this->getHeader('ETag');
+ }
+
+ /**
+ * Get the Expires HTTP header
+ *
+ * @return string|null Returns the date/time after which the response is considered stale.
+ */
+ public function getExpires()
+ {
+ return (string) $this->getHeader('Expires');
+ }
+
+ /**
+ * Get the Last-Modified HTTP header
+ *
+ * @return string|null Returns the last modified date for the requested object, in RFC 2822 format
+ * (e.g. Tue, 15 Nov 1994 12:45:26 GMT)
+ */
+ public function getLastModified()
+ {
+ return (string) $this->getHeader('Last-Modified');
+ }
+
+ /**
+ * Get the Location HTTP header
+ *
+ * @return string|null Used in redirection, or when a new resource has been created.
+ */
+ public function getLocation()
+ {
+ return (string) $this->getHeader('Location');
+ }
+
+ /**
+ * Get the Pragma HTTP header
+ *
+ * @return Header|null Returns the implementation-specific headers that may have various effects anywhere along
+ * the request-response chain.
+ */
+ public function getPragma()
+ {
+ return (string) $this->getHeader('Pragma');
+ }
+
+ /**
+ * Get the Proxy-Authenticate HTTP header
+ *
+ * @return string|null Authentication to access the proxy (e.g. Basic)
+ */
+ public function getProxyAuthenticate()
+ {
+ return (string) $this->getHeader('Proxy-Authenticate');
+ }
+
+ /**
+ * Get the Retry-After HTTP header
+ *
+ * @return int|null If an entity is temporarily unavailable, this instructs the client to try again after a
+ * specified period of time.
+ */
+ public function getRetryAfter()
+ {
+ return (string) $this->getHeader('Retry-After');
+ }
+
+ /**
+ * Get the Server HTTP header
+ *
+ * @return string|null A name for the server
+ */
+ public function getServer()
+ {
+ return (string) $this->getHeader('Server');
+ }
+
+ /**
+ * Get the Set-Cookie HTTP header
+ *
+ * @return string|null An HTTP cookie.
+ */
+ public function getSetCookie()
+ {
+ return (string) $this->getHeader('Set-Cookie');
+ }
+
+ /**
+ * Get the Trailer HTTP header
+ *
+ * @return string|null The Trailer general field value indicates that the given set of header fields is present in
+ * the trailer of a message encoded with chunked transfer-coding.
+ */
+ public function getTrailer()
+ {
+ return (string) $this->getHeader('Trailer');
+ }
+
+ /**
+ * Get the Transfer-Encoding HTTP header
+ *
+ * @return string|null The form of encoding used to safely transfer the entity to the user
+ */
+ public function getTransferEncoding()
+ {
+ return (string) $this->getHeader('Transfer-Encoding');
+ }
+
+ /**
+ * Get the Vary HTTP header
+ *
+ * @return string|null Tells downstream proxies how to match future request headers to decide whether the cached
+ * response can be used rather than requesting a fresh one from the origin server.
+ */
+ public function getVary()
+ {
+ return (string) $this->getHeader('Vary');
+ }
+
+ /**
+ * Get the Via HTTP header
+ *
+ * @return string|null Informs the client of proxies through which the response was sent.
+ */
+ public function getVia()
+ {
+ return (string) $this->getHeader('Via');
+ }
+
+ /**
+ * Get the Warning HTTP header
+ *
+ * @return string|null A general warning about possible problems with the entity body
+ */
+ public function getWarning()
+ {
+ return (string) $this->getHeader('Warning');
+ }
+
+ /**
+ * Get the WWW-Authenticate HTTP header
+ *
+ * @return string|null Indicates the authentication scheme that should be used to access the requested entity
+ */
+ public function getWwwAuthenticate()
+ {
+ return (string) $this->getHeader('WWW-Authenticate');
+ }
+
+ /**
+ * Checks if HTTP Status code is a Client Error (4xx)
+ *
+ * @return bool
+ */
+ public function isClientError()
+ {
+ return $this->statusCode >= 400 && $this->statusCode < 500;
+ }
+
+ /**
+ * Checks if HTTP Status code is Server OR Client Error (4xx or 5xx)
+ *
+ * @return boolean
+ */
+ public function isError()
+ {
+ return $this->isClientError() || $this->isServerError();
+ }
+
+ /**
+ * Checks if HTTP Status code is Information (1xx)
+ *
+ * @return bool
+ */
+ public function isInformational()
+ {
+ return $this->statusCode < 200;
+ }
+
+ /**
+ * Checks if HTTP Status code is a Redirect (3xx)
+ *
+ * @return bool
+ */
+ public function isRedirect()
+ {
+ return $this->statusCode >= 300 && $this->statusCode < 400;
+ }
+
+ /**
+ * Checks if HTTP Status code is Server Error (5xx)
+ *
+ * @return bool
+ */
+ public function isServerError()
+ {
+ return $this->statusCode >= 500 && $this->statusCode < 600;
+ }
+
+ /**
+ * Checks if HTTP Status code is Successful (2xx | 304)
+ *
+ * @return bool
+ */
+ public function isSuccessful()
+ {
+ return ($this->statusCode >= 200 && $this->statusCode < 300) || $this->statusCode == 304;
+ }
+
+ /**
+ * Check if the response can be cached based on the response headers
+ *
+ * @return bool Returns TRUE if the response can be cached or false if not
+ */
+ public function canCache()
+ {
+ // Check if the response is cacheable based on the code
+ if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
+ return false;
+ }
+
+ // Make sure a valid body was returned and can be cached
+ if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
+ && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
+ return false;
+ }
+
+ // Never cache no-store resources (this is a private cache, so private
+ // can be cached)
+ if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
+ return false;
+ }
+
+ return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
+ }
+
+ /**
+ * Gets the number of seconds from the current time in which this response is still considered fresh
+ *
+ * @return int|null Returns the number of seconds
+ */
+ public function getMaxAge()
+ {
+ if ($header = $this->getHeader('Cache-Control')) {
+ // s-max-age, then max-age, then Expires
+ if ($age = $header->getDirective('s-maxage')) {
+ return $age;
+ }
+ if ($age = $header->getDirective('max-age')) {
+ return $age;
+ }
+ }
+
+ if ($this->getHeader('Expires')) {
+ return strtotime($this->getExpires()) - time();
+ }
+
+ return null;
+ }
+
+ /**
+ * Check if the response is considered fresh.
+ *
+ * A response is considered fresh when its age is less than or equal to the freshness lifetime (maximum age) of the
+ * response.
+ *
+ * @return bool|null
+ */
+ public function isFresh()
+ {
+ $fresh = $this->getFreshness();
+
+ return $fresh === null ? null : $fresh >= 0;
+ }
+
+ /**
+ * Check if the response can be validated against the origin server using a conditional GET request.
+ *
+ * @return bool
+ */
+ public function canValidate()
+ {
+ return $this->getEtag() || $this->getLastModified();
+ }
+
+ /**
+ * Get the freshness of the response by returning the difference of the maximum lifetime of the response and the
+ * age of the response (max-age - age).
+ *
+ * Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired.
+ * Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL
+ * result means that no freshness information is available.
+ *
+ * @return int
+ */
+ public function getFreshness()
+ {
+ $maxAge = $this->getMaxAge();
+ $age = $this->calculateAge();
+
+ return $maxAge && $age ? ($maxAge - $age) : null;
+ }
+
+ /**
+ * Parse the JSON response body and return an array
+ *
+ * @return array|string|int|bool|float
+ * @throws RuntimeException if the response body is not in JSON format
+ */
+ public function json()
+ {
+ $data = json_decode((string) $this->body, true);
+ if (JSON_ERROR_NONE !== json_last_error()) {
+ throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error());
+ }
+
+ return $data === null ? array() : $data;
+ }
+
+ /**
+ * Parse the XML response body and return a SimpleXMLElement
+ *
+ * @return \SimpleXMLElement
+ * @throws RuntimeException if the response body is not in XML format
+ */
+ public function xml()
+ {
+ try {
+ // Allow XML to be retrieved even if there is no response body
+ $xml = new \SimpleXMLElement((string) $this->body ?: ''); + } diff --git a/apps/files_external/3rdparty/google-api-php-client/src/Google_Client.php b/apps/files_external/3rdparty/google-api-php-client/src/Google_Client.php new file mode 100644 index 0000000000..498d3a8e9d --- /dev/null +++ b/apps/files_external/3rdparty/google-api-php-client/src/Google_Client.php @@ -0,0 +1,462 @@ + + * @author Chirag Shah
+ * $driveService = new Google_DriveService(...);
+ * $apps = $driveService->apps;
+ *
+ */
+ class Google_AppsServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Gets a specific app. (apps.get)
+ *
+ * @param string $appId The ID of the app.
+ * @param array $optParams Optional parameters.
+ * @return Google_App
+ */
+ public function get($appId, $optParams = array()) {
+ $params = array('appId' => $appId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_App($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a user's installed apps. (apps.list)
+ *
+ * @param array $optParams Optional parameters.
+ * @return Google_AppList
+ */
+ public function listApps($optParams = array()) {
+ $params = array();
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_AppList($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "changes" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $changes = $driveService->changes;
+ *
+ */
+ class Google_ChangesServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Gets a specific change. (changes.get)
+ *
+ * @param string $changeId The ID of the change.
+ * @param array $optParams Optional parameters.
+ * @return Google_Change
+ */
+ public function get($changeId, $optParams = array()) {
+ $params = array('changeId' => $changeId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_Change($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists the changes for a user. (changes.list)
+ *
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool includeDeleted Whether to include deleted items.
+ * @opt_param bool includeSubscribed Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.
+ * @opt_param int maxResults Maximum number of changes to return.
+ * @opt_param string pageToken Page token for changes.
+ * @opt_param string startChangeId Change ID to start listing changes from.
+ * @return Google_ChangeList
+ */
+ public function listChanges($optParams = array()) {
+ $params = array();
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_ChangeList($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "children" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $children = $driveService->children;
+ *
+ */
+ class Google_ChildrenServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Removes a child from a folder. (children.delete)
+ *
+ * @param string $folderId The ID of the folder.
+ * @param string $childId The ID of the child.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($folderId, $childId, $optParams = array()) {
+ $params = array('folderId' => $folderId, 'childId' => $childId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a specific child reference. (children.get)
+ *
+ * @param string $folderId The ID of the folder.
+ * @param string $childId The ID of the child.
+ * @param array $optParams Optional parameters.
+ * @return Google_ChildReference
+ */
+ public function get($folderId, $childId, $optParams = array()) {
+ $params = array('folderId' => $folderId, 'childId' => $childId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_ChildReference($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Inserts a file into a folder. (children.insert)
+ *
+ * @param string $folderId The ID of the folder.
+ * @param Google_ChildReference $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_ChildReference
+ */
+ public function insert($folderId, Google_ChildReference $postBody, $optParams = array()) {
+ $params = array('folderId' => $folderId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_ChildReference($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a folder's children. (children.list)
+ *
+ * @param string $folderId The ID of the folder.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param int maxResults Maximum number of children to return.
+ * @opt_param string pageToken Page token for children.
+ * @opt_param string q Query string for searching children.
+ * @return Google_ChildList
+ */
+ public function listChildren($folderId, $optParams = array()) {
+ $params = array('folderId' => $folderId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_ChildList($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "comments" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $comments = $driveService->comments;
+ *
+ */
+ class Google_CommentsServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Deletes a comment. (comments.delete)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($fileId, $commentId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a comment by ID. (comments.get)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool includeDeleted If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.
+ * @return Google_Comment
+ */
+ public function get($fileId, $commentId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_Comment($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Creates a new comment on the given file. (comments.insert)
+ *
+ * @param string $fileId The ID of the file.
+ * @param Google_Comment $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_Comment
+ */
+ public function insert($fileId, Google_Comment $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_Comment($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a file's comments. (comments.list)
+ *
+ * @param string $fileId The ID of the file.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool includeDeleted If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.
+ * @opt_param int maxResults The maximum number of discussions to include in the response, used for paging.
+ * @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
+ * @opt_param string updatedMin Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.
+ * @return Google_CommentList
+ */
+ public function listComments($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_CommentList($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates an existing comment. This method supports patch semantics. (comments.patch)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param Google_Comment $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_Comment
+ */
+ public function patch($fileId, $commentId, Google_Comment $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('patch', array($params));
+ if ($this->useObjects()) {
+ return new Google_Comment($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates an existing comment. (comments.update)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param Google_Comment $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_Comment
+ */
+ public function update($fileId, $commentId, Google_Comment $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('update', array($params));
+ if ($this->useObjects()) {
+ return new Google_Comment($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "files" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $files = $driveService->files;
+ *
+ */
+ class Google_FilesServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Creates a copy of the specified file. (files.copy)
+ *
+ * @param string $fileId The ID of the file to copy.
+ * @param Google_DriveFile $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
+ * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
+ * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
+ * @opt_param bool pinned Whether to pin the head revision of the new copy.
+ * @opt_param string timedTextLanguage The language of the timed text.
+ * @opt_param string timedTextTrackName The timed text track name.
+ * @return Google_DriveFile
+ */
+ public function copy($fileId, Google_DriveFile $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('copy', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Permanently deletes a file by ID. Skips the trash. (files.delete)
+ *
+ * @param string $fileId The ID of the file to delete.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a file's metadata by ID. (files.get)
+ *
+ * @param string $fileId The ID for the file in question.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string projection This parameter is deprecated and has no function.
+ * @opt_param bool updateViewedDate Whether to update the view date after successfully retrieving the file.
+ * @return Google_DriveFile
+ */
+ public function get($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Insert a new file. (files.insert)
+ *
+ * @param Google_DriveFile $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
+ * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
+ * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
+ * @opt_param bool pinned Whether to pin the head revision of the uploaded file.
+ * @opt_param string timedTextLanguage The language of the timed text.
+ * @opt_param string timedTextTrackName The timed text track name.
+ * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text.
+ * @return Google_DriveFile
+ */
+ public function insert(Google_DriveFile $postBody, $optParams = array()) {
+ $params = array('postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists the user's files. (files.list)
+ *
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param int maxResults Maximum number of files to return.
+ * @opt_param string pageToken Page token for files.
+ * @opt_param string projection This parameter is deprecated and has no function.
+ * @opt_param string q Query string for searching files.
+ * @return Google_FileList
+ */
+ public function listFiles($optParams = array()) {
+ $params = array();
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_FileList($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates file metadata and/or content. This method supports patch semantics. (files.patch)
+ *
+ * @param string $fileId The ID of the file to update.
+ * @param Google_DriveFile $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
+ * @opt_param bool newRevision Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
+ * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
+ * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
+ * @opt_param bool pinned Whether to pin the new revision.
+ * @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date.
+ * @opt_param string timedTextLanguage The language of the timed text.
+ * @opt_param string timedTextTrackName The timed text track name.
+ * @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file.
+ * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text.
+ * @return Google_DriveFile
+ */
+ public function patch($fileId, Google_DriveFile $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('patch', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Set the file's updated time to the current server time. (files.touch)
+ *
+ * @param string $fileId The ID of the file to update.
+ * @param array $optParams Optional parameters.
+ * @return Google_DriveFile
+ */
+ public function touch($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('touch', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Moves a file to the trash. (files.trash)
+ *
+ * @param string $fileId The ID of the file to trash.
+ * @param array $optParams Optional parameters.
+ * @return Google_DriveFile
+ */
+ public function trash($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('trash', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Restores a file from the trash. (files.untrash)
+ *
+ * @param string $fileId The ID of the file to untrash.
+ * @param array $optParams Optional parameters.
+ * @return Google_DriveFile
+ */
+ public function untrash($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('untrash', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates file metadata and/or content. (files.update)
+ *
+ * @param string $fileId The ID of the file to update.
+ * @param Google_DriveFile $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool convert Whether to convert this file to the corresponding Google Docs format.
+ * @opt_param bool newRevision Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
+ * @opt_param bool ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
+ * @opt_param string ocrLanguage If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
+ * @opt_param bool pinned Whether to pin the new revision.
+ * @opt_param bool setModifiedDate Whether to set the modified date with the supplied modified date.
+ * @opt_param string timedTextLanguage The language of the timed text.
+ * @opt_param string timedTextTrackName The timed text track name.
+ * @opt_param bool updateViewedDate Whether to update the view date after successfully updating the file.
+ * @opt_param bool useContentAsIndexableText Whether to use the content as indexable text.
+ * @return Google_DriveFile
+ */
+ public function update($fileId, Google_DriveFile $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('update', array($params));
+ if ($this->useObjects()) {
+ return new Google_DriveFile($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "parents" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $parents = $driveService->parents;
+ *
+ */
+ class Google_ParentsServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Removes a parent from a file. (parents.delete)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $parentId The ID of the parent.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($fileId, $parentId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'parentId' => $parentId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a specific parent reference. (parents.get)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $parentId The ID of the parent.
+ * @param array $optParams Optional parameters.
+ * @return Google_ParentReference
+ */
+ public function get($fileId, $parentId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'parentId' => $parentId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_ParentReference($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Adds a parent folder for a file. (parents.insert)
+ *
+ * @param string $fileId The ID of the file.
+ * @param Google_ParentReference $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_ParentReference
+ */
+ public function insert($fileId, Google_ParentReference $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_ParentReference($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a file's parents. (parents.list)
+ *
+ * @param string $fileId The ID of the file.
+ * @param array $optParams Optional parameters.
+ * @return Google_ParentList
+ */
+ public function listParents($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_ParentList($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "permissions" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $permissions = $driveService->permissions;
+ *
+ */
+ class Google_PermissionsServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Deletes a permission from a file. (permissions.delete)
+ *
+ * @param string $fileId The ID for the file.
+ * @param string $permissionId The ID for the permission.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($fileId, $permissionId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'permissionId' => $permissionId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a permission by ID. (permissions.get)
+ *
+ * @param string $fileId The ID for the file.
+ * @param string $permissionId The ID for the permission.
+ * @param array $optParams Optional parameters.
+ * @return Google_Permission
+ */
+ public function get($fileId, $permissionId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'permissionId' => $permissionId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_Permission($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Inserts a permission for a file. (permissions.insert)
+ *
+ * @param string $fileId The ID for the file.
+ * @param Google_Permission $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string emailMessage A custom message to include in notification emails.
+ * @opt_param bool sendNotificationEmails Whether to send notification emails when sharing to users or groups.
+ * @return Google_Permission
+ */
+ public function insert($fileId, Google_Permission $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_Permission($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a file's permissions. (permissions.list)
+ *
+ * @param string $fileId The ID for the file.
+ * @param array $optParams Optional parameters.
+ * @return Google_PermissionList
+ */
+ public function listPermissions($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_PermissionList($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates a permission. This method supports patch semantics. (permissions.patch)
+ *
+ * @param string $fileId The ID for the file.
+ * @param string $permissionId The ID for the permission.
+ * @param Google_Permission $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool transferOwnership Whether changing a role to 'owner' should also downgrade the current owners to writers.
+ * @return Google_Permission
+ */
+ public function patch($fileId, $permissionId, Google_Permission $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('patch', array($params));
+ if ($this->useObjects()) {
+ return new Google_Permission($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates a permission. (permissions.update)
+ *
+ * @param string $fileId The ID for the file.
+ * @param string $permissionId The ID for the permission.
+ * @param Google_Permission $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool transferOwnership Whether changing a role to 'owner' should also downgrade the current owners to writers.
+ * @return Google_Permission
+ */
+ public function update($fileId, $permissionId, Google_Permission $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'permissionId' => $permissionId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('update', array($params));
+ if ($this->useObjects()) {
+ return new Google_Permission($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "properties" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $properties = $driveService->properties;
+ *
+ */
+ class Google_PropertiesServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Deletes a property. (properties.delete)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $propertyKey The key of the property.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string visibility The visibility of the property.
+ */
+ public function delete($fileId, $propertyKey, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'propertyKey' => $propertyKey);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a property by its key. (properties.get)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $propertyKey The key of the property.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string visibility The visibility of the property.
+ * @return Google_Property
+ */
+ public function get($fileId, $propertyKey, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'propertyKey' => $propertyKey);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_Property($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Adds a property to a file. (properties.insert)
+ *
+ * @param string $fileId The ID of the file.
+ * @param Google_Property $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_Property
+ */
+ public function insert($fileId, Google_Property $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_Property($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a file's properties. (properties.list)
+ *
+ * @param string $fileId The ID of the file.
+ * @param array $optParams Optional parameters.
+ * @return Google_PropertyList
+ */
+ public function listProperties($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_PropertyList($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates a property. This method supports patch semantics. (properties.patch)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $propertyKey The key of the property.
+ * @param Google_Property $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string visibility The visibility of the property.
+ * @return Google_Property
+ */
+ public function patch($fileId, $propertyKey, Google_Property $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'propertyKey' => $propertyKey, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('patch', array($params));
+ if ($this->useObjects()) {
+ return new Google_Property($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates a property. (properties.update)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $propertyKey The key of the property.
+ * @param Google_Property $postBody
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param string visibility The visibility of the property.
+ * @return Google_Property
+ */
+ public function update($fileId, $propertyKey, Google_Property $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'propertyKey' => $propertyKey, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('update', array($params));
+ if ($this->useObjects()) {
+ return new Google_Property($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "replies" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $replies = $driveService->replies;
+ *
+ */
+ class Google_RepliesServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Deletes a reply. (replies.delete)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param string $replyId The ID of the reply.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($fileId, $commentId, $replyId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a reply. (replies.get)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param string $replyId The ID of the reply.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool includeDeleted If set, this will succeed when retrieving a deleted reply.
+ * @return Google_CommentReply
+ */
+ public function get($fileId, $commentId, $replyId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_CommentReply($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Creates a new reply to the given comment. (replies.insert)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param Google_CommentReply $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_CommentReply
+ */
+ public function insert($fileId, $commentId, Google_CommentReply $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('insert', array($params));
+ if ($this->useObjects()) {
+ return new Google_CommentReply($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists all of the replies to a comment. (replies.list)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param array $optParams Optional parameters.
+ *
+ * @opt_param bool includeDeleted If set, all replies, including deleted replies (with content stripped) will be returned.
+ * @opt_param int maxResults The maximum number of replies to include in the response, used for paging.
+ * @opt_param string pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
+ * @return Google_CommentReplyList
+ */
+ public function listReplies($fileId, $commentId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_CommentReplyList($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates an existing reply. This method supports patch semantics. (replies.patch)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param string $replyId The ID of the reply.
+ * @param Google_CommentReply $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_CommentReply
+ */
+ public function patch($fileId, $commentId, $replyId, Google_CommentReply $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('patch', array($params));
+ if ($this->useObjects()) {
+ return new Google_CommentReply($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates an existing reply. (replies.update)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $commentId The ID of the comment.
+ * @param string $replyId The ID of the reply.
+ * @param Google_CommentReply $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_CommentReply
+ */
+ public function update($fileId, $commentId, $replyId, Google_CommentReply $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'commentId' => $commentId, 'replyId' => $replyId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('update', array($params));
+ if ($this->useObjects()) {
+ return new Google_CommentReply($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+ /**
+ * The "revisions" collection of methods.
+ * Typical usage is:
+ *
+ * $driveService = new Google_DriveService(...);
+ * $revisions = $driveService->revisions;
+ *
+ */
+ class Google_RevisionsServiceResource extends Google_ServiceResource {
+
+
+ /**
+ * Removes a revision. (revisions.delete)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $revisionId The ID of the revision.
+ * @param array $optParams Optional parameters.
+ */
+ public function delete($fileId, $revisionId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'revisionId' => $revisionId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('delete', array($params));
+ return $data;
+ }
+ /**
+ * Gets a specific revision. (revisions.get)
+ *
+ * @param string $fileId The ID of the file.
+ * @param string $revisionId The ID of the revision.
+ * @param array $optParams Optional parameters.
+ * @return Google_Revision
+ */
+ public function get($fileId, $revisionId, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'revisionId' => $revisionId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('get', array($params));
+ if ($this->useObjects()) {
+ return new Google_Revision($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Lists a file's revisions. (revisions.list)
+ *
+ * @param string $fileId The ID of the file.
+ * @param array $optParams Optional parameters.
+ * @return Google_RevisionList
+ */
+ public function listRevisions($fileId, $optParams = array()) {
+ $params = array('fileId' => $fileId);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('list', array($params));
+ if ($this->useObjects()) {
+ return new Google_RevisionList($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates a revision. This method supports patch semantics. (revisions.patch)
+ *
+ * @param string $fileId The ID for the file.
+ * @param string $revisionId The ID for the revision.
+ * @param Google_Revision $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_Revision
+ */
+ public function patch($fileId, $revisionId, Google_Revision $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'revisionId' => $revisionId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('patch', array($params));
+ if ($this->useObjects()) {
+ return new Google_Revision($data);
+ } else {
+ return $data;
+ }
+ }
+ /**
+ * Updates a revision. (revisions.update)
+ *
+ * @param string $fileId The ID for the file.
+ * @param string $revisionId The ID for the revision.
+ * @param Google_Revision $postBody
+ * @param array $optParams Optional parameters.
+ * @return Google_Revision
+ */
+ public function update($fileId, $revisionId, Google_Revision $postBody, $optParams = array()) {
+ $params = array('fileId' => $fileId, 'revisionId' => $revisionId, 'postBody' => $postBody);
+ $params = array_merge($params, $optParams);
+ $data = $this->__call('update', array($params));
+ if ($this->useObjects()) {
+ return new Google_Revision($data);
+ } else {
+ return $data;
+ }
+ }
+ }
+
+/**
+ * Service definition for Google_Drive (v2).
+ *
+ * + * The API to interact with Drive. + * + * + *+ * For more information about this service, see the + * API Documentation + * + * + * @author Google, Inc. + */ +class Google_DriveService extends Google_Service { + public $about; + public $apps; + public $changes; + public $children; + public $comments; + public $files; + public $parents; + public $permissions; + public $properties; + public $replies; + public $revisions; + /** + * Constructs the internal representation of the Drive service. + * + * @param Google_Client $client + */ + public function __construct(Google_Client $client) { + $this->servicePath = 'drive/v2/'; + $this->version = 'v2'; + $this->serviceName = 'drive'; + + $client->addService($this->serviceName, $this->version); + $this->about = new Google_AboutServiceResource($this, $this->serviceName, 'about', json_decode('{"methods": {"get": {"id": "drive.about.get", "path": "about", "httpMethod": "GET", "parameters": {"includeSubscribed": {"type": "boolean", "default": "true", "location": "query"}, "maxChangeIdCount": {"type": "string", "default": "1", "format": "int64", "location": "query"}, "startChangeId": {"type": "string", "format": "int64", "location": "query"}}, "response": {"$ref": "About"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}}}', true)); + $this->apps = new Google_AppsServiceResource($this, $this->serviceName, 'apps', json_decode('{"methods": {"get": {"id": "drive.apps.get", "path": "apps/{appId}", "httpMethod": "GET", "parameters": {"appId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "App"}, "scopes": ["https://www.googleapis.com/auth/drive.apps.readonly"]}, "list": {"id": "drive.apps.list", "path": "apps", "httpMethod": "GET", "response": {"$ref": "AppList"}, "scopes": ["https://www.googleapis.com/auth/drive.apps.readonly"]}}}', true)); + $this->changes = new Google_ChangesServiceResource($this, $this->serviceName, 'changes', json_decode('{"methods": {"get": {"id": "drive.changes.get", "path": "changes/{changeId}", "httpMethod": "GET", "parameters": {"changeId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Change"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "list": {"id": "drive.changes.list", "path": "changes", "httpMethod": "GET", "parameters": {"includeDeleted": {"type": "boolean", "default": "true", "location": "query"}, "includeSubscribed": {"type": "boolean", "default": "true", "location": "query"}, "maxResults": {"type": "integer", "default": "100", "format": "int32", "minimum": "0", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "startChangeId": {"type": "string", "format": "int64", "location": "query"}}, "response": {"$ref": "ChangeList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "supportsSubscription": true}}}', true)); + $this->children = new Google_ChildrenServiceResource($this, $this->serviceName, 'children', json_decode('{"methods": {"delete": {"id": "drive.children.delete", "path": "files/{folderId}/children/{childId}", "httpMethod": "DELETE", "parameters": {"childId": {"type": "string", "required": true, "location": "path"}, "folderId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.children.get", "path": "files/{folderId}/children/{childId}", "httpMethod": "GET", "parameters": {"childId": {"type": "string", "required": true, "location": "path"}, "folderId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "ChildReference"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "insert": {"id": "drive.children.insert", "path": "files/{folderId}/children", "httpMethod": "POST", "parameters": {"folderId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "ChildReference"}, "response": {"$ref": "ChildReference"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "list": {"id": "drive.children.list", "path": "files/{folderId}/children", "httpMethod": "GET", "parameters": {"folderId": {"type": "string", "required": true, "location": "path"}, "maxResults": {"type": "integer", "default": "100", "format": "int32", "minimum": "0", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "q": {"type": "string", "location": "query"}}, "response": {"$ref": "ChildList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}}}', true)); + $this->comments = new Google_CommentsServiceResource($this, $this->serviceName, 'comments', json_decode('{"methods": {"delete": {"id": "drive.comments.delete", "path": "files/{fileId}/comments/{commentId}", "httpMethod": "DELETE", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"]}, "get": {"id": "drive.comments.get", "path": "files/{fileId}/comments/{commentId}", "httpMethod": "GET", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}, "includeDeleted": {"type": "boolean", "default": "false", "location": "query"}}, "response": {"$ref": "Comment"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"]}, "insert": {"id": "drive.comments.insert", "path": "files/{fileId}/comments", "httpMethod": "POST", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Comment"}, "response": {"$ref": "Comment"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"]}, "list": {"id": "drive.comments.list", "path": "files/{fileId}/comments", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "includeDeleted": {"type": "boolean", "default": "false", "location": "query"}, "maxResults": {"type": "integer", "default": "20", "format": "int32", "minimum": "0", "maximum": "100", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "updatedMin": {"type": "string", "location": "query"}}, "response": {"$ref": "CommentList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"]}, "patch": {"id": "drive.comments.patch", "path": "files/{fileId}/comments/{commentId}", "httpMethod": "PATCH", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Comment"}, "response": {"$ref": "Comment"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "update": {"id": "drive.comments.update", "path": "files/{fileId}/comments/{commentId}", "httpMethod": "PUT", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Comment"}, "response": {"$ref": "Comment"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}}}', true)); + $this->files = new Google_FilesServiceResource($this, $this->serviceName, 'files', json_decode('{"methods": {"copy": {"id": "drive.files.copy", "path": "files/{fileId}/copy", "httpMethod": "POST", "parameters": {"convert": {"type": "boolean", "default": "false", "location": "query"}, "fileId": {"type": "string", "required": true, "location": "path"}, "ocr": {"type": "boolean", "default": "false", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"type": "boolean", "default": "false", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "delete": {"id": "drive.files.delete", "path": "files/{fileId}", "httpMethod": "DELETE", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.files.get", "path": "files/{fileId}", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "projection": {"type": "string", "enum": ["BASIC", "FULL"], "location": "query"}, "updateViewedDate": {"type": "boolean", "default": "false", "location": "query"}}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"], "supportsSubscription": true}, "insert": {"id": "drive.files.insert", "path": "files", "httpMethod": "POST", "parameters": {"convert": {"type": "boolean", "default": "false", "location": "query"}, "ocr": {"type": "boolean", "default": "false", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"type": "boolean", "default": "false", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "useContentAsIndexableText": {"type": "boolean", "default": "false", "location": "query"}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"], "supportsMediaUpload": true, "mediaUpload": {"accept": ["*/*"], "maxSize": "10GB", "protocols": {"simple": {"multipart": true, "path": "/upload/drive/v2/files"}, "resumable": {"multipart": true, "path": "/resumable/upload/drive/v2/files"}}}, "supportsSubscription": true}, "list": {"id": "drive.files.list", "path": "files", "httpMethod": "GET", "parameters": {"maxResults": {"type": "integer", "default": "100", "format": "int32", "minimum": "0", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "projection": {"type": "string", "enum": ["BASIC", "FULL"], "location": "query"}, "q": {"type": "string", "location": "query"}}, "response": {"$ref": "FileList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "patch": {"id": "drive.files.patch", "path": "files/{fileId}", "httpMethod": "PATCH", "parameters": {"convert": {"type": "boolean", "default": "false", "location": "query"}, "fileId": {"type": "string", "required": true, "location": "path"}, "newRevision": {"type": "boolean", "default": "true", "location": "query"}, "ocr": {"type": "boolean", "default": "false", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"type": "boolean", "default": "false", "location": "query"}, "setModifiedDate": {"type": "boolean", "default": "false", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "updateViewedDate": {"type": "boolean", "default": "true", "location": "query"}, "useContentAsIndexableText": {"type": "boolean", "default": "false", "location": "query"}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.scripts"]}, "touch": {"id": "drive.files.touch", "path": "files/{fileId}/touch", "httpMethod": "POST", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "trash": {"id": "drive.files.trash", "path": "files/{fileId}/trash", "httpMethod": "POST", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "untrash": {"id": "drive.files.untrash", "path": "files/{fileId}/untrash", "httpMethod": "POST", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "update": {"id": "drive.files.update", "path": "files/{fileId}", "httpMethod": "PUT", "parameters": {"convert": {"type": "boolean", "default": "false", "location": "query"}, "fileId": {"type": "string", "required": true, "location": "path"}, "newRevision": {"type": "boolean", "default": "true", "location": "query"}, "ocr": {"type": "boolean", "default": "false", "location": "query"}, "ocrLanguage": {"type": "string", "location": "query"}, "pinned": {"type": "boolean", "default": "false", "location": "query"}, "setModifiedDate": {"type": "boolean", "default": "false", "location": "query"}, "timedTextLanguage": {"type": "string", "location": "query"}, "timedTextTrackName": {"type": "string", "location": "query"}, "updateViewedDate": {"type": "boolean", "default": "true", "location": "query"}, "useContentAsIndexableText": {"type": "boolean", "default": "false", "location": "query"}}, "request": {"$ref": "File"}, "response": {"$ref": "File"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.scripts"], "supportsMediaUpload": true, "mediaUpload": {"accept": ["*/*"], "maxSize": "10GB", "protocols": {"simple": {"multipart": true, "path": "/upload/drive/v2/files/{fileId}"}, "resumable": {"multipart": true, "path": "/resumable/upload/drive/v2/files/{fileId}"}}}}}}', true)); + $this->parents = new Google_ParentsServiceResource($this, $this->serviceName, 'parents', json_decode('{"methods": {"delete": {"id": "drive.parents.delete", "path": "files/{fileId}/parents/{parentId}", "httpMethod": "DELETE", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "parentId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.parents.get", "path": "files/{fileId}/parents/{parentId}", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "parentId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "ParentReference"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "insert": {"id": "drive.parents.insert", "path": "files/{fileId}/parents", "httpMethod": "POST", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "ParentReference"}, "response": {"$ref": "ParentReference"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "list": {"id": "drive.parents.list", "path": "files/{fileId}/parents", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "ParentList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}}}', true)); + $this->permissions = new Google_PermissionsServiceResource($this, $this->serviceName, 'permissions', json_decode('{"methods": {"delete": {"id": "drive.permissions.delete", "path": "files/{fileId}/permissions/{permissionId}", "httpMethod": "DELETE", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "permissionId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.permissions.get", "path": "files/{fileId}/permissions/{permissionId}", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "permissionId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Permission"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "insert": {"id": "drive.permissions.insert", "path": "files/{fileId}/permissions", "httpMethod": "POST", "parameters": {"emailMessage": {"type": "string", "location": "query"}, "fileId": {"type": "string", "required": true, "location": "path"}, "sendNotificationEmails": {"type": "boolean", "default": "true", "location": "query"}}, "request": {"$ref": "Permission"}, "response": {"$ref": "Permission"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "list": {"id": "drive.permissions.list", "path": "files/{fileId}/permissions", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "PermissionList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "patch": {"id": "drive.permissions.patch", "path": "files/{fileId}/permissions/{permissionId}", "httpMethod": "PATCH", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "permissionId": {"type": "string", "required": true, "location": "path"}, "transferOwnership": {"type": "boolean", "default": "false", "location": "query"}}, "request": {"$ref": "Permission"}, "response": {"$ref": "Permission"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "update": {"id": "drive.permissions.update", "path": "files/{fileId}/permissions/{permissionId}", "httpMethod": "PUT", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "permissionId": {"type": "string", "required": true, "location": "path"}, "transferOwnership": {"type": "boolean", "default": "false", "location": "query"}}, "request": {"$ref": "Permission"}, "response": {"$ref": "Permission"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}}}', true)); + $this->properties = new Google_PropertiesServiceResource($this, $this->serviceName, 'properties', json_decode('{"methods": {"delete": {"id": "drive.properties.delete", "path": "files/{fileId}/properties/{propertyKey}", "httpMethod": "DELETE", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "propertyKey": {"type": "string", "required": true, "location": "path"}, "visibility": {"type": "string", "default": "private", "location": "query"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.properties.get", "path": "files/{fileId}/properties/{propertyKey}", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "propertyKey": {"type": "string", "required": true, "location": "path"}, "visibility": {"type": "string", "default": "private", "location": "query"}}, "response": {"$ref": "Property"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "insert": {"id": "drive.properties.insert", "path": "files/{fileId}/properties", "httpMethod": "POST", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Property"}, "response": {"$ref": "Property"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "list": {"id": "drive.properties.list", "path": "files/{fileId}/properties", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "PropertyList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "patch": {"id": "drive.properties.patch", "path": "files/{fileId}/properties/{propertyKey}", "httpMethod": "PATCH", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "propertyKey": {"type": "string", "required": true, "location": "path"}, "visibility": {"type": "string", "default": "private", "location": "query"}}, "request": {"$ref": "Property"}, "response": {"$ref": "Property"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "update": {"id": "drive.properties.update", "path": "files/{fileId}/properties/{propertyKey}", "httpMethod": "PUT", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "propertyKey": {"type": "string", "required": true, "location": "path"}, "visibility": {"type": "string", "default": "private", "location": "query"}}, "request": {"$ref": "Property"}, "response": {"$ref": "Property"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}}}', true)); + $this->replies = new Google_RepliesServiceResource($this, $this->serviceName, 'replies', json_decode('{"methods": {"delete": {"id": "drive.replies.delete", "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", "httpMethod": "DELETE", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}, "replyId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.replies.get", "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", "httpMethod": "GET", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}, "includeDeleted": {"type": "boolean", "default": "false", "location": "query"}, "replyId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "CommentReply"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"]}, "insert": {"id": "drive.replies.insert", "path": "files/{fileId}/comments/{commentId}/replies", "httpMethod": "POST", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "CommentReply"}, "response": {"$ref": "CommentReply"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "list": {"id": "drive.replies.list", "path": "files/{fileId}/comments/{commentId}/replies", "httpMethod": "GET", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}, "includeDeleted": {"type": "boolean", "default": "false", "location": "query"}, "maxResults": {"type": "integer", "default": "20", "format": "int32", "minimum": "0", "maximum": "100", "location": "query"}, "pageToken": {"type": "string", "location": "query"}}, "response": {"$ref": "CommentReplyList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.readonly"]}, "patch": {"id": "drive.replies.patch", "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", "httpMethod": "PATCH", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}, "replyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "CommentReply"}, "response": {"$ref": "CommentReply"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "update": {"id": "drive.replies.update", "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", "httpMethod": "PUT", "parameters": {"commentId": {"type": "string", "required": true, "location": "path"}, "fileId": {"type": "string", "required": true, "location": "path"}, "replyId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "CommentReply"}, "response": {"$ref": "CommentReply"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}}}', true)); + $this->revisions = new Google_RevisionsServiceResource($this, $this->serviceName, 'revisions', json_decode('{"methods": {"delete": {"id": "drive.revisions.delete", "path": "files/{fileId}/revisions/{revisionId}", "httpMethod": "DELETE", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "revisionId": {"type": "string", "required": true, "location": "path"}}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "get": {"id": "drive.revisions.get", "path": "files/{fileId}/revisions/{revisionId}", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "revisionId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "Revision"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "list": {"id": "drive.revisions.list", "path": "files/{fileId}/revisions", "httpMethod": "GET", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}}, "response": {"$ref": "RevisionList"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly"]}, "patch": {"id": "drive.revisions.patch", "path": "files/{fileId}/revisions/{revisionId}", "httpMethod": "PATCH", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "revisionId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Revision"}, "response": {"$ref": "Revision"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}, "update": {"id": "drive.revisions.update", "path": "files/{fileId}/revisions/{revisionId}", "httpMethod": "PUT", "parameters": {"fileId": {"type": "string", "required": true, "location": "path"}, "revisionId": {"type": "string", "required": true, "location": "path"}}, "request": {"$ref": "Revision"}, "response": {"$ref": "Revision"}, "scopes": ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file"]}}}', true)); + + } +} + + + +class Google_About extends Google_Model { + protected $__additionalRoleInfoType = 'Google_AboutAdditionalRoleInfo'; + protected $__additionalRoleInfoDataType = 'array'; + public $additionalRoleInfo; + public $domainSharingPolicy; + public $etag; + protected $__exportFormatsType = 'Google_AboutExportFormats'; + protected $__exportFormatsDataType = 'array'; + public $exportFormats; + protected $__featuresType = 'Google_AboutFeatures'; + protected $__featuresDataType = 'array'; + public $features; + protected $__importFormatsType = 'Google_AboutImportFormats'; + protected $__importFormatsDataType = 'array'; + public $importFormats; + public $isCurrentAppInstalled; + public $kind; + public $largestChangeId; + protected $__maxUploadSizesType = 'Google_AboutMaxUploadSizes'; + protected $__maxUploadSizesDataType = 'array'; + public $maxUploadSizes; + public $name; + public $permissionId; + public $quotaBytesTotal; + public $quotaBytesUsed; + public $quotaBytesUsedAggregate; + public $quotaBytesUsedInTrash; + public $remainingChangeIds; + public $rootFolderId; + public $selfLink; + protected $__userType = 'Google_User'; + protected $__userDataType = ''; + public $user; + public function setAdditionalRoleInfo(/* array(Google_AboutAdditionalRoleInfo) */ $additionalRoleInfo) { + $this->assertIsArray($additionalRoleInfo, 'Google_AboutAdditionalRoleInfo', __METHOD__); + $this->additionalRoleInfo = $additionalRoleInfo; + } + public function getAdditionalRoleInfo() { + return $this->additionalRoleInfo; + } + public function setDomainSharingPolicy($domainSharingPolicy) { + $this->domainSharingPolicy = $domainSharingPolicy; + } + public function getDomainSharingPolicy() { + return $this->domainSharingPolicy; + } + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setExportFormats(/* array(Google_AboutExportFormats) */ $exportFormats) { + $this->assertIsArray($exportFormats, 'Google_AboutExportFormats', __METHOD__); + $this->exportFormats = $exportFormats; + } + public function getExportFormats() { + return $this->exportFormats; + } + public function setFeatures(/* array(Google_AboutFeatures) */ $features) { + $this->assertIsArray($features, 'Google_AboutFeatures', __METHOD__); + $this->features = $features; + } + public function getFeatures() { + return $this->features; + } + public function setImportFormats(/* array(Google_AboutImportFormats) */ $importFormats) { + $this->assertIsArray($importFormats, 'Google_AboutImportFormats', __METHOD__); + $this->importFormats = $importFormats; + } + public function getImportFormats() { + return $this->importFormats; + } + public function setIsCurrentAppInstalled($isCurrentAppInstalled) { + $this->isCurrentAppInstalled = $isCurrentAppInstalled; + } + public function getIsCurrentAppInstalled() { + return $this->isCurrentAppInstalled; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setLargestChangeId($largestChangeId) { + $this->largestChangeId = $largestChangeId; + } + public function getLargestChangeId() { + return $this->largestChangeId; + } + public function setMaxUploadSizes(/* array(Google_AboutMaxUploadSizes) */ $maxUploadSizes) { + $this->assertIsArray($maxUploadSizes, 'Google_AboutMaxUploadSizes', __METHOD__); + $this->maxUploadSizes = $maxUploadSizes; + } + public function getMaxUploadSizes() { + return $this->maxUploadSizes; + } + public function setName($name) { + $this->name = $name; + } + public function getName() { + return $this->name; + } + public function setPermissionId($permissionId) { + $this->permissionId = $permissionId; + } + public function getPermissionId() { + return $this->permissionId; + } + public function setQuotaBytesTotal($quotaBytesTotal) { + $this->quotaBytesTotal = $quotaBytesTotal; + } + public function getQuotaBytesTotal() { + return $this->quotaBytesTotal; + } + public function setQuotaBytesUsed($quotaBytesUsed) { + $this->quotaBytesUsed = $quotaBytesUsed; + } + public function getQuotaBytesUsed() { + return $this->quotaBytesUsed; + } + public function setQuotaBytesUsedAggregate($quotaBytesUsedAggregate) { + $this->quotaBytesUsedAggregate = $quotaBytesUsedAggregate; + } + public function getQuotaBytesUsedAggregate() { + return $this->quotaBytesUsedAggregate; + } + public function setQuotaBytesUsedInTrash($quotaBytesUsedInTrash) { + $this->quotaBytesUsedInTrash = $quotaBytesUsedInTrash; + } + public function getQuotaBytesUsedInTrash() { + return $this->quotaBytesUsedInTrash; + } + public function setRemainingChangeIds($remainingChangeIds) { + $this->remainingChangeIds = $remainingChangeIds; + } + public function getRemainingChangeIds() { + return $this->remainingChangeIds; + } + public function setRootFolderId($rootFolderId) { + $this->rootFolderId = $rootFolderId; + } + public function getRootFolderId() { + return $this->rootFolderId; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } + public function setUser(Google_User $user) { + $this->user = $user; + } + public function getUser() { + return $this->user; + } +} + +class Google_AboutAdditionalRoleInfo extends Google_Model { + protected $__roleSetsType = 'Google_AboutAdditionalRoleInfoRoleSets'; + protected $__roleSetsDataType = 'array'; + public $roleSets; + public $type; + public function setRoleSets(/* array(Google_AboutAdditionalRoleInfoRoleSets) */ $roleSets) { + $this->assertIsArray($roleSets, 'Google_AboutAdditionalRoleInfoRoleSets', __METHOD__); + $this->roleSets = $roleSets; + } + public function getRoleSets() { + return $this->roleSets; + } + public function setType($type) { + $this->type = $type; + } + public function getType() { + return $this->type; + } +} + +class Google_AboutAdditionalRoleInfoRoleSets extends Google_Model { + public $additionalRoles; + public $primaryRole; + public function setAdditionalRoles(/* array(Google_string) */ $additionalRoles) { + $this->assertIsArray($additionalRoles, 'Google_string', __METHOD__); + $this->additionalRoles = $additionalRoles; + } + public function getAdditionalRoles() { + return $this->additionalRoles; + } + public function setPrimaryRole($primaryRole) { + $this->primaryRole = $primaryRole; + } + public function getPrimaryRole() { + return $this->primaryRole; + } +} + +class Google_AboutExportFormats extends Google_Model { + public $source; + public $targets; + public function setSource($source) { + $this->source = $source; + } + public function getSource() { + return $this->source; + } + public function setTargets(/* array(Google_string) */ $targets) { + $this->assertIsArray($targets, 'Google_string', __METHOD__); + $this->targets = $targets; + } + public function getTargets() { + return $this->targets; + } +} + +class Google_AboutFeatures extends Google_Model { + public $featureName; + public $featureRate; + public function setFeatureName($featureName) { + $this->featureName = $featureName; + } + public function getFeatureName() { + return $this->featureName; + } + public function setFeatureRate($featureRate) { + $this->featureRate = $featureRate; + } + public function getFeatureRate() { + return $this->featureRate; + } +} + +class Google_AboutImportFormats extends Google_Model { + public $source; + public $targets; + public function setSource($source) { + $this->source = $source; + } + public function getSource() { + return $this->source; + } + public function setTargets(/* array(Google_string) */ $targets) { + $this->assertIsArray($targets, 'Google_string', __METHOD__); + $this->targets = $targets; + } + public function getTargets() { + return $this->targets; + } +} + +class Google_AboutMaxUploadSizes extends Google_Model { + public $size; + public $type; + public function setSize($size) { + $this->size = $size; + } + public function getSize() { + return $this->size; + } + public function setType($type) { + $this->type = $type; + } + public function getType() { + return $this->type; + } +} + +class Google_App extends Google_Model { + public $authorized; + protected $__iconsType = 'Google_AppIcons'; + protected $__iconsDataType = 'array'; + public $icons; + public $id; + public $installed; + public $kind; + public $name; + public $objectType; + public $primaryFileExtensions; + public $primaryMimeTypes; + public $productUrl; + public $secondaryFileExtensions; + public $secondaryMimeTypes; + public $supportsCreate; + public $supportsImport; + public $useByDefault; + public function setAuthorized($authorized) { + $this->authorized = $authorized; + } + public function getAuthorized() { + return $this->authorized; + } + public function setIcons(/* array(Google_AppIcons) */ $icons) { + $this->assertIsArray($icons, 'Google_AppIcons', __METHOD__); + $this->icons = $icons; + } + public function getIcons() { + return $this->icons; + } + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setInstalled($installed) { + $this->installed = $installed; + } + public function getInstalled() { + return $this->installed; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setName($name) { + $this->name = $name; + } + public function getName() { + return $this->name; + } + public function setObjectType($objectType) { + $this->objectType = $objectType; + } + public function getObjectType() { + return $this->objectType; + } + public function setPrimaryFileExtensions(/* array(Google_string) */ $primaryFileExtensions) { + $this->assertIsArray($primaryFileExtensions, 'Google_string', __METHOD__); + $this->primaryFileExtensions = $primaryFileExtensions; + } + public function getPrimaryFileExtensions() { + return $this->primaryFileExtensions; + } + public function setPrimaryMimeTypes(/* array(Google_string) */ $primaryMimeTypes) { + $this->assertIsArray($primaryMimeTypes, 'Google_string', __METHOD__); + $this->primaryMimeTypes = $primaryMimeTypes; + } + public function getPrimaryMimeTypes() { + return $this->primaryMimeTypes; + } + public function setProductUrl($productUrl) { + $this->productUrl = $productUrl; + } + public function getProductUrl() { + return $this->productUrl; + } + public function setSecondaryFileExtensions(/* array(Google_string) */ $secondaryFileExtensions) { + $this->assertIsArray($secondaryFileExtensions, 'Google_string', __METHOD__); + $this->secondaryFileExtensions = $secondaryFileExtensions; + } + public function getSecondaryFileExtensions() { + return $this->secondaryFileExtensions; + } + public function setSecondaryMimeTypes(/* array(Google_string) */ $secondaryMimeTypes) { + $this->assertIsArray($secondaryMimeTypes, 'Google_string', __METHOD__); + $this->secondaryMimeTypes = $secondaryMimeTypes; + } + public function getSecondaryMimeTypes() { + return $this->secondaryMimeTypes; + } + public function setSupportsCreate($supportsCreate) { + $this->supportsCreate = $supportsCreate; + } + public function getSupportsCreate() { + return $this->supportsCreate; + } + public function setSupportsImport($supportsImport) { + $this->supportsImport = $supportsImport; + } + public function getSupportsImport() { + return $this->supportsImport; + } + public function setUseByDefault($useByDefault) { + $this->useByDefault = $useByDefault; + } + public function getUseByDefault() { + return $this->useByDefault; + } +} + +class Google_AppIcons extends Google_Model { + public $category; + public $iconUrl; + public $size; + public function setCategory($category) { + $this->category = $category; + } + public function getCategory() { + return $this->category; + } + public function setIconUrl($iconUrl) { + $this->iconUrl = $iconUrl; + } + public function getIconUrl() { + return $this->iconUrl; + } + public function setSize($size) { + $this->size = $size; + } + public function getSize() { + return $this->size; + } +} + +class Google_AppList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_App'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_App) */ $items) { + $this->assertIsArray($items, 'Google_App', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_Change extends Google_Model { + public $deleted; + protected $__fileType = 'Google_DriveFile'; + protected $__fileDataType = ''; + public $file; + public $fileId; + public $id; + public $kind; + public $selfLink; + public function setDeleted($deleted) { + $this->deleted = $deleted; + } + public function getDeleted() { + return $this->deleted; + } + public function setFile(Google_DriveFile $file) { + $this->file = $file; + } + public function getFile() { + return $this->file; + } + public function setFileId($fileId) { + $this->fileId = $fileId; + } + public function getFileId() { + return $this->fileId; + } + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_ChangeList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_Change'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $largestChangeId; + public $nextLink; + public $nextPageToken; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_Change) */ $items) { + $this->assertIsArray($items, 'Google_Change', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setLargestChangeId($largestChangeId) { + $this->largestChangeId = $largestChangeId; + } + public function getLargestChangeId() { + return $this->largestChangeId; + } + public function setNextLink($nextLink) { + $this->nextLink = $nextLink; + } + public function getNextLink() { + return $this->nextLink; + } + public function setNextPageToken($nextPageToken) { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() { + return $this->nextPageToken; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_ChildList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_ChildReference'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $nextLink; + public $nextPageToken; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_ChildReference) */ $items) { + $this->assertIsArray($items, 'Google_ChildReference', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setNextLink($nextLink) { + $this->nextLink = $nextLink; + } + public function getNextLink() { + return $this->nextLink; + } + public function setNextPageToken($nextPageToken) { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() { + return $this->nextPageToken; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_ChildReference extends Google_Model { + public $childLink; + public $id; + public $kind; + public $selfLink; + public function setChildLink($childLink) { + $this->childLink = $childLink; + } + public function getChildLink() { + return $this->childLink; + } + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_Comment extends Google_Model { + public $anchor; + protected $__authorType = 'Google_User'; + protected $__authorDataType = ''; + public $author; + public $commentId; + public $content; + protected $__contextType = 'Google_CommentContext'; + protected $__contextDataType = ''; + public $context; + public $createdDate; + public $deleted; + public $fileId; + public $fileTitle; + public $htmlContent; + public $kind; + public $modifiedDate; + protected $__repliesType = 'Google_CommentReply'; + protected $__repliesDataType = 'array'; + public $replies; + public $selfLink; + public $status; + public function setAnchor($anchor) { + $this->anchor = $anchor; + } + public function getAnchor() { + return $this->anchor; + } + public function setAuthor(Google_User $author) { + $this->author = $author; + } + public function getAuthor() { + return $this->author; + } + public function setCommentId($commentId) { + $this->commentId = $commentId; + } + public function getCommentId() { + return $this->commentId; + } + public function setContent($content) { + $this->content = $content; + } + public function getContent() { + return $this->content; + } + public function setContext(Google_CommentContext $context) { + $this->context = $context; + } + public function getContext() { + return $this->context; + } + public function setCreatedDate($createdDate) { + $this->createdDate = $createdDate; + } + public function getCreatedDate() { + return $this->createdDate; + } + public function setDeleted($deleted) { + $this->deleted = $deleted; + } + public function getDeleted() { + return $this->deleted; + } + public function setFileId($fileId) { + $this->fileId = $fileId; + } + public function getFileId() { + return $this->fileId; + } + public function setFileTitle($fileTitle) { + $this->fileTitle = $fileTitle; + } + public function getFileTitle() { + return $this->fileTitle; + } + public function setHtmlContent($htmlContent) { + $this->htmlContent = $htmlContent; + } + public function getHtmlContent() { + return $this->htmlContent; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setModifiedDate($modifiedDate) { + $this->modifiedDate = $modifiedDate; + } + public function getModifiedDate() { + return $this->modifiedDate; + } + public function setReplies(/* array(Google_CommentReply) */ $replies) { + $this->assertIsArray($replies, 'Google_CommentReply', __METHOD__); + $this->replies = $replies; + } + public function getReplies() { + return $this->replies; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } + public function setStatus($status) { + $this->status = $status; + } + public function getStatus() { + return $this->status; + } +} + +class Google_CommentContext extends Google_Model { + public $type; + public $value; + public function setType($type) { + $this->type = $type; + } + public function getType() { + return $this->type; + } + public function setValue($value) { + $this->value = $value; + } + public function getValue() { + return $this->value; + } +} + +class Google_CommentList extends Google_Model { + protected $__itemsType = 'Google_Comment'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $nextPageToken; + public function setItems(/* array(Google_Comment) */ $items) { + $this->assertIsArray($items, 'Google_Comment', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setNextPageToken($nextPageToken) { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() { + return $this->nextPageToken; + } +} + +class Google_CommentReply extends Google_Model { + protected $__authorType = 'Google_User'; + protected $__authorDataType = ''; + public $author; + public $content; + public $createdDate; + public $deleted; + public $htmlContent; + public $kind; + public $modifiedDate; + public $replyId; + public $verb; + public function setAuthor(Google_User $author) { + $this->author = $author; + } + public function getAuthor() { + return $this->author; + } + public function setContent($content) { + $this->content = $content; + } + public function getContent() { + return $this->content; + } + public function setCreatedDate($createdDate) { + $this->createdDate = $createdDate; + } + public function getCreatedDate() { + return $this->createdDate; + } + public function setDeleted($deleted) { + $this->deleted = $deleted; + } + public function getDeleted() { + return $this->deleted; + } + public function setHtmlContent($htmlContent) { + $this->htmlContent = $htmlContent; + } + public function getHtmlContent() { + return $this->htmlContent; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setModifiedDate($modifiedDate) { + $this->modifiedDate = $modifiedDate; + } + public function getModifiedDate() { + return $this->modifiedDate; + } + public function setReplyId($replyId) { + $this->replyId = $replyId; + } + public function getReplyId() { + return $this->replyId; + } + public function setVerb($verb) { + $this->verb = $verb; + } + public function getVerb() { + return $this->verb; + } +} + +class Google_CommentReplyList extends Google_Model { + protected $__itemsType = 'Google_CommentReply'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $nextPageToken; + public function setItems(/* array(Google_CommentReply) */ $items) { + $this->assertIsArray($items, 'Google_CommentReply', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setNextPageToken($nextPageToken) { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() { + return $this->nextPageToken; + } +} + +class Google_DriveFile extends Google_Model { + public $alternateLink; + public $appDataContents; + public $createdDate; + public $description; + public $downloadUrl; + public $editable; + public $embedLink; + public $etag; + public $explicitlyTrashed; + public $exportLinks; + public $fileExtension; + public $fileSize; + public $iconLink; + public $id; + protected $__imageMediaMetadataType = 'Google_DriveFileImageMediaMetadata'; + protected $__imageMediaMetadataDataType = ''; + public $imageMediaMetadata; + protected $__indexableTextType = 'Google_DriveFileIndexableText'; + protected $__indexableTextDataType = ''; + public $indexableText; + public $kind; + protected $__labelsType = 'Google_DriveFileLabels'; + protected $__labelsDataType = ''; + public $labels; + protected $__lastModifyingUserType = 'Google_User'; + protected $__lastModifyingUserDataType = ''; + public $lastModifyingUser; + public $lastModifyingUserName; + public $lastViewedByMeDate; + public $md5Checksum; + public $mimeType; + public $modifiedByMeDate; + public $modifiedDate; + public $originalFilename; + public $ownerNames; + protected $__ownersType = 'Google_User'; + protected $__ownersDataType = 'array'; + public $owners; + protected $__parentsType = 'Google_ParentReference'; + protected $__parentsDataType = 'array'; + public $parents; + public $quotaBytesUsed; + public $selfLink; + public $shared; + public $sharedWithMeDate; + protected $__thumbnailType = 'Google_DriveFileThumbnail'; + protected $__thumbnailDataType = ''; + public $thumbnail; + public $thumbnailLink; + public $title; + protected $__userPermissionType = 'Google_Permission'; + protected $__userPermissionDataType = ''; + public $userPermission; + public $webContentLink; + public $webViewLink; + public $writersCanShare; + public function setAlternateLink($alternateLink) { + $this->alternateLink = $alternateLink; + } + public function getAlternateLink() { + return $this->alternateLink; + } + public function setAppDataContents($appDataContents) { + $this->appDataContents = $appDataContents; + } + public function getAppDataContents() { + return $this->appDataContents; + } + public function setCreatedDate($createdDate) { + $this->createdDate = $createdDate; + } + public function getCreatedDate() { + return $this->createdDate; + } + public function setDescription($description) { + $this->description = $description; + } + public function getDescription() { + return $this->description; + } + public function setDownloadUrl($downloadUrl) { + $this->downloadUrl = $downloadUrl; + } + public function getDownloadUrl() { + return $this->downloadUrl; + } + public function setEditable($editable) { + $this->editable = $editable; + } + public function getEditable() { + return $this->editable; + } + public function setEmbedLink($embedLink) { + $this->embedLink = $embedLink; + } + public function getEmbedLink() { + return $this->embedLink; + } + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setExplicitlyTrashed($explicitlyTrashed) { + $this->explicitlyTrashed = $explicitlyTrashed; + } + public function getExplicitlyTrashed() { + return $this->explicitlyTrashed; + } + public function setExportLinks($exportLinks) { + $this->exportLinks = $exportLinks; + } + public function getExportLinks() { + return $this->exportLinks; + } + public function setFileExtension($fileExtension) { + $this->fileExtension = $fileExtension; + } + public function getFileExtension() { + return $this->fileExtension; + } + public function setFileSize($fileSize) { + $this->fileSize = $fileSize; + } + public function getFileSize() { + return $this->fileSize; + } + public function setIconLink($iconLink) { + $this->iconLink = $iconLink; + } + public function getIconLink() { + return $this->iconLink; + } + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setImageMediaMetadata(Google_DriveFileImageMediaMetadata $imageMediaMetadata) { + $this->imageMediaMetadata = $imageMediaMetadata; + } + public function getImageMediaMetadata() { + return $this->imageMediaMetadata; + } + public function setIndexableText(Google_DriveFileIndexableText $indexableText) { + $this->indexableText = $indexableText; + } + public function getIndexableText() { + return $this->indexableText; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setLabels(Google_DriveFileLabels $labels) { + $this->labels = $labels; + } + public function getLabels() { + return $this->labels; + } + public function setLastModifyingUser(Google_User $lastModifyingUser) { + $this->lastModifyingUser = $lastModifyingUser; + } + public function getLastModifyingUser() { + return $this->lastModifyingUser; + } + public function setLastModifyingUserName($lastModifyingUserName) { + $this->lastModifyingUserName = $lastModifyingUserName; + } + public function getLastModifyingUserName() { + return $this->lastModifyingUserName; + } + public function setLastViewedByMeDate($lastViewedByMeDate) { + $this->lastViewedByMeDate = $lastViewedByMeDate; + } + public function getLastViewedByMeDate() { + return $this->lastViewedByMeDate; + } + public function setMd5Checksum($md5Checksum) { + $this->md5Checksum = $md5Checksum; + } + public function getMd5Checksum() { + return $this->md5Checksum; + } + public function setMimeType($mimeType) { + $this->mimeType = $mimeType; + } + public function getMimeType() { + return $this->mimeType; + } + public function setModifiedByMeDate($modifiedByMeDate) { + $this->modifiedByMeDate = $modifiedByMeDate; + } + public function getModifiedByMeDate() { + return $this->modifiedByMeDate; + } + public function setModifiedDate($modifiedDate) { + $this->modifiedDate = $modifiedDate; + } + public function getModifiedDate() { + return $this->modifiedDate; + } + public function setOriginalFilename($originalFilename) { + $this->originalFilename = $originalFilename; + } + public function getOriginalFilename() { + return $this->originalFilename; + } + public function setOwnerNames(/* array(Google_string) */ $ownerNames) { + $this->assertIsArray($ownerNames, 'Google_string', __METHOD__); + $this->ownerNames = $ownerNames; + } + public function getOwnerNames() { + return $this->ownerNames; + } + public function setOwners(/* array(Google_User) */ $owners) { + $this->assertIsArray($owners, 'Google_User', __METHOD__); + $this->owners = $owners; + } + public function getOwners() { + return $this->owners; + } + public function setParents(/* array(Google_ParentReference) */ $parents) { + $this->assertIsArray($parents, 'Google_ParentReference', __METHOD__); + $this->parents = $parents; + } + public function getParents() { + return $this->parents; + } + public function setQuotaBytesUsed($quotaBytesUsed) { + $this->quotaBytesUsed = $quotaBytesUsed; + } + public function getQuotaBytesUsed() { + return $this->quotaBytesUsed; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } + public function setShared($shared) { + $this->shared = $shared; + } + public function getShared() { + return $this->shared; + } + public function setSharedWithMeDate($sharedWithMeDate) { + $this->sharedWithMeDate = $sharedWithMeDate; + } + public function getSharedWithMeDate() { + return $this->sharedWithMeDate; + } + public function setThumbnail(Google_DriveFileThumbnail $thumbnail) { + $this->thumbnail = $thumbnail; + } + public function getThumbnail() { + return $this->thumbnail; + } + public function setThumbnailLink($thumbnailLink) { + $this->thumbnailLink = $thumbnailLink; + } + public function getThumbnailLink() { + return $this->thumbnailLink; + } + public function setTitle($title) { + $this->title = $title; + } + public function getTitle() { + return $this->title; + } + public function setUserPermission(Google_Permission $userPermission) { + $this->userPermission = $userPermission; + } + public function getUserPermission() { + return $this->userPermission; + } + public function setWebContentLink($webContentLink) { + $this->webContentLink = $webContentLink; + } + public function getWebContentLink() { + return $this->webContentLink; + } + public function setWebViewLink($webViewLink) { + $this->webViewLink = $webViewLink; + } + public function getWebViewLink() { + return $this->webViewLink; + } + public function setWritersCanShare($writersCanShare) { + $this->writersCanShare = $writersCanShare; + } + public function getWritersCanShare() { + return $this->writersCanShare; + } +} + +class Google_DriveFileImageMediaMetadata extends Google_Model { + public $aperture; + public $cameraMake; + public $cameraModel; + public $colorSpace; + public $date; + public $exposureBias; + public $exposureMode; + public $exposureTime; + public $flashUsed; + public $focalLength; + public $height; + public $isoSpeed; + public $lens; + protected $__locationType = 'Google_DriveFileImageMediaMetadataLocation'; + protected $__locationDataType = ''; + public $location; + public $maxApertureValue; + public $meteringMode; + public $rotation; + public $sensor; + public $subjectDistance; + public $whiteBalance; + public $width; + public function setAperture($aperture) { + $this->aperture = $aperture; + } + public function getAperture() { + return $this->aperture; + } + public function setCameraMake($cameraMake) { + $this->cameraMake = $cameraMake; + } + public function getCameraMake() { + return $this->cameraMake; + } + public function setCameraModel($cameraModel) { + $this->cameraModel = $cameraModel; + } + public function getCameraModel() { + return $this->cameraModel; + } + public function setColorSpace($colorSpace) { + $this->colorSpace = $colorSpace; + } + public function getColorSpace() { + return $this->colorSpace; + } + public function setDate($date) { + $this->date = $date; + } + public function getDate() { + return $this->date; + } + public function setExposureBias($exposureBias) { + $this->exposureBias = $exposureBias; + } + public function getExposureBias() { + return $this->exposureBias; + } + public function setExposureMode($exposureMode) { + $this->exposureMode = $exposureMode; + } + public function getExposureMode() { + return $this->exposureMode; + } + public function setExposureTime($exposureTime) { + $this->exposureTime = $exposureTime; + } + public function getExposureTime() { + return $this->exposureTime; + } + public function setFlashUsed($flashUsed) { + $this->flashUsed = $flashUsed; + } + public function getFlashUsed() { + return $this->flashUsed; + } + public function setFocalLength($focalLength) { + $this->focalLength = $focalLength; + } + public function getFocalLength() { + return $this->focalLength; + } + public function setHeight($height) { + $this->height = $height; + } + public function getHeight() { + return $this->height; + } + public function setIsoSpeed($isoSpeed) { + $this->isoSpeed = $isoSpeed; + } + public function getIsoSpeed() { + return $this->isoSpeed; + } + public function setLens($lens) { + $this->lens = $lens; + } + public function getLens() { + return $this->lens; + } + public function setLocation(Google_DriveFileImageMediaMetadataLocation $location) { + $this->location = $location; + } + public function getLocation() { + return $this->location; + } + public function setMaxApertureValue($maxApertureValue) { + $this->maxApertureValue = $maxApertureValue; + } + public function getMaxApertureValue() { + return $this->maxApertureValue; + } + public function setMeteringMode($meteringMode) { + $this->meteringMode = $meteringMode; + } + public function getMeteringMode() { + return $this->meteringMode; + } + public function setRotation($rotation) { + $this->rotation = $rotation; + } + public function getRotation() { + return $this->rotation; + } + public function setSensor($sensor) { + $this->sensor = $sensor; + } + public function getSensor() { + return $this->sensor; + } + public function setSubjectDistance($subjectDistance) { + $this->subjectDistance = $subjectDistance; + } + public function getSubjectDistance() { + return $this->subjectDistance; + } + public function setWhiteBalance($whiteBalance) { + $this->whiteBalance = $whiteBalance; + } + public function getWhiteBalance() { + return $this->whiteBalance; + } + public function setWidth($width) { + $this->width = $width; + } + public function getWidth() { + return $this->width; + } +} + +class Google_DriveFileImageMediaMetadataLocation extends Google_Model { + public $altitude; + public $latitude; + public $longitude; + public function setAltitude($altitude) { + $this->altitude = $altitude; + } + public function getAltitude() { + return $this->altitude; + } + public function setLatitude($latitude) { + $this->latitude = $latitude; + } + public function getLatitude() { + return $this->latitude; + } + public function setLongitude($longitude) { + $this->longitude = $longitude; + } + public function getLongitude() { + return $this->longitude; + } +} + +class Google_DriveFileIndexableText extends Google_Model { + public $text; + public function setText($text) { + $this->text = $text; + } + public function getText() { + return $this->text; + } +} + +class Google_DriveFileLabels extends Google_Model { + public $hidden; + public $restricted; + public $starred; + public $trashed; + public $viewed; + public function setHidden($hidden) { + $this->hidden = $hidden; + } + public function getHidden() { + return $this->hidden; + } + public function setRestricted($restricted) { + $this->restricted = $restricted; + } + public function getRestricted() { + return $this->restricted; + } + public function setStarred($starred) { + $this->starred = $starred; + } + public function getStarred() { + return $this->starred; + } + public function setTrashed($trashed) { + $this->trashed = $trashed; + } + public function getTrashed() { + return $this->trashed; + } + public function setViewed($viewed) { + $this->viewed = $viewed; + } + public function getViewed() { + return $this->viewed; + } +} + +class Google_DriveFileThumbnail extends Google_Model { + public $image; + public $mimeType; + public function setImage($image) { + $this->image = $image; + } + public function getImage() { + return $this->image; + } + public function setMimeType($mimeType) { + $this->mimeType = $mimeType; + } + public function getMimeType() { + return $this->mimeType; + } +} + +class Google_FileList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_DriveFile'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $nextLink; + public $nextPageToken; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_DriveFile) */ $items) { + $this->assertIsArray($items, 'Google_DriveFile', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setNextLink($nextLink) { + $this->nextLink = $nextLink; + } + public function getNextLink() { + return $this->nextLink; + } + public function setNextPageToken($nextPageToken) { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() { + return $this->nextPageToken; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_ParentList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_ParentReference'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_ParentReference) */ $items) { + $this->assertIsArray($items, 'Google_ParentReference', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_ParentReference extends Google_Model { + public $id; + public $isRoot; + public $kind; + public $parentLink; + public $selfLink; + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setIsRoot($isRoot) { + $this->isRoot = $isRoot; + } + public function getIsRoot() { + return $this->isRoot; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setParentLink($parentLink) { + $this->parentLink = $parentLink; + } + public function getParentLink() { + return $this->parentLink; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_Permission extends Google_Model { + public $additionalRoles; + public $authKey; + public $etag; + public $id; + public $kind; + public $name; + public $photoLink; + public $role; + public $selfLink; + public $type; + public $value; + public $withLink; + public function setAdditionalRoles(/* array(Google_string) */ $additionalRoles) { + $this->assertIsArray($additionalRoles, 'Google_string', __METHOD__); + $this->additionalRoles = $additionalRoles; + } + public function getAdditionalRoles() { + return $this->additionalRoles; + } + public function setAuthKey($authKey) { + $this->authKey = $authKey; + } + public function getAuthKey() { + return $this->authKey; + } + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setName($name) { + $this->name = $name; + } + public function getName() { + return $this->name; + } + public function setPhotoLink($photoLink) { + $this->photoLink = $photoLink; + } + public function getPhotoLink() { + return $this->photoLink; + } + public function setRole($role) { + $this->role = $role; + } + public function getRole() { + return $this->role; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } + public function setType($type) { + $this->type = $type; + } + public function getType() { + return $this->type; + } + public function setValue($value) { + $this->value = $value; + } + public function getValue() { + return $this->value; + } + public function setWithLink($withLink) { + $this->withLink = $withLink; + } + public function getWithLink() { + return $this->withLink; + } +} + +class Google_PermissionList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_Permission'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_Permission) */ $items) { + $this->assertIsArray($items, 'Google_Permission', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_Property extends Google_Model { + public $etag; + public $key; + public $kind; + public $selfLink; + public $value; + public $visibility; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setKey($key) { + $this->key = $key; + } + public function getKey() { + return $this->key; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } + public function setValue($value) { + $this->value = $value; + } + public function getValue() { + return $this->value; + } + public function setVisibility($visibility) { + $this->visibility = $visibility; + } + public function getVisibility() { + return $this->visibility; + } +} + +class Google_PropertyList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_Property'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_Property) */ $items) { + $this->assertIsArray($items, 'Google_Property', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_Revision extends Google_Model { + public $downloadUrl; + public $etag; + public $exportLinks; + public $fileSize; + public $id; + public $kind; + protected $__lastModifyingUserType = 'Google_User'; + protected $__lastModifyingUserDataType = ''; + public $lastModifyingUser; + public $lastModifyingUserName; + public $md5Checksum; + public $mimeType; + public $modifiedDate; + public $originalFilename; + public $pinned; + public $publishAuto; + public $published; + public $publishedLink; + public $publishedOutsideDomain; + public $selfLink; + public function setDownloadUrl($downloadUrl) { + $this->downloadUrl = $downloadUrl; + } + public function getDownloadUrl() { + return $this->downloadUrl; + } + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setExportLinks($exportLinks) { + $this->exportLinks = $exportLinks; + } + public function getExportLinks() { + return $this->exportLinks; + } + public function setFileSize($fileSize) { + $this->fileSize = $fileSize; + } + public function getFileSize() { + return $this->fileSize; + } + public function setId($id) { + $this->id = $id; + } + public function getId() { + return $this->id; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setLastModifyingUser(Google_User $lastModifyingUser) { + $this->lastModifyingUser = $lastModifyingUser; + } + public function getLastModifyingUser() { + return $this->lastModifyingUser; + } + public function setLastModifyingUserName($lastModifyingUserName) { + $this->lastModifyingUserName = $lastModifyingUserName; + } + public function getLastModifyingUserName() { + return $this->lastModifyingUserName; + } + public function setMd5Checksum($md5Checksum) { + $this->md5Checksum = $md5Checksum; + } + public function getMd5Checksum() { + return $this->md5Checksum; + } + public function setMimeType($mimeType) { + $this->mimeType = $mimeType; + } + public function getMimeType() { + return $this->mimeType; + } + public function setModifiedDate($modifiedDate) { + $this->modifiedDate = $modifiedDate; + } + public function getModifiedDate() { + return $this->modifiedDate; + } + public function setOriginalFilename($originalFilename) { + $this->originalFilename = $originalFilename; + } + public function getOriginalFilename() { + return $this->originalFilename; + } + public function setPinned($pinned) { + $this->pinned = $pinned; + } + public function getPinned() { + return $this->pinned; + } + public function setPublishAuto($publishAuto) { + $this->publishAuto = $publishAuto; + } + public function getPublishAuto() { + return $this->publishAuto; + } + public function setPublished($published) { + $this->published = $published; + } + public function getPublished() { + return $this->published; + } + public function setPublishedLink($publishedLink) { + $this->publishedLink = $publishedLink; + } + public function getPublishedLink() { + return $this->publishedLink; + } + public function setPublishedOutsideDomain($publishedOutsideDomain) { + $this->publishedOutsideDomain = $publishedOutsideDomain; + } + public function getPublishedOutsideDomain() { + return $this->publishedOutsideDomain; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_RevisionList extends Google_Model { + public $etag; + protected $__itemsType = 'Google_Revision'; + protected $__itemsDataType = 'array'; + public $items; + public $kind; + public $selfLink; + public function setEtag($etag) { + $this->etag = $etag; + } + public function getEtag() { + return $this->etag; + } + public function setItems(/* array(Google_Revision) */ $items) { + $this->assertIsArray($items, 'Google_Revision', __METHOD__); + $this->items = $items; + } + public function getItems() { + return $this->items; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setSelfLink($selfLink) { + $this->selfLink = $selfLink; + } + public function getSelfLink() { + return $this->selfLink; + } +} + +class Google_User extends Google_Model { + public $displayName; + public $isAuthenticatedUser; + public $kind; + public $permissionId; + protected $__pictureType = 'Google_UserPicture'; + protected $__pictureDataType = ''; + public $picture; + public function setDisplayName($displayName) { + $this->displayName = $displayName; + } + public function getDisplayName() { + return $this->displayName; + } + public function setIsAuthenticatedUser($isAuthenticatedUser) { + $this->isAuthenticatedUser = $isAuthenticatedUser; + } + public function getIsAuthenticatedUser() { + return $this->isAuthenticatedUser; + } + public function setKind($kind) { + $this->kind = $kind; + } + public function getKind() { + return $this->kind; + } + public function setPermissionId($permissionId) { + $this->permissionId = $permissionId; + } + public function getPermissionId() { + return $this->permissionId; + } + public function setPicture(Google_UserPicture $picture) { + $this->picture = $picture; + } + public function getPicture() { + return $this->picture; + } +} + +class Google_UserPicture extends Google_Model { + public $url; + public function setUrl($url) { + $this->url = $url; + } + public function getUrl() { + return $this->url; + } +} diff --git a/apps/files_external/3rdparty/google-api-php-client/src/external/URITemplateParser.php b/apps/files_external/3rdparty/google-api-php-client/src/external/URITemplateParser.php new file mode 100644 index 0000000000..594adbb15e --- /dev/null +++ b/apps/files_external/3rdparty/google-api-php-client/src/external/URITemplateParser.php @@ -0,0 +1,209 @@ +template = $template; + } + + public function expand($data) { + // Modification to make this a bit more performant (since gettype is very slow) + if (! is_array($data)) { + $data = (array)$data; + } + /* + // Original code, which uses a slow gettype() statement, kept in place for if the assumption that is_array always works here is incorrect + switch (gettype($data)) { + case "boolean": + case "integer": + case "double": + case "string": + case "object": + $data = (array)$data; + break; + } +*/ + + // Resolve template vars + preg_match_all('/\{([^\}]*)\}/', $this->template, $em); + + foreach ($em[1] as $i => $bare_expression) { + preg_match('/^([\+\;\?\/\.]{1})?(.*)$/', $bare_expression, $lm); + $exp = new StdClass(); + $exp->expression = $em[0][$i]; + $exp->operator = $lm[1]; + $exp->variable_list = $lm[2]; + $exp->varspecs = explode(',', $exp->variable_list); + $exp->vars = array(); + foreach ($exp->varspecs as $varspec) { + preg_match('/^([a-zA-Z0-9_]+)([\*\+]{1})?([\:\^][0-9-]+)?(\=[^,]+)?$/', $varspec, $vm); + $var = new StdClass(); + $var->name = $vm[1]; + $var->modifier = isset($vm[2]) && $vm[2] ? $vm[2] : null; + $var->modifier = isset($vm[3]) && $vm[3] ? $vm[3] : $var->modifier; + $var->default = isset($vm[4]) ? substr($vm[4], 1) : null; + $exp->vars[] = $var; + } + + // Add processing flags + $exp->reserved = false; + $exp->prefix = ''; + $exp->delimiter = ','; + switch ($exp->operator) { + case '+': + $exp->reserved = 'true'; + break; + case ';': + $exp->prefix = ';'; + $exp->delimiter = ';'; + break; + case '?': + $exp->prefix = '?'; + $exp->delimiter = '&'; + break; + case '/': + $exp->prefix = '/'; + $exp->delimiter = '/'; + break; + case '.': + $exp->prefix = '.'; + $exp->delimiter = '.'; + break; + } + $expressions[] = $exp; + } + + // Expansion + $this->expansion = $this->template; + + foreach ($expressions as $exp) { + $part = $exp->prefix; + $exp->one_var_defined = false; + foreach ($exp->vars as $var) { + $val = ''; + if ($exp->one_var_defined && isset($data[$var->name])) { + $part .= $exp->delimiter; + } + // Variable present + if (isset($data[$var->name])) { + $exp->one_var_defined = true; + $var->data = $data[$var->name]; + + $val = self::val_from_var($var, $exp); + + // Variable missing + } else { + if ($var->default) { + $exp->one_var_defined = true; + $val = $var->default; + } + } + $part .= $val; + } + if (! $exp->one_var_defined) $part = ''; + $this->expansion = str_replace($exp->expression, $part, $this->expansion); + } + + return $this->expansion; + } + + private function val_from_var($var, $exp) { + $val = ''; + if (is_array($var->data)) { + $i = 0; + if ($exp->operator == '?' && ! $var->modifier) { + $val .= $var->name . '='; + } + foreach ($var->data as $k => $v) { + $del = $var->modifier ? $exp->delimiter : ','; + $ek = rawurlencode($k); + $ev = rawurlencode($v); + + // Array + if ($k !== $i) { + if ($var->modifier == '+') { + $val .= $var->name . '.'; + } + if ($exp->operator == '?' && $var->modifier || $exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+') { + $val .= $ek . '='; + } else { + $val .= $ek . $del; + } + + // List + } else { + if ($var->modifier == '+') { + if ($exp->operator == ';' && $var->modifier == '*' || $exp->operator == ';' && $var->modifier == '+' || $exp->operator == '?' && $var->modifier == '+') { + $val .= $var->name . '='; + } else { + $val .= $var->name . '.'; + } + } + } + $val .= $ev . $del; + $i ++; + } + $val = trim($val, $del); + + // Strings, numbers, etc. + } else { + if ($exp->operator == '?') { + $val = $var->name . (isset($var->data) ? '=' : ''); + } else if ($exp->operator == ';') { + $val = $var->name . ($var->data ? '=' : ''); + } + $val .= rawurlencode($var->data); + if ($exp->operator == '+') { + $val = str_replace(self::$reserved_pct, self::$reserved, $val); + } + } + return $val; + } + + public function match($uri) {} + + public function __toString() { + return $this->template; + } +} diff --git a/apps/files_external/3rdparty/google-api-php-client/src/io/Google_CacheParser.php b/apps/files_external/3rdparty/google-api-php-client/src/io/Google_CacheParser.php new file mode 100644 index 0000000000..7f5accfefe --- /dev/null +++ b/apps/files_external/3rdparty/google-api-php-client/src/io/Google_CacheParser.php @@ -0,0 +1,173 @@ + + */ +class Google_CacheParser { + public static $CACHEABLE_HTTP_METHODS = array('GET', 'HEAD'); + public static $CACHEABLE_STATUS_CODES = array('200', '203', '300', '301'); + + private function __construct() {} + + /** + * Check if an HTTP request can be cached by a private local cache. + * + * @static + * @param Google_HttpRequest $resp + * @return bool True if the request is cacheable. + * False if the request is uncacheable. + */ + public static function isRequestCacheable (Google_HttpRequest $resp) { + $method = $resp->getRequestMethod(); + if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) { + return false; + } + + // Don't cache authorized requests/responses. + // [rfc2616-14.8] When a shared cache receives a request containing an + // Authorization field, it MUST NOT return the corresponding response + // as a reply to any other request... + if ($resp->getRequestHeader("authorization")) { + return false; + } + + return true; + } + + /** + * Check if an HTTP response can be cached by a private local cache. + * + * @static + * @param Google_HttpRequest $resp + * @return bool True if the response is cacheable. + * False if the response is un-cacheable. + */ + public static function isResponseCacheable (Google_HttpRequest $resp) { + // First, check if the HTTP request was cacheable before inspecting the + // HTTP response. + if (false == self::isRequestCacheable($resp)) { + return false; + } + + $code = $resp->getResponseHttpCode(); + if (! in_array($code, self::$CACHEABLE_STATUS_CODES)) { + return false; + } + + // The resource is uncacheable if the resource is already expired and + // the resource doesn't have an ETag for revalidation. + $etag = $resp->getResponseHeader("etag"); + if (self::isExpired($resp) && $etag == false) { + return false; + } + + // [rfc2616-14.9.2] If [no-store is] sent in a response, a cache MUST NOT + // store any part of either this response or the request that elicited it. + $cacheControl = $resp->getParsedCacheControl(); + if (isset($cacheControl['no-store'])) { + return false; + } + + // Pragma: no-cache is an http request directive, but is occasionally + // used as a response header incorrectly. + $pragma = $resp->getResponseHeader('pragma'); + if ($pragma == 'no-cache' || strpos($pragma, 'no-cache') !== false) { + return false; + } + + // [rfc2616-14.44] Vary: * is extremely difficult to cache. "It implies that + // a cache cannot determine from the request headers of a subsequent request + // whether this response is the appropriate representation." + // Given this, we deem responses with the Vary header as uncacheable. + $vary = $resp->getResponseHeader('vary'); + if ($vary) { + return false; + } + + return true; + } + + /** + * @static + * @param Google_HttpRequest $resp + * @return bool True if the HTTP response is considered to be expired. + * False if it is considered to be fresh. + */ + public static function isExpired(Google_HttpRequest $resp) { + // HTTP/1.1 clients and caches MUST treat other invalid date formats, + // especially including the value “0”, as in the past. + $parsedExpires = false; + $responseHeaders = $resp->getResponseHeaders(); + if (isset($responseHeaders['expires'])) { + $rawExpires = $responseHeaders['expires']; + // Check for a malformed expires header first. + if (empty($rawExpires) || (is_numeric($rawExpires) && $rawExpires <= 0)) { + return true; + } + + // See if we can parse the expires header. + $parsedExpires = strtotime($rawExpires); + if (false == $parsedExpires || $parsedExpires <= 0) { + return true; + } + } + + // Calculate the freshness of an http response. + $freshnessLifetime = false; + $cacheControl = $resp->getParsedCacheControl(); + if (isset($cacheControl['max-age'])) { + $freshnessLifetime = $cacheControl['max-age']; + } + + $rawDate = $resp->getResponseHeader('date'); + $parsedDate = strtotime($rawDate); + + if (empty($rawDate) || false == $parsedDate) { + $parsedDate = time(); + } + if (false == $freshnessLifetime && isset($responseHeaders['expires'])) { + $freshnessLifetime = $parsedExpires - $parsedDate; + } + + if (false == $freshnessLifetime) { + return true; + } + + // Calculate the age of an http response. + $age = max(0, time() - $parsedDate); + if (isset($responseHeaders['age'])) { + $age = max($age, strtotime($responseHeaders['age'])); + } + + return $freshnessLifetime <= $age; + } + + /** + * Determine if a cache entry should be revalidated with by the origin. + * + * @param Google_HttpRequest $response + * @return bool True if the entry is expired, else return false. + */ + public static function mustRevalidate(Google_HttpRequest $response) { + // [13.3] When a cache has a stale entry that it would like to use as a + // response to a client's request, it first has to check with the origin + // server to see if its cached entry is still usable. + return self::isExpired($response); + } +} \ No newline at end of file diff --git a/apps/files_external/3rdparty/google-api-php-client/src/io/Google_CurlIO.php b/apps/files_external/3rdparty/google-api-php-client/src/io/Google_CurlIO.php new file mode 100644 index 0000000000..65352f2988 --- /dev/null +++ b/apps/files_external/3rdparty/google-api-php-client/src/io/Google_CurlIO.php @@ -0,0 +1,278 @@ + + * @author Chirag Shah\n"; + return RODSConnManager::getConn($account); + } + + public static function releaseConn(RODSConn $conn) + { + $manager = $GLOBALS['RODSConnManager']; + $conn_sig = $conn->getSignature(); + + //echo "id:".$conn->getId()." ".implode(",",array_keys($manager->conn_map[$conn_sig]))." \n"; + + if (isset($manager->conn_map[$conn_sig][$conn->getId()])) { + $manager->conn_map[$conn_sig][$conn->getId()]->unlock(); + } + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSDirStats.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSDirStats.class.php new file mode 100644 index 0000000000..16d24584f4 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSDirStats.class.php @@ -0,0 +1,25 @@ +name = $name; + $this->owner = $owner; + $this->ownerzone = $ownerzone; + $this->mtime = $mtime; + $this->ctime = $ctime; + $this->id = $id; + $this->comments = $comments; + } + +} + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php new file mode 100644 index 0000000000..52eb95bbfb --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSException.class.php @@ -0,0 +1,184 @@ + + * @copyright Copyright © 2007, TBD + * @package Prods + */ + +$errtable_file = dirname(__FILE__) . "/RodsErrorTable.inc.php"; + +if (is_readable($errtable_file)) + require_once($errtable_file); +else + die("Could not read file $errtable_file \n"); + +/** + * custom exception class for RODS + */ +class RODSException extends Exception +{ + private $code_abbr; + private $cause; + + /** + * Makes a new RODS excption + * @param string $message err/exception message + * @param string $code_abbr error code abbreviation + */ + public function __construct($message, $code_abbr = "UNKNOWN_PRODS_ERR", + Exception $cause = NULL) + { + $this->code_abbr = $code_abbr; + $this->cause = $cause; + + parent::__construct($message, $GLOBALS['PRODS_ERR_CODES'][$code_abbr]); + } + + public function getCause() + { + return $this->cause; + } + + public function getCodeAbbr() + { + return $this->code_abbr; + } + + public static function rodsErrCodeToAbbr($code) + { + if (isset($GLOBALS['PRODS_ERR_CODES_REV']["$code"])) + return $GLOBALS['PRODS_ERR_CODES_REV']["$code"]; + else + return null; + } + + public static function rodsErrAbbrToCode($codeabbr) + { + if (isset($GLOBALS['PRODS_ERR_CODES']["$codeabbr"])) + return $GLOBALS['PRODS_ERR_CODES']["$codeabbr"]; + else + return null; + } + + public function getStackTrace() + { + if ($this->cause !== null) { + $arr = array(); + $trace = $this->getTrace(); + array_push($arr, $trace[0]); + unset($trace); + if (get_class($this->cause) == "RODSException") { + foreach ($this->cause->getStackTrace() as $key => $trace) { + array_push($arr, $trace); + } + } else { + foreach ($this->cause->getTrace() as $key => $trace) { + array_push($arr, $trace); + } + } + return $arr; + } else { + return $this->getTrace(); + } + } + + public function showStackTrace() + { + $htmldoc = " An exception was thrown : "; + } + return $htmldoc; + } + + /** + * Magic function to turn exception obj to a string + */ + public function __toString() + { + return __CLASS__ . ": [{$this->code} $this->code_abbr]: {$this->message}\n"; + //return $this->showStackTrace(); + } + +} + +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSFileStats.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSFileStats.class.php new file mode 100644 index 0000000000..6452c2b1e5 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSFileStats.class.php @@ -0,0 +1,34 @@ +name = $name; + $this->size = $size; + $this->owner = $owner; + $this->ownerzone = $ownerzone; + $this->mtime = $mtime; + $this->ctime = $ctime; + $this->id = $id; + $this->typename = $typename; + $this->rescname = $rescname; + $this->comments = $comments; + $this->num_replica = $num_replica; + } + +} + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php new file mode 100644 index 0000000000..848f29e85e --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueConds.class.php @@ -0,0 +1,114 @@ +=' and val='0', then the triplex means + * "foo >= 0" as one iRODS general query condition. + * @param array (of string) $names names of the field, which must be one defined in file 'RodsGenQueryNum.inc.php'. + * @param array (of string) $ops logical operator, such as '=' 'like' '>' + * @param array (of string) $vals value of the filed + */ + public function __construct(array $names = array(), array $ops = array(), + array $vals = array()) + { + require_once("RodsGenQueryNum.inc.php"); //load magic numbers + require_once("RodsGenQueryKeyWd.inc.php"); //load magic keywords + + $this->cond = array('names' => array(), 'sysnames' => array(), 'values' => array()); + $this->cond_kw = array('names' => array(), 'sysnames' => array(), 'values' => array()); + + for ($i = 0; $i < count($names); $i++) { + $name = $names[$i]; + $op = $ops[$i]; + $val = $vals[$i]; + if (isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { + $this->cond['names'][] = $name; + $this->cond['sysnames'][] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; + $this->cond['values'][] = "$op '$val'"; + } else + if (isset($GLOBALS['PRODS_GENQUE_KEYWD']["$name"])) { + $this->cond_kw['names'][] = $name; + $this->cond_kw['sysnames'][] = $GLOBALS['PRODS_GENQUE_KEYWD']["$name"]; + $this->cond_kw['values'][] = "$op '$val'"; + } else { + throw new RODSException("General Query condition field name '$name' is not valid", + 'PERR_USER_INPUT_ERROR'); + } + } + } + + /** + * Add a single select field. + * @param string $name names of the field, which must be one defined in file 'RodsGenQueryNum.inc.php'. + * @param string $op logical operator, such as '=' 'like' '>' + * @param string $val value of the filed + * @param array an array of tuples of extra op's and val's, each tuple is an assosive array that has key 'op' and 'val'. These conditions will be 'OR' with the other conditions. + * for example add ('COL_D_DATA_ID','like', '/tempZone/home/rods/%', array(array('op'=>'=','val'=>'/tempZone/home/rods'"))) + * would select all file ids both in subdirectories under '/tempZone/home/rods' and directly under '/tempZone/home/rods' + */ + public function add($name, $op, $val, array $OR_ops_vals = array()) + { + require_once("RodsGenQueryNum.inc.php"); //load magic numbers + require_once("RodsGenQueryKeyWd.inc.php"); //load magic keywords + + if (isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { + $this->cond['names'][] = $name; + $this->cond['sysnames'][] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; + $value = "$op '$val'"; + foreach ($OR_ops_vals as $op_val) { + $or_op = $op_val['op']; + $or_val = $op_val['val']; + if (empty($or_op) || empty($or_val)) + continue; + $value = $value . " || $or_op '$or_val'"; + } + $this->cond['values'][] = $value; + } else + if (isset($GLOBALS['PRODS_GENQUE_KEYWD']["$name"])) { + $this->cond_kw['names'][] = $name; + $this->cond_kw['sysnames'][] = $GLOBALS['PRODS_GENQUE_KEYWD']["$name"]; + $value = "$op '$val'"; + foreach ($OR_ops_vals as $op_val) { + $or_op = $op_val['op']; + $or_val = $op_val['val']; + if (empty($or_op) || empty($or_val)) + continue; + $value = $value . " || $or_op '$or_val'"; + } + $this->cond_kw['values'][] = $value; + } else { + throw new RODSException("General Query condition field name '$name' is not valid", + 'PERR_USER_INPUT_ERROR'); + } + } + + /** + * make a RP_InxValPair. + */ + public function packetize() + { + return (new RP_InxValPair(count($this->cond['names']), + $this->cond['sysnames'], $this->cond['values'])); + } + + /** + * make a RP_KeyValPair. + */ + public function packetizeKW() + { + return (new RP_KeyValPair(count($this->cond_kw['names']), + $this->cond_kw['sysnames'], $this->cond_kw['values'])); + } + + public function getCond() + { + return $this->cond; + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php new file mode 100644 index 0000000000..41be1069af --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueResults.class.php @@ -0,0 +1,99 @@ +total_count = $total_count; + $this->values = $result_array; + $this->numcol = count($result_array); + if ($this->numcol > 0) + $this->numrow = count(current($result_array)); + else + $this->numrow = 0; + } + + /** + * Add general query result packet RP_GenQueryOut, directly from the protocol level query, into the result structure. + * @param RP_GenQueryOut $genque_result_pk result packet directly from the protocol level query. + * @return number of rows just added + */ + public function addResults(RP_GenQueryOut $genque_result_pk) + { + if ($genque_result_pk->totalRowCount > $this->total_count) + $this->total_count = $genque_result_pk->totalRowCount; + + require_once("RodsGenQueryNum.inc.php"); //load magic numbers + + $num_row_added = 0; + for ($i = 0; $i < $genque_result_pk->attriCnt; $i++) { + $sql_res_pk = $genque_result_pk->SqlResult_PI[$i]; + $attri_name = $GLOBALS['PRODS_GENQUE_NUMS_REV'][$sql_res_pk->attriInx]; + if (empty($this->values["$attri_name"])) + $this->values["$attri_name"] = $sql_res_pk->value; + else + array_splice($this->values["$attri_name"], + count($this->values["$attri_name"]), 0, $sql_res_pk->value); + if ($i == 0) { + $num_row_added = count($sql_res_pk->value); + if ($num_row_added != (int)$genque_result_pk->rowCnt) { + throw new RODSException("Gen Query result packet num row mismatch. Expect: $genque_result_pk->rowCnt, got: $num_row_added", + 'PERR_UNEXPECTED_PACKET_FORMAT'); + } + } + } + + $this->numcol = count($this->values); + if ($this->numcol > 0) + $this->numrow = count(current($this->values)); + else + $this->numrow = 0; + + return $num_row_added; + } + + /** + * get result values in (2-d) array, each array key is the name + * used RODSGenQueSelFlds, such as COL_COLL_NAME + */ + public function getValues() + { + return $this->values; + } + + /** + * get total result count, including all the potential results not returned. + */ + public function getTotalCount() + { + return $this->total_count; + } + + /** + * get number of columns/fields of the results. + */ + public function getNumCol() + { + return $this->numcol; + } + + /** + * get number of rows of the results. + */ + public function getNumRow() + { + return $this->numrow; + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php new file mode 100644 index 0000000000..10a32f6614 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSGenQueSelFlds.class.php @@ -0,0 +1,160 @@ +names = $names; + $this->attrs = array(); + $this->indexes = array(); + + for ($i = 0; $i < count($names); $i++) { + $name = $names[$i]; + if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { + throw new RODSException("General Query select field name '$name' is not valid", + 'PERR_USER_INPUT_ERROR'); + } + $this->indexes[] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; + $this->attrs[] = RODSGenQueSelFlds::attr2GenQueNumber($attrs[$i]); + } + + } + + /** + * Add a single select field. + * + * @param string name name of the field, which must be one defined in file 'RodsGenQueryNum.inc.php'. + */ + public function add($name, $attr = NULL) + { + require_once("RodsGenQueryNum.inc.php"); //load magic numbers + if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { + throw new RODSException("General Query select field name '$name' is not valid", + 'PERR_USER_INPUT_ERROR'); + } + $this->indexes[] = $GLOBALS['PRODS_GENQUE_NUMS']["$name"]; + $this->names[] = $name; + $this->attrs[] = RODSGenQueSelFlds::attr2GenQueNumber($attr); + } + + /** + * update a single select field's attr/value. Note that if the value already exists, + * it will OR the bits. This is used when you want more than one type of operation + * for a select field, such as select_max and sort. + */ + public function update($name, $attr) + { + require_once("RodsGenQueryNum.inc.php"); //load magic numbers + if (!isset($GLOBALS['PRODS_GENQUE_NUMS']["$name"])) { + throw new RODSException("General Query select field name '$name' is not valid", + 'PERR_USER_INPUT_ERROR'); + } + + $newattr = RODSGenQueSelFlds::attr2GenQueNumber($attr); + for ($i = 0; $i < count($this->names); $i++) { + if ($this->names[$i] == $name) { + if ($this->attrs[$i] == 1) + $this->attrs[$i] = $newattr; + else + $this->attrs[$i] = $newattr | $this->attrs[$i]; + return; + } + } + $this->add($name, $attr); + } + + /** + * Convert supported attribute to magic number, that iRODS protocol uses + * Following attributes are supported: + * - 'order_by_asc' order the result by this field, in ASCENDING order + * - 'order_by_desc' order the result by this field, in DESCENDING order + * - min minimum of the group + * - max maximum of the group + * - sum sum of the group + * - avg average of the group + * - count count of the group + */ + public static function attr2GenQueNumber($attr) + { + if (empty($attr)) return 1; + $retval = 1; + switch ($attr) { + case 'order_by_asc': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['ORDER_BY']; + break; + case 'order_by_desc': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['ORDER_BY_DESC']; + break; + case 'min': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_MIN']; + break; + case 'max': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_MAX']; + break; + case 'sum': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_SUM']; + break; + case 'avg': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_AVG']; + break; + case 'count': + $retval = $GLOBALS['PRODS_GENQUE_NUMS']['SELECT_COUNT']; + break; + default: + throw new RODSException("Unexpected attribute: '$attr'", + 'PERR_USER_INPUT_ERROR'); + } + return intval($retval); + } + + /** + * make a RP_InxIvalPair, a low level iRODS packet + */ + public function packetize() + { + return (new RP_InxIvalPair(count($this->names), $this->indexes, + $this->attrs)); + + } + + public function getIndexes() + { + return $this->indexes; + } + + public function getAttrs() + { + return $this->attrs; + } + + public function getCount() + { + return count($this->names); + } + + public function getNames() + { + return $this->names; + } + +} + +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php new file mode 100644 index 0000000000..31b720cf19 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSKeyValPair.class.php @@ -0,0 +1,50 @@ + + * @copyright Copyright © 2007, TBD + * @package RODSConn + */ + + +require_once("autoload.inc.php"); + +class RODSKeyValPair +{ + private $keys; + private $vals; + + public function __construct(array $arr = array()) + { + $this->keys = array_keys($arr); + $this->vals = array_values($arr); + } + + public function addPair($key, $val) + { + $this->keys[] = $key; + $this->vals[] = $val; + } + + /** + * Make a RP_KeyValPair + * @return RP_KeyValPair a RP_KeyValPair object + */ + public function makePacket() + { + return new RP_KeyValPair(count($this->keys), $this->keys, $this->vals); + } + + /** + * make a RODSKeyValPair from a RP_KeyValPair + */ + public static function fromPacket(RP_KeyValPair $RP_KeyValPair) + { + $new_keyval = new RODSKeyValPair(); + $new_keyval->keys = $RP_KeyValPair->keyWord; + $new_keyval->vals = $RP_KeyValPair->svalue; + return $new_keyval; + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php new file mode 100644 index 0000000000..ca3e8bc23a --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMessage.class.php @@ -0,0 +1,185 @@ + "RODS_CONNECT", + "RODS_VERSION_T" => "RODS_VERSION", + "RODS_API_REQ_T" => "RODS_API_REQ", + "RODS_DISCONNECT_T" => "RODS_DISCONNECT", + "RODS_REAUTH_T" => "RODS_REAUTH", + "RODS_API_REPLY_T" => "RODS_API_REPLY" +); + +class RODSMessage +{ + private $type; // (String) message type, such as "RODS_CONNECT_T" + private $typestr; // (String) str representation of the type that RODS server understand + private $msg; // (RODSPacket) main message body + private $header; // (RODSPacket) a special packet, header for other packets + private $header_xml; // (string) packet header in XML + private $msg_xml; // (string) message in XML + private $binstr; // (string) binary string + private $errstr; // (string) error string + private $intinfo; // an additional integer info, for API, it is the + // apiReqNum + private $serialized; + + public function __construct($type = NULL, $_msg = NULL, $intinfo = 0, $binstr = "", $errstr = "") + { + if (!isset($type)) { + return; + } + + $this->type = $type; + $RODSMessage_types = $GLOBALS['RODSMessage_types']; + if (!isset($RODSMessage_types[$type])) { + throw new RODSException("RODSMessage::__construct failed.1! Unknown type '$type'", + "PERR_INTERNAL_ERR"); + } + $this->typestr = $RODSMessage_types[$type]; + + if (isset($_msg)) { + if (!($_msg instanceof RODSPacket)) { + throw new RODSException("RODSMessage::__construct failed.2!", + "PERR_INTERNAL_ERR"); + } + } + $this->msg = $_msg; + $this->intinfo = $intinfo; + $this->binstr = $binstr; + $this->errstr = $errstr; + } + + public function pack() + { + if (isset($this->msg)) + $this->msg_xml = $this->msg->toXML(); + + $this->header = new RP_MsgHeader($this->typestr, strlen($this->msg_xml), + strlen($this->errstr), strlen($this->binstr), $this->intinfo); + $header_xml = $this->header->toXML(); + $this->serialized = pack("N", strlen($header_xml)) . $header_xml . + $this->msg_xml; + return $this->serialized; + } + + + public function unpack($conn, &$bslen = NULL) + { + if (FALSE === ($chunk = stream_get_contents($conn, 4))) { + throw new RODSException("RODSMessage::unpack failed.0! ", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + + + $arr = unpack("Nlen", $chunk); + $header_len = $arr['len']; + if ((!is_int($header_len)) || ($header_len < 1) || ($header_len > 8192 - 4)) { + throw new RODSException("RODSMessage::unpack failed.1! The header length is unexpected: '$header_len'", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + + $this->header_xml = stream_get_contents($conn, $header_len); + $this->parseHeaderXML($this->header_xml); + $intInfo = $this->header->intInfo; + + // get main msg string + $msg_len = $this->header->msgLen; + $this->msg_xml = stream_get_contents($conn, $msg_len); + if ($msg_len != strlen($this->msg_xml)) { + throw new RODSException("RODSMessage::unpack failed.2! " . + "The body length is unexpected: " . strlen($this->msg_xml) . + " expecting: $msg_len", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + if ($msg_len > 0) { + $this->parseBodyXML($this->msg_xml); + } + + // get err string + $errlen = $this->header->errorLen; + $this->errstr = stream_get_contents($conn, $errlen); + if ($errlen != strlen($this->errstr)) { + throw new RODSException("RODSMessage::unpack failed.3! " . + "The err length is unexpected: " . strlen($this->errstr) . + " expecting: $errlen", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + + // get bin string + $bslen = $this->header->bsLen; + $this->binstr = stream_get_contents($conn, $bslen); + if ($bslen != strlen($this->binstr)) { + throw new RODSException("RODSMessage::unpack failed.4! " . + "The bin str length is unexpected: " . strlen($this->binstr) . + " expecting: $bslen", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + + return $this->header->intInfo; + } + + private function parseHeaderXML($xmlstr) + { + $xml = new SimpleXMLElement($xmlstr); + $name = $xml->getName(); + if ($name != "MsgHeader_PI") { + throw new RODSException("RODSMessage::parseHeaderXML failed! " . + "The XML header name is unexpected:$name " . + " expecting: MsgHeader_PI", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + $this->header = new RP_MsgHeader(); + $this->header->fromSXE($xml); + } + + private function parseBodyXML($xmlstr) + { + //try { + $xml = new SimpleXMLElement($xmlstr); + $name = $xml->getName(); + if (substr($name, -3, 3) != "_PI") { + throw new RODSException("RODSMessage::parseMainBodyXML failed! " . + "The XML node's name is unexpected:$name " . + " expecting some thing like xxx_PI", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + $rp_classname = "RP_" . substr($name, 0, strlen($name) - 3); + $this->msg = new $rp_classname(); + $this->msg->fromSXE($xml); + + /*} catch (Exception $e) { + throw new RODSException("RODSMessage::parseMainBodyXML failed! ". + "Mal formated XML in RODS message :". + $xmlstr, + "SYS_PACK_INSTRUCT_FORMAT_ERR",$e); + } + */ + } + + public function getBody() + { + return $this->msg; + } + + public function getBinstr() + { + return $this->binstr; + } + + public function getXML() + { + return $this->header_xml . "\n" . $this->msg_xml; + } + + public static function packConnectMsg($user, $zone, $relVersion = RODS_REL_VERSION, + $apiVersion = RODS_API_VERSION, $option = NULL) + { + $msgbody = new RP_StartupPack($user, $zone, $relVersion, $apiVersion . $option); + $rods_msg = new RODSMessage("RODS_CONNECT_T", $msgbody); + return $rods_msg->pack(); + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSMeta.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMeta.class.php new file mode 100644 index 0000000000..55d48af19d --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSMeta.class.php @@ -0,0 +1,21 @@ +name = $name; + $this->value = $value; + $this->units = $units; + $this->id = $id; + $this->op = $op; + } + +} + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php new file mode 100644 index 0000000000..95807d12ea --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSObjIOOpr.inc.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RODSQueryCondition.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/RODSQueryCondition.class.php new file mode 100644 index 0000000000..ecc0282065 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RODSQueryCondition.class.php @@ -0,0 +1,22 @@ +name = $name; + $this->value = $value; + $this->op = $op; + } + + public function __toString() + { + return "$this->name $this->op '$this->value'"; + } + +} + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php new file mode 100644 index 0000000000..c4e2c03117 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsAPINum.inc.php @@ -0,0 +1,217 @@ + '500', + 'FILE_OPEN_AN' => '501', + 'FILE_WRITE_AN' => '502', + 'FILE_CLOSE_AN' => '503', + 'FILE_LSEEK_AN' => '504', + 'FILE_READ_AN' => '505', + 'FILE_UNLINK_AN' => '506', + 'FILE_MKDIR_AN' => '507', + 'FILE_CHMOD_AN' => '508', + 'FILE_RMDIR_AN' => '509', + 'FILE_STAT_AN' => '510', + 'FILE_FSTAT_AN' => '511', + 'FILE_FSYNC_AN' => '512', + 'FILE_STAGE_AN' => '513', + 'FILE_GET_FS_FREE_SPACE_AN' => '514', + 'FILE_OPENDIR_AN' => '515', + 'FILE_CLOSEDIR_AN' => '516', + 'FILE_READDIR_AN' => '517', + 'FILE_PUT_AN' => '518', + 'FILE_GET_AN' => '519', + 'FILE_CHKSUM_AN' => '520', + 'CHK_N_V_PATH_PERM_AN' => '521', + 'FILE_RENAME_AN' => '522', + 'FILE_TRUNCATE_AN' => '523', + 'DATA_OBJ_CREATE_AN' => '601', + 'DATA_OBJ_OPEN_AN' => '602', + 'DATA_OBJ_READ_AN' => '603', + 'DATA_OBJ_WRITE_AN' => '604', + 'DATA_OBJ_CLOSE_AN' => '605', + 'DATA_OBJ_PUT_AN' => '606', + 'DATA_PUT_AN' => '607', + 'DATA_OBJ_GET_AN' => '608', + 'DATA_GET_AN' => '609', + 'DATA_OBJ_REPL_AN' => '610', + 'DATA_COPY_AN' => '611', + 'DATA_OBJ_LSEEK_AN' => '612', + 'DATA_OBJ_COPY_AN' => '613', + 'SIMPLE_QUERY_AN' => '614', + 'DATA_OBJ_UNLINK_AN' => '615', + 'COLL_CREATE_AN' => '616', + 'RM_COLL_OLD_AN' => '617', + 'REG_COLL_AN' => '618', + 'REG_DATA_OBJ_AN' => '619', + 'UNREG_DATA_OBJ_AN' => '620', + 'REG_REPLICA_AN' => '621', + 'MOD_DATA_OBJ_META_AN' => '622', + 'RULE_EXEC_SUBMIT_AN' => '623', + 'RULE_EXEC_DEL_AN' => '624', + 'EXEC_MY_RULE_AN' => '625', + 'OPR_COMPLETE_AN' => '626', + 'DATA_OBJ_RENAME_AN' => '627', + 'DATA_OBJ_RSYNC_AN' => '628', + 'DATA_OBJ_CHKSUM_AN' => '629', + 'PHY_PATH_REG_AN' => '630', + 'DATA_OBJ_PHYMV_AN' => '631', + 'DATA_OBJ_TRIM_AN' => '632', + 'OBJ_STAT_AN' => '633', + 'EXEC_CMD_AN' => '634', + 'SUB_STRUCT_FILE_CREATE_AN' => '635', + 'SUB_STRUCT_FILE_OPEN_AN' => '636', + 'SUB_STRUCT_FILE_READ_AN' => '637', + 'SUB_STRUCT_FILE_WRITE_AN' => '638', + 'SUB_STRUCT_FILE_CLOSE_AN' => '639', + 'SUB_STRUCT_FILE_UNLINK_AN' => '640', + 'SUB_STRUCT_FILE_STAT_AN' => '641', + 'SUB_STRUCT_FILE_FSTAT_AN' => '642', + 'SUB_STRUCT_FILE_LSEEK_AN' => '643', + 'SUB_STRUCT_FILE_RENAME_AN' => '644', + 'QUERY_SPEC_COLL_AN' => '645', + 'MOD_COLL_AN' => '646', + 'SUB_STRUCT_FILE_MKDIR_AN' => '647', + 'SUB_STRUCT_FILE_RMDIR_AN' => '648', + 'SUB_STRUCT_FILE_OPENDIR_AN' => '649', + 'SUB_STRUCT_FILE_READDIR_AN' => '650', + 'SUB_STRUCT_FILE_CLOSEDIR_AN' => '651', + 'DATA_OBJ_TRUNCATE_AN' => '652', + 'SUB_STRUCT_FILE_TRUNCATE_AN' => '653', + 'GET_XMSG_TICKET_AN' => '654', + 'SEND_XMSG_AN' => '655', + 'RCV_XMSG_AN' => '656', + 'SUB_STRUCT_FILE_GET_AN' => '657', + 'SUB_STRUCT_FILE_PUT_AN' => '658', + 'SYNC_MOUNTED_COLL_AN' => '659', + 'STRUCT_FILE_SYNC_AN' => '660', + 'CLOSE_COLLECTION_AN' => '661', + 'COLL_REPL_AN' => '662', + 'RM_COLL_AN' => '663', + 'GET_MISC_SVR_INFO_AN' => '700', + 'GENERAL_ADMIN_AN' => '701', + 'GEN_QUERY_AN' => '702', + 'AUTH_REQUEST_AN' => '703', + 'AUTH_RESPONSE_AN' => '704', + 'AUTH_CHECK_AN' => '705', + 'MOD_AVU_METADATA_AN' => '706', + 'MOD_ACCESS_CONTROL_AN' => '707', + 'RULE_EXEC_MOD_AN' => '708', + 'GET_TEMP_PASSWORD_AN' => '709', + 'GENERAL_UPDATE_AN' => '710', + 'GSI_AUTH_REQUEST_AN' => '711', + 'OPEN_COLLECTION_AN' => '712', + 'READ_COLLECTION_AN' => '713', + 'PAM_AUTH_REQUEST_AN' => '725', + 'SSL_START_AN' => '1100', + 'SSL_END_AN' => '1101', +); +$GLOBALS['PRODS_API_NUMS_REV'] = array( + '500' => 'FILE_CREATE_AN', + '501' => 'FILE_OPEN_AN', + '502' => 'FILE_WRITE_AN', + '503' => 'FILE_CLOSE_AN', + '504' => 'FILE_LSEEK_AN', + '505' => 'FILE_READ_AN', + '506' => 'FILE_UNLINK_AN', + '507' => 'FILE_MKDIR_AN', + '508' => 'FILE_CHMOD_AN', + '509' => 'FILE_RMDIR_AN', + '510' => 'FILE_STAT_AN', + '511' => 'FILE_FSTAT_AN', + '512' => 'FILE_FSYNC_AN', + '513' => 'FILE_STAGE_AN', + '514' => 'FILE_GET_FS_FREE_SPACE_AN', + '515' => 'FILE_OPENDIR_AN', + '516' => 'FILE_CLOSEDIR_AN', + '517' => 'FILE_READDIR_AN', + '518' => 'FILE_PUT_AN', + '519' => 'FILE_GET_AN', + '520' => 'FILE_CHKSUM_AN', + '521' => 'CHK_N_V_PATH_PERM_AN', + '522' => 'FILE_RENAME_AN', + '523' => 'FILE_TRUNCATE_AN', + '601' => 'DATA_OBJ_CREATE_AN', + '602' => 'DATA_OBJ_OPEN_AN', + '603' => 'DATA_OBJ_READ_AN', + '604' => 'DATA_OBJ_WRITE_AN', + '605' => 'DATA_OBJ_CLOSE_AN', + '606' => 'DATA_OBJ_PUT_AN', + '607' => 'DATA_PUT_AN', + '608' => 'DATA_OBJ_GET_AN', + '609' => 'DATA_GET_AN', + '610' => 'DATA_OBJ_REPL_AN', + '611' => 'DATA_COPY_AN', + '612' => 'DATA_OBJ_LSEEK_AN', + '613' => 'DATA_OBJ_COPY_AN', + '614' => 'SIMPLE_QUERY_AN', + '615' => 'DATA_OBJ_UNLINK_AN', + '616' => 'COLL_CREATE_AN', + '617' => 'RM_COLL_OLD_AN', + '618' => 'REG_COLL_AN', + '619' => 'REG_DATA_OBJ_AN', + '620' => 'UNREG_DATA_OBJ_AN', + '621' => 'REG_REPLICA_AN', + '622' => 'MOD_DATA_OBJ_META_AN', + '623' => 'RULE_EXEC_SUBMIT_AN', + '624' => 'RULE_EXEC_DEL_AN', + '625' => 'EXEC_MY_RULE_AN', + '626' => 'OPR_COMPLETE_AN', + '627' => 'DATA_OBJ_RENAME_AN', + '628' => 'DATA_OBJ_RSYNC_AN', + '629' => 'DATA_OBJ_CHKSUM_AN', + '630' => 'PHY_PATH_REG_AN', + '631' => 'DATA_OBJ_PHYMV_AN', + '632' => 'DATA_OBJ_TRIM_AN', + '633' => 'OBJ_STAT_AN', + '634' => 'EXEC_CMD_AN', + '635' => 'SUB_STRUCT_FILE_CREATE_AN', + '636' => 'SUB_STRUCT_FILE_OPEN_AN', + '637' => 'SUB_STRUCT_FILE_READ_AN', + '638' => 'SUB_STRUCT_FILE_WRITE_AN', + '639' => 'SUB_STRUCT_FILE_CLOSE_AN', + '640' => 'SUB_STRUCT_FILE_UNLINK_AN', + '641' => 'SUB_STRUCT_FILE_STAT_AN', + '642' => 'SUB_STRUCT_FILE_FSTAT_AN', + '643' => 'SUB_STRUCT_FILE_LSEEK_AN', + '644' => 'SUB_STRUCT_FILE_RENAME_AN', + '645' => 'QUERY_SPEC_COLL_AN', + '646' => 'MOD_COLL_AN', + '647' => 'SUB_STRUCT_FILE_MKDIR_AN', + '648' => 'SUB_STRUCT_FILE_RMDIR_AN', + '649' => 'SUB_STRUCT_FILE_OPENDIR_AN', + '650' => 'SUB_STRUCT_FILE_READDIR_AN', + '651' => 'SUB_STRUCT_FILE_CLOSEDIR_AN', + '652' => 'DATA_OBJ_TRUNCATE_AN', + '653' => 'SUB_STRUCT_FILE_TRUNCATE_AN', + '654' => 'GET_XMSG_TICKET_AN', + '655' => 'SEND_XMSG_AN', + '656' => 'RCV_XMSG_AN', + '657' => 'SUB_STRUCT_FILE_GET_AN', + '658' => 'SUB_STRUCT_FILE_PUT_AN', + '659' => 'SYNC_MOUNTED_COLL_AN', + '660' => 'STRUCT_FILE_SYNC_AN', + '661' => 'CLOSE_COLLECTION_AN', + '662' => 'COLL_REPL_AN', + '663' => 'RM_COLL_AN', + '700' => 'GET_MISC_SVR_INFO_AN', + '701' => 'GENERAL_ADMIN_AN', + '702' => 'GEN_QUERY_AN', + '703' => 'AUTH_REQUEST_AN', + '704' => 'AUTH_RESPONSE_AN', + '705' => 'AUTH_CHECK_AN', + '706' => 'MOD_AVU_METADATA_AN', + '707' => 'MOD_ACCESS_CONTROL_AN', + '708' => 'RULE_EXEC_MOD_AN', + '709' => 'GET_TEMP_PASSWORD_AN', + '710' => 'GENERAL_UPDATE_AN', + '711' => 'GSI_AUTH_REQUEST_AN', + '712' => 'OPEN_COLLECTION_AN', + '713' => 'READ_COLLECTION_AN', + '725' => 'PAM_AUTH_REQUEST_AN', + '1100' => 'SSL_START_AN', + '1101' => 'SSL_END_AN', +); +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php new file mode 100644 index 0000000000..1d51f61919 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsConst.inc.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php new file mode 100644 index 0000000000..7c4bb170d4 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsErrorTable.inc.php @@ -0,0 +1,587 @@ + '-1000', + 'SYS_SOCK_BIND_ERR' => '-2000', + 'SYS_SOCK_ACCEPT_ERR' => '-3000', + 'SYS_HEADER_READ_LEN_ERR' => '-4000', + 'SYS_HEADER_WRITE_LEN_ERR' => '-5000', + 'SYS_HEADER_TPYE_LEN_ERR' => '-6000', + 'SYS_CAUGHT_SIGNAL' => '-7000', + 'SYS_GETSTARTUP_PACK_ERR' => '-8000', + 'SYS_EXCEED_CONNECT_CNT' => '-9000', + 'SYS_USER_NOT_ALLOWED_TO_CONN' => '-10000', + 'SYS_READ_MSG_BODY_INPUT_ERR' => '-11000', + 'SYS_UNMATCHED_API_NUM' => '-12000', + 'SYS_NO_API_PRIV' => '-13000', + 'SYS_API_INPUT_ERR' => '-14000', + 'SYS_PACK_INSTRUCT_FORMAT_ERR' => '-15000', + 'SYS_MALLOC_ERR' => '-16000', + 'SYS_GET_HOSTNAME_ERR' => '-17000', + 'SYS_OUT_OF_FILE_DESC' => '-18000', + 'SYS_FILE_DESC_OUT_OF_RANGE' => '-19000', + 'SYS_UNRECOGNIZED_REMOTE_FLAG' => '-20000', + 'SYS_INVALID_SERVER_HOST' => '-21000', + 'SYS_SVR_TO_SVR_CONNECT_FAILED' => '-22000', + 'SYS_BAD_FILE_DESCRIPTOR' => '-23000', + 'SYS_INTERNAL_NULL_INPUT_ERR' => '-24000', + 'SYS_CONFIG_FILE_ERR' => '-25000', + 'SYS_INVALID_ZONE_NAME' => '-26000', + 'SYS_COPY_LEN_ERR' => '-27000', + 'SYS_PORT_COOKIE_ERR' => '-28000', + 'SYS_KEY_VAL_TABLE_ERR' => '-29000', + 'SYS_INVALID_RESC_TYPE' => '-30000', + 'SYS_INVALID_FILE_PATH' => '-31000', + 'SYS_INVALID_RESC_INPUT' => '-32000', + 'SYS_INVALID_PORTAL_OPR' => '-33000', + 'SYS_PARA_OPR_NO_SUPPORT' => '-34000', + 'SYS_INVALID_OPR_TYPE' => '-35000', + 'SYS_NO_PATH_PERMISSION' => '-36000', + 'SYS_NO_ICAT_SERVER_ERR' => '-37000', + 'SYS_AGENT_INIT_ERR' => '-38000', + 'SYS_PROXYUSER_NO_PRIV' => '-39000', + 'SYS_NO_DATA_OBJ_PERMISSION' => '-40000', + 'SYS_DELETE_DISALLOWED' => '-41000', + 'SYS_OPEN_REI_FILE_ERR' => '-42000', + 'SYS_NO_RCAT_SERVER_ERR' => '-43000', + 'SYS_UNMATCH_PACK_INSTRUCTI_NAME' => '-44000', + 'SYS_SVR_TO_CLI_MSI_NO_EXIST' => '-45000', + 'SYS_COPY_ALREADY_IN_RESC' => '-46000', + 'SYS_RECONN_OPR_MISMATCH' => '-47000', + 'SYS_INPUT_PERM_OUT_OF_RANGE' => '-48000', + 'SYS_FORK_ERROR' => '-49000', + 'SYS_PIPE_ERROR' => '-50000', + 'SYS_EXEC_CMD_STATUS_SZ_ERROR' => '-51000', + 'SYS_PATH_IS_NOT_A_FILE' => '-52000', + 'SYS_UNMATCHED_SPEC_COLL_TYPE' => '-53000', + 'SYS_TOO_MANY_QUERY_RESULT' => '-54000', + 'USER_AUTH_SCHEME_ERR' => '-300000', + 'USER_AUTH_STRING_EMPTY' => '-301000', + 'USER_RODS_HOST_EMPTY' => '-302000', + 'USER_RODS_HOSTNAME_ERR' => '-303000', + 'USER_SOCK_OPEN_ERR' => '-304000', + 'USER_SOCK_CONNECT_ERR' => '-305000', + 'USER_STRLEN_TOOLONG' => '-306000', + 'USER_API_INPUT_ERR' => '-307000', + 'USER_PACKSTRUCT_INPUT_ERR' => '-308000', + 'USER_NO_SUPPORT_ERR' => '-309000', + 'USER_FILE_DOES_NOT_EXIST' => '-310000', + 'USER_FILE_TOO_LARGE' => '-311000', + 'OVERWITE_WITHOUT_FORCE_FLAG' => '-312000', + 'UNMATCHED_KEY_OR_INDEX' => '-313000', + 'USER_CHKSUM_MISMATCH' => '-314000', + 'USER_BAD_KEYWORD_ERR' => '-315000', + 'USER__NULL_INPUT_ERR' => '-316000', + 'USER_INPUT_PATH_ERR' => '-317000', + 'USER_INPUT_OPTION_ERR' => '-318000', + 'USER_INVALID_USERNAME_FORMAT' => '-319000', + 'USER_DIRECT_RESC_INPUT_ERR' => '-320000', + 'USER_NO_RESC_INPUT_ERR' => '-321000', + 'USER_PARAM_LABEL_ERR' => '-322000', + 'USER_PARAM_TYPE_ERR' => '-323000', + 'BASE64_BUFFER_OVERFLOW' => '-324000', + 'BASE64_INVALID_PACKET' => '-325000', + 'USER_MSG_TYPE_NO_SUPPORT' => '-326000', + 'USER_RSYNC_NO_MODE_INPUT_ERR' => '-337000', + 'USER_OPTION_INPUT_ERR' => '-338000', + 'SAME_SRC_DEST_PATHS_ERR' => '-339000', + 'USER_RESTART_FILE_INPUT_ERR' => '-340000', + 'RESTART_OPR_FAILED' => '-341000', + 'BAD_EXEC_CMD_PATH' => '-342000', + 'EXEC_CMD_OUTPUT_TOO_LARGE' => '-343000', + 'EXEC_CMD_ERROR' => '-344000', + 'FILE_INDEX_LOOKUP_ERR' => '-500000', + 'UNIX_FILE_OPEN_ERR' => '-510000', + 'UNIX_FILE_OPEN_ERR_1' => '-510001', + 'UNIX_FILE_OPEN_ERR_2' => '-510002', + 'UNIX_FILE_CREATE_ERR' => '-511000', + 'UNIX_FILE_READ_ERR' => '-512000', + 'UNIX_FILE_WRITE_ERR' => '-513000', + 'UNIX_FILE_CLOSE_ERR' => '-514000', + 'UNIX_FILE_UNLINK_ERR' => '-515000', + 'UNIX_FILE_STAT_ERR' => '-516000', + 'UNIX_FILE_FSTAT_ERR' => '-517000', + 'UNIX_FILE_LSEEK_ERR' => '-518000', + 'UNIX_FILE_FSYNC_ERR' => '-519000', + 'UNIX_FILE_MKDIR_ERR' => '-520000', + 'UNIX_FILE_RMDIR_ERR' => '-521000', + 'UNIX_FILE_OPENDIR_ERR' => '-522000', + 'UNIX_FILE_CLOSEDIR_ERR' => '-523000', + 'UNIX_FILE_READDIR_ERR' => '-524000', + 'UNIX_FILE_STAGE_ERR' => '-525000', + 'UNIX_FILE_GET_FS_FREESPACE_ERR' => '-526000', + 'UNIX_FILE_CHMOD_ERR' => '-527000', + 'UNIX_FILE_RENAME_ERR' => '-528000', + 'CATALOG_NOT_CONNECTED' => '-801000', + 'CAT_ENV_ERR' => '-802000', + 'CAT_CONNECT_ERR' => '-803000', + 'CAT_DISCONNECT_ERR' => '-804000', + 'CAT_CLOSE_ENV_ERR' => '-805000', + 'CAT_SQL_ERR' => '-806000', + 'CAT_GET_ROW_ERR' => '-807000', + 'CAT_NO_ROWS_FOUND' => '-808000', + 'CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME' => '-809000', + 'CAT_INVALID_RESOURCE_TYPE' => '-810000', + 'CAT_INVALID_RESOURCE_CLASS' => '-811000', + 'CAT_INVALID_RESOURCE_NET_ADDR' => '-812000', + 'CAT_INVALID_RESOURCE_VAULT_PATH' => '-813000', + 'CAT_UNKNOWN_COLLECTION' => '-814000', + 'CAT_INVALID_DATA_TYPE' => '-815000', + 'CAT_INVALID_ARGUMENT' => '-816000', + 'CAT_UNKNOWN_FILE' => '-817000', + 'CAT_NO_ACCESS_PERMISSION' => '-818000', + 'CAT_SUCCESS_BUT_WITH_NO_INFO' => '-819000', + 'CAT_INVALID_USER_TYPE' => '-820000', + 'CAT_COLLECTION_NOT_EMPTY' => '-821000', + 'CAT_TOO_MANY_TABLES' => '-822000', + 'CAT_UNKNOWN_TABLE' => '-823000', + 'CAT_NOT_OPEN' => '-824000', + 'CAT_FAILED_TO_LINK_TABLES' => '-825000', + 'CAT_INVALID_AUTHENTICATION' => '-826000', + 'CAT_INVALID_USER' => '-827000', + 'CAT_INVALID_ZONE' => '-828000', + 'CAT_INVALID_GROUP' => '-829000', + 'CAT_INSUFFICIENT_PRIVILEGE_LEVEL' => '-830000', + 'CAT_INVALID_RESOURCE' => '-831000', + 'CAT_INVALID_CLIENT_USER' => '-832000', + 'CAT_NAME_EXISTS_AS_COLLECTION' => '-833000', + 'CAT_NAME_EXISTS_AS_DATAOBJ' => '-834000', + 'CAT_RESOURCE_NOT_EMPTY' => '-835000', + 'CAT_NOT_A_DATAOBJ_AND_NOT_A_COLLECTION' => '-836000', + 'CAT_RECURSIVE_MOVE' => '-837000', + 'CAT_LAST_REPLICA' => '-838000', + 'CAT_OCI_ERROR' => '-839000', + 'CAT_PASSWORD_EXPIRED' => '-840000', + 'FILE_OPEN_ERR' => '-900000', + 'FILE_READ_ERR' => '-901000', + 'FILE_WRITE_ERR' => '-902000', + 'PASSWORD_EXCEEDS_MAX_SIZE' => '-903000', + 'ENVIRONMENT_VAR_HOME_NOT_DEFINED' => '-904000', + 'UNABLE_TO_STAT_FILE' => '-905000', + 'AUTH_FILE_NOT_ENCRYPTED' => '-906000', + 'AUTH_FILE_DOES_NOT_EXIST' => '-907000', + 'UNLINK_FAILED' => '-908000', + 'NO_PASSWORD_ENTERED' => '-909000', + 'OBJPATH_EMPTY_IN_STRUCT_ERR' => '-1000000', + 'RESCNAME_EMPTY_IN_STRUCT_ERR' => '-1001000', + 'DATATYPE_EMPTY_IN_STRUCT_ERR' => '-1002000', + 'DATASIZE_EMPTY_IN_STRUCT_ERR' => '-1003000', + 'CHKSUM_EMPTY_IN_STRUCT_ERR' => '-1004000', + 'VERSION_EMPTY_IN_STRUCT_ERR' => '-1005000', + 'FILEPATH_EMPTY_IN_STRUCT_ERR' => '-1006000', + 'REPLNUM_EMPTY_IN_STRUCT_ERR' => '-1007000', + 'REPLSTATUS_EMPTY_IN_STRUCT_ERR' => '-1008000', + 'DATAOWNER_EMPTY_IN_STRUCT_ERR' => '-1009000', + 'DATAOWNERZONE_EMPTY_IN_STRUCT_ERR' => '-1010000', + 'DATAEXPIRY_EMPTY_IN_STRUCT_ERR' => '-1011000', + 'DATACOMMENTS_EMPTY_IN_STRUCT_ERR' => '-1012000', + 'DATACREATE_EMPTY_IN_STRUCT_ERR' => '-1013000', + 'DATAMODIFY_EMPTY_IN_STRUCT_ERR' => '-1014000', + 'DATAACCESS_EMPTY_IN_STRUCT_ERR' => '-1015000', + 'DATAACCESSINX_EMPTY_IN_STRUCT_ERR' => '-1016000', + 'NO_RULE_FOUND_ERR' => '-1017000', + 'NO_MORE_RULES_ERR' => '-1018000', + 'UNMATCHED_ACTION_ERR' => '-1019000', + 'RULES_FILE_READ_ERROR' => '-1020000', + 'ACTION_ARG_COUNT_MISMATCH' => '-1021000', + 'MAX_NUM_OF_ARGS_IN_ACTION_EXCEEDED' => '-1022000', + 'UNKNOWN_PARAM_IN_RULE_ERR' => '-1023000', + 'DESTRESCNAME_EMPTY_IN_STRUCT_ERR' => '-1024000', + 'BACKUPRESCNAME_EMPTY_IN_STRUCT_ERR' => '-1025000', + 'DATAID_EMPTY_IN_STRUCT_ERR' => '-1026000', + 'COLLID_EMPTY_IN_STRUCT_ERR' => '-1027000', + 'RESCGROUPNAME_EMPTY_IN_STRUCT_ERR' => '-1028000', + 'STATUSSTRING_EMPTY_IN_STRUCT_ERR' => '-1029000', + 'DATAMAPID_EMPTY_IN_STRUCT_ERR' => '-1030000', + 'USERNAMECLIENT_EMPTY_IN_STRUCT_ERR' => '-1031000', + 'RODSZONECLIENT_EMPTY_IN_STRUCT_ERR' => '-1032000', + 'USERTYPECLIENT_EMPTY_IN_STRUCT_ERR' => '-1033000', + 'HOSTCLIENT_EMPTY_IN_STRUCT_ERR' => '-1034000', + 'AUTHSTRCLIENT_EMPTY_IN_STRUCT_ERR' => '-1035000', + 'USERAUTHSCHEMECLIENT_EMPTY_IN_STRUCT_ERR' => '-1036000', + 'USERINFOCLIENT_EMPTY_IN_STRUCT_ERR' => '-1037000', + 'USERCOMMENTCLIENT_EMPTY_IN_STRUCT_ERR' => '-1038000', + 'USERCREATECLIENT_EMPTY_IN_STRUCT_ERR' => '-1039000', + 'USERMODIFYCLIENT_EMPTY_IN_STRUCT_ERR' => '-1040000', + 'USERNAMEPROXY_EMPTY_IN_STRUCT_ERR' => '-1041000', + 'RODSZONEPROXY_EMPTY_IN_STRUCT_ERR' => '-1042000', + 'USERTYPEPROXY_EMPTY_IN_STRUCT_ERR' => '-1043000', + 'HOSTPROXY_EMPTY_IN_STRUCT_ERR' => '-1044000', + 'AUTHSTRPROXY_EMPTY_IN_STRUCT_ERR' => '-1045000', + 'USERAUTHSCHEMEPROXY_EMPTY_IN_STRUCT_ERR' => '-1046000', + 'USERINFOPROXY_EMPTY_IN_STRUCT_ERR' => '-1047000', + 'USERCOMMENTPROXY_EMPTY_IN_STRUCT_ERR' => '-1048000', + 'USERCREATEPROXY_EMPTY_IN_STRUCT_ERR' => '-1049000', + 'USERMODIFYPROXY_EMPTY_IN_STRUCT_ERR' => '-1050000', + 'COLLNAME_EMPTY_IN_STRUCT_ERR' => '-1051000', + 'COLLPARENTNAME_EMPTY_IN_STRUCT_ERR' => '-1052000', + 'COLLOWNERNAME_EMPTY_IN_STRUCT_ERR' => '-1053000', + 'COLLOWNERZONE_EMPTY_IN_STRUCT_ERR' => '-1054000', + 'COLLEXPIRY_EMPTY_IN_STRUCT_ERR' => '-1055000', + 'COLLCOMMENTS_EMPTY_IN_STRUCT_ERR' => '-1056000', + 'COLLCREATE_EMPTY_IN_STRUCT_ERR' => '-1057000', + 'COLLMODIFY_EMPTY_IN_STRUCT_ERR' => '-1058000', + 'COLLACCESS_EMPTY_IN_STRUCT_ERR' => '-1059000', + 'COLLACCESSINX_EMPTY_IN_STRUCT_ERR' => '-1060000', + 'COLLMAPID_EMPTY_IN_STRUCT_ERR' => '-1062000', + 'COLLINHERITANCE_EMPTY_IN_STRUCT_ERR' => '-1063000', + 'RESCZONE_EMPTY_IN_STRUCT_ERR' => '-1065000', + 'RESCLOC_EMPTY_IN_STRUCT_ERR' => '-1066000', + 'RESCTYPE_EMPTY_IN_STRUCT_ERR' => '-1067000', + 'RESCTYPEINX_EMPTY_IN_STRUCT_ERR' => '-1068000', + 'RESCCLASS_EMPTY_IN_STRUCT_ERR' => '-1069000', + 'RESCCLASSINX_EMPTY_IN_STRUCT_ERR' => '-1070000', + 'RESCVAULTPATH_EMPTY_IN_STRUCT_ERR' => '-1071000', + 'NUMOPEN_ORTS_EMPTY_IN_STRUCT_ERR' => '-1072000', + 'PARAOPR_EMPTY_IN_STRUCT_ERR' => '-1073000', + 'RESCID_EMPTY_IN_STRUCT_ERR' => '-1074000', + 'GATEWAYADDR_EMPTY_IN_STRUCT_ERR' => '-1075000', + 'RESCMAX_BJSIZE_EMPTY_IN_STRUCT_ERR' => '-1076000', + 'FREESPACE_EMPTY_IN_STRUCT_ERR' => '-1077000', + 'FREESPACETIME_EMPTY_IN_STRUCT_ERR' => '-1078000', + 'FREESPACETIMESTAMP_EMPTY_IN_STRUCT_ERR' => '-1079000', + 'RESCINFO_EMPTY_IN_STRUCT_ERR' => '-1080000', + 'RESCCOMMENTS_EMPTY_IN_STRUCT_ERR' => '-1081000', + 'RESCCREATE_EMPTY_IN_STRUCT_ERR' => '-1082000', + 'RESCMODIFY_EMPTY_IN_STRUCT_ERR' => '-1083000', + 'INPUT_ARG_NOT_WELL_FORMED_ERR' => '-1084000', + 'INPUT_ARG_OUT_OF_ARGC_RANGE_ERR' => '-1085000', + 'INSUFFICIENT_INPUT_ARG_ERR' => '-1086000', + 'INPUT_ARG_DOES_NOT_MATCH_ERR' => '-1087000', + 'RETRY_WITHOUT_RECOVERY_ERR' => '-1088000', + 'CUT_ACTION_PROCESSED_ERR' => '-1089000', + 'ACTION_FAILED_ERR' => '-1090000', + 'FAIL_ACTION_ENCOUNTERED_ERR' => '-1091000', + 'VARIABLE_NAME_TOO_LONG_ERR' => '-1092000', + 'UNKNOWN_VARIABLE_MAP_ERR' => '-1093000', + 'UNDEFINED_VARIABLE_MAP_ERR' => '-1094000', + 'NULL_VALUE_ERR' => '-1095000', + 'DVARMAP_FILE_READ_ERROR' => '-1096000', + 'NO_RULE_OR_MSI_FUNCTION_FOUND_ERR' => '-1097000', + 'FILE_CREATE_ERROR' => '-1098000', + 'FMAP_FILE_READ_ERROR' => '-1099000', + 'DATE_FORMAT_ERR' => '-1100000', + 'RULE_FAILED_ERR' => '-1101000', + 'NO_MICROSERVICE_FOUND_ERR' => '-1102000', + 'INVALID_REGEXP' => '-1103000', + 'INVALID_OBJECT_NAME' => '-1104000', + 'INVALID_OBJECT_TYPE' => '-1105000', + 'NO_VALUES_FOUND' => '-1106000', + 'NO_COLUMN_NAME_FOUND' => '-1107000', + 'SYS_NULL_INPUT' => '-99999996', + 'SYS_HANDLER_DONE_WITH_ERROR' => '-99999997', + 'SYS_HANDLER_DONE_NO_ERROR' => '-99999998', + 'SYS_NO_HANDLER_REPLY_MSG' => '-99999999', + 'GENERAL_PRODS_ERR' => '-3000000', + 'PERR_INTERNAL_ERR' => '-3100000', + 'PERR_UNEXPECTED_PACKET_FORMAT' => '-3101000', + 'PERR_PATH_DOES_NOT_EXISTS' => '-3102000', + 'PERR_UNSUPPORTED_PROTOCOL_SCHEME' => '-3103000', + 'PERR_USER_INPUT_ERROR' => '-3104000', + 'PERR_USER_INPUT_PATH_ERROR' => '-3105000', + 'PERR_CONN_NOT_ACTIVE' => '-3106000', + 'SSL_NOT_BUILT_INTO_CLIENT' => '-2100000', + 'SSL_NOT_BUILT_INTO_SERVER' => '-2101000', + 'SSL_INIT_ERROR' => '-2102000', + 'SSL_HANDSHAKE_ERROR' => '-2103000', + 'SSL_SHUTDOWN_ERROR' => '-2104000', + 'SSL_CERT_ERROR' => '-2105000', + 'PAM_AUTH_NOT_BUILT_INTO_CLIENT' => '-991000', + 'PAM_AUTH_NOT_BUILT_INTO_SERVER' => '-992000', + 'PAM_AUTH_PASSWORD_FAILED' => '-993000', + 'PAM_AUTH_PASSWORD_INVALID_TTL' => '-994000', +); +$GLOBALS['PRODS_ERR_CODES_REV'] = array( + '-1000' => 'SYS_SOCK_OPEN_ERR', + '-2000' => 'SYS_SOCK_BIND_ERR', + '-3000' => 'SYS_SOCK_ACCEPT_ERR', + '-4000' => 'SYS_HEADER_READ_LEN_ERR', + '-5000' => 'SYS_HEADER_WRITE_LEN_ERR', + '-6000' => 'SYS_HEADER_TPYE_LEN_ERR', + '-7000' => 'SYS_CAUGHT_SIGNAL', + '-8000' => 'SYS_GETSTARTUP_PACK_ERR', + '-9000' => 'SYS_EXCEED_CONNECT_CNT', + '-10000' => 'SYS_USER_NOT_ALLOWED_TO_CONN', + '-11000' => 'SYS_READ_MSG_BODY_INPUT_ERR', + '-12000' => 'SYS_UNMATCHED_API_NUM', + '-13000' => 'SYS_NO_API_PRIV', + '-14000' => 'SYS_API_INPUT_ERR', + '-15000' => 'SYS_PACK_INSTRUCT_FORMAT_ERR', + '-16000' => 'SYS_MALLOC_ERR', + '-17000' => 'SYS_GET_HOSTNAME_ERR', + '-18000' => 'SYS_OUT_OF_FILE_DESC', + '-19000' => 'SYS_FILE_DESC_OUT_OF_RANGE', + '-20000' => 'SYS_UNRECOGNIZED_REMOTE_FLAG', + '-21000' => 'SYS_INVALID_SERVER_HOST', + '-22000' => 'SYS_SVR_TO_SVR_CONNECT_FAILED', + '-23000' => 'SYS_BAD_FILE_DESCRIPTOR', + '-24000' => 'SYS_INTERNAL_NULL_INPUT_ERR', + '-25000' => 'SYS_CONFIG_FILE_ERR', + '-26000' => 'SYS_INVALID_ZONE_NAME', + '-27000' => 'SYS_COPY_LEN_ERR', + '-28000' => 'SYS_PORT_COOKIE_ERR', + '-29000' => 'SYS_KEY_VAL_TABLE_ERR', + '-30000' => 'SYS_INVALID_RESC_TYPE', + '-31000' => 'SYS_INVALID_FILE_PATH', + '-32000' => 'SYS_INVALID_RESC_INPUT', + '-33000' => 'SYS_INVALID_PORTAL_OPR', + '-34000' => 'SYS_PARA_OPR_NO_SUPPORT', + '-35000' => 'SYS_INVALID_OPR_TYPE', + '-36000' => 'SYS_NO_PATH_PERMISSION', + '-37000' => 'SYS_NO_ICAT_SERVER_ERR', + '-38000' => 'SYS_AGENT_INIT_ERR', + '-39000' => 'SYS_PROXYUSER_NO_PRIV', + '-40000' => 'SYS_NO_DATA_OBJ_PERMISSION', + '-41000' => 'SYS_DELETE_DISALLOWED', + '-42000' => 'SYS_OPEN_REI_FILE_ERR', + '-43000' => 'SYS_NO_RCAT_SERVER_ERR', + '-44000' => 'SYS_UNMATCH_PACK_INSTRUCTI_NAME', + '-45000' => 'SYS_SVR_TO_CLI_MSI_NO_EXIST', + '-46000' => 'SYS_COPY_ALREADY_IN_RESC', + '-47000' => 'SYS_RECONN_OPR_MISMATCH', + '-48000' => 'SYS_INPUT_PERM_OUT_OF_RANGE', + '-49000' => 'SYS_FORK_ERROR', + '-50000' => 'SYS_PIPE_ERROR', + '-51000' => 'SYS_EXEC_CMD_STATUS_SZ_ERROR', + '-52000' => 'SYS_PATH_IS_NOT_A_FILE', + '-53000' => 'SYS_UNMATCHED_SPEC_COLL_TYPE', + '-54000' => 'SYS_TOO_MANY_QUERY_RESULT', + '-300000' => 'USER_AUTH_SCHEME_ERR', + '-301000' => 'USER_AUTH_STRING_EMPTY', + '-302000' => 'USER_RODS_HOST_EMPTY', + '-303000' => 'USER_RODS_HOSTNAME_ERR', + '-304000' => 'USER_SOCK_OPEN_ERR', + '-305000' => 'USER_SOCK_CONNECT_ERR', + '-306000' => 'USER_STRLEN_TOOLONG', + '-307000' => 'USER_API_INPUT_ERR', + '-308000' => 'USER_PACKSTRUCT_INPUT_ERR', + '-309000' => 'USER_NO_SUPPORT_ERR', + '-310000' => 'USER_FILE_DOES_NOT_EXIST', + '-311000' => 'USER_FILE_TOO_LARGE', + '-312000' => 'OVERWITE_WITHOUT_FORCE_FLAG', + '-313000' => 'UNMATCHED_KEY_OR_INDEX', + '-314000' => 'USER_CHKSUM_MISMATCH', + '-315000' => 'USER_BAD_KEYWORD_ERR', + '-316000' => 'USER__NULL_INPUT_ERR', + '-317000' => 'USER_INPUT_PATH_ERR', + '-318000' => 'USER_INPUT_OPTION_ERR', + '-319000' => 'USER_INVALID_USERNAME_FORMAT', + '-320000' => 'USER_DIRECT_RESC_INPUT_ERR', + '-321000' => 'USER_NO_RESC_INPUT_ERR', + '-322000' => 'USER_PARAM_LABEL_ERR', + '-323000' => 'USER_PARAM_TYPE_ERR', + '-324000' => 'BASE64_BUFFER_OVERFLOW', + '-325000' => 'BASE64_INVALID_PACKET', + '-326000' => 'USER_MSG_TYPE_NO_SUPPORT', + '-337000' => 'USER_RSYNC_NO_MODE_INPUT_ERR', + '-338000' => 'USER_OPTION_INPUT_ERR', + '-339000' => 'SAME_SRC_DEST_PATHS_ERR', + '-340000' => 'USER_RESTART_FILE_INPUT_ERR', + '-341000' => 'RESTART_OPR_FAILED', + '-342000' => 'BAD_EXEC_CMD_PATH', + '-343000' => 'EXEC_CMD_OUTPUT_TOO_LARGE', + '-344000' => 'EXEC_CMD_ERROR', + '-500000' => 'FILE_INDEX_LOOKUP_ERR', + '-510000' => 'UNIX_FILE_OPEN_ERR', + '-510001' => 'UNIX_FILE_OPEN_ERR_1', + '-510002' => 'UNIX_FILE_OPEN_ERR_2', + '-511000' => 'UNIX_FILE_CREATE_ERR', + '-512000' => 'UNIX_FILE_READ_ERR', + '-513000' => 'UNIX_FILE_WRITE_ERR', + '-514000' => 'UNIX_FILE_CLOSE_ERR', + '-515000' => 'UNIX_FILE_UNLINK_ERR', + '-516000' => 'UNIX_FILE_STAT_ERR', + '-517000' => 'UNIX_FILE_FSTAT_ERR', + '-518000' => 'UNIX_FILE_LSEEK_ERR', + '-519000' => 'UNIX_FILE_FSYNC_ERR', + '-520000' => 'UNIX_FILE_MKDIR_ERR', + '-521000' => 'UNIX_FILE_RMDIR_ERR', + '-522000' => 'UNIX_FILE_OPENDIR_ERR', + '-523000' => 'UNIX_FILE_CLOSEDIR_ERR', + '-524000' => 'UNIX_FILE_READDIR_ERR', + '-525000' => 'UNIX_FILE_STAGE_ERR', + '-526000' => 'UNIX_FILE_GET_FS_FREESPACE_ERR', + '-527000' => 'UNIX_FILE_CHMOD_ERR', + '-528000' => 'UNIX_FILE_RENAME_ERR', + '-801000' => 'CATALOG_NOT_CONNECTED', + '-802000' => 'CAT_ENV_ERR', + '-803000' => 'CAT_CONNECT_ERR', + '-804000' => 'CAT_DISCONNECT_ERR', + '-805000' => 'CAT_CLOSE_ENV_ERR', + '-806000' => 'CAT_SQL_ERR', + '-807000' => 'CAT_GET_ROW_ERR', + '-808000' => 'CAT_NO_ROWS_FOUND', + '-809000' => 'CATALOG_ALREADY_HAS_ITEM_BY_THAT_NAME', + '-810000' => 'CAT_INVALID_RESOURCE_TYPE', + '-811000' => 'CAT_INVALID_RESOURCE_CLASS', + '-812000' => 'CAT_INVALID_RESOURCE_NET_ADDR', + '-813000' => 'CAT_INVALID_RESOURCE_VAULT_PATH', + '-814000' => 'CAT_UNKNOWN_COLLECTION', + '-815000' => 'CAT_INVALID_DATA_TYPE', + '-816000' => 'CAT_INVALID_ARGUMENT', + '-817000' => 'CAT_UNKNOWN_FILE', + '-818000' => 'CAT_NO_ACCESS_PERMISSION', + '-819000' => 'CAT_SUCCESS_BUT_WITH_NO_INFO', + '-820000' => 'CAT_INVALID_USER_TYPE', + '-821000' => 'CAT_COLLECTION_NOT_EMPTY', + '-822000' => 'CAT_TOO_MANY_TABLES', + '-823000' => 'CAT_UNKNOWN_TABLE', + '-824000' => 'CAT_NOT_OPEN', + '-825000' => 'CAT_FAILED_TO_LINK_TABLES', + '-826000' => 'CAT_INVALID_AUTHENTICATION', + '-827000' => 'CAT_INVALID_USER', + '-828000' => 'CAT_INVALID_ZONE', + '-829000' => 'CAT_INVALID_GROUP', + '-830000' => 'CAT_INSUFFICIENT_PRIVILEGE_LEVEL', + '-831000' => 'CAT_INVALID_RESOURCE', + '-832000' => 'CAT_INVALID_CLIENT_USER', + '-833000' => 'CAT_NAME_EXISTS_AS_COLLECTION', + '-834000' => 'CAT_NAME_EXISTS_AS_DATAOBJ', + '-835000' => 'CAT_RESOURCE_NOT_EMPTY', + '-836000' => 'CAT_NOT_A_DATAOBJ_AND_NOT_A_COLLECTION', + '-837000' => 'CAT_RECURSIVE_MOVE', + '-838000' => 'CAT_LAST_REPLICA', + '-839000' => 'CAT_OCI_ERROR', + '-840000' => 'CAT_PASSWORD_EXPIRED', + '-900000' => 'FILE_OPEN_ERR', + '-901000' => 'FILE_READ_ERR', + '-902000' => 'FILE_WRITE_ERR', + '-903000' => 'PASSWORD_EXCEEDS_MAX_SIZE', + '-904000' => 'ENVIRONMENT_VAR_HOME_NOT_DEFINED', + '-905000' => 'UNABLE_TO_STAT_FILE', + '-906000' => 'AUTH_FILE_NOT_ENCRYPTED', + '-907000' => 'AUTH_FILE_DOES_NOT_EXIST', + '-908000' => 'UNLINK_FAILED', + '-909000' => 'NO_PASSWORD_ENTERED', + '-1000000' => 'OBJPATH_EMPTY_IN_STRUCT_ERR', + '-1001000' => 'RESCNAME_EMPTY_IN_STRUCT_ERR', + '-1002000' => 'DATATYPE_EMPTY_IN_STRUCT_ERR', + '-1003000' => 'DATASIZE_EMPTY_IN_STRUCT_ERR', + '-1004000' => 'CHKSUM_EMPTY_IN_STRUCT_ERR', + '-1005000' => 'VERSION_EMPTY_IN_STRUCT_ERR', + '-1006000' => 'FILEPATH_EMPTY_IN_STRUCT_ERR', + '-1007000' => 'REPLNUM_EMPTY_IN_STRUCT_ERR', + '-1008000' => 'REPLSTATUS_EMPTY_IN_STRUCT_ERR', + '-1009000' => 'DATAOWNER_EMPTY_IN_STRUCT_ERR', + '-1010000' => 'DATAOWNERZONE_EMPTY_IN_STRUCT_ERR', + '-1011000' => 'DATAEXPIRY_EMPTY_IN_STRUCT_ERR', + '-1012000' => 'DATACOMMENTS_EMPTY_IN_STRUCT_ERR', + '-1013000' => 'DATACREATE_EMPTY_IN_STRUCT_ERR', + '-1014000' => 'DATAMODIFY_EMPTY_IN_STRUCT_ERR', + '-1015000' => 'DATAACCESS_EMPTY_IN_STRUCT_ERR', + '-1016000' => 'DATAACCESSINX_EMPTY_IN_STRUCT_ERR', + '-1017000' => 'NO_RULE_FOUND_ERR', + '-1018000' => 'NO_MORE_RULES_ERR', + '-1019000' => 'UNMATCHED_ACTION_ERR', + '-1020000' => 'RULES_FILE_READ_ERROR', + '-1021000' => 'ACTION_ARG_COUNT_MISMATCH', + '-1022000' => 'MAX_NUM_OF_ARGS_IN_ACTION_EXCEEDED', + '-1023000' => 'UNKNOWN_PARAM_IN_RULE_ERR', + '-1024000' => 'DESTRESCNAME_EMPTY_IN_STRUCT_ERR', + '-1025000' => 'BACKUPRESCNAME_EMPTY_IN_STRUCT_ERR', + '-1026000' => 'DATAID_EMPTY_IN_STRUCT_ERR', + '-1027000' => 'COLLID_EMPTY_IN_STRUCT_ERR', + '-1028000' => 'RESCGROUPNAME_EMPTY_IN_STRUCT_ERR', + '-1029000' => 'STATUSSTRING_EMPTY_IN_STRUCT_ERR', + '-1030000' => 'DATAMAPID_EMPTY_IN_STRUCT_ERR', + '-1031000' => 'USERNAMECLIENT_EMPTY_IN_STRUCT_ERR', + '-1032000' => 'RODSZONECLIENT_EMPTY_IN_STRUCT_ERR', + '-1033000' => 'USERTYPECLIENT_EMPTY_IN_STRUCT_ERR', + '-1034000' => 'HOSTCLIENT_EMPTY_IN_STRUCT_ERR', + '-1035000' => 'AUTHSTRCLIENT_EMPTY_IN_STRUCT_ERR', + '-1036000' => 'USERAUTHSCHEMECLIENT_EMPTY_IN_STRUCT_ERR', + '-1037000' => 'USERINFOCLIENT_EMPTY_IN_STRUCT_ERR', + '-1038000' => 'USERCOMMENTCLIENT_EMPTY_IN_STRUCT_ERR', + '-1039000' => 'USERCREATECLIENT_EMPTY_IN_STRUCT_ERR', + '-1040000' => 'USERMODIFYCLIENT_EMPTY_IN_STRUCT_ERR', + '-1041000' => 'USERNAMEPROXY_EMPTY_IN_STRUCT_ERR', + '-1042000' => 'RODSZONEPROXY_EMPTY_IN_STRUCT_ERR', + '-1043000' => 'USERTYPEPROXY_EMPTY_IN_STRUCT_ERR', + '-1044000' => 'HOSTPROXY_EMPTY_IN_STRUCT_ERR', + '-1045000' => 'AUTHSTRPROXY_EMPTY_IN_STRUCT_ERR', + '-1046000' => 'USERAUTHSCHEMEPROXY_EMPTY_IN_STRUCT_ERR', + '-1047000' => 'USERINFOPROXY_EMPTY_IN_STRUCT_ERR', + '-1048000' => 'USERCOMMENTPROXY_EMPTY_IN_STRUCT_ERR', + '-1049000' => 'USERCREATEPROXY_EMPTY_IN_STRUCT_ERR', + '-1050000' => 'USERMODIFYPROXY_EMPTY_IN_STRUCT_ERR', + '-1051000' => 'COLLNAME_EMPTY_IN_STRUCT_ERR', + '-1052000' => 'COLLPARENTNAME_EMPTY_IN_STRUCT_ERR', + '-1053000' => 'COLLOWNERNAME_EMPTY_IN_STRUCT_ERR', + '-1054000' => 'COLLOWNERZONE_EMPTY_IN_STRUCT_ERR', + '-1055000' => 'COLLEXPIRY_EMPTY_IN_STRUCT_ERR', + '-1056000' => 'COLLCOMMENTS_EMPTY_IN_STRUCT_ERR', + '-1057000' => 'COLLCREATE_EMPTY_IN_STRUCT_ERR', + '-1058000' => 'COLLMODIFY_EMPTY_IN_STRUCT_ERR', + '-1059000' => 'COLLACCESS_EMPTY_IN_STRUCT_ERR', + '-1060000' => 'COLLACCESSINX_EMPTY_IN_STRUCT_ERR', + '-1062000' => 'COLLMAPID_EMPTY_IN_STRUCT_ERR', + '-1063000' => 'COLLINHERITANCE_EMPTY_IN_STRUCT_ERR', + '-1065000' => 'RESCZONE_EMPTY_IN_STRUCT_ERR', + '-1066000' => 'RESCLOC_EMPTY_IN_STRUCT_ERR', + '-1067000' => 'RESCTYPE_EMPTY_IN_STRUCT_ERR', + '-1068000' => 'RESCTYPEINX_EMPTY_IN_STRUCT_ERR', + '-1069000' => 'RESCCLASS_EMPTY_IN_STRUCT_ERR', + '-1070000' => 'RESCCLASSINX_EMPTY_IN_STRUCT_ERR', + '-1071000' => 'RESCVAULTPATH_EMPTY_IN_STRUCT_ERR', + '-1072000' => 'NUMOPEN_ORTS_EMPTY_IN_STRUCT_ERR', + '-1073000' => 'PARAOPR_EMPTY_IN_STRUCT_ERR', + '-1074000' => 'RESCID_EMPTY_IN_STRUCT_ERR', + '-1075000' => 'GATEWAYADDR_EMPTY_IN_STRUCT_ERR', + '-1076000' => 'RESCMAX_BJSIZE_EMPTY_IN_STRUCT_ERR', + '-1077000' => 'FREESPACE_EMPTY_IN_STRUCT_ERR', + '-1078000' => 'FREESPACETIME_EMPTY_IN_STRUCT_ERR', + '-1079000' => 'FREESPACETIMESTAMP_EMPTY_IN_STRUCT_ERR', + '-1080000' => 'RESCINFO_EMPTY_IN_STRUCT_ERR', + '-1081000' => 'RESCCOMMENTS_EMPTY_IN_STRUCT_ERR', + '-1082000' => 'RESCCREATE_EMPTY_IN_STRUCT_ERR', + '-1083000' => 'RESCMODIFY_EMPTY_IN_STRUCT_ERR', + '-1084000' => 'INPUT_ARG_NOT_WELL_FORMED_ERR', + '-1085000' => 'INPUT_ARG_OUT_OF_ARGC_RANGE_ERR', + '-1086000' => 'INSUFFICIENT_INPUT_ARG_ERR', + '-1087000' => 'INPUT_ARG_DOES_NOT_MATCH_ERR', + '-1088000' => 'RETRY_WITHOUT_RECOVERY_ERR', + '-1089000' => 'CUT_ACTION_PROCESSED_ERR', + '-1090000' => 'ACTION_FAILED_ERR', + '-1091000' => 'FAIL_ACTION_ENCOUNTERED_ERR', + '-1092000' => 'VARIABLE_NAME_TOO_LONG_ERR', + '-1093000' => 'UNKNOWN_VARIABLE_MAP_ERR', + '-1094000' => 'UNDEFINED_VARIABLE_MAP_ERR', + '-1095000' => 'NULL_VALUE_ERR', + '-1096000' => 'DVARMAP_FILE_READ_ERROR', + '-1097000' => 'NO_RULE_OR_MSI_FUNCTION_FOUND_ERR', + '-1098000' => 'FILE_CREATE_ERROR', + '-1099000' => 'FMAP_FILE_READ_ERROR', + '-1100000' => 'DATE_FORMAT_ERR', + '-1101000' => 'RULE_FAILED_ERR', + '-1102000' => 'NO_MICROSERVICE_FOUND_ERR', + '-1103000' => 'INVALID_REGEXP', + '-1104000' => 'INVALID_OBJECT_NAME', + '-1105000' => 'INVALID_OBJECT_TYPE', + '-1106000' => 'NO_VALUES_FOUND', + '-1107000' => 'NO_COLUMN_NAME_FOUND', + '-99999996' => 'SYS_NULL_INPUT', + '-99999997' => 'SYS_HANDLER_DONE_WITH_ERROR', + '-99999998' => 'SYS_HANDLER_DONE_NO_ERROR', + '-99999999' => 'SYS_NO_HANDLER_REPLY_MSG', + '-3000000' => 'GENERAL_PRODS_ERR', + '-3100000' => 'PERR_INTERNAL_ERR', + '-3101000' => 'PERR_UNEXPECTED_PACKET_FORMAT', + '-3102000' => 'PERR_PATH_DOES_NOT_EXISTS', + '-3103000' => 'PERR_UNSUPPORTED_PROTOCOL_SCHEME', + '-3104000' => 'PERR_USER_INPUT_ERROR', + '-3105000' => 'PERR_USER_INPUT_PATH_ERROR', + '-3106000' => 'PERR_CONN_NOT_ACTIVE', + '-2100000' => 'SSL_NOT_BUILT_INTO_CLIENT', + '-2101000' => 'SSL_NOT_BUILT_INTO_SERVER', + '-2102000' => 'SSL_INIT_ERROR', + '-2103000' => 'SSL_HANDSHAKE_ERROR', + '-2104000' => 'SSL_SHUTDOWN_ERROR', + '-2105000' => 'SSL_CERT_ERROR', + '-991000' => 'PAM_AUTH_NOT_BUILT_INTO_CLIENT', + '-992000' => 'PAM_AUTH_NOT_BUILT_INTO_SERVER', + '-993000' => 'PAM_AUTH_PASSWORD_FAILED', + '-994000' => 'PAM_AUTH_PASSWORD_INVALID_TTL', +); +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php new file mode 100644 index 0000000000..ff830c6d6a --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryKeyWd.inc.php @@ -0,0 +1,225 @@ + "all", + 'COPIES_KW' => "copies", + 'EXEC_LOCALLY_KW' => "execLocally", + 'FORCE_FLAG_KW' => "forceFlag", + 'CLI_IN_SVR_FIREWALL_KW' => "cliInSvrFirewall", + 'REG_CHKSUM_KW' => "regChksum", + 'VERIFY_CHKSUM_KW' => "verifyChksum", + 'VERIFY_BY_SIZE_KW' => "verifyBySize", + 'OBJ_PATH_KW' => "objPath", + 'RESC_NAME_KW' => "rescName", + 'DEST_RESC_NAME_KW' => "destRescName", + 'BACKUP_RESC_NAME_KW' => "backupRescName", + 'DATA_TYPE_KW' => "dataType", + 'DATA_SIZE_KW' => "dataSize", + 'CHKSUM_KW' => "chksum", + 'VERSION_KW' => "version", + 'FILE_PATH_KW' => "filePath", + 'REPL_NUM_KW' => "replNum", + 'REPL_STATUS_KW' => "replStatus", + 'ALL_REPL_STATUS_KW' => "allReplStatus", + 'DATA_INCLUDED_KW' => "dataIncluded", + 'DATA_OWNER_KW' => "dataOwner", + 'DATA_OWNER_ZONE_KW' => "dataOwnerZone", + 'DATA_EXPIRY_KW' => "dataExpiry", + 'DATA_COMMENTS_KW' => "dataComments", + 'DATA_CREATE_KW' => "dataCreate", + 'DATA_MODIFY_KW' => "dataModify", + 'DATA_ACCESS_KW' => "dataAccess", + 'DATA_ACCESS_INX_KW' => "dataAccessInx", + 'NO_OPEN_FLAG_KW' => "noOpenFlag", + 'STREAMING_KW' => "streaming", + 'DATA_ID_KW' => "dataId", + 'COLL_ID_KW' => "collId", + 'RESC_GROUP_NAME_KW' => "rescGroupName", + 'STATUS_STRING_KW' => "statusString", + 'DATA_MAP_ID_KW' => "dataMapId", + 'NO_PARA_OP_KW' => "noParaOpr", + 'LOCAL_PATH_KW' => "localPath", + 'RSYNC_MODE_KW' => "rsyncMode", + 'RSYNC_DEST_PATH_KW' => "rsyncDestPath", + 'RSYNC_CHKSUM_KW' => "rsyncChksum", + 'CHKSUM_ALL_KW' => "ChksumAll", + 'FORCE_CHKSUM_KW' => "forceChksum", + 'COLLECTION_KW' => "collection", + 'IRODS_ADMIN_KW' => "irodsAdmin", + 'RESC_ZONE_KW' => "zoneName", + 'RESC_LOC_KW' => "rescLoc", + 'RESC_TYPE_KW' => "rescType", + 'RESC_CLASS_KW' => "rescClass", + 'RESC_VAULT_PATH_KW' => "rescVaultPath", + 'NUM_OPEN_PORTS_KW' => "numOpenPorts", + 'PARA_OPR_KW' => "paraOpr", + 'GATEWAY_ADDR_KW' => "gateWayAddr", + 'RESC_MAX_OBJ_SIZE_KW' => "rescMaxObjSize", + 'FREE_SPACE_KW' => "freeSpace", + 'FREE_SPACE_TIME_KW' => "freeSpaceTime", + 'FREE_SPACE_TIMESTAMP_KW' => "freeSpaceTimeStamp", + 'RESC_TYPE_INX_KW' => "rescTypeInx", + 'RESC_CLASS_INX_KW' => "rescClassInx", + 'RESC_ID_KW' => "rescId", + 'RESC_INFO_KW' => "rescInfo", + 'RESC_COMMENTS_KW' => "rescComments", + 'RESC_CREATE_KW' => "rescCreate", + 'RESC_MODIFY_KW' => "rescModify", + 'USER_NAME_CLIENT_KW' => "userNameClient", + 'RODS_ZONE_CLIENT_KW' => "rodsZoneClient", + 'HOST_CLIENT_KW' => "hostClient", + 'USER_TYPE_CLIENT_KW' => "userTypeClient", + 'AUTH_STR_CLIENT_KW' => "authStrClient", + 'USER_AUTH_SCHEME_CLIENT_KW' => "userAuthSchemeClient", + 'USER_INFO_CLIENT_KW' => "userInfoClient", + 'USER_COMMENT_CLIENT_KW' => "userCommentClient", + 'USER_CREATE_CLIENT_KW' => "userCreateClient", + 'USER_MODIFY_CLIENT_KW' => "userModifyClient", + 'USER_NAME_PROXY_KW' => "userNameProxy", + 'RODS_ZONE_PROXY_KW' => "rodsZoneProxy", + 'HOST_PROXY_KW' => "hostProxy", + 'USER_TYPE_PROXY_KW' => "userTypeProxy", + 'AUTH_STR_PROXY_KW' => "authStrProxy", + 'USER_AUTH_SCHEME_PROXY_KW' => "userAuthSchemeProxy", + 'USER_INFO_PROXY_KW' => "userInfoProxy", + 'USER_COMMENT_PROXY_KW' => "userCommentProxy", + 'USER_CREATE_PROXY_KW' => "userCreateProxy", + 'USER_MODIFY_PROXY_KW' => "userModifyProxy", + 'ACCESS_PERMISSION_KW' => "accessPermission", + 'COLL_NAME_KW' => "collName", + 'COLL_PARENT_NAME_KW' => "collParentName", + 'COLL_OWNER_NAME_KW' => "collOwnername", + 'COLL_OWNER_ZONE_KW' => "collOwnerZone", + 'COLL_MAP_ID_KW' => "collMapId", + 'COLL_INHERITANCE_KW' => "collInheritance", + 'COLL_COMMENTS_KW' => "collComments", + 'COLL_EXPIRY_KW' => "collExpiry", + 'COLL_CREATE_KW' => "collCreate", + 'COLL_MODIFY_KW' => "collModify", + 'COLL_ACCESS_KW' => "collAccess", + 'COLL_ACCESS_INX_KW' => "collAccessInx", + 'COLL_ID_KW' => "collId", + 'RULE_NAME_KW' => "ruleName", + 'RULE_REI_FILE_PATH_KW' => "reiFilePath", + 'RULE_USER_NAME_KW' => "userName", + 'RULE_EXE_ADDRESS_KW' => "exeAddress", + 'RULE_EXE_TIME_KW' => "exeTime", + 'RULE_EXE_FREQUENCY_KW' => "exeFrequency", + 'RULE_PRIORITY_KW' => "priority", + 'RULE_ESTIMATE_EXE_TIME_KW' => "estimateExeTime", + 'RULE_NOTIFICATION_ADDR_KW' => "notificationAddr", + 'RULE_LAST_EXE_TIME_KW' => "lastExeTime", + 'RULE_EXE_STATUS_KW' => "exeStatus", +); +$GLOBALS['PRODS_GENQUE_KEYWD_REV'] = array( + "all" => 'ALL_KW', + "copies" => 'COPIES_KW', + "execLocally" => 'EXEC_LOCALLY_KW', + "forceFlag" => 'FORCE_FLAG_KW', + "cliInSvrFirewall" => 'CLI_IN_SVR_FIREWALL_KW', + "regChksum" => 'REG_CHKSUM_KW', + "verifyChksum" => 'VERIFY_CHKSUM_KW', + "verifyBySize" => 'VERIFY_BY_SIZE_KW', + "objPath" => 'OBJ_PATH_KW', + "rescName" => 'RESC_NAME_KW', + "destRescName" => 'DEST_RESC_NAME_KW', + "backupRescName" => 'BACKUP_RESC_NAME_KW', + "dataType" => 'DATA_TYPE_KW', + "dataSize" => 'DATA_SIZE_KW', + "chksum" => 'CHKSUM_KW', + "version" => 'VERSION_KW', + "filePath" => 'FILE_PATH_KW', + "replNum" => 'REPL_NUM_KW', + "replStatus" => 'REPL_STATUS_KW', + "allReplStatus" => 'ALL_REPL_STATUS_KW', + "dataIncluded" => 'DATA_INCLUDED_KW', + "dataOwner" => 'DATA_OWNER_KW', + "dataOwnerZone" => 'DATA_OWNER_ZONE_KW', + "dataExpiry" => 'DATA_EXPIRY_KW', + "dataComments" => 'DATA_COMMENTS_KW', + "dataCreate" => 'DATA_CREATE_KW', + "dataModify" => 'DATA_MODIFY_KW', + "dataAccess" => 'DATA_ACCESS_KW', + "dataAccessInx" => 'DATA_ACCESS_INX_KW', + "noOpenFlag" => 'NO_OPEN_FLAG_KW', + "streaming" => 'STREAMING_KW', + "dataId" => 'DATA_ID_KW', + "collId" => 'COLL_ID_KW', + "rescGroupName" => 'RESC_GROUP_NAME_KW', + "statusString" => 'STATUS_STRING_KW', + "dataMapId" => 'DATA_MAP_ID_KW', + "noParaOpr" => 'NO_PARA_OP_KW', + "localPath" => 'LOCAL_PATH_KW', + "rsyncMode" => 'RSYNC_MODE_KW', + "rsyncDestPath" => 'RSYNC_DEST_PATH_KW', + "rsyncChksum" => 'RSYNC_CHKSUM_KW', + "ChksumAll" => 'CHKSUM_ALL_KW', + "forceChksum" => 'FORCE_CHKSUM_KW', + "collection" => 'COLLECTION_KW', + "irodsAdmin" => 'IRODS_ADMIN_KW', + "zoneName" => 'RESC_ZONE_KW', + "rescLoc" => 'RESC_LOC_KW', + "rescType" => 'RESC_TYPE_KW', + "rescClass" => 'RESC_CLASS_KW', + "rescVaultPath" => 'RESC_VAULT_PATH_KW', + "numOpenPorts" => 'NUM_OPEN_PORTS_KW', + "paraOpr" => 'PARA_OPR_KW', + "gateWayAddr" => 'GATEWAY_ADDR_KW', + "rescMaxObjSize" => 'RESC_MAX_OBJ_SIZE_KW', + "freeSpace" => 'FREE_SPACE_KW', + "freeSpaceTime" => 'FREE_SPACE_TIME_KW', + "freeSpaceTimeStamp" => 'FREE_SPACE_TIMESTAMP_KW', + "rescTypeInx" => 'RESC_TYPE_INX_KW', + "rescClassInx" => 'RESC_CLASS_INX_KW', + "rescId" => 'RESC_ID_KW', + "rescInfo" => 'RESC_INFO_KW', + "rescComments" => 'RESC_COMMENTS_KW', + "rescCreate" => 'RESC_CREATE_KW', + "rescModify" => 'RESC_MODIFY_KW', + "userNameClient" => 'USER_NAME_CLIENT_KW', + "rodsZoneClient" => 'RODS_ZONE_CLIENT_KW', + "hostClient" => 'HOST_CLIENT_KW', + "userTypeClient" => 'USER_TYPE_CLIENT_KW', + "authStrClient" => 'AUTH_STR_CLIENT_KW', + "userAuthSchemeClient" => 'USER_AUTH_SCHEME_CLIENT_KW', + "userInfoClient" => 'USER_INFO_CLIENT_KW', + "userCommentClient" => 'USER_COMMENT_CLIENT_KW', + "userCreateClient" => 'USER_CREATE_CLIENT_KW', + "userModifyClient" => 'USER_MODIFY_CLIENT_KW', + "userNameProxy" => 'USER_NAME_PROXY_KW', + "rodsZoneProxy" => 'RODS_ZONE_PROXY_KW', + "hostProxy" => 'HOST_PROXY_KW', + "userTypeProxy" => 'USER_TYPE_PROXY_KW', + "authStrProxy" => 'AUTH_STR_PROXY_KW', + "userAuthSchemeProxy" => 'USER_AUTH_SCHEME_PROXY_KW', + "userInfoProxy" => 'USER_INFO_PROXY_KW', + "userCommentProxy" => 'USER_COMMENT_PROXY_KW', + "userCreateProxy" => 'USER_CREATE_PROXY_KW', + "userModifyProxy" => 'USER_MODIFY_PROXY_KW', + "accessPermission" => 'ACCESS_PERMISSION_KW', + "collName" => 'COLL_NAME_KW', + "collParentName" => 'COLL_PARENT_NAME_KW', + "collOwnername" => 'COLL_OWNER_NAME_KW', + "collOwnerZone" => 'COLL_OWNER_ZONE_KW', + "collMapId" => 'COLL_MAP_ID_KW', + "collInheritance" => 'COLL_INHERITANCE_KW', + "collComments" => 'COLL_COMMENTS_KW', + "collExpiry" => 'COLL_EXPIRY_KW', + "collCreate" => 'COLL_CREATE_KW', + "collModify" => 'COLL_MODIFY_KW', + "collAccess" => 'COLL_ACCESS_KW', + "collAccessInx" => 'COLL_ACCESS_INX_KW', + "collId" => 'COLL_ID_KW', + "ruleName" => 'RULE_NAME_KW', + "reiFilePath" => 'RULE_REI_FILE_PATH_KW', + "userName" => 'RULE_USER_NAME_KW', + "exeAddress" => 'RULE_EXE_ADDRESS_KW', + "exeTime" => 'RULE_EXE_TIME_KW', + "exeFrequency" => 'RULE_EXE_FREQUENCY_KW', + "priority" => 'RULE_PRIORITY_KW', + "estimateExeTime" => 'RULE_ESTIMATE_EXE_TIME_KW', + "notificationAddr" => 'RULE_NOTIFICATION_ADDR_KW', + "lastExeTime" => 'RULE_LAST_EXE_TIME_KW', + "exeStatus" => 'RULE_EXE_STATUS_KW', +); +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php new file mode 100644 index 0000000000..82de94095b --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/RodsGenQueryNum.inc.php @@ -0,0 +1,235 @@ + '50', + 'MAX_SQL_ROWS' => '500', + 'ORDER_BY' => '1024', + 'ORDER_BY_DESC' => '2048', + 'RETURN_TOTAL_ROW_COUNT' => '32', + 'SELECT_MIN' => '2', + 'SELECT_MAX' => '3', + 'SELECT_SUM' => '4', + 'SELECT_AVG' => '5', + 'SELECT_COUNT' => '6', + 'COL_ZONE_ID' => '101', + 'COL_ZONE_NAME' => '102', + 'COL_USER_ID' => '201', + 'COL_USER_NAME' => '202', + 'COL_USER_TYPE' => '203', + 'COL_USER_ZONE' => '204', + 'COL_USER_DN' => '205', + 'COL_USER_INFO' => '206', + 'COL_USER_COMMENT' => '207', + 'COL_USER_CREATE_TIME' => '208', + 'COL_USER_MODIFY_TIME' => '209', + 'COL_R_RESC_ID' => '301', + 'COL_R_RESC_NAME' => '302', + 'COL_R_ZONE_NAME' => '303', + 'COL_R_TYPE_NAME' => '304', + 'COL_R_CLASS_NAME' => '305', + 'COL_R_LOC' => '306', + 'COL_R_VAULT_PATH' => '307', + 'COL_R_FREE_SPACE' => '308', + 'COL_R_RESC_INFO' => '309', + 'COL_R_RESC_COMMENT' => '310', + 'COL_R_CREATE_TIME' => '311', + 'COL_R_MODIFY_TIME' => '312', + 'COL_D_DATA_ID' => '401', + 'COL_D_COLL_ID' => '402', + 'COL_DATA_NAME' => '403', + 'COL_DATA_REPL_NUM' => '404', + 'COL_DATA_VERSION' => '405', + 'COL_DATA_TYPE_NAME' => '406', + 'COL_DATA_SIZE' => '407', + 'COL_D_RESC_GROUP_NAME' => '408', + 'COL_D_RESC_NAME' => '409', + 'COL_D_DATA_PATH' => '410', + 'COL_D_OWNER_NAME' => '411', + 'COL_D_OWNER_ZONE' => '412', + 'COL_D_REPL_STATUS' => '413', + 'COL_D_DATA_STATUS' => '414', + 'COL_D_DATA_CHECKSUM' => '415', + 'COL_D_EXPIRY' => '416', + 'COL_D_MAP_ID' => '417', + 'COL_D_COMMENTS' => '418', + 'COL_D_CREATE_TIME' => '419', + 'COL_D_MODIFY_TIME' => '420', + 'COL_COLL_ID' => '500', + 'COL_COLL_NAME' => '501', + 'COL_COLL_PARENT_NAME' => '502', + 'COL_COLL_OWNER_NAME' => '503', + 'COL_COLL_OWNER_ZONE' => '504', + 'COL_COLL_MAP_ID' => '505', + 'COL_COLL_INHERITANCE' => '506', + 'COL_COLL_COMMENTS' => '507', + 'COL_COLL_CREATE_TIME' => '508', + 'COL_COLL_MODIFY_TIME' => '509', + 'COL_COLL_TYPE' => '510', + 'COL_COLL_INFO1' => '511', + 'COL_COLL_INFO2' => '512', + 'COL_META_DATA_ATTR_NAME' => '600', + 'COL_META_DATA_ATTR_VALUE' => '601', + 'COL_META_DATA_ATTR_UNITS' => '602', + 'COL_META_DATA_ATTR_ID' => '603', + 'COL_META_COLL_ATTR_NAME' => '610', + 'COL_META_COLL_ATTR_VALUE' => '611', + 'COL_META_COLL_ATTR_UNITS' => '612', + 'COL_META_COLL_ATTR_ID' => '613', + 'COL_META_NAMESPACE_COLL' => '620', + 'COL_META_NAMESPACE_DATA' => '621', + 'COL_META_NAMESPACE_RESC' => '622', + 'COL_META_NAMESPACE_USER' => '623', + 'COL_META_RESC_ATTR_NAME' => '630', + 'COL_META_RESC_ATTR_VALUE' => '631', + 'COL_META_RESC_ATTR_UNITS' => '632', + 'COL_META_RESC_ATTR_ID' => '633', + 'COL_META_USER_ATTR_NAME' => '640', + 'COL_META_USER_ATTR_VALUE' => '641', + 'COL_META_USER_ATTR_UNITS' => '642', + 'COL_META_USER_ATTR_ID' => '643', + 'COL_DATA_ACCESS_TYPE' => '700', + 'COL_DATA_ACCESS_NAME' => '701', + 'COL_DATA_TOKEN_NAMESPACE' => '702', + 'COL_DATA_ACCESS_USER_ID' => '703', + 'COL_DATA_ACCESS_DATA_ID' => '704', + 'COL_RESC_GROUP_RESC_ID' => '800', + 'COL_RESC_GROUP_NAME' => '801', + 'COL_USER_GROUP_ID' => '900', + 'COL_USER_GROUP_NAME' => '901', + 'COL_RULE_EXEC_ID' => '1000', + 'COL_RULE_EXEC_NAME' => '1001', + 'COL_RULE_EXEC_REI_FILE_PATH' => '1002', + 'COL_RULE_EXEC_USER_NAME' => '1003', + 'COL_RULE_EXEC_ADDRESS' => '1004', + 'COL_RULE_EXEC_TIME' => '1005', + 'COL_RULE_EXEC_FREQUENCY' => '1006', + 'COL_RULE_EXEC_PRIORITY' => '1007', + 'COL_RULE_EXEC_ESTIMATED_EXE_TIME' => '1008', + 'COL_RULE_EXEC_NOTIFICATION_ADDR' => '1009', + 'COL_RULE_EXEC_LAST_EXE_TIME' => '1010', + 'COL_RULE_EXEC_STATUS' => '1011', + 'COL_TOKEN_NAMESPACE' => '1100', + 'COL_TOKEN_ID' => '1101', + 'COL_TOKEN_NAME' => '1102', + 'COL_TOKEN_VALUE' => '1103', + 'COL_TOKEN_VALUE2' => '1104', + 'COL_TOKEN_VALUE3' => '1105', + 'COL_TOKEN_COMMENT' => '1106', +); +$GLOBALS['PRODS_GENQUE_NUMS_REV'] = array( + '50' => 'MAX_SQL_ATTR', + '500' => 'MAX_SQL_ROWS', + '1024' => 'ORDER_BY', + '2048' => 'ORDER_BY_DESC', + '32' => 'RETURN_TOTAL_ROW_COUNT', + '2' => 'SELECT_MIN', + '3' => 'SELECT_MAX', + '4' => 'SELECT_SUM', + '5' => 'SELECT_AVG', + '6' => 'SELECT_COUNT', + '101' => 'COL_ZONE_ID', + '102' => 'COL_ZONE_NAME', + '201' => 'COL_USER_ID', + '202' => 'COL_USER_NAME', + '203' => 'COL_USER_TYPE', + '204' => 'COL_USER_ZONE', + '205' => 'COL_USER_DN', + '206' => 'COL_USER_INFO', + '207' => 'COL_USER_COMMENT', + '208' => 'COL_USER_CREATE_TIME', + '209' => 'COL_USER_MODIFY_TIME', + '301' => 'COL_R_RESC_ID', + '302' => 'COL_R_RESC_NAME', + '303' => 'COL_R_ZONE_NAME', + '304' => 'COL_R_TYPE_NAME', + '305' => 'COL_R_CLASS_NAME', + '306' => 'COL_R_LOC', + '307' => 'COL_R_VAULT_PATH', + '308' => 'COL_R_FREE_SPACE', + '309' => 'COL_R_RESC_INFO', + '310' => 'COL_R_RESC_COMMENT', + '311' => 'COL_R_CREATE_TIME', + '312' => 'COL_R_MODIFY_TIME', + '401' => 'COL_D_DATA_ID', + '402' => 'COL_D_COLL_ID', + '403' => 'COL_DATA_NAME', + '404' => 'COL_DATA_REPL_NUM', + '405' => 'COL_DATA_VERSION', + '406' => 'COL_DATA_TYPE_NAME', + '407' => 'COL_DATA_SIZE', + '408' => 'COL_D_RESC_GROUP_NAME', + '409' => 'COL_D_RESC_NAME', + '410' => 'COL_D_DATA_PATH', + '411' => 'COL_D_OWNER_NAME', + '412' => 'COL_D_OWNER_ZONE', + '413' => 'COL_D_REPL_STATUS', + '414' => 'COL_D_DATA_STATUS', + '415' => 'COL_D_DATA_CHECKSUM', + '416' => 'COL_D_EXPIRY', + '417' => 'COL_D_MAP_ID', + '418' => 'COL_D_COMMENTS', + '419' => 'COL_D_CREATE_TIME', + '420' => 'COL_D_MODIFY_TIME', + '500' => 'COL_COLL_ID', + '501' => 'COL_COLL_NAME', + '502' => 'COL_COLL_PARENT_NAME', + '503' => 'COL_COLL_OWNER_NAME', + '504' => 'COL_COLL_OWNER_ZONE', + '505' => 'COL_COLL_MAP_ID', + '506' => 'COL_COLL_INHERITANCE', + '507' => 'COL_COLL_COMMENTS', + '508' => 'COL_COLL_CREATE_TIME', + '509' => 'COL_COLL_MODIFY_TIME', + '510' => 'COL_COLL_TYPE', + '511' => 'COL_COLL_INFO1', + '512' => 'COL_COLL_INFO2', + '600' => 'COL_META_DATA_ATTR_NAME', + '601' => 'COL_META_DATA_ATTR_VALUE', + '602' => 'COL_META_DATA_ATTR_UNITS', + '603' => 'COL_META_DATA_ATTR_ID', + '610' => 'COL_META_COLL_ATTR_NAME', + '611' => 'COL_META_COLL_ATTR_VALUE', + '612' => 'COL_META_COLL_ATTR_UNITS', + '613' => 'COL_META_COLL_ATTR_ID', + '620' => 'COL_META_NAMESPACE_COLL', + '621' => 'COL_META_NAMESPACE_DATA', + '622' => 'COL_META_NAMESPACE_RESC', + '623' => 'COL_META_NAMESPACE_USER', + '630' => 'COL_META_RESC_ATTR_NAME', + '631' => 'COL_META_RESC_ATTR_VALUE', + '632' => 'COL_META_RESC_ATTR_UNITS', + '633' => 'COL_META_RESC_ATTR_ID', + '640' => 'COL_META_USER_ATTR_NAME', + '641' => 'COL_META_USER_ATTR_VALUE', + '642' => 'COL_META_USER_ATTR_UNITS', + '643' => 'COL_META_USER_ATTR_ID', + '700' => 'COL_DATA_ACCESS_TYPE', + '701' => 'COL_DATA_ACCESS_NAME', + '702' => 'COL_DATA_TOKEN_NAMESPACE', + '703' => 'COL_DATA_ACCESS_USER_ID', + '704' => 'COL_DATA_ACCESS_DATA_ID', + '800' => 'COL_RESC_GROUP_RESC_ID', + '801' => 'COL_RESC_GROUP_NAME', + '900' => 'COL_USER_GROUP_ID', + '901' => 'COL_USER_GROUP_NAME', + '1000' => 'COL_RULE_EXEC_ID', + '1001' => 'COL_RULE_EXEC_NAME', + '1002' => 'COL_RULE_EXEC_REI_FILE_PATH', + '1003' => 'COL_RULE_EXEC_USER_NAME', + '1004' => 'COL_RULE_EXEC_ADDRESS', + '1005' => 'COL_RULE_EXEC_TIME', + '1006' => 'COL_RULE_EXEC_FREQUENCY', + '1007' => 'COL_RULE_EXEC_PRIORITY', + '1008' => 'COL_RULE_EXEC_ESTIMATED_EXE_TIME', + '1009' => 'COL_RULE_EXEC_NOTIFICATION_ADDR', + '1010' => 'COL_RULE_EXEC_LAST_EXE_TIME', + '1011' => 'COL_RULE_EXEC_STATUS', + '1100' => 'COL_TOKEN_NAMESPACE', + '1101' => 'COL_TOKEN_ID', + '1102' => 'COL_TOKEN_NAME', + '1103' => 'COL_TOKEN_VALUE', + '1104' => 'COL_TOKEN_VALUE2', + '1105' => 'COL_TOKEN_VALUE3', + '1106' => 'COL_TOKEN_COMMENT', +); +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/autoload.inc.php b/apps/files_external/3rdparty/irodsphp/prods/src/autoload.inc.php new file mode 100644 index 0000000000..593b901959 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/autoload.inc.php @@ -0,0 +1,47 @@ +read())) { + if ($folder != "." && $folder != "..") { + if (is_dir(CLASS_DIR . $sub . $folder)) { + $subFolder = classFolder($className, $sub . $folder . "/"); + + if ($subFolder) + return $subFolder; + } + } + } + $dir->close(); + return false; +} + +spl_autoload_register('__autoload'); diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php new file mode 100644 index 0000000000..89040882d2 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RODSPacket.class.php @@ -0,0 +1,250 @@ + array ("type" => NULL, "msgLen" => 0, + "errorLen" => 0, "bsLen" => 0, "intInfo" => 0), + "StartupPack_PI" => array ("irodsProt" => 1, "connectCnt" => 0, + "proxyUser" => NULL, "proxyRcatZone" => NULL, "clientUser" => NULL, + "clientRcatZone" => NULL, "relVersion" => NULL, + "apiVersion" => NULL, "option" => NULL ), + "Version_PI" => array ("status"=>0,"relVersion"=>NULL,"apiVersion"=>NULL), + "authResponseInp_PI" => array("response" => NULL, "username" => NULL), + "authRequestOut_PI" => array("challenge" => NULL) +); +*/ + +class RODSPacket +{ + protected $type; // type of packet + protected $packlets; // (array of mixed) main message body + + public function __construct($type = NULL, array $arr = NULL) + { + if (!isset($type)) + return; + + $this->type = $type; + $this->packlets = $arr; + } + + public function toXML() + { + if (empty($this->type)) + return NULL; + + $doc = new DOMDocument(); + $root = $this->toDOMElement($doc); + $doc->appendChild($root); + return ($doc->saveXML($root, LIBXML_NOEMPTYTAG)); + } + + /* + public function fromXML($str) + { + try { + $xml = new SimpleXMLElement($str); + } catch (Exception $e) { + throw new RODSException("RODSPacket::fromXML failed. ". + "Mal-formated XML: '$str'\n", + PERR_INTERNAL_ERR); + } + + if (isset($this->type)&&($this->type!=$xml->getName())) + { + throw new RODSException("RODSPacket::fromXML failed. ". + "Possible type mismatch! expected type:".$this->type." but got: ". + $xml->getName()." \n", + PERR_INTERNAL_ERR); + } + + $this->type=$xml->getName(); + + foreach($xml as $key => $val) + { + if (!array_key_exists($key,$this->msg)) + { + throw new RODSException("RODSPacket::fromXML failed. ". + "Possible type mismatch! expected key '$key' doesn't exists\n", + PERR_INTERNAL_ERR); + } + $this->msg[$key]=(string)$val; + } + } + */ + + public static function parseXML($xmlstr) + { + if (false == ($doc = DOMDocument::loadXML($xmlstr))) { + throw new RODSException("RODSPacket::parseXML failed. " . + "Failed to loadXML(). The xmlstr is: $xmlstr\n", + PERR_UNEXPECTED_PACKET_FORMAT); + } + + $rp_classname = "RP_" . substr($doc->tagName, 0, strlen($doc->tagName) - 3); + $packet = new $rp_classname(); + $packet->fromDOM($doc); + } + + /* + public function fromDOM(DOMNode $domnode) + { + if (!isset($this->packlets)) + return; + + $i=0; + $domnode_children=$domnode->childNodes; + + foreach($this->packlets as $packlet_key => &$packlet_val) + { + $domnode_child=$domnode_children->item($i++); + + // check if the tag names are expected + if ($domnode_child->tagName!=$packlet_key) + { + throw new RODSException("RODSPacket::fromDOM failed. ". + "Expecting packlet:$packlet_key, but got:".$domnode_child->tagName." \n", + PERR_UNEXPECTED_PACKET_FORMAT); + } + + if (is_a($packlet_val, "RODSPacket")) //if expecting sub packet + { + $packlet_val->fromDOM($domnode_child); + } + else //if expecting an string + { + + } + } + } + + */ + + public function fromSXE(SimpleXMLElement $sxe) + { + if (!isset($this->packlets)) + return; + + foreach ($this->packlets as $packlet_key => &$packlet_val) { + if ($packlet_val instanceof RODSPacket) //if expecting sub packet + { + if (!isset($sxe->$packlet_key)) { + throw new RODSException("RODSPacket(" . get_class($this) . ")::fromSXE failed. " . + "Failed to find expected packlet: '$packlet_key' \n", + "PERR_UNEXPECTED_PACKET_FORMAT"); + } + $packlet_val->fromSXE($sxe->$packlet_key); + } else + if (is_array($packlet_val)) //if expecting array + { + if (isset($sxe->$packlet_key)) { + $packlet_val = array(); + foreach ($sxe->$packlet_key as $sxe_val) { + if ((!empty($this->array_rp_type)) && + (!empty($this->array_rp_type["$packlet_key"])) + ) // if it's an array of packets + { + $class_name = $this->array_rp_type[$packlet_key]; + $sub_array_packet = new $class_name(); + $sub_array_packet->fromSXE($sxe_val); + $packlet_val[] = $sub_array_packet; + } else { + $packlet_val[] = (string)$sxe_val; + } + } + } + + } else { + if (isset($sxe->$packlet_key)) { + $packlet_val = (string)$sxe->$packlet_key; + } + } + } + /* + foreach($sxe->children() as $child) + { + $tagname=$child->getName(); + if(substr($tagname,-3,3)=="_PI") + { + $rp_classname="RP_".substr($name,0,strlen($name)-3); + $child_rp=new $rp_classname(); + $child_rp->fromSXE($child); + } + else + { + $this->packlets[$child->getName()]=(string)$child; + } + } + */ + } + + public function toDOMElement(DOMDocument $doc) + { + if (empty($this->type)) + return NULL; + + $node = $doc->createElement($this->type); + + foreach ($this->packlets as $name => $packlet) { + if ($packlet instanceof RODSPacket) //if node is a packet + { + $child_node = $packlet->toDOMElement($doc); + if (isset($child_node)) + $node->appendChild($packlet->toDOMElement($doc)); + } else + if (is_array($packlet)) //if node is an array + { + if (isset($packlet)) { + foreach ($packlet as $sub_packlet) { + if ($sub_packlet instanceof RODSPacket) //if sub_node is a packet + { + $child_node = $sub_packlet->toDOMElement($doc); + if (isset($child_node)) + $node->appendChild($sub_packlet->toDOMElement($doc)); + } else { + //echo "sub_packlet = $sub_packlet \n"; + $node->appendChild($doc->createElement($name, htmlspecialchars($sub_packlet))); + } + } + } + } else //if node holds a string + { //echo "packlet = $packlet \n"; + $node->appendChild($doc->createElement($name, htmlspecialchars($packlet))); + } + } + + return $node; + } + + public function __get($name) + { + if (array_key_exists($name, $this->packlets)) + return $this->packlets[$name]; + else { + debug_print_backtrace(); + throw new RODSException("RODSPacket::__get() failed. Trying to access field '$name' that doesn't exist!", + "PERR_INTERNAL_ERR"); + } + } + + public function __set($name, $val) + { + if (array_key_exists($name, $this->packlets)) + $this->packlets[$name] = $val; + else + throw new RODSException("RODSPacket::__set() failed. Trying to access field '$name' that doesn't exist!", + "PERR_INTERNAL_ERR"); + } + + /* + public static function makeStartupPack($user,$zone) + { + $msg=array(1,0,$user,$zone,$user,$zone,'rods0.5','a',NULL); + return (new RODSPacket("StartupPack_PI",$msg)); + } + */ +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php new file mode 100644 index 0000000000..8cabcd0ae4 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_BinBytesBuf.class.php @@ -0,0 +1,14 @@ + $buflen, "buf" => $buf); + parent::__construct("BinBytesBuf_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php new file mode 100644 index 0000000000..b7ad6fd0ca --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollInp.class.php @@ -0,0 +1,19 @@ + $collName, + 'KeyValPair_PI' => $KeyValPair_PI); + parent::__construct("CollInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php new file mode 100644 index 0000000000..939d2e3759 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_CollOprStat.class.php @@ -0,0 +1,17 @@ + $filesCnt, "totalFileCnt" => $totalFileCnt, + 'bytesWritten' => $bytesWritten, 'lastObjPath' => $lastObjPath); + parent::__construct("CollOprStat_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php new file mode 100644 index 0000000000..c16b3628f5 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjCopyInp.class.php @@ -0,0 +1,19 @@ + $src, 'dest' => $dest); + parent::__construct("DataObjCopyInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php new file mode 100644 index 0000000000..f7a8f939b8 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_DataObjInp.class.php @@ -0,0 +1,22 @@ + $objPath, 'createMode' => $createMode, + 'openFlags' => $openFlags, 'offset' => $offset, "dataSize" => $dataSize, + "numThreads" => $numThreads, "oprType" => $oprType, + 'KeyValPair_PI' => $KeyValPair_PI); + parent::__construct("DataObjInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php new file mode 100644 index 0000000000..55dcb02383 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecCmdOut.class.php @@ -0,0 +1,56 @@ + $buf); + parent::__construct("ExecCmdOut_PI", $packlets); + } + + public function fromSXE(SimpleXMLElement $sxe) + { + $binbytes = "BinBytesBuf_PI"; + $name = "buf"; + + if (!isset($this->packlets)) + return; + + $packlet_value = ""; + try { + foreach ($sxe->$binbytes as $binpacket) { + if (strlen($binpacket->$name) > 0) { + $decoded_value = base64_decode($binpacket->$name); + $packlet_value .= $decoded_value; + } + } + + // can't find a better way yet to get rid of the garbage on the end of the string ... + $len = strlen($packlet_value); + $cleaned_value = ""; + for ($i = 0; $i < $len; $i++) { + if (ord($packlet_value{$i}) <= 0) break; + $cleaned_value .= $packlet_value{$i}; + } + + $this->packlets[$name] = $cleaned_value; + $this->packlets["buflen"] = $i; + } catch (Exception $ex) { + $this->packlets[$name] = ""; + } + } +} + +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php new file mode 100644 index 0000000000..88a62fc2b0 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ExecMyRuleInp.class.php @@ -0,0 +1,22 @@ + $myRule, "RHostAddr_PI" => $RHostAddr_PI, + "KeyValPair_PI" => $KeyValPair_PI, "outParamDesc" => $outParamDesc, + "MsParamArray_PI" => $MsParamArray_PI); + parent::__construct("ExecMyRuleInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php new file mode 100644 index 0000000000..2e1e29a2bf --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryInp.class.php @@ -0,0 +1,25 @@ + $maxRows, 'continueInx' => $continueInx, + 'partialStartIndex' => $partialStartIndex, 'options' => $options, + 'KeyValPair_PI' => $KeyValPair_PI, 'InxIvalPair_PI' => $InxIvalPair_PI, + 'InxValPair_PI' => $InxValPair_PI); + parent::__construct("GenQueryInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php new file mode 100644 index 0000000000..e9f31dd536 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_GenQueryOut.class.php @@ -0,0 +1,22 @@ +array_rp_type = array("SqlResult_PI" => "RP_SqlResult"); + + $packlets = array("rowCnt" => $rowCnt, 'attriCnt' => $attriCnt, + 'continueInx' => $continueInx, 'totalRowCount' => $totalRowCount, + 'SqlResult_PI' => $SqlResult_PI); + parent::__construct("GenQueryOut_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php new file mode 100644 index 0000000000..ac56bc93df --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxIvalPair.class.php @@ -0,0 +1,27 @@ + $iiLen, 'inx' => $inx, 'ivalue' => $ivalue); + parent::__construct("InxIvalPair_PI", $packlets); + } + + public function fromAssocArray($array) + { + if (!empty($array)) { + $this->packlets["iiLen"] = count($array); + $this->packlets["inx"] = array_keys($array); + $this->packlets["ivalue"] = array_values($array); + } else { + $this->packlets["iiLen"] = 0; + $this->packlets["inx"] = array(); + $this->packlets["ivalue"] = array(); + } + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php new file mode 100644 index 0000000000..787d27fd10 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_InxValPair.class.php @@ -0,0 +1,44 @@ + $isLen, 'inx' => $inx, 'svalue' => $svalue); + parent::__construct("InxValPair_PI", $packlets); + } + + public function fromAssocArray($array) + { + if (!empty($array)) { + $this->packlets["isLen"] = count($array); + $this->packlets["inx"] = array_keys($array); + $this->packlets["svalue"] = array_values($array); + } else { + $this->packlets["isLen"] = 0; + $this->packlets["inx"] = array(); + $this->packlets["svalue"] = array(); + } + } + + public function fromRODSQueryConditionArray($array) + { + $this->packlets["isLen"] = 0; + $this->packlets["inx"] = array(); + $this->packlets["svalue"] = array(); + + if (!isset($array)) return; + + $this->packlets["isLen"] = count($array); + foreach ($array as $cond) { + $this->packlets["inx"][] = $cond->name; + $this->packlets["svalue"][] = "$cond->op '$cond->value'"; + //echo " $cond->op '$cond->value'"; + } + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php new file mode 100644 index 0000000000..6d8dd12ff1 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_KeyValPair.class.php @@ -0,0 +1,47 @@ + $ssLen, 'keyWord' => $keyWord, + 'svalue' => $svalue); + parent::__construct("KeyValPair_PI", $packlets); + } + + public function fromAssocArray(array $array) + { + if (!empty($array)) { + $this->packlets["ssLen"] = count($array); + $this->packlets["keyWord"] = array_keys($array); + $this->packlets["svalue"] = array_values($array); + } else { + $this->packlets["ssLen"] = 0; + $this->packlets["keyWord"] = array(); + $this->packlets["svalue"] = array(); + } + } + + public function fromRODSQueryConditionArray($array) + { + $this->packlets["ssLen"] = 0; + $this->packlets["keyWord"] = array(); + $this->packlets["svalue"] = array(); + + if (!isset($array)) return; + + $this->packlets["ssLen"] = count($array); + foreach ($array as $cond) { + $this->packlets["keyWord"][] = $cond->name; + $this->packlets["svalue"][] = "$cond->op '$cond->value'"; + } + } +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php new file mode 100644 index 0000000000..65ee3580e9 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MiscSvrInfo.class.php @@ -0,0 +1,17 @@ + $serverType, 'relVersion' => $relVersion, + 'apiVersion' => $apiVersion, 'rodsZone' => $rodsZone); + parent::__construct("MiscSvrInfo_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php new file mode 100644 index 0000000000..b67b7083d4 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ModAVUMetadataInp.class.php @@ -0,0 +1,18 @@ + $arg0, "arg1" => $arg1, "arg2" => $arg2, + "arg3" => $arg3, "arg4" => $arg4, "arg5" => $arg5, + "arg6" => $arg6, "arg7" => $arg7, "arg8" => $arg8, "arg9" => $arg9); + parent::__construct("ModAVUMetadataInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php new file mode 100644 index 0000000000..abf9bc471b --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParam.class.php @@ -0,0 +1,45 @@ + $label, "type" => $inOutStruct->type, + $inOutStruct->type => $inOutStruct, "BinBytesBuf_PI" => $BinBytesBuf_PI); + parent::__construct("MsParam_PI", $packlets); + } + + // need to overwrite it's parent function here, since $inOutStruct->type + // can be undefined, when it's parent packet class was defined. + public function fromSXE(SimpleXMLElement $sxe) + { + if (!isset($this->packlets)) + return; + + $this->packlets["label"] = (string)$sxe->label; + $this->packlets["type"] = (string)$sxe->type; + + $typename = $this->packlets["type"]; //type of the expected packet + if (substr($typename, -3, 3) != "_PI") { + throw new RODSException("RP_MsParam::fromSXE " . + "The XML node's type is unexpected: '$typename' " . + " expecting some thing like xxx_PI", + "SYS_PACK_INSTRUCT_FORMAT_ERR"); + } + $rp_classname = "RP_" . substr($typename, 0, strlen($typename) - 3); + $inOutStruct = new $rp_classname(); + $inOutStruct->fromSXE($sxe->$typename); + $this->packlets["$typename"] = $inOutStruct; + + $this->packlets['BinBytesBuf_PI'] = new RP_BinBytesBuf(); + $this->packlets['BinBytesBuf_PI']->fromSXE($sxe->BinBytesBuf_PI); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php new file mode 100644 index 0000000000..b747c098dd --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsParamArray.class.php @@ -0,0 +1,21 @@ +array_rp_type = array("MsParam_PI" => "RP_MsParam"); + + $packlets = array("paramLen" => count($MsParam_PI), + "oprType" => $oprType, "MsParam_PI" => $MsParam_PI); + parent::__construct("MsParamArray_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php new file mode 100644 index 0000000000..0249da9a05 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_MsgHeader.class.php @@ -0,0 +1,17 @@ + $type, "msgLen" => $msgLen, + "errorLen" => $errorLen, "bsLen" => $bsLen, "intInfo" => $intInfo); + parent::__construct("MsgHeader_PI", $packlets); + } + +} + +?> + \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php new file mode 100644 index 0000000000..28602f3150 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RHostAddr.class.php @@ -0,0 +1,15 @@ + $hostAddr, "rodsZone" => $rodsZone, + "port" => $port); + parent::__construct("RHostAddr_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php new file mode 100644 index 0000000000..290a4c9a5b --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_RodsObjStat.class.php @@ -0,0 +1,20 @@ + $objSize, 'objType' => $objType, + 'numCopies' => $numCopies, 'dataId' => $dataId, "chksum" => $chksum, + "ownerName" => $ownerName, "ownerZone" => $ownerZone, + 'createTime' => $createTime, 'modifyTime' => $modifyTime); + parent::__construct("RodsObjStat_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php new file mode 100644 index 0000000000..3f5a91a35d --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_STR.class.php @@ -0,0 +1,14 @@ + $myStr); + parent::__construct("STR_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php new file mode 100644 index 0000000000..1950f096f1 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_SqlResult.class.php @@ -0,0 +1,15 @@ + $attriInx, 'reslen' => $reslen, 'value' => $value); + parent::__construct("SqlResult_PI", $packlets); + } + + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php new file mode 100644 index 0000000000..a411bd7425 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_StartupPack.class.php @@ -0,0 +1,18 @@ + 1, "connectCnt" => 0, + "proxyUser" => $user, "proxyRcatZone" => $zone, "clientUser" => $user, + "clientRcatZone" => $zone, "relVersion" => $relVersion, + "apiVersion" => $apiVersion, "option" => $option); + parent::__construct("StartupPack_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php new file mode 100644 index 0000000000..bb591f0134 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_TransStat.class.php @@ -0,0 +1,16 @@ + $numThreads, + 'bytesWritten' => $bytesWritten); + parent::__construct("TransStat_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php new file mode 100644 index 0000000000..a08cb6cc24 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_Version.class.php @@ -0,0 +1,16 @@ + $status, "relVersion" => $relVersion, + "apiVersion" => $apiVersion); + parent::__construct("Version_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php new file mode 100644 index 0000000000..9dc8714063 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authRequestOut.class.php @@ -0,0 +1,14 @@ + $challenge); + parent::__construct("authRequestOut_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php new file mode 100644 index 0000000000..23d754df0a --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_authResponseInp.class.php @@ -0,0 +1,14 @@ + $response, "username" => $username); + parent::__construct("authResponseInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php new file mode 100644 index 0000000000..d16e1b3f3a --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjCloseInp.class.php @@ -0,0 +1,16 @@ + $l1descInx, + 'bytesWritten' => $bytesWritten); + parent::__construct("dataObjCloseInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php new file mode 100644 index 0000000000..29bd1b68e3 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjReadInp.class.php @@ -0,0 +1,16 @@ + $l1descInx, + 'len' => $len); + parent::__construct("dataObjReadInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php new file mode 100644 index 0000000000..5327d7a893 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_dataObjWriteInp.class.php @@ -0,0 +1,16 @@ + $dataObjInx, + 'len' => $len); + parent::__construct("dataObjWriteInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php new file mode 100644 index 0000000000..e28a7b3b49 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekInp.class.php @@ -0,0 +1,16 @@ + $fileInx, "offset" => $offset, + 'whence' => $whence); + parent::__construct("fileLseekInp_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php new file mode 100644 index 0000000000..cf01741bea --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_fileLseekOut.class.php @@ -0,0 +1,15 @@ + $offset); + parent::__construct("fileLseekOut_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php new file mode 100644 index 0000000000..ba073e9793 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_getTempPasswordOut.class.php @@ -0,0 +1,14 @@ + $stringToHashWith); + parent::__construct("getTempPasswordOut_PI", $packlets); + } + +} + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php new file mode 100644 index 0000000000..0bbc2334a8 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestInp.class.php @@ -0,0 +1,13 @@ + $pamUser, "pamPassword" => $pamPassword, "timeToLive" => $timeToLive); + parent::__construct("pamAuthRequestInp_PI",$packlets); + } + +} +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php new file mode 100644 index 0000000000..01959954c9 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_pamAuthRequestOut.class.php @@ -0,0 +1,13 @@ + $irodsPamPassword); + parent::__construct("pamAuthRequestOut_PI",$packlets); + } + +} +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php new file mode 100644 index 0000000000..530f304860 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslEndInp.class.php @@ -0,0 +1,13 @@ + $arg0); + parent::__construct("sslEndInp_PI",$packlets); + } + +} +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php new file mode 100644 index 0000000000..03c8365898 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_sslStartInp.class.php @@ -0,0 +1,13 @@ + $arg0); + parent::__construct("sslStartInp_PI",$packlets); + } + +} +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ticketAdminInp.class.php b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ticketAdminInp.class.php new file mode 100644 index 0000000000..ec849b68db --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/packet/RP_ticketAdminInp.class.php @@ -0,0 +1,30 @@ + to use it, create -> to... create!, + $arg2 = '', // the actual ticket + $arg3 = '', // "read" or "write" -> in case of "create" above + $arg4 = '', // full path to the resource, e.g.: /tempZone/home/rods/as + $arg5 = '', + $arg6 = '') + { + + $packlets = array( 'arg1' => $arg1, + 'arg2' => $arg2, + 'arg3' => $arg3, + 'arg4' => $arg4, + 'arg5' => $arg5, + 'arg6' => $arg6, + ); + parent::__construct('ticketAdminInp_PI', $packlets); + } + +} \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/prods.ini b/apps/files_external/3rdparty/irodsphp/prods/src/prods.ini new file mode 100644 index 0000000000..5c81a71de7 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/prods.ini @@ -0,0 +1,15 @@ +; Configuration file for the Prods API + +[ssl] +; Require verification of SSL certificate used. Default "false". +;verify_peer = "true" +; Allow self-signed certificates. Requires verify_peer. Default "false". +;allow_self_signed = "true" +; Location of Certificate Authority file on local filesystem which +; should be used with verify_peer equal "true" to authenticate +; the identity of the remote peer. +;cafile = "/path/to/cert.pem" +; If cafile is not specified or if the certificate is not found there, +; the directory pointed to by capath is searched for a suitable +; certificate. capath must be a correctly hashed certificate directory. +;capath = "/path/to/certfiles" diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/release_notes.txt b/apps/files_external/3rdparty/irodsphp/prods/src/release_notes.txt new file mode 100644 index 0000000000..7d892eedb6 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/release_notes.txt @@ -0,0 +1,31 @@ + +*'''Project''': iRODS PHP Library PRODS and PRODS Web Browser +*'''Date''': 11/26/2012 +*'''Release Version''': 3.2.0 Release +*'''git tag''': 3.2.0 + +==News== + +This is the consolidated and updated release of the PRODS PHP library for iRODS. This library provides a pure-PHP interface to the iRODS system. This library is suitable for simple and quick interfaces to the iRODS data grid, and will be maintained for stability and compatibility. If advanced or higher-performance interfaces are desired, the Jargon Java API should be considered. Note that PHP, Jython, JRuby, Groovy, and other JVM dynamic languages can be used with Jarogn. + +The PRODS PHP Web Browser is also included in this project, and remains supported. Note that the PHP Web Browser functionality has been subsumed by the idrop-web browser and idrop-swing client. + +Please go to [[https://code.renci.org/gf/project/irodsphp/] for the latest news and info. + +Note that the git repository is now the canonical version of the PHP code. The code in the iRODS SVN server is deprecated and will be taken down at the 3.0.0 release point. There may be other versions in Google Code and other places, but these should be considered obsolete. + + +==Requirements== + +==Libraries== + +==Features== + +*[#1076] irods 3.2 release activities +**Added a LICENSE.txt file at the top project level + + +==Bug Fixes== + +*[#1071] php uses self-closing tags for empty HTML tags +**Added patch suggested by community Changing line 41 in RODSPacket.class.php (in PRods) from return ($doc->saveXML($root)); to return ($doc->saveXML($root, LIBXML_NOEMPTYTAG)); \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php new file mode 100644 index 0000000000..382a85c051 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsAPINum.php @@ -0,0 +1,70 @@ + 1) { + if (empty($val1)) $val1 = trim($token); + else $val2 = trim($token); + } + } + if ((!empty($val1)) && (!empty($val2))) { + array_push($value_pairs, array($val1, $val2)); + } + } +} +var_dump($value_pairs); +foreach ($new_api_nums as $new_code_pair) { + if ((!is_array($new_code_pair)) || (count($new_code_pair) != 2)) + die("unexpected new_code_pair:$new_code_pair\n"); + array_push($value_pairs, $new_code_pair); +} + +$outputstr = " '$val2',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . '$GLOBALS[\'PRODS_API_NUMS_REV\']=array(' . "\n"; +foreach ($value_pairs as $value_pair) { + $val1 = $value_pair[0]; + $val2 = $value_pair[1]; + $outputstr = $outputstr . " '$val2' => '$val1',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . "?>\n"; +file_put_contents($prods_api_num_file, $outputstr); + +?> diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php new file mode 100644 index 0000000000..d5c4377384 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsErrorCodes.php @@ -0,0 +1,75 @@ + 3) { + if (empty($val1)) $val1 = trim($token); + else $val2 = trim($token); + } + } + if ((!empty($val1)) && (!empty($val2))) { + array_push($value_pairs, array($val1, $val2)); + } + } +} + +foreach ($new_error_codes as $new_code_pair) { + if ((!is_array($new_code_pair)) || (count($new_code_pair) != 2)) + die("unexpected new_code_pair:$new_code_pair\n"); + array_push($value_pairs, $new_code_pair); +} + +$outputstr = " '$val2',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . '$GLOBALS[\'PRODS_ERR_CODES_REV\']=array(' . "\n"; +foreach ($value_pairs as $value_pair) { + $val1 = $value_pair[0]; + $val2 = $value_pair[1]; + $outputstr = $outputstr . " '$val2' => '$val1',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . "?>\n"; +file_put_contents($prods_error_table_file, $outputstr); + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php new file mode 100644 index 0000000000..4372a849aa --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryKeyWd.php @@ -0,0 +1,73 @@ + 1) { + if (empty($val1)) $val1 = trim($token); + else { + + if (($token{0} == '"') /*&&($token{strlen($token)-1}=='"')*/) { + if (empty($val2)) + $val2 = trim($token); + } + } + } + } + if ((!empty($val1)) && (!empty($val2))) { + array_push($value_pairs, array($val1, $val2)); + } + } +} +foreach ($new_genque_keywds as $new_code_pair) { + if ((!is_array($new_code_pair)) || (count($new_code_pair) != 2)) + die("unexpected new_code_pair:$new_code_pair\n"); + array_push($value_pairs, $new_code_pair); +} + +$outputstr = " $val2,\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . '$GLOBALS[\'PRODS_GENQUE_KEYWD_REV\']=array(' . "\n"; +foreach ($value_pairs as $value_pair) { + $val1 = $value_pair[0]; + $val2 = $value_pair[1]; + $outputstr = $outputstr . " $val2 => '$val1',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . "?>\n"; +file_put_contents($prods_genque_keywd_file, $outputstr); + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php new file mode 100644 index 0000000000..03fa051f09 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/src/setRodsGenQueryNum.php @@ -0,0 +1,63 @@ + '$val2',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . '$GLOBALS[\'PRODS_GENQUE_NUMS_REV\']=array(' . "\n"; +foreach ($value_pairs as $value_pair) { + $val1 = $value_pair[0]; + $val2 = $value_pair[1]; + $outputstr = $outputstr . " '$val2' => '$val1',\n"; +} +$outputstr = $outputstr . ");\n"; + +$outputstr = $outputstr . "?>\n"; +file_put_contents($prods_genque_num_file, $outputstr); + +?> \ No newline at end of file diff --git a/apps/files_external/3rdparty/irodsphp/prods/utilities/exif2meta.php b/apps/files_external/3rdparty/irodsphp/prods/utilities/exif2meta.php new file mode 100644 index 0000000000..9ee9495f10 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/prods/utilities/exif2meta.php @@ -0,0 +1,145 @@ +getMeta(); + $metaalreadyset = false; + foreach ($metas as $meta) { + if ($meta->name == 'EXIF.ExifVersion') { + $metaalreadyset = true; + break; + } + } + + if ($metaalreadyset === true) { + $time = '[' . date('c') . ']'; + echo "$time 0: metadata already set for '$target_file'\n"; + exit(0); + } + + // download file from irods to tmp + $localfile = '/tmp/' . basename($target_file); + if (file_exists($localfile)) + unlink($localfile); + $irodsfile->open("r"); + $str = ''; + while ((($buffer = $irodsfile->read(1024 * 1024)) != NULL) && + (connection_status() == 0)) { + $str = $str . $buffer; + } + $irodsfile->close(); + file_put_contents($localfile, $str); + + extactExif($localfile, $irodsfile); + + if (file_exists($localfile)) + unlink($localfile); + + $time = '[' . date('c') . ']'; + echo "$time 0: '$target_file' processed!\n"; + exit(0); + +} catch (Exception $e) { + + if (file_exists($localfile)) + unlink($localfile); + + $time = '[' . date('c') . ']'; + echo "$time " . $e->getCode() . ": " . "$e"; + exit(-1); +} + + +function extactExif($localfile, $remoteRODSfile) +{ + $exif = exif_read_data($localfile, 'EXIF'); + if ($exif === false) return; + + foreach ($exif as $name => $val) { + + // replace ascii char that can't be displayed, which causes problem in irods + if ((!is_array($val)) && (is_string($val)) && + ((ord($val[0]) < 32) || (ord($val[0]) > 126)) && + ($name != 'UserComment') + ) { + $val = '__undefined__'; + } + + if ($name == 'THUMBNAIL') { + foreach ($val as $tname => $tval) + $remoteRODSfile->addMeta(new RODSMeta( + 'EXIF.THUMBNAIL.' . $tname, $tval, '')); + } else + if ($name == 'COMPUTED') { + foreach ($val as $cname => $cval) { + if ($cname == 'html') { + //skip html tag, because there is a irods server bug that corrupting string with + //double quotes: 'COMPUTED.html: width="3264" height="2448"' + } else + $remoteRODSfile->addMeta(new RODSMeta( + 'EXIF.COMPUTED.' . $cname, $cval, '')); + } + } else + if ($name == 'MakerNote') { + //skip makernote + } else + if ($name == 'ComponentsConfiguration') { + //skip ComponentsConfiguration, because there is a irods server bug that corrupting string with + + } else + if ($name == 'UserComment') { + if (($start = strpos($val, 'GCM_TAG')) !== false) { + $str = substr($val, $start + strlen('GCM_TAG')); + $gcm_tokens = explode(chr(0), $str); + $gcm_counter = 0; + foreach ($gcm_tokens as $gcm_tag) { + if ((strlen($gcm_tag) > 0) && (preg_match('/^[' . chr(32) . '-' . chr(126) . ']+$/', $gcm_tag))) { + $remoteRODSfile->addMeta(new RODSMeta( + 'EXIF.UserComment' . $gcm_counter++, $gcm_tag, '')); + } + } + } else { + if (strlen($val) < 1) + $str = ' '; + //replace no displable char + $str = preg_replace('/[^' . chr(32) . '-' . chr(126) . ']+/', ' ', $val); + $remoteRODSfile->addMeta(new RODSMeta( + 'EXIF.UserComment', $str, '')); + } + } else + if (is_array($val)) { + foreach ($val as $cname => $cval) { + $remoteRODSfile->addMeta(new RODSMeta( + "EXIF.$name." . $cname, $cval, '')); + } + } else + $remoteRODSfile->addMeta(new RODSMeta( + 'EXIF.' . $name, $val, '')); + } +} + +?> diff --git a/apps/files_external/3rdparty/irodsphp/release_notes.txt b/apps/files_external/3rdparty/irodsphp/release_notes.txt new file mode 100644 index 0000000000..9d109faf84 --- /dev/null +++ b/apps/files_external/3rdparty/irodsphp/release_notes.txt @@ -0,0 +1,14 @@ +*'''Project''': iRODS PHP Library PRODS and PRODS Web Browser +*'''Date''': 06/04/2013 +*'''Release Version''': 3.3.0-beta1 +*'''git tag''': 3.3.0-beta1 + +==News== + +The PRODS PHP Web Browser is also included in this project, and remains supported. Note that the PHP Web Browser functionality has been subsumed by the idrop-web browser and idrop-swing client. + +Please go to [[https://code.renci.org/gf/project/irodsphp/] for the latest news and info. + +Note that the git repository is now the canonical version of the PHP code. The code in the iRODS SVN server is deprecated and will be taken down at the 3.0.0 release point. There may be other versions in Google Code and other places, but these should be considered obsolete. + +Please review release notes in sub projects for details diff --git a/apps/files_external/ajax/google.php b/apps/files_external/ajax/google.php index 70adcb2c2a..e63b7cb07b 100644 --- a/apps/files_external/ajax/google.php +++ b/apps/files_external/ajax/google.php @@ -1,64 +1,42 @@ $scope, 'oauth_callback' => $callback); - $request = OAuthRequest::from_consumer_and_token($consumer, null, 'GET', $url, $params); - $request->sign_request($sigMethod, $consumer, null); - $response = send_signed_request('GET', $url, array($request->to_header()), null, false); - $token = array(); - parse_str($response, $token); - if (isset($token['oauth_token']) && isset($token['oauth_token_secret'])) { - $authUrl = 'https://www.google.com/accounts/OAuthAuthorizeToken?oauth_token='.$token['oauth_token']; - OCP\JSON::success(array('data' => array('url' => $authUrl, - 'request_token' => $token['oauth_token'], - 'request_token_secret' => $token['oauth_token_secret']))); - } else { +if (isset($_POST['client_id']) && isset($_POST['client_secret']) && isset($_POST['redirect'])) { + $client = new Google_Client(); + $client->setClientId($_POST['client_id']); + $client->setClientSecret($_POST['client_secret']); + $client->setRedirectUri($_POST['redirect']); + $client->setScopes(array('https://www.googleapis.com/auth/drive')); + if (isset($_POST['step'])) { + $step = $_POST['step']; + if ($step == 1) { + try { + $authUrl = $client->createAuthUrl(); + OCP\JSON::success(array('data' => array( + 'url' => $authUrl + ))); + } catch (Exception $exception) { OCP\JSON::error(array('data' => array( - 'message' => 'Fetching request tokens failed. Error: '.$response - ))); + 'message' => 'Step 1 failed. Exception: '.$exception->getMessage() + ))); } - break; - case 2: - if (isset($_POST['oauth_verifier']) - && isset($_POST['request_token']) - && isset($_POST['request_token_secret']) - ) { - $token = new OAuthToken($_POST['request_token'], $_POST['request_token_secret']); - $url = 'https://www.google.com/accounts/OAuthGetAccessToken'; - $request = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', $url, - array('oauth_verifier' => $_POST['oauth_verifier'])); - $request->sign_request($sigMethod, $consumer, $token); - $response = send_signed_request('GET', $url, array($request->to_header()), null, false); - $token = array(); - parse_str($response, $token); - if (isset($token['oauth_token']) && isset($token['oauth_token_secret'])) { - OCP\JSON::success(array('access_token' => $token['oauth_token'], - 'access_token_secret' => $token['oauth_token_secret'])); - } else { - OCP\JSON::error(array('data' => array( - 'message' => 'Fetching access tokens failed. Error: '.$response - ))); - } + } else if ($step == 2 && isset($_POST['code'])) { + try { + $token = $client->authenticate($_POST['code']); + OCP\JSON::success(array('data' => array( + 'token' => $token + ))); + } catch (Exception $exception) { + OCP\JSON::error(array('data' => array( + 'message' => 'Step 2 failed. Exception: '.$exception->getMessage() + ))); } - break; + } } -} +} \ No newline at end of file diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index d786c6c7a2..dd0b76ed9d 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -15,9 +15,14 @@ OC::$CLASSPATH['OC\Files\Storage\SMB'] = 'files_external/lib/smb.php'; OC::$CLASSPATH['OC\Files\Storage\AmazonS3'] = 'files_external/lib/amazons3.php'; OC::$CLASSPATH['OC\Files\Storage\Dropbox'] = 'files_external/lib/dropbox.php'; OC::$CLASSPATH['OC\Files\Storage\SFTP'] = 'files_external/lib/sftp.php'; +OC::$CLASSPATH['OC\Files\Storage\iRODS'] = 'files_external/lib/irods.php'; OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; OCP\App::registerAdmin('files_external', 'settings'); if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == 'yes') { OCP\App::registerPersonal('files_external', 'personal'); } + +// connecting hooks +OCP\Util::connectHook( 'OC_User', 'post_login', 'OC\Files\Storage\iRODS', 'login' ); + diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index 94b453793b..f2f40247b2 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -1,10 +1,24 @@ -td.status>span { display:inline-block; height:16px; width:16px; } -span.success { background-image: url('../img/success.png'); background-repeat:no-repeat; } -span.error { background-image: url('../img/error.png'); background-repeat:no-repeat; } -span.waiting { background-image: url('../img/waiting.png'); background-repeat:no-repeat; } +td.status > span { + display: inline-block; + height: 16px; + width: 16px; + vertical-align: text-bottom; +} + +span.success { + background: #37ce02; + border-radius: 8px; +} +span.error { + background: #ce3702; +} +span.waiting { + background: none; +} + td.mountPoint, td.backend { width:10em; } td.remove>img { visibility:hidden; padding-top:0.8em; } tr:hover>td.remove>img { visibility:visible; cursor:pointer; } #addMountPoint>td { border:none; } #addMountPoint>td.applicable { visibility:hidden; } -#selectBackend { margin-left:-10px; } \ No newline at end of file +#selectBackend { margin-left:-10px; } diff --git a/apps/files_external/img/error.png b/apps/files_external/img/error.png deleted file mode 100644 index e8cf45e7a4..0000000000 Binary files a/apps/files_external/img/error.png and /dev/null differ diff --git a/apps/files_external/img/success.png b/apps/files_external/img/success.png deleted file mode 100644 index 6f7022ee7f..0000000000 Binary files a/apps/files_external/img/success.png and /dev/null differ diff --git a/apps/files_external/img/waiting.png b/apps/files_external/img/waiting.png deleted file mode 100644 index 02a8cbff0d..0000000000 Binary files a/apps/files_external/img/waiting.png and /dev/null differ diff --git a/apps/files_external/js/google.js b/apps/files_external/js/google.js index 7be1b338e9..7e111a95d9 100644 --- a/apps/files_external/js/google.js +++ b/apps/files_external/js/google.js @@ -1,69 +1,89 @@ $(document).ready(function() { - $('#externalStorage tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google').each(function(index, tr) { - setupGoogleRow(tr); - }); - - $('#externalStorage').on('change', '#selectBackend', function() { - if ($(this).val() == '\\OC\\Files\\Storage\\Google') { - setupGoogleRow($('#externalStorage tbody>tr:last').prev('tr')); - } - }); - - function setupGoogleRow(tr) { - var configured = $(tr).find('[data-parameter="configured"]'); + $('#externalStorage tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google').each(function() { + var configured = $(this).find('[data-parameter="configured"]'); if ($(configured).val() == 'true') { - $(tr).find('.configuration').append(''+t('files_external', 'Access granted')+''); + $(this).find('.configuration input').attr('disabled', 'disabled'); + $(this).find('.configuration').append($('').attr('id', 'access') + .text(t('files_external', 'Access granted'))); } else { - var token = $(tr).find('[data-parameter="token"]'); - var token_secret = $(tr).find('[data-parameter="token_secret"]'); - var params = {}; - window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { - params[key] = value; - }); - if (params['oauth_token'] !== undefined && params['oauth_verifier'] !== undefined && decodeURIComponent(params['oauth_token']) == $(token).val()) { - var statusSpan = $(tr).find('.status span'); - statusSpan.removeClass(); - statusSpan.addClass('waiting'); - $.post(OC.filePath('files_external', 'ajax', 'google.php'), { step: 2, oauth_verifier: params['oauth_verifier'], request_token: $(token).val(), request_token_secret: $(token_secret).val() }, function(result) { - if (result && result.status == 'success') { - $(token).val(result.access_token); - $(token_secret).val(result.access_token_secret); - $(configured).val('true'); - OC.MountConfig.saveStorage(tr); - $(tr).find('.configuration').append(''+t('files_external', 'Access granted')+''); - } else { - OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Google Drive storage')); - onGoogleInputsChange(tr); - } + var client_id = $(this).find('.configuration [data-parameter="client_id"]').val(); + var client_secret = $(this).find('.configuration [data-parameter="client_secret"]') + .val(); + if (client_id != '' && client_secret != '') { + var params = {}; + window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { + params[key] = value; }); + if (params['code'] !== undefined) { + var tr = $(this); + var token = $(this).find('.configuration [data-parameter="token"]'); + var statusSpan = $(tr).find('.status span'); + statusSpan.removeClass(); + statusSpan.addClass('waiting'); + $.post(OC.filePath('files_external', 'ajax', 'google.php'), + { + step: 2, + client_id: client_id, + client_secret: client_secret, + redirect: location.protocol + '//' + location.host + location.pathname, + code: params['code'], + }, function(result) { + if (result && result.status == 'success') { + $(token).val(result.data.token); + $(configured).val('true'); + OC.MountConfig.saveStorage(tr); + $(tr).find('.configuration input').attr('disabled', 'disabled'); + $(tr).find('.configuration').append($('') + .attr('id', 'access') + .text(t('files_external', 'Access granted'))); + } else { + OC.dialogs.alert(result.data.message, + t('files_external', 'Error configuring Google Drive storage') + ); + } + } + ); + } } else { - onGoogleInputsChange(tr); + onGoogleInputsChange($(this)); } } - } - - $('#externalStorage').on('paste', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google td', function() { - var tr = $(this).parent(); - setTimeout(function() { - onGoogleInputsChange(tr); - }, 20); }); - $('#externalStorage').on('keyup', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google td', function() { - onGoogleInputsChange($(this).parent()); - }); + $('#externalStorage').on('paste', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google td', + function() { + var tr = $(this).parent(); + setTimeout(function() { + onGoogleInputsChange(tr); + }, 20); + } + ); - $('#externalStorage').on('change', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google .chzn-select', function() { - onGoogleInputsChange($(this).parent().parent()); - }); + $('#externalStorage').on('keyup', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google td', + function() { + onGoogleInputsChange($(this).parent()); + } + ); + + $('#externalStorage').on('change', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google .chzn-select' + , function() { + onGoogleInputsChange($(this).parent().parent()); + } + ); function onGoogleInputsChange(tr) { if ($(tr).find('[data-parameter="configured"]').val() != 'true') { var config = $(tr).find('.configuration'); - if ($(tr).find('.mountPoint input').val() != '' && ($(tr).find('.chzn-select').length == 0 || $(tr).find('.chzn-select').val() != null)) { + if ($(tr).find('.mountPoint input').val() != '' + && $(config).find('[data-parameter="client_id"]').val() != '' + && $(config).find('[data-parameter="client_secret"]').val() != '' + && ($(tr).find('.chzn-select').length == 0 + || $(tr).find('.chzn-select').val() != null)) + { if ($(tr).find('.google').length == 0) { - $(config).append(''+t('files_external', 'Grant access')+''); + $(config).append($('').addClass('button google') + .text(t('files_external', 'Grant access'))); } else { $(tr).find('.google').show(); } @@ -77,22 +97,33 @@ $(document).ready(function() { event.preventDefault(); var tr = $(this).parent().parent(); var configured = $(this).parent().find('[data-parameter="configured"]'); - var token = $(this).parent().find('[data-parameter="token"]'); - var token_secret = $(this).parent().find('[data-parameter="token_secret"]'); + var client_id = $(this).parent().find('[data-parameter="client_id"]').val(); + var client_secret = $(this).parent().find('[data-parameter="client_secret"]').val(); var statusSpan = $(tr).find('.status span'); - $.post(OC.filePath('files_external', 'ajax', 'google.php'), { step: 1, callback: location.protocol + '//' + location.host + location.pathname }, function(result) { - if (result && result.status == 'success') { - $(configured).val('false'); - $(token).val(result.data.request_token); - $(token_secret).val(result.data.request_token_secret); - OC.MountConfig.saveStorage(tr); - statusSpan.removeClass(); - statusSpan.addClass('waiting'); - window.location = result.data.url; - } else { - OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Google Drive storage')); - } - }); + if (client_id != '' && client_secret != '') { + var token = $(this).parent().find('[data-parameter="token"]'); + $.post(OC.filePath('files_external', 'ajax', 'google.php'), + { + step: 1, + client_id: client_id, + client_secret: client_secret, + redirect: location.protocol + '//' + location.host + location.pathname, + }, function(result) { + if (result && result.status == 'success') { + $(configured).val('false'); + $(token).val('false'); + OC.MountConfig.saveStorage(tr); + statusSpan.removeClass(); + statusSpan.addClass('waiting'); + window.location = result.data.url; + } else { + OC.dialogs.alert(result.data.message, + t('files_external', 'Error configuring Google Drive storage') + ); + } + } + ); + } }); -}); +}); \ No newline at end of file diff --git a/apps/files_external/l10n/es_AR.php b/apps/files_external/l10n/es_AR.php index a844615272..c1b3ac6388 100644 --- a/apps/files_external/l10n/es_AR.php +++ b/apps/files_external/l10n/es_AR.php @@ -4,9 +4,9 @@ "Grant access" => "Permitir acceso", "Please provide a valid Dropbox app key and secret." => "Por favor, proporcioná un secreto y una contraseña válida para la aplicación Dropbox.", "Error configuring Google Drive storage" => "Error al configurar el almacenamiento de Google Drive", -"Warning: \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "Advertencia: El cliente smb (smbclient) no se encuentra instalado. El montado de archivos o ficheros CIFS/SMB no es posible. Por favor pida al administrador de su sistema que lo instale.", -"Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "Advertencia: El soporte de FTP en PHP no se encuentra instalado. El montado de archivos o ficheros FTP no es posible. Por favor pida al administrador de su sistema que lo instale.", -"Warning: The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "Advertencia: El soporte de Curl de PHP no está activado ni instalado. Montar servicios ownCloud, WebDAV y/o GoogleDrive no será posible. Pedile al administrador del sistema que lo instale.", +"Warning: \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "Advertencia: El cliente smb \"smbclient\" no está instalado. Montar archivos CIFS/SMB no es posible. Por favor, pedile al administrador de tu sistema que lo instale.", +"Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "Advertencia: El soporte de FTP en PHP no está instalado. Montar archivos FTP no es posible. Por favor, pedile al administrador de tu sistema que lo instale.", +"Warning: The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "Advertencia: El soporte de Curl de PHP no está activo ni instalado. Montar servicios ownCloud, WebDAV y/o GoogleDrive no será posible. Pedile al administrador del sistema que lo instale.", "External Storage" => "Almacenamiento externo", "Folder name" => "Nombre de la carpeta", "External storage" => "Almacenamiento externo", diff --git a/apps/files_external/l10n/fa.php b/apps/files_external/l10n/fa.php index 1921ba9f2a..036a34c099 100644 --- a/apps/files_external/l10n/fa.php +++ b/apps/files_external/l10n/fa.php @@ -1,13 +1,26 @@ "مجوز دسترسی صادر شد", +"Error configuring Dropbox storage" => "خطا به هنگام تنظیم فضای دراپ باکس", +"Grant access" => " مجوز اعطا دسترسی", +"Please provide a valid Dropbox app key and secret." => "لطفا یک کلید و کد امنیتی صحیح دراپ باکس وارد کنید.", +"Error configuring Google Drive storage" => "خطا به هنگام تنظیم فضای Google Drive", +"Warning: \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "خطا: \"smbclient\" نصب نشده است. نصب و راه اندازی سهام CIFS/SMB امکان پذیر نمیباشد. لطفا از مدیریت سازمان خود برای راه اندازی آن درخواست نمایید.", +"Warning: The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "خطا: پشتیبانی FTP در PHP فعال نمی باشد یا نصب نشده است. نصب و راه اندازی از سهم های FTP امکان پذیر نمی باشد. لطفا از مدیر سیستم خود برای راه اندازی آن درخواست\nکنید.", +"Warning: The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "خطا: پشتیبانی Curl فعال نمی باشد یا نصب نشده است. نصب و راه اندازی ownCloud / WebDAV یا GoogleDrive امکان پذیر نیست. لطفا از مدیر سیستم خود برای نصب آن درخواست کنید.", "External Storage" => "حافظه خارجی", +"Folder name" => "نام پوشه", +"External storage" => "حافظه خارجی", "Configuration" => "پیکربندی", "Options" => "تنظیمات", "Applicable" => "قابل اجرا", +"Add storage" => "اضافه کردن حافظه", "None set" => "تنظیم نشده", "All Users" => "تمام کاربران", "Groups" => "گروه ها", "Users" => "کاربران", "Delete" => "حذف", "Enable User External Storage" => "فعال سازی حافظه خارجی کاربر", -"Allow users to mount their own external storage" => "اجازه به کاربران برای متصل کردن منابع ذخیره ی خارجی خودشان" +"Allow users to mount their own external storage" => "اجازه به کاربران برای متصل کردن منابع ذخیره ی خارجی خودشان", +"SSL root certificates" => "گواهی های اصلی SSL ", +"Import Root Certificate" => "وارد کردن گواهی اصلی" ); diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 7bcefd4176..f2dd6108b1 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -4,7 +4,9 @@ * ownCloud * * @author Michael Gapczynski + * @author Christian Berendt * @copyright 2012 Michael Gapczynski mtgap@owncloud.com + * @copyright 2013 Christian Berendt berendt@b1-systems.de * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -22,164 +24,301 @@ namespace OC\Files\Storage; -require_once 'aws-sdk/sdk.class.php'; +set_include_path(get_include_path() . PATH_SEPARATOR . + \OC_App::getAppPath('files_external') . '/3rdparty/aws-sdk-php'); +require 'aws-autoloader.php'; + +use Aws\S3\S3Client; +use Aws\S3\Exception\S3Exception; class AmazonS3 extends \OC\Files\Storage\Common { - private $s3; + private $connection; private $bucket; - private $objects = array(); - private $id; + private static $tmpFiles = array(); + private $test = false; + private $timeout = 15; - private static $tempFiles = array(); + private function normalizePath($path) { + $path = trim($path, '/'); - // TODO Update to new AWS SDK + if (!$path) { + $path = '.'; + } + + return $path; + } + + private function testTimeout() { + if ($this->test) { + sleep($this->timeout); + } + } public function __construct($params) { - if (isset($params['key']) && isset($params['secret']) && isset($params['bucket'])) { - $this->id = 'amazon::' . $params['key'] . md5($params['secret']); - $this->s3 = new \AmazonS3(array('key' => $params['key'], 'secret' => $params['secret'])); - $this->bucket = $params['bucket']; - } else { - throw new \Exception(); + if (!isset($params['key']) || !isset($params['secret']) || !isset($params['bucket'])) { + throw new \Exception("Access Key, Secret and Bucket have to be configured."); } - } - private function getObject($path) { - if (array_key_exists($path, $this->objects)) { - return $this->objects[$path]; - } else { - $response = $this->s3->get_object_metadata($this->bucket, $path); - if ($response) { - $this->objects[$path] = $response; - return $response; - // This object could be a folder, a '/' must be at the end of the path - } else if (substr($path, -1) != '/') { - $response = $this->s3->get_object_metadata($this->bucket, $path . '/'); - if ($response) { - $this->objects[$path] = $response; - return $response; - } + $this->id = 'amazon::' . $params['key'] . md5($params['secret']); + + $this->bucket = $params['bucket']; + $scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https'; + $this->test = ( isset($params['test'])) ? true : false; + $this->timeout = ( ! isset($params['timeout'])) ? 15 : $params['timeout']; + $params['region'] = ( ! isset($params['region'])) ? 'eu-west-1' : $params['region']; + $params['hostname'] = ( !isset($params['hostname'])) ? 's3.amazonaws.com' : $params['hostname']; + if (!isset($params['port'])) { + $params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443; + } + $base_url = $scheme.'://'.$params['hostname'].':'.$params['port'].'/'; + + $this->connection = S3Client::factory(array( + 'key' => $params['key'], + 'secret' => $params['secret'], + 'base_url' => $base_url, + 'region' => $params['region'] + )); + + if (!$this->connection->isValidBucketName($this->bucket)) { + throw new \Exception("The configured bucket name is invalid."); + } + + if (!$this->connection->doesBucketExist($this->bucket)) { + try { + $result = $this->connection->createBucket(array( + 'Bucket' => $this->bucket + )); + $this->connection->waitUntilBucketExists(array( + 'Bucket' => $this->bucket, + 'waiter.interval' => 1, + 'waiter.max_attempts' => 15 + )); + $this->testTimeout(); + } catch (S3Exception $e) { + throw new \Exception("Creation of bucket failed."); } } - return false; - } - public function getId() { - return $this->id; + if (!$this->file_exists('.')) { + $result = $this->connection->putObject(array( + 'Bucket' => $this->bucket, + 'Key' => '.', + 'Body' => '', + 'ContentType' => 'httpd/unix-directory', + 'ContentLength' => 0 + )); + $this->testTimeout(); + } } public function mkdir($path) { - // Folders in Amazon S3 are 0 byte objects with a '/' at the end of the name - if (substr($path, -1) != '/') { - $path .= '/'; - } - $response = $this->s3->create_object($this->bucket, $path, array('body' => '')); - return $response->isOK(); - } + $path = $this->normalizePath($path); - public function rmdir($path) { - if (substr($path, -1) != '/') { - $path .= '/'; + if ($this->is_dir($path)) { + return false; } - return $this->unlink($path); - } - public function opendir($path) { - if ($path == '' || $path == '/') { - // Use the '/' delimiter to only fetch objects inside the folder - $opt = array('delimiter' => '/'); - } else { - if (substr($path, -1) != '/') { - $path .= '/'; - } - $opt = array('delimiter' => '/', 'prefix' => $path); + try { + $result = $this->connection->putObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path . '/', + 'Body' => '', + 'ContentType' => 'httpd/unix-directory', + 'ContentLength' => 0 + )); + $this->testTimeout(); + } catch (S3Exception $e) { + return false; } - $response = $this->s3->list_objects($this->bucket, $opt); - if ($response->isOK()) { - $files = array(); - foreach ($response->body->Contents as $object) { - // The folder being opened also shows up in the list of objects, don't add it to the files - if ($object->Key != $path) { - $files[] = basename($object->Key); - } - } - // Sub folders show up as CommonPrefixes - foreach ($response->body->CommonPrefixes as $object) { - $files[] = basename($object->Prefix); - } - \OC\Files\Stream\Dir::register('amazons3' . $path, $files); - return opendir('fakedir://amazons3' . $path); - } - return false; - } - public function stat($path) { - if ($path == '' || $path == '/') { - $stat['size'] = $this->s3->get_bucket_filesize($this->bucket); - $stat['atime'] = time(); - $stat['mtime'] = $stat['atime']; - } else if ($object = $this->getObject($path)) { - $stat['size'] = $object['Size']; - $stat['atime'] = time(); - $stat['mtime'] = strtotime($object['LastModified']); - } - if (isset($stat)) { - return $stat; - } - return false; - } - - public function filetype($path) { - if ($path == '' || $path == '/') { - return 'dir'; - } else { - $object = $this->getObject($path); - if ($object) { - // Amazon S3 doesn't have typical folders, this is an alternative method to detect a folder - if (substr($object['Key'], -1) == '/' && $object['Size'] == 0) { - return 'dir'; - } else { - return 'file'; - } - } - } - return false; - } - - public function isReadable($path) { - // TODO Check acl and determine who grantee is - return true; - } - - public function isUpdatable($path) { - // TODO Check acl and determine who grantee is return true; } public function file_exists($path) { - if ($this->filetype($path) == 'dir' && substr($path, -1) != '/') { + $path = $this->normalizePath($path); + + if (!$path) { + $path = '.'; + } else if ($path != '.' && $this->is_dir($path)) { $path .= '/'; } - return $this->s3->if_object_exists($this->bucket, $path); + + try { + $result = $this->connection->doesObjectExist( + $this->bucket, + $path + ); + } catch (S3Exception $e) { + return false; + } + + return $result; + } + + + public function rmdir($path) { + $path = $this->normalizePath($path); + + if (!$this->file_exists($path)) { + return false; + } + + $dh = $this->opendir($path); + while ($file = readdir($dh)) { + if ($file === '.' || $file === '..') { + continue; + } + + if ($this->is_dir($path . '/' . $file)) { + $this->rmdir($path . '/' . $file); + } else { + $this->unlink($path . '/' . $file); + } + } + + try { + $result = $this->connection->deleteObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path . '/' + )); + $this->testTimeout(); + } catch (S3Exception $e) { + return false; + } + + return true; + } + + public function opendir($path) { + $path = $this->normalizePath($path); + + if ($path === '.') { + $path = ''; + } else if ($path) { + $path .= '/'; + } + + try { + $files = array(); + $result = $this->connection->getIterator('ListObjects', array( + 'Bucket' => $this->bucket, + 'Delimiter' => '/', + 'Prefix' => $path + ), array('return_prefixes' => true)); + + foreach ($result as $object) { + $file = basename( + isset($object['Key']) ? $object['Key'] : $object['Prefix'] + ); + + if ($file != basename($path)) { + $files[] = $file; + } + } + + \OC\Files\Stream\Dir::register('amazons3' . $path, $files); + + return opendir('fakedir://amazons3' . $path); + } catch (S3Exception $e) { + return false; + } + } + + public function stat($path) { + $path = $this->normalizePath($path); + + try { + if ($this->is_dir($path) && $path != '.') { + $path .= '/'; + } + + $result = $this->connection->headObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path + )); + + $stat = array(); + $stat['size'] = $result['ContentLength'] ? $result['ContentLength'] : 0; + if ($result['Metadata']['lastmodified']) { + $stat['mtime'] = strtotime($result['Metadata']['lastmodified']); + } else { + $stat['mtime'] = strtotime($result['LastModified']); + } + $stat['atime'] = time(); + + return $stat; + } catch(S3Exception $e) { + return false; + } + } + + public function filetype($path) { + $path = $this->normalizePath($path); + + try { + if ($path != '.' && $this->connection->doesObjectExist($this->bucket, $path)) { + return 'file'; + } + + if ($path != '.') { + $path .= '/'; + } + + if ($this->connection->doesObjectExist($this->bucket, $path)) { + return 'dir'; + } + } catch (S3Exception $e) { + return false; + } + + return false; + } + + public function isReadable($path) { + return true; + } + + public function isUpdatable($path) { + return true; } public function unlink($path) { - $response = $this->s3->delete_object($this->bucket, $path); - return $response->isOK(); + $path = $this->normalizePath($path); + + try { + $result = $this->connection->deleteObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path + )); + $this->testTimeout(); + } catch (S3Exception $e) { + return false; + } + + return true; } public function fopen($path, $mode) { + $path = $this->normalizePath($path); + switch ($mode) { case 'r': case 'rb': $tmpFile = \OC_Helper::tmpFile(); - $handle = fopen($tmpFile, 'w'); - $response = $this->s3->get_object($this->bucket, $path, array('fileDownload' => $handle)); - if ($response->isOK()) { - return fopen($tmpFile, 'r'); + self::$tmpFiles[$tmpFile] = $path; + + try { + $result = $this->connection->getObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path, + 'SaveAs' => $tmpFile + )); + } catch (S3Exception $e) { + return false; } - break; + + return fopen($tmpFile, 'r'); case 'w': case 'wb': case 'a': @@ -203,45 +342,143 @@ class AmazonS3 extends \OC\Files\Storage\Common { $source = $this->fopen($path, 'r'); file_put_contents($tmpFile, $source); } - self::$tempFiles[$tmpFile] = $path; + self::$tmpFiles[$tmpFile] = $path; + return fopen('close://' . $tmpFile, $mode); } return false; } - public function writeBack($tmpFile) { - if (isset(self::$tempFiles[$tmpFile])) { - $handle = fopen($tmpFile, 'r'); - $response = $this->s3->create_object($this->bucket, - self::$tempFiles[$tmpFile], - array('fileUpload' => $handle)); - if ($response->isOK()) { - unlink($tmpFile); - } - } - } - public function getMimeType($path) { - if ($this->filetype($path) == 'dir') { + $path = $this->normalizePath($path); + + if ($this->is_dir($path)) { return 'httpd/unix-directory'; - } else { - $object = $this->getObject($path); - if ($object) { - return $object['ContentType']; + } else if ($this->file_exists($path)) { + try { + $result = $this->connection->headObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path + )); + } catch (S3Exception $e) { + return false; } + + return $result['ContentType']; } return false; } public function touch($path, $mtime = null) { - if (is_null($mtime)) { - $mtime = time(); + $path = $this->normalizePath($path); + + $metadata = array(); + if (!is_null($mtime)) { + $metadata = array('lastmodified' => $mtime); } - if ($this->filetype($path) == 'dir' && substr($path, -1) != '/') { - $path .= '/'; + + try { + if ($this->file_exists($path)) { + if ($this->is_dir($path) && $path != '.') { + $path .= '/'; + } + $result = $this->connection->copyObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path, + 'Metadata' => $metadata, + 'CopySource' => $this->bucket . '/' . $path + )); + $this->testTimeout(); + } else { + $result = $this->connection->putObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path, + 'Metadata' => $metadata + )); + $this->testTimeout(); + } + } catch (S3Exception $e) { + return false; } - $response = $this->s3->update_object($this->bucket, $path, array('meta' => array('LastModified' => $mtime))); - return $response->isOK(); + + return true; + } + + public function copy($path1, $path2) { + $path1 = $this->normalizePath($path1); + $path2 = $this->normalizePath($path2); + + if ($this->is_file($path1)) { + try { + $result = $this->connection->copyObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path2, + 'CopySource' => $this->bucket . '/' . $path1 + )); + $this->testTimeout(); + } catch (S3Exception $e) { + return false; + } + } else { + if ($this->file_exists($path2)) { + return false; + } + + try { + $result = $this->connection->copyObject(array( + 'Bucket' => $this->bucket, + 'Key' => $path2 . '/', + 'CopySource' => $this->bucket . '/' . $path1 . '/' + )); + $this->testTimeout(); + } catch (S3Exception $e) { + return false; + } + + $dh = $this->opendir($path1); + while ($file = readdir($dh)) { + if ($file === '.' || $file === '..') { + continue; + } + + $source = $path1 . '/' . $file; + $target = $path2 . '/' . $file; + $this->copy($source, $target); + } + } + + return true; + } + + public function rename($path1, $path2) { + $path1 = $this->normalizePath($path1); + $path2 = $this->normalizePath($path2); + + if ($this->is_file($path1)) { + if ($this->copy($path1, $path2) === false) { + return false; + } + + if ($this->unlink($path1) === false) { + $this->unlink($path2); + return false; + } + } else { + if ($this->file_exists($path2)) { + return false; + } + + if ($this->copy($path1, $path2) === false) { + return false; + } + + if ($this->rmdir($path1) === false) { + $this->rmdir($path2); + return false; + } + } + + return true; } public function test() { @@ -252,4 +489,32 @@ class AmazonS3 extends \OC\Files\Storage\Common { return false; } + public function getId() { + return $this->id; + } + + public function getConnection() { + return $this->connection; + } + + public function writeBack($tmpFile) { + if (!isset(self::$tmpFiles[$tmpFile])) { + return false; + } + + try { + $result= $this->connection->putObject(array( + 'Bucket' => $this->bucket, + 'Key' => self::$tmpFiles[$tmpFile], + 'SourceFile' => $tmpFile, + 'ContentType' => \OC_Helper::getMimeType($tmpFile), + 'ContentLength' => filesize($tmpFile) + )); + $this->testTimeout(); + + unlink($tmpFile); + } catch (S3Exception $e) { + return false; + } + } } diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 4cb9b7c8ec..e3a2cf0b30 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -34,7 +34,7 @@ class OC_Mount_Config { * If the configuration parameter should be secret, add a '*' to the beginning of the value * If the configuration parameter is a boolean, add a '!' to the beginning of the value * If the configuration parameter is optional, add a '&' to the beginning of the value - * If the configuration parameter is hidden, add a '#' to the begining of the value + * If the configuration parameter is hidden, add a '#' to the beginning of the value * @return array */ public static function getBackends() { @@ -47,9 +47,14 @@ class OC_Mount_Config { $backends['\OC\Files\Storage\AmazonS3']=array( 'backend' => 'Amazon S3', 'configuration' => array( - 'key' => 'Key', - 'secret' => '*Secret', - 'bucket' => 'Bucket')); + 'key' => 'Access Key', + 'secret' => '*Secret Key', + 'bucket' => 'Bucket', + 'hostname' => 'Hostname (optional)', + 'port' => 'Port (optional)', + 'region' => 'Region (optional)', + 'use_ssl' => '!Enable SSL', + 'use_path_style' => '!Enable Path Style')); $backends['\OC\Files\Storage\Dropbox']=array( 'backend' => 'Dropbox', @@ -74,8 +79,9 @@ class OC_Mount_Config { 'backend' => 'Google Drive', 'configuration' => array( 'configured' => '#configured', - 'token' => '#token', - 'token_secret' => '#token secret'), + 'client_id' => 'Client ID', + 'client_secret' => 'Client secret', + 'token' => '#token'), 'custom' => 'google'); $backends['\OC\Files\Storage\SWIFT']=array( @@ -113,6 +119,17 @@ class OC_Mount_Config { 'password' => '*Password', 'root' => '&Root')); + $backends['\OC\Files\Storage\iRODS']=array( + 'backend' => 'iRODS', + 'configuration' => array( + 'host' => 'Host', + 'port' => 'Port', + 'use_logon_credentials' => '!Use ownCloud login', + 'user' => 'Username', + 'password' => '*Password', + 'auth_mode' => 'Authentication Mode', + 'zone' => 'Zone')); + return($backends); } diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index ec7de3f357..ef8dd6d8ca 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -1,437 +1,409 @@ . -*/ + * ownCloud + * + * @author Michael Gapczynski + * @copyright 2012 Michael Gapczynski mtgap@owncloud.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU Affero General Public + * License along with this library. If not, see |
---|