/** * Install a plugin by its manifest. * * @return Plugin */ public static function installPlugin(PluginManifest $manifest) { global $db; $pluginClashCheck = self::getPluginByPackage($manifest->getPackageName()); if ($pluginClashCheck instanceof Plugin) { throw new Exception("Package '" . $manifest->getPackageName() . "' does already exist.", 23); } $db->query("\n\t\t\t\tINSERT INTO " . TABLE_PLUGINS . "\n\t\t\t\t(package, title, description, author, url, active)\n\t\t\t\tVALUES\n\t\t\t\t(:p, :t, :d, :a, :u, 1)\n\t\t\t", array($manifest->getPackageName(), $manifest->getTitle(), $manifest->getDescription(), $manifest->getAuthor(), $manifest->getURL())); return self::getPluginByPackage($manifest->getPackageName()); }