Merge branch '2.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / package / plugin / IPackageInstallationPlugin.class.php
1 <?php
2 namespace wcf\system\package\plugin;
3 use wcf\system\package\PackageArchive;
4
5 /**
6 * Every PackageInstallationPlugin has to implement this interface.
7 *
8 * @author Marcel Werk
9 * @copyright 2001-2014 WoltLab GmbH
10 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
11 * @package com.woltlab.wcf
12 * @subpackage system.package.plugin
13 * @category Community Framework
14 */
15 interface IPackageInstallationPlugin {
16 /**
17 * Executes the installation of this plugin.
18 */
19 public function install();
20
21 /**
22 * Executes the update of this plugin.
23 */
24 public function update();
25
26 /**
27 * Returns true if the uninstallation of the given package should execute
28 * this plugin.
29 *
30 * @return boolean
31 */
32 public function hasUninstall();
33
34 /**
35 * Executes the uninstallation of this plugin.
36 */
37 public function uninstall();
38
39 /**
40 * Validates if the passed instruction is valid for this package installation plugin. If anything is
41 * wrong with it, this method should return false.
42 *
43 * @param \wcf\system\package\PackageArchive $packageArchive
44 * @param string $instruction
45 * @return boolean
46 */
47 public static function isValid(PackageArchive $packageArchive, $instruction);
48 }