/** * * @param NameResolverInterface $app_name_resolver * @throws ActionRuntimeException * @return void */ public function uninstall(NameResolverInterface $app_name_resolver) { $result = ''; // Run the custom uninstaller of the app $app = AppFactory::create($app_name_resolver); $custom_uninstaller_result = $app->uninstall(); if ($custom_uninstaller_result) { $result .= ".\nUninstalling: " . $custom_uninstaller_result; } // Uninstall the model $result .= "\nModel changes: "; $result .= $this->uninstall_model($app); // Save the result $this->add_result_message($result); return $result; }
public function create_app_folder(NameResolverInterface $name_resolver) { // Make sure the vendor folder exists $app_vendor_folder = $this->filemanager()->get_path_to_vendor_folder() . DIRECTORY_SEPARATOR . $name_resolver->get_vendor(); if (!is_dir($app_vendor_folder)) { mkdir($app_vendor_folder); } // Create the app folder $app_folder = $app_vendor_folder . DIRECTORY_SEPARATOR . $name_resolver->get_alias(); if (!is_dir($app_folder)) { mkdir($app_folder); } // Make sure, the app class exists if (!class_exists($name_resolver->get_class_name_with_namespace())) { $this->create_app_class($name_resolver); } $app = AppFactory::create($name_resolver); $this->create_composer_json($app); }
/** * * @param NameResolverInterface $app_name_resolver * @throws ActionRuntimeException * @return void */ public function install(NameResolverInterface $app_name_resolver) { $result = ''; // Install the model $result .= "\nModel changes: "; $result .= $this->install_model($app_name_resolver); // Finalize installation running the custom installer of the app $app = AppFactory::create($app_name_resolver); $custom_installer_result = $app->install(); if ($custom_installer_result) { $result .= ".\nFinalizing installation: " . $custom_installer_result; } // Save the result $this->add_result_message($result); return $result; }