Skip to content

Commit

Permalink
Fixed install and uninstall.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed Aug 6, 2017
1 parent b28cfa3 commit 55a32a8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
namespace IiifServer;

use IiifServer\Form\Config as ConfigForm;
use IiifServer\Mvc\Controller\Plugin\TileInfo;
use Omeka\Module\AbstractModule;
use Omeka\Module\Exception\ModuleCannotInstallException;
use Omeka\Mvc\Controller\Plugin\Messenger;
Expand All @@ -41,7 +42,6 @@
use Zend\Mvc\MvcEvent;
use Zend\ServiceManager\ServiceLocatorInterface;
use Zend\View\Renderer\PhpRenderer;
use IiifServer\Mvc\Controller\Plugin\TileInfo;

class Module extends AbstractModule
{
Expand Down Expand Up @@ -96,7 +96,7 @@ public function install(ServiceLocatorInterface $serviceLocator)
if (!file_exists($checkDeepzoom) || !file_exists($checkZoomify)) {
throw new ModuleCannotInstallException(
$t->translate('You should run "composer install" from the root of the module, or install a release with the dependencies.') // @translate
. ' ' . $t->translate('See module’s installation documentation.')); // @translate
. ' ' . $t->translate('See module’s installation documentation.')); // @translate
}

$processors = $this->listProcessors($serviceLocator);
Expand All @@ -105,7 +105,10 @@ public function install(ServiceLocatorInterface $serviceLocator)
$module = $moduleManager->getModule('UniversalViewer');
if ($module) {
$version = $module->getDb('version');
if (version_compare($version, '3.4.3', '<')) {
// Check if installed.
if (empty($version)) {
// Nothing to do.
} elseif (version_compare($version, '3.4.3', '<')) {
$messenger->addWarning(
$t->translate('Warning: The module Universal Viewer was not upgraded to version 3.4.3.') // @translate
. ' ' . $t->translate('The settings are set to default.'));
Expand Down Expand Up @@ -155,7 +158,7 @@ public function uninstall(ServiceLocatorInterface $serviceLocator)
} else {
$messenger = new Messenger();
$messenger->addWarning(
'The tile dir "%d" is not a real path and was not removed.', $tileDir); // @translate
'The tile dir "%s" is not a real path and was not removed.', $tileDir); // @translate
}

$ingesters = $settings->get('archive_repertory_ingesters');
Expand Down Expand Up @@ -381,8 +384,11 @@ protected function registerArchiveRepertory(ServiceLocatorInterface $serviceLoca
'extension' => [
'.dzi',
'.js',
TileInfo::FOLDER_EXTENSION_DEEPZOOM,
TileInfo::FOLDER_EXTENSION_ZOOMIFY,
// The classes are not available before the end of install.
// TileInfo::FOLDER_EXTENSION_DEEPZOOM,
'_files',
// TileInfo::FOLDER_EXTENSION_ZOOMIFY,
'_zdata',
],
];
$settings->set('archive_repertory_ingesters', $ingesters);
Expand Down

0 comments on commit 55a32a8

Please sign in to comment.