Changeset 1162
- Timestamp:
- 11/13/08 23:49:15 (2 months ago)
- Files:
-
- trunk/lib/jelix/installer/jInstaller.class.php (added)
- trunk/lib/jelix/installer/jInstallerApp.class.php (modified) (1 diff)
- trunk/lib/jelix/installer/jInstallerBase.class.php (modified) (3 diffs)
- trunk/lib/jelix/installer/jInstallerModule.class.php (modified) (2 diffs)
- trunk/testapp/install/installer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/installer/jInstallerApp.class.php
r1026 r1162 21 21 abstract class jInstallerApp extends jInstallerBase { 22 22 23 24 25 26 23 /** 27 24 * Install modules by respecting dependencies trunk/lib/jelix/installer/jInstallerBase.class.php
r1026 r1162 12 12 /** 13 13 * EXPERIMENTAL 14 * a class to install a module. You should override it into a install/install.php file. The 15 * class should be named appInstaller 14 * a class to install a component (module or plugin) 16 15 * @package jelix 17 16 * @subpackage installer … … 21 20 abstract class jInstallerBase { 22 21 23 /** 24 * @var jIInstallReporter 25 */ 26 public $reporter; 27 28 29 function __construct($reporter, $basePath) { 30 $this->reporter = $reporter; 31 $this->basePath = $basePath; 22 function __construct($name) { 23 32 24 } 33 25 26 abstract function isInstalled(); 27 abstract function isActivated(); 28 34 29 /** 35 * main method for the installation 30 * install the component. It just call the _install.php of the component 31 * 32 * It should expose a variable $installer to the _install.php, 33 * $installer should be the current instance of this class. 36 34 */ 37 35 abstract function install(); 38 36 39 37 /** 40 * main method for the uninstallation 38 * uninstall the component. It just call the _uninstall.php 39 * of the component 40 * 41 * It should expose a variable $installer to the _uninstall.php, 42 * $installer should be the current instance of this class. 41 43 */ 42 44 abstract function uninstall(); 45 46 /** 47 * activate the component. 48 * It just call the _activate.php of the component ? 49 * 50 * It should expose a variable $installer to the _activate.php, 51 * $installer should be the current instance of this class. 52 */ 53 abstract function activate(); 54 55 /** 56 * deactivate the component. It just call the _deactivate.php 57 * of the component 58 * 59 * It should expose a variable $installer to the _deactivate.php, 60 * $installer should be the current instance of this class. 61 */ 62 abstract function deactivate(); 43 63 44 64 /** … … 85 105 } 86 106 } 87 trunk/lib/jelix/installer/jInstallerModule.class.php
r1026 r1162 12 12 /** 13 13 * EXPERIMENTAL 14 * a class to install a module. You should override it into a install/install.php file. The 15 * class should be named appInstaller 14 * a class to install a module. 16 15 * @package jelix 17 16 * @subpackage installer … … 19 18 * @since 1.1 20 19 */ 21 abstract class jInstallerModule extends jInstallerBase { 20 class jInstallerModule extends jInstallerBase { 21 22 23 /** 24 * The module should be present in the application. 25 * @param string $name the name of the module 26 */ 27 function __construct($name) { 28 // read the module.xml 29 } 30 31 /** 32 * @return boolean true if the module is installed 33 */ 34 function isInstalled() { 35 36 } 37 38 /** 39 * install the module, by checking dependencies. 40 * @throw jException if an error occurs during the install. 41 */ 42 function install() { 43 44 // * check that all dependencies are ok : the needed modules and plugins 45 // should be present in the application, even if this modules or plugins 46 // are not install 47 // * start the install of all needed modules and plugins before installing 48 // the module. Check before isInstalled() of the module/plugin 49 // If an exception occured during the install of this dependencies 50 // we should call uninstall of previous modules/plugins well installed and which 51 // install() has returned true. throw the exception 52 // * if ok, install the module, by calling the _install.php script 53 // * if error, uninstall dependencies which have just been installed, 54 // undo things which have made during the install of the module, and 55 // throw an exception 56 } 57 58 /** 59 * uninstall the module, by checking dependencies. 60 * @throw jException if an error occurs during the install. 61 */ 62 function uninstall() { 63 // * check that all dependencies are ok : the needed modules and plugins 64 // should be present in the application 65 // * start the uninstall of all needed modules and plugins before installing 66 // the module. 67 // * if ok, uninstall the module, by calling the _uninstall.php script 68 } 69 70 function activate() { 71 } 72 73 function deactivate() { 74 75 } 76 77 22 78 23 79 } trunk/testapp/install/installer.php
r830 r1162 10 10 */ 11 11 12 class appInstaller extends jInstallerApp {13 14 function install(){15 //$this->copyDirectoryContent($this->basePath.'/www', JELIX_APP_WWW_PATH.'test');16 $this->reporter->message("Test ok");17 //$this->execSQLScript('install');18 }19 20 function uninstall(){21 //$this->execSQLScript('uninstall');22 }23 }24 12 25 13 ?>
