diff options
author | tobiasKaminsky <tobias@kaminsky.me> | 2014-08-09 10:39:12 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-09-16 15:00:58 +0200 |
commit | e62d5b7e55ea5eab098751146f6c49641574c7c9 (patch) | |
tree | 166c7ceedb173845b36858ce7e32b19f4ca09090 /apps/files/appinfo | |
parent | 1978d3d6a279a4c60371b2cf809bd57e70f4ed35 (diff) | |
download | nextcloud-server-e62d5b7e55ea5eab098751146f6c49641574c7c9.tar.gz nextcloud-server-e62d5b7e55ea5eab098751146f6c49641574c7c9.zip |
Route for thumbnail generation
Thumbnail generation
Removed Log
Added requested changes
Added requested changes.
- Fix code style
- Add exception if file does not exist
- Switch route styling
Replaces https://github.com/owncloud/core/pull/10805
Fix codestyle
Fix codestyle
Migrate to appframework
Fix typo
Diffstat (limited to 'apps/files/appinfo')
-rw-r--r-- | apps/files/appinfo/application.php | 31 | ||||
-rw-r--r-- | apps/files/appinfo/routes.php | 12 |
2 files changed, 41 insertions, 2 deletions
diff --git a/apps/files/appinfo/application.php b/apps/files/appinfo/application.php new file mode 100644 index 00000000000..7ca48bab474 --- /dev/null +++ b/apps/files/appinfo/application.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCA\Files\Appinfo; + +use OC\AppFramework\Utility\SimpleContainer; +use OCA\Files\Controller\ApiController; +use OCP\AppFramework\App; + +class Application extends App { + public function __construct(array $urlParams=array()) { + parent::__construct('files', $urlParams); + $container = $this->getContainer(); + + + /** + * Controllers + */ + $container->registerService('APIController', function (SimpleContainer $c) { + return new ApiController( + $c->query('AppName'), + $c->query('Request') + ); + }); + } +} diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index 4d77065a347..a99b5de3af9 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -6,7 +6,15 @@ * See the COPYING-README file. */ -/** @var $this OC\Route\Router */ +namespace OCA\Files\Appinfo; + +$application = new Application(); +$application->registerRoutes($this, array('routes' => array( + array('name' => 'API#getThumbnail', 'url' => '/api/v1/thumbnail/{x}/{y}/{file}', 'verb' => 'GET'), +))); + + +/** @var $this \OC\Route\Router */ $this->create('files_index', '/') ->actionInclude('files/index.php'); @@ -38,4 +46,4 @@ $this->create('download', 'download{file}') ->actionInclude('files/download.php'); // Register with the capabilities API -OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', OC_API::USER_AUTH); +\OC_API::register('get', '/cloud/capabilities', array('OCA\Files\Capabilities', 'getCapabilities'), 'files', \OC_API::USER_AUTH); |