/** * @param string $codename * @param array $register * @param int $core_minimum * @param int $mybb_minimum * @param string $php_minimum */ function jb_install_plugin($codename, $register = array(), $core_minimum = false, $mybb_minimum = false, $php_minimum = "5.3") { $installed = false; if (JB_CORE_INSTALLED === false) { $installed = jb_install_core(); } // In case we installed the core and this plugin needs to register itself we need to do this here. Otherwise the installer can't find its files if ($installed === true && isset($register['vendor']) && isset($register['prefix'])) { JB_Core::i(); // Needed to register the autoloader JB_Packages::i()->register($register['prefix'], $register['vendor'], $codename); } // Don't use an else as the function above might change the value if (JB_CORE_INSTALLED === true || $installed === true) { JB_Core::i()->install($codename, $core_minimum, $mybb_minimum, $php_minimum); } else { // This message should normally never appear as "jb_install_core" should already throw an error flash_message("Couldn't install", 'error'); admin_redirect('index.php?module=config-plugins'); } }
function mylikes_deactivate() { JB_Core::i()->deactivate("mylikes"); }