changed git call from https to git readonly
[atutor.git] / mods / photos / module_uninstall.php
1 <?php\r
2 /***********************************************************************/\r
3 /* ATutor                                                                                                                          */\r
4 /***********************************************************************/\r
5 /* Copyright (c) 2002-2009                                                                                         */\r
6 /* Adaptive Technology Resource Centre / Inclusive Design Institution  */\r
7 /* http://atutor.ca                                                                                                        */\r
8 /*                                                                                                                                         */\r
9 /* This program is free software. You can redistribute it and/or           */\r
10 /* modify it under the terms of the GNU General Public License             */\r
11 /* as published by the Free Software Foundation.                                           */\r
12 /***********************************************************************/\r
13 // $Id$\r
14 \r
15 /*******\r
16  * module_uninstall.php performs reversion of module_install.php\r
17  */\r
18 \r
19 /*******\r
20  * the line below safe-guards this file from being accessed directly from\r
21  * a web browser. It will only execute if required from within an ATutor script,\r
22  * in our case the Module::uninstall() method.\r
23  */\r
24 if (!defined('AT_INCLUDE_PATH')) { exit; }\r
25 \r
26 /********\r
27  * the following code is used for removing a module-specific directory created in module_install.php.\r
28  * it generates appropriate error messages to aid in its creation.\r
29  */\r
30 $directory = AT_PA_CONTENT_DIR;\r
31 \r
32 /******\r
33  * the following code checks if there are any errors (generated previously)\r
34  * then uses the SqlUtility to run reverted database queries of module.sql, \r
35  * ie. "create table" statement in module.sql is run as drop according table.\r
36  */\r
37 if (!$msg->containsErrors() && file_exists(dirname(__FILE__) . '/module.sql')) {\r
38         // deal with the SQL file:\r
39         require(AT_INCLUDE_PATH . 'classes/sqlutility.class.php');\r
40         $sqlUtility =& new SqlUtility();\r
41 \r
42         /*\r
43          * the SQL file could be stored anywhere, and named anything, "module.sql" is simply\r
44          * a convention we're using.\r
45          */\r
46         $sqlUtility->revertQueryFromFile(dirname(__FILE__) . '/module.sql', TABLE_PREFIX);\r
47 }\r
48 \r
49 ?>