예제 #1
0
 public function indexAction()
 {
     $bootstrap = $this->getInvokeArg('bootstrap');
     $db = $bootstrap->db;
     $storage = $bootstrap->bootstrap('Storage')->storage;
     $requirements = new Installer_Requirements();
     $requirements->setDbAdapter($db->getAdapter());
     $requirements->setStorage($storage);
     $requirements->check();
     require_once APP_DIR . '/forms/Install.php';
     $form = new Omeka_Form_Install();
     $form->setDefault('path_to_convert', Omeka_File_Derivative_Strategy_ExternalImageMagick::getDefaultImageMagickDir());
     if ($requirements->hasError()) {
         return $this->_forward('errors', null, null, array('installer' => $requirements));
     } else {
         if ($this->getRequest()->isPost() && $form->isValid($_POST)) {
             $this->installer->setForm($form);
             $this->installer->install();
             return $this->_forward('installed');
         }
     }
     $this->view->requirements = $requirements;
     $this->view->installer = $this->installer;
     $this->view->form = $form;
     $this->view->form = $form;
 }
예제 #2
0
 /**
  * Determine whether or not ImageMagick has been correctly installed and
  * configured.  
  * 
  * In a few cases, this will indicate failure even though the ImageMagick
  * program works properly.  In those cases, users may ignore the results of
  * this test.  This is because the 'convert' command may have returned a 
  * non-zero status code for some reason.  Keep in mind that a 0 status code 
  * always indicates success.
  *
  * @return boolean True if the command line return status is 0 when
  * attempting to run ImageMagick's convert utility, false otherwise.
  */
 public function checkImagemagickAction()
 {
     $this->_helper->viewRenderer->setNoRender(true);
     $imPath = $this->_getParam('path-to-convert');
     $isValid = Omeka_File_Derivative_Strategy_ExternalImageMagick::isValidImageMagickPath($imPath);
     $this->getResponse()->setBody($isValid ? '<div class="success">' . __('The ImageMagick directory path works.') . '</div>' : '<div class="error">' . __('The ImageMagick directory path does not work.') . '</div>');
 }