uninstall() public static method

Uninstall from module name
public static uninstall ( AbstractModule $module, Model $model ) : boolean
$module AbstractModule Module
$model Model Module model
return boolean
Example #1
0
 /**
  * Tears down the fixture, for example, closes a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 public function tearDown()
 {
     StaticEventManager::resetInstance();
     ModuleModel::uninstall(Registry::get('Application')->getServiceManager()->get('CustomModules')->getModule('Social'), ModuleModel::fromName('Social'));
     parent::tearDown();
 }
Example #2
0
 /**
  * Uninstall module
  *
  * @return \Zend\View\Model\ViewModel
  */
 public function uninstallAction()
 {
     $moduleId = $this->getRouteMatch()->getParam('id');
     $modules = $this->getServiceLocator()->get('CustomModules');
     $moduleModel = ModuleModel::fromId($moduleId);
     if (!empty($moduleModel)) {
         $module = $modules->getModule($moduleModel->getName());
         if (ModuleModel::uninstall($module, $moduleModel)) {
             return $this->returnJson(array('success' => true, 'message' => 'Module uninstalled'));
         }
     }
     return $this->returnJson(array('success' => false, 'message' => 'Can\'t uninstall module'));
 }
Example #3
0
 /**
  * Tears down the fixture, for example, closes a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 public function tearDown()
 {
     StaticEventManager::resetInstance();
     ModuleModel::uninstall(Registry::get('Application')->getServiceManager()->get('CustomModules')->getModule('Blog'), ModuleModel::fromName('Blog'));
     $this->document->delete();
     $this->view->delete();
     $this->layout->delete();
     $this->documentType->delete();
     unset($this->document);
     unset($this->object);
     unset($this->view);
     unset($this->layout);
     unset($this->documentType);
     parent::tearDown();
 }
Example #4
0
 /**
  * Test
  *
  * @return void
  */
 public function testInstallAndUninstall()
 {
     $modules = Registry::get('Application')->getServiceManager()->get('CustomModules');
     Model::uninstall($modules->getModule('Blog'), Model::fromName('Blog'));
     $this->assertInternalType('integer', (int) Model::install($modules, 'Blog'));
     $this->assertTrue(Model::uninstall($modules->getModule('Blog'), Model::fromName('Blog')));
 }