Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
prepare mergeability
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Aug 22, 2018
1 parent 22afc23 commit 575a7d2
Show file tree
Hide file tree
Showing 6 changed files with 1,042 additions and 508 deletions.
25 changes: 10 additions & 15 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,23 @@
* Entry point for installation process
*/
function plugin_flyvemdm_install() {
$version = plugin_version_flyvemdm();
$migration = new Migration($version['version']);
require_once(PLUGIN_FLYVEMDM_ROOT . "/install/install.class.php");
spl_autoload_register([PluginFlyvemdmInstall::class, 'autoload']);
$install = new PluginFlyvemdmInstall();
if (!$install->isPluginInstalled()) {
return $install->install($migration);
}
return $install->upgrade($migration);
global $DB;

require_once(PLUGIN_FLYVEMDM_ROOT . "/install/installer.class.php");
$installer = new PluginFlyvemdmInstaller();

return $installer->install();
}

/**
* Uninstalls the plugin
* @return boolean True if success
*/
function plugin_flyvemdm_uninstall() {
require_once(PLUGIN_FLYVEMDM_ROOT . "/install/install.class.php");
$install = new PluginFlyvemdmInstall();
require_once(PLUGIN_FLYVEMDM_ROOT . "/install/installer.class.php");
$installer = new PluginFlyvemdmInstaller();

return $install->uninstall();
return $installer->uninstall();
}

/**
Expand Down Expand Up @@ -158,11 +155,9 @@ function plugin_Flyvemdm_addDefaultWhere($itemtype) {
case PluginFlyvemdmAgent::class:
return PluginFlyvemdmAgent::addDefaultWhere();

case PluginFlyvemdmFDroidApplication::class: {
case PluginFlyvemdmFDroidApplication::class:
return PluginFlyvemdmFDroidApplication::addDefaultWhere();
}
}

}

/**
Expand Down
Loading

0 comments on commit 575a7d2

Please sign in to comment.