Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New occ commands to manage thumbnails #387

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions appinfo/register_command.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* ownCloud - gallery
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Olivier Paroz <owncloud@interfasys.ch>
* @author Bernhard Posselt <dev@bernhard-posselt.com>
*
* @copyright Olivier Paroz 2015
* @copyright Bernhard Posselt 2015
*/

use OCP\AppFramework\IAppContainer;

if (\OC::$server->getConfig()
->getSystemValue('installed', false)
) {
$galleryApp = new OCA\Gallery\AppInfo\Application();
$galleryContainer = $galleryApp->getContainer();
$galleryContainer->registerService(
'userFolder', function (IAppContainer $c) {
return null;
}
);
$galleryContainer->registerService(
'OCP\Encryption\IManager', function (IAppContainer $c) {
return $c->getServer()
->getEncryptionManager();
}
);
$galleryContainer->registerService(
'OCP\Files\Mount\IMountManager', function (IAppContainer $c) {
return $c->getServer()
->getMountManager();
}
);
$galleryContainer->registerService(
'OCP\Lock\ILockingProvider', function (IAppContainer $c) {
return $c->getServer()
->getLockingProvider();
}
);

$createThumbnailsCmd = $galleryContainer->query('OCA\Gallery\Command\CreateThumbnails');
$deleteThumbnailsCmd = $galleryContainer->query('OCA\Gallery\Command\DeleteThumbnails');

$application->add($createThumbnailsCmd);
$application->add($deleteThumbnailsCmd);
}
18 changes: 18 additions & 0 deletions command/commandexception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* ownCloud - gallery
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Olivier Paroz <owncloud@interfasys.ch>
*
* @copyright Olivier Paroz 2015
*/

namespace OCA\Gallery\Command;

/**
* Thrown when the command is not authorised to access a file
*/
class CommandException extends \Exception {}
Loading